Skip to content

Events

Endpoint for sending events.

Send an event

Request

Sends an event to the referenced contact from the referenced app. Note that this operation enqueues the event in a queue so a successful response only indicates that the event has been queued.

Security
Basic or oAuth2
Path
project_idstringrequired

The unique ID of the project. You can find this on the Sinch Dashboard.

Bodyapplication/jsonrequired

The event to be sent.

app_idstringrequired

The ID of the app sending the event.

recipientChannel Identities (object) or Contact ID (object)(RecipientRequest)required
One of:

Identifies the recipient. If Dispatch Mode is used, you must use the identified_by field.

eventComposing (object) or Composing End Event Type (object) or Read Message Event Type (object) or Comment Reply Event Type (object) or Agent Joined Event Type (object) or Agent Left Event Type (object) or Generic Type (object)(AppEventField)required
One of:
callback_urlstring

Overwrites the default callback url for delivery receipts for this message The REST URL should be of the form: http://host[:port]/path

channel_priority_orderArray of strings

Optional. A single element array that dictates on what channel should the Conversation API try to send the event. It overrides any default set on the contact. Providing more than one option has no effect.

event_metadatastring

Optional. Eventual metadata that should be associated to the event.

queuestring(MessageQueue)

Select the priority type for the message

Default:"NORMAL_PRIORITY"
Enum ValueDescription
NORMAL_PRIORITY

The normal priority queue.

HIGH_PRIORITY

The high priority queue.

Example:"NORMAL_PRIORITY"
curl -i -X POST \
  -u '<username>:<password>' \
  'https://us.conversation.api.sinch.com/v1/projects/{project_id}/events:send' \
  -H 'Content-Type: application/json' \
  -d '{
    "app_id": "string",
    "callback_url": "string",
    "channel_priority_order": [
      "WHATSAPP"
    ],
    "event": {
      "composing_event": {}
    },
    "event_metadata": "string",
    "queue": "NORMAL_PRIORITY",
    "recipient": {
      "identified_by": {
        "channel_identities": [
          {
            "channel": "WHATSAPP",
            "identity": "string"
          }
        ]
      }
    }
  }'

Responses

A successful response.

Bodyapplication/json
accepted_timestring, (date-time)read-only

Accepted timestamp.

event_idstringread-only

Event id.

Response
{ "accepted_time": "2019-08-24T14:15:22Z", "event_id": "string" }