POST
https://www.app.ocoya.com/api/_public/v1/inbox/conversations/{conversationId}/reply
Reply to a conversation
curl --request POST \
  --url https://www.app.ocoya.com/api/_public/v1/inbox/conversations/{conversationId}/reply \
  --header 'Content-Type: application/json' \
  --header 'X-API-Key: <api-key>' \
  --data '
{
  "text": "Yes, we ship to Spain! Delivery takes 3 to 5 days.",
  "as": "reply",
  "imageUrl": "https://example.com/delivery-map.png"
}
'
{
  "conversationId": "cmhx3v0k2000b7aps8q2u4n6e",
  "message": {
    "id": "cmhx3x2pq000d7apsf4k5l6m7",
    "type": "received",
    "text": "Hi! Do you ship to Spain?",
    "images": [],
    "authorId": null,
    "deleted": false,
    "createdAt": "2024-01-01T00:00:00Z"
  }
}

Authorizations

X-API-Keystringheaderrequired

Your API key. Create one in Ocoya. Authorization: Bearer <key> works too.

Path Parameters

conversationIdstringrequired

Conversation ID. Get one from GET /inbox/conversations.

Example:"cmhx3v0k2000b7aps8q2u4n6e"

Body

application/json
textstringrequired

What to send.

Maximum string length: 10000
Example:"Yes, we ship to Spain! Delivery takes 3 to 5 days."
asenum<string>

reply (default) answers where they wrote, dm answers a Facebook or Instagram comment in a private message, note is kept to the team and never sent.

Available options: reply, dm, note
Example:"reply"
imageUrlstring

A public https image to send with it, where the network takes one: Facebook DMs and comments, Instagram DMs, and emails.

Example:"https://example.com/delivery-map.png"

Response

application/json

Sent.

conversationIdstring
Example:"cmhx3v0k2000b7aps8q2u4n6e"
messageobject | null

The reply or note as kept in the conversation.

Show child attributesHide child attributes
message.idstring

Message ID.

Example:"cmhx3x2pq000d7apsf4k5l6m7"
message.typeenum<string>

received from the customer, sent by the brand (a teammate, an automation or the API), note kept to the team.

Available options: received, sent, note
Example:"received"
message.textstring

What was written.

Example:"Hi! Do you ship to Spain?"
message.imagesstring[]

Image URLs attached to it.

Example:[]
message.authorIdstring | null

The teammate who wrote a note or sent a reply. Null for the customer and for automations.

message.deletedboolean

Deleted on the network. Kept so the conversation still reads in order.

Example:false
message.createdAtstring

When it was written.

Example:"2024-01-01T00:00:00Z"