Skip to content

Reply in a conversation

POST
/api/v1/conversations/{id}/messages
curl --request POST \
--url https://digize.com/api/v1/conversations/conv_01JF4A1B2C3D4E5F6G7H8J9K0M/messages \
--header 'Content-Type: application/json' \
--header 'Idempotency-Key: 5f1c2a8e-3b7d-4c55-9a0e-1f2d3c4b5a69' \
--header 'x-api-key: <x-api-key>' \
--data '{ "body": "Your order is ready to pick up. See you soon!" }'

Sends a reply in a conversation, on its channel: a text from its number, which Twilio reports on as it’s delivered. Refused for a contact who replied STOP, and for email until the workspace has a sending domain.

Needs the crm:write permission. It can’t be undone.

id
required
string
>= 1 characters <= 64 characters

Example

conv_01JF4A1B2C3D4E5F6G7H8J9K0M
Idempotency-Key
string
>= 1 characters <= 255 characters

Makes the request safe to send again: for 24 hours the same key and request answer the first response without repeating the change.

Example

5f1c2a8e-3b7d-4c55-9a0e-1f2d3c4b5a69
Media typeapplication/json
object
body
required
string
>= 1 characters <= 20000 characters
subject
string
<= 200 characters

Example

{
"body": "Your order is ready to pick up. See you soon!"
}

Done

Media typeapplication/json
object
conversation
required
object
id
required
string
contact
required
object
id
required
string
name
required
string
firstName
required
string
email
required
string | null
phone
required
string | null
channel
required
string
Allowed values: sms email
address
required

The workspace’s number or address the contact writes to.

string
subject
required

Emails only.

string | null
status
required
string
Allowed values: open closed
assigneeId
required

The member answering it, by user id.

string | null
unread
required
boolean
lastMessage
required
Any of:
object
kind
required
string
Allowed values: message call
direction
required
string
Allowed values: in out
authorKind
required
string
Allowed values: contact team automation system
body
required

The start of it, on one line.

string
status
required
string
Allowed values: pending queued sent delivered failed undelivered received
sentAt
required
string format: date-time
lastMessageAt
required
string format: date-time
optedOut
required

A text conversation whose contact replied STOP: nothing can be texted to them until they reply START.

boolean
createdAt
required
string format: date-time
message
required
object
id
required
string
conversationId
required
string
kind
required

A text or email, or a call to one of the workspace’s numbers.

string
Allowed values: message call
direction
required
string
Allowed values: in out
author
required
One of:
object
kind
required
string
Allowed value: contact
from
required
string
to
required
string
subject
required
string | null
body
required
string
status
required

Pending until Twilio takes it, then queued, sent and delivered, or failed or undelivered; received for one that came in.

string
Allowed values: pending queued sent delivered failed undelivered received
error
required

Why it didn’t go.

string | null
attachments
required
Array<object>
object
name
required
string
type
required
string
size
required
number
url
required

A signed link that works for an hour.

string | null
fullEmailUrl
required

The whole email, when it was too long to show here.

string | null
call
required
Any of:
object
status
required
string
Allowed values: ringing answered completed missed voicemail failed
durationSeconds
required
number
recording
required
Any of:
object
kind
required
string
Allowed values: voicemail call
status
required
string
Allowed values: pending stored absent failed
seconds
required
number | null
url
required
string | null
sentAt
required
string format: date-time

Example

{
"conversation": {
"channel": "sms",
"status": "open",
"lastMessage": {
"kind": "message",
"direction": "in",
"authorKind": "contact",
"status": "pending"
}
},
"message": {
"kind": "message",
"direction": "in",
"author": {
"kind": "contact"
},
"status": "pending",
"call": {
"status": "ringing",
"recording": {
"kind": "voicemail",
"status": "pending"
}
}
}
}

What was sent isn’t valid (invalid).

Media typeapplication/json
object
error
required
object
code
required
string
Allowed values: invalid unauthorized forbidden not_found conflict too_large rate_limited unavailable internal
message
required
string
details
object
key
additional properties
any

Example

{
"error": {
"code": "invalid"
}
}

No key, or one that’s unknown, off or expired.

Media typeapplication/json
object
error
required
object
code
required
string
Allowed values: invalid unauthorized forbidden not_found conflict too_large rate_limited unavailable internal
message
required
string
details
object
key
additional properties
any

Example

{
"error": {
"code": "invalid"
}
}

The key doesn’t have the permission this needs.

Media typeapplication/json
object
error
required
object
code
required
string
Allowed values: invalid unauthorized forbidden not_found conflict too_large rate_limited unavailable internal
message
required
string
details
object
key
additional properties
any

Example

{
"error": {
"code": "invalid"
}
}

Nothing has that id (not_found).

Media typeapplication/json
object
error
required
object
code
required
string
Allowed values: invalid unauthorized forbidden not_found conflict too_large rate_limited unavailable internal
message
required
string
details
object
key
additional properties
any

Example

{
"error": {
"code": "invalid"
}
}

A request with the same Idempotency-Key is still running (conflict).

Media typeapplication/json
object
error
required
object
code
required
string
Allowed values: invalid unauthorized forbidden not_found conflict too_large rate_limited unavailable internal
message
required
string
details
object
key
additional properties
any

Example

{
"error": {
"code": "invalid"
}
}

The Idempotency-Key was used with a different request.

Media typeapplication/json
object
error
required
object
code
required
string
Allowed values: invalid unauthorized forbidden not_found conflict too_large rate_limited unavailable internal
message
required
string
details
object
key
additional properties
any

Example

{
"error": {
"code": "invalid"
}
}

Over the rate limit; see retry-after.

Media typeapplication/json
object
error
required
object
code
required
string
Allowed values: invalid unauthorized forbidden not_found conflict too_large rate_limited unavailable internal
message
required
string
details
object
key
additional properties
any

Example

{
"error": {
"code": "invalid"
}
}