All developer pages

API reference

Notifications

3 operations. Base URL: https://api.ringura.com/api/v1. Authenticate with a bearer token that carries the scope named on each operation.

POST /api/v1/notifications

Send an order update, reminder or one-time code on WhatsApp (an approved template), SMS or e-mail, in the recipient's preferred order with fallback. The message lands on the contact's timeline; a reply routes to agents.

Scope
notifications:write
Operation id
sendNotification
Idempotent
Send Idempotency-Key to make a retry safe

Parameters

Parameters of POST /api/v1/notifications
NameInTypeRequiredConstraints
Idempotency-KeyheaderstringNomatches ^[A-Za-z0-9_.:-]{8,100}$

Request body

JSON (Content-Type: application/json).

Request body of POST /api/v1/notifications
FieldTypeRequiredConstraints
contactIdstring (uuid)No
toobjectNo
to.phonestringNomatches ^[+][1-9][0-9]{6,14}$
to.emailstringNoat most 320 characters
purposestringYesone of "utility", "authentication"
channelsarray of stringYesat least 1 items at most 3 items
referencestringNo1-200 characters
whatsappobjectNo
whatsapp.templateobjectYes
whatsapp.template.namestringYesat most 512 characters
whatsapp.template.languagestringYesat most 20 characters
whatsapp.template.categorystringNoone of "utility", "authentication"
whatsapp.template.parametersarray of stringNoat most 20 items
smsobjectNo
sms.bodystringYes1-1600 characters
emailobjectNo
email.subjectstringYes1-300 characters
email.bodystringYes1-20000 characters

Response

201 JSON with these fields.

Response fields of POST /api/v1/notifications
FieldTypeRequiredConstraints
idstring (uuid)Yes
contactIdstring (uuid)Yes
purposestringYesone of "utility", "authentication"
referencestring or nullYes
statusstringYesone of "sent", "failed"
channelstring or nullYes
messageIdstring (uuid) or nullYes
interactionIdstring (uuid) or nullYes
attemptsarray of objectYes
attempts[].channelstringYes
attempts[].outcomestringYes
attempts[].reasonstring or nullYes
createdAtstring (date-time)Yes

Errors

400, 401, 403, 404, 409, 422, 429. What each status means

Example request

curl -X POST 'https://api.ringura.com/api/v1/notifications' \
  -H "Authorization: Bearer $CC_TOKEN" \
  -H 'Idempotency-Key: order-2027-0001' \
  -H 'Content-Type: application/json' \
  -d '{
  "purpose": "utility",
  "channels": [
    "whatsapp"
  ]
}'

GET /api/v1/notifications/{id}

One notification with every channel tried.

Scope
notifications:write
Operation id
getNotification

Parameters

Parameters of GET /api/v1/notifications/{id}
NameInTypeRequiredConstraints
idpathstring (uuid)Yes

Response

200 JSON with these fields.

Response fields of GET /api/v1/notifications/{id}
FieldTypeRequiredConstraints
idstring (uuid)Yes
contactIdstring (uuid)Yes
purposestringYesone of "utility", "authentication"
referencestring or nullYes
statusstringYesone of "sent", "failed"
channelstring or nullYes
messageIdstring (uuid) or nullYes
interactionIdstring (uuid) or nullYes
attemptsarray of objectYes
attempts[].channelstringYes
attempts[].outcomestringYes
attempts[].reasonstring or nullYes
createdAtstring (date-time)Yes

Errors

400, 401, 403, 404, 409, 429. What each status means

Example request

curl -X GET 'https://api.ringura.com/api/v1/notifications/0192f5a0-7c1e-7d3a-9b2e-3f4a5b6c7d8e' \
  -H "Authorization: Bearer $CC_TOKEN"

PUT /api/v1/contacts/{id}/notification-preferences

A contact's preferred channel order and the channels it opted out of.

Scope
contacts:write
Operation id
setNotificationPreferences
Idempotent
Send Idempotency-Key to make a retry safe

Parameters

Parameters of PUT /api/v1/contacts/{id}/notification-preferences
NameInTypeRequiredConstraints
idpathstring (uuid)Yes
Idempotency-KeyheaderstringNomatches ^[A-Za-z0-9_.:-]{8,100}$

Request body

JSON (Content-Type: application/json).

Request body of PUT /api/v1/contacts/{id}/notification-preferences
FieldTypeRequiredConstraints
channelsarray of stringNoat most 3 items
optedOutarray of stringNoat most 3 items

Response

200 JSON with these fields.

Response fields of PUT /api/v1/contacts/{id}/notification-preferences
FieldTypeRequiredConstraints
contactIdstring (uuid)Yes
channelsarray of stringYes
optedOutarray of stringYes

Errors

400, 401, 403, 404, 409, 422, 429. What each status means

Example request

curl -X PUT 'https://api.ringura.com/api/v1/contacts/0192f5a0-7c1e-7d3a-9b2e-3f4a5b6c7d8e/notification-preferences' \
  -H "Authorization: Bearer $CC_TOKEN" \
  -H 'Idempotency-Key: order-2027-0001' \
  -H 'Content-Type: application/json' \
  -d '{
  "channels": [
    "whatsapp"
  ]
}'