Skip to content

Text the person who opened a ticket instead of emailing them

POST
/tickets/{id}/texts
Code sample: Shell / cURL
curl --request POST \
--url https://example.com/api/v1/tickets/example/texts \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '{ "dryRun": false, "expectedPhone": "example", "statusId": "example", "text": "example" }'

Texts a plain-text message to the person who opened the ticket, at the phone on their client contact, as the calling member, instead of emailing it. The message stays on the ticket and in the client portal and is not emailed, and every later reply on the ticket is texted to the same phone too. At most one text is ever sent this way per ticket: a second call, a retry after a timeout included, is refused with already_texting, and so is texting a phone another open ticket already texts (phone_in_use), since its replies go to that ticket. With dryRun it returns who would get the text, or why the ticket cannot be texted, and sends nothing. Requires the tickets.manage permission.

id
required

Resource identifier (CUID2).

string
>= 1 characters

Resource identifier (CUID2).

Media typeapplication/json
object
dryRun

Return who would get the text, or why the ticket cannot be texted, and send nothing.

boolean
expectedPhone

The E.164 phone you expect to text, as a dry run returned it. Refused with recipient_changed when the requester’s phone is different now.

string
statusId

Ticket status to move to with the text. No status email is sent; the text is the notice.

string
text
required

Plain text, sent as typed. Over 1,600 characters the text is cut short: it ends with a link to the ticket when the requester can open it in the client portal, and otherwise asks them to text back for the rest. The ticket keeps the whole message.

string
>= 1 characters <= 10000 characters

Dry run: who would get the text; nothing was posted or sent.

Media typeapplication/json
object
data
required
object
dryRun
required
boolean
messageId
required

The message the text was posted as; null for a dry run. Its smsDelivery shows on GET /tickets/{id} once the text is tried, asynchronously.

string | null
name
required

The requester’s name on their client contact.

string
statusError
required

Set when statusId was given and the text was sent, but the status did not change.

string | null
ticketId
required
string
to
required

E.164 phone texted, or that a dry run would text.

string

Example generated

{
"data": {
"dryRun": true,
"messageId": "example",
"name": "example",
"statusError": "example",
"ticketId": "example",
"to": "example"
}
}

The message was posted and its text queued.

Media typeapplication/json
object
data
required
object
dryRun
required
boolean
messageId
required

The message the text was posted as; null for a dry run. Its smsDelivery shows on GET /tickets/{id} once the text is tried, asynchronously.

string | null
name
required

The requester’s name on their client contact.

string
statusError
required

Set when statusId was given and the text was sent, but the status did not change.

string | null
ticketId
required
string
to
required

E.164 phone texted, or that a dry run would text.

string

Example generated

{
"data": {
"dryRun": true,
"messageId": "example",
"name": "example",
"statusError": "example",
"ticketId": "example",
"to": "example"
}
}

Validation error. Parse failures include field paths and expectations.

Media typeapplication/json

Validation error with safe field paths and expected values; submitted values are never returned.

object
error
required
object
code
required

Stable machine-readable error code.

string
issues
Array<object>
object
expected
required
string
message
required
string
path
required
Array<string | number>
message
required

Human-readable error message.

string
status
required

HTTP status code, mirrored in the body.

integer
>= -9007199254740991 <= 9007199254740991

Example

{
"error": {
"code": "UNAUTHORIZED"
}
}

Unauthorized.

Media typeapplication/json

Standard error envelope.

object
error
required
object
code
required

Stable machine-readable error code.

string
message
required

Human-readable error message.

string
status
required

HTTP status code, mirrored in the body.

integer
>= -9007199254740991 <= 9007199254740991

Example

{
"error": {
"code": "UNAUTHORIZED"
}
}

Forbidden.

Media typeapplication/json

Standard error envelope.

object
error
required
object
code
required

Stable machine-readable error code.

string
message
required

Human-readable error message.

string
status
required

HTTP status code, mirrored in the body.

integer
>= -9007199254740991 <= 9007199254740991

Example

{
"error": {
"code": "UNAUTHORIZED"
}
}

Not found.

Media typeapplication/json

Standard error envelope.

object
error
required
object
code
required

Stable machine-readable error code.

string
message
required

Human-readable error message.

string
status
required

HTTP status code, mirrored in the body.

integer
>= -9007199254740991 <= 9007199254740991

Example

{
"error": {
"code": "UNAUTHORIZED"
}
}

The ticket cannot be texted now; reason says why. Nothing was posted or sent.

Media typeapplication/json

Conflict: the ticket cannot be texted now; nothing was posted or sent.

object
error
required
object
code
required

Stable machine-readable error code.

string
message
required

Human-readable error message.

string
reason
required

Why: already_texting (also on a retry after a text that went through; read GET /tickets/{id}), merged, author_not_team, no_requester_contact, contact_revoked, awaiting_invitation (not invited to the portal yet, so Chelsea does not contact them), no_requester_phone, invalid_number, opted_out (replied STOP), phone_in_use (another open ticket already texts that phone and gets its replies; the message names it), recipient_changed, not_connected, texting_off, replies_off, incoming_off or token_unreadable.

string
Allowed values: already_texting merged author_not_team no_requester_contact contact_revoked awaiting_invitation no_requester_phone invalid_number opted_out phone_in_use recipient_changed not_connected texting_off replies_off incoming_off token_unreadable
status
required

HTTP status code, mirrored in the body.

integer
>= -9007199254740991 <= 9007199254740991

Example

{
"error": {
"code": "UNAUTHORIZED",
"reason": "already_texting"
}
}

Invalid input.

Media typeapplication/json

Standard error envelope.

object
error
required
object
code
required

Stable machine-readable error code.

string
message
required

Human-readable error message.

string
status
required

HTTP status code, mirrored in the body.

integer
>= -9007199254740991 <= 9007199254740991

Example

{
"error": {
"code": "UNAUTHORIZED"
}
}

Rate limit exceeded. Wait for Retry-After before retrying.

Media typeapplication/json

Standard error envelope.

object
error
required
object
code
required

Stable machine-readable error code.

string
message
required

Human-readable error message.

string
status
required

HTTP status code, mirrored in the body.

integer
>= -9007199254740991 <= 9007199254740991

Example

{
"error": {
"code": "UNAUTHORIZED"
}
}
RateLimit-Limit
string
/^\d+$/

Maximum requests in the current quota window.

RateLimit-Policy
string

Quota policy in requests and window seconds, for example 60;w=60.

RateLimit-Remaining
string
/^\d+$/

Requests left in this quota window (zero when blocked).

RateLimit-Reset
string
/^\d+$/

Seconds until the current quota window resets, when available from the rate-limit store.

Retry-After
string
/^\d+$/

Seconds until another request may be attempted.