Messages
A message is a single text sent to one recipient. Its status moves from queued to sent to delivered (or failed).
The message object
Section titled “The message object”| Field | Type | Description |
|---|---|---|
id |
string | Unique ID, starting with msg_ |
to |
string | Recipient in E.164 format |
body |
string | The text that was sent |
status |
string | queued, scheduled, sent, delivered, failed or canceled |
parts |
integer | How many segments the body used |
send_at |
string or null | Scheduled time, if any |
created_at |
string | ISO 8601 timestamp |
Create a message
Section titled “Create a message”POST/v1/messages
Sends a message now, or schedules it with send_at.
Body parameters
Section titled “Body parameters”| Name | Type | Required | Description |
|---|---|---|---|
to |
string | Yes | Recipient phone number in E.164 format |
body |
string | One of body or template |
Up to 1,600 characters |
template |
string | One of body or template |
A template ID from the dashboard |
variables |
object | No | Values for the template’s placeholders |
send_at |
string | No | ISO 8601 time, up to 30 days ahead |
metadata |
object | No | Up to 20 keys of your own data, returned in webhooks |
curl https://api.tidewire.example/v1/messages \ -H "Authorization: Bearer $TIDEWIRE_API_KEY" \ -H "Content-Type: application/json" \ -H "Idempotency-Key: 6f1c2b7e-order-1042" \ -d '{ "to": "+15550100", "body": "Your order #1042 is on its way.", "metadata": { "order_id": "1042" } }'const message = await tw.messages.create( { to: "+15550100", body: "Your order #1042 is on its way.", metadata: { order_id: "1042" }, }, { idempotencyKey: "6f1c2b7e-order-1042" },);message = tw.messages.create( to="+15550100", body="Your order #1042 is on its way.", metadata={"order_id": "1042"}, idempotency_key="6f1c2b7e-order-1042",)msg, err := client.Messages.Create(ctx, &tidewire.MessageParams{ To: "+15550100", Body: "Your order #1042 is on its way.", Metadata: map[string]string{"order_id": "1042"},}, tidewire.WithIdempotencyKey("6f1c2b7e-order-1042")){ "id": "msg_9Hc2Lr7Qx", "to": "+15550100", "body": "Your order #1042 is on its way.", "status": "queued", "parts": 1, "send_at": null, "metadata": { "order_id": "1042" }, "created_at": "2026-11-02T16:04:09Z"}Retrieve a message
Section titled “Retrieve a message”GET/v1/messages/{id}
Returns a message by its ID.
curl https://api.tidewire.example/v1/messages/msg_9Hc2Lr7Qx \ -H "Authorization: Bearer $TIDEWIRE_API_KEY"const message = await tw.messages.retrieve("msg_9Hc2Lr7Qx");message = tw.messages.retrieve("msg_9Hc2Lr7Qx")msg, err := client.Messages.Get(ctx, "msg_9Hc2Lr7Qx")List messages
Section titled “List messages”GET/v1/messages
Returns messages, newest first.
Query parameters
Section titled “Query parameters”| Name | Type | Description |
|---|---|---|
status |
string | Only return messages with this status |
to |
string | Only return messages sent to this number |
limit |
integer | 1 to 100, default 25 |
cursor |
string | The next_cursor from the previous page |
curl "https://api.tidewire.example/v1/messages?status=failed&limit=10" \ -H "Authorization: Bearer $TIDEWIRE_API_KEY"for await (const message of tw.messages.list({ status: "failed" })) { console.log(message.id, message.status);}for message in tw.messages.list(status="failed").auto_paging_iter(): print(message.id, message.status)iter := client.Messages.List(ctx, &tidewire.ListParams{Status: "failed"})for iter.Next() { fmt.Println(iter.Message().ID)}Cancel a scheduled message Scheduled only
Section titled “Cancel a scheduled message ”DELETE/v1/messages/{id}
Cancels a message that hasn’t been sent yet. Returns the message with status set to canceled.
curl -X DELETE https://api.tidewire.example/v1/messages/msg_9Hc2Lr7Qx \ -H "Authorization: Bearer $TIDEWIRE_API_KEY"await tw.messages.cancel("msg_9Hc2Lr7Qx");tw.messages.cancel("msg_9Hc2Lr7Qx")_, err := client.Messages.Cancel(ctx, "msg_9Hc2Lr7Qx")