Text the person who opened a ticket instead of emailing them
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.
Authorizations
Section titled “Authorizations”Parameters
Section titled “Parameters”Path Parameters
Section titled “Path Parameters”Resource identifier (CUID2).
Resource identifier (CUID2).
Request Body
Section titled “Request Body”object
Return who would get the text, or why the ticket cannot be texted, and send nothing.
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.
Ticket status to move to with the text. No status email is sent; the text is the notice.
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.
Responses
Section titled “Responses”Dry run: who would get the text; nothing was posted or sent.
object
object
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.
The requester’s name on their client contact.
Set when statusId was given and the text was sent, but the status did not change.
E.164 phone texted, or that a dry run would text.
Example generated
{ "data": { "dryRun": true, "messageId": "example", "name": "example", "statusError": "example", "ticketId": "example", "to": "example" }}The message was posted and its text queued.
object
object
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.
The requester’s name on their client contact.
Set when statusId was given and the text was sent, but the status did not change.
E.164 phone texted, or that a dry run would text.
Example generated
{ "data": { "dryRun": true, "messageId": "example", "name": "example", "statusError": "example", "ticketId": "example", "to": "example" }}Validation error. Parse failures include field paths and expectations.
Validation error with safe field paths and expected values; submitted values are never returned.
object
object
Stable machine-readable error code.
object
Human-readable error message.
HTTP status code, mirrored in the body.
Example
{ "error": { "code": "UNAUTHORIZED" }}Unauthorized.
Standard error envelope.
object
object
Stable machine-readable error code.
Human-readable error message.
HTTP status code, mirrored in the body.
Example
{ "error": { "code": "UNAUTHORIZED" }}Forbidden.
Standard error envelope.
object
object
Stable machine-readable error code.
Human-readable error message.
HTTP status code, mirrored in the body.
Example
{ "error": { "code": "UNAUTHORIZED" }}Not found.
Standard error envelope.
object
object
Stable machine-readable error code.
Human-readable error message.
HTTP status code, mirrored in the body.
Example
{ "error": { "code": "UNAUTHORIZED" }}The ticket cannot be texted now; reason says why. Nothing was posted or sent.
Conflict: the ticket cannot be texted now; nothing was posted or sent.
object
object
Stable machine-readable error code.
Human-readable error message.
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.
HTTP status code, mirrored in the body.
Example
{ "error": { "code": "UNAUTHORIZED", "reason": "already_texting" }}Invalid input.
Standard error envelope.
object
object
Stable machine-readable error code.
Human-readable error message.
HTTP status code, mirrored in the body.
Example
{ "error": { "code": "UNAUTHORIZED" }}Rate limit exceeded. Wait for Retry-After before retrying.
Standard error envelope.
object
object
Stable machine-readable error code.
Human-readable error message.
HTTP status code, mirrored in the body.
Example
{ "error": { "code": "UNAUTHORIZED" }}Headers
Section titled “Headers”Maximum requests in the current quota window.
Quota policy in requests and window seconds, for example 60;w=60.
Requests left in this quota window (zero when blocked).
Seconds until the current quota window resets, when available from the rate-limit store.
Seconds until another request may be attempted.
Chelsea is operated by Arepa Labs LLC