# Inject an event

This operation injects a conversation event in to a specific conversation. It only supports injecting App events in CONVERSATION mode.

Endpoint: POST /v1/projects/{project_id}/conversations/{conversation_id}:inject-event
Version: 1.0
Security: Basic, oAuth2

## Path parameters:

  - `project_id` (string, required)
    The unique ID of the project. You can find this on the Sinch Dashboard.

  - `conversation_id` (string, required)
    The unique ID of the conversation. This is generated by the system.

## Request fields (application/json):

  - `accept_time` (string, required)
    The processed time of the message in UTC timezone. Must be less than current_time and greater than (current_time - 30 days).

  - `app_event` (object) — one of:
    Event originating from an app
    - Composing:
      - `composing_event` (object)
        Represents a typing indicator shown to the contact.
    - Composing End Event Type:
      - `composing_end_event` (object)
        Represents a typing-end indicator. Stops a typing indicator previously shown to the contact.
    - Read Message Event Type:
      - `read_message_event` (object)
        Marks an inbound (contact) message as read on the channel, producing a read receipt for the contact. Supported on WhatsApp and RCS.
    - Comment Reply Event Type:
      - `comment_reply_event` (object)
        Represents a response to a comment event.
      - `comment_reply_event.text` (string, required)
        The text of the comment reply.
    - Agent Joined Event Type:
      - `agent_joined_event` (object)
      - `agent_joined_event.agent` (object, required)
        Represents an agent that is involved in a conversation.
      - `agent_joined_event.agent.display_name` (string)
        Agent's display name
      - `agent_joined_event.agent.type` (string)
        Agent's classification. It can be UNKNOWN_AGENT_TYPE, HUMAN or BOT.
        Enum: "UNKNOWN_AGENT_TYPE", "HUMAN", "BOT"
      - `agent_joined_event.agent.picture_url` (string)
        The Agent's picture url.
    - Agent Left Event Type:
      - `agent_left_event` (object)
      - `agent_left_event.agent` (object, required)
        Represents an agent that is involved in a conversation.
      - `agent_left_event.agent.display_name` (string)
        Agent's display name
      - `agent_left_event.agent.type` (string)
        Agent's classification. It can be UNKNOWN_AGENT_TYPE, HUMAN or BOT.
        Enum: same as `agent_joined_event.agent.type` in "Agent Joined Event Type" (3 values)
      - `agent_left_event.agent.picture_url` (string)
        The Agent's picture url.
    - Generic Type:
      - `generic_event` (object)
        Event that contains only a flexible payload field.
      - `generic_event.payload` (object, required)
        Arbitrary data set to the event. A valid JSON object.

  - `conversation_id` (string)
    Optional. The ID of the event's conversation. Will not be present for apps in Dispatch Mode.

  - `contact_id` (string)
    Optional. The ID of the contact. Will not be present for apps in Dispatch Mode.

  - `channel_identity` (object)
    A unique identity of message recipient on a particular channel.
For example, the channel identity on SMS, WHATSAPP or VIBERBM is a MSISDN phone number.

  - `channel_identity.identity` (string, required)
    The channel identity. This will differ from channel to channel. For example, a phone number for SMS, WhatsApp, and Viber Business.

  - `channel_identity.channel` (string, required)
    The identifier of the channel you want to include. Must be one of the enum values.
    Enum: "SMS", "RCS", "WHATSAPP", "MMS", "KAKAOTALK", "KAKAOTALKCHAT", "VIBERBM", "LINE", "INSTAGRAM", "MESSENGER", "WECHAT", "TELEGRAM", "APPLEBC"

  - `channel_identity.app_id` (string)
    Required if using a channel that uses app-scoped channel identities. Currently, FB Messenger, Instagram, LINE, and WeChat use app-scoped channel identities, which means contacts will have different channel identities on different Conversation API apps. These can be thought of as virtual identities that are app-specific and, therefore, the app_id must be included in the API call.

  - `processing_mode` (string)
    Whether or not Conversation API should store contacts and conversations for the app. For more information, see [Processing Modes](https://developers.sinch.com/docs/conversation/processing-modes/).
    Enum: "CONVERSATION", "DISPATCH"

## Response 200 fields (application/json):

  - `event_id` (string)
    Event id.

  - `accepted_time` (string)

## Response 400 fields (application/json):

  - `error` (object)

  - `error.code` (integer)

  - `error.details` (array)

  - `error.details.type_url` (string)

  - `error.details.value` (string)

  - `error.message` (string)

  - `error.status` (string)


