Scheduled messages

SDK platic.messages.scheduled.list()
SDK platic.messages.scheduled.get()
SDK platic.messages.scheduled.reschedule()
SDK platic.messages.scheduled.cancel()

Manage sends created with delay or scheduleTime through POST /v1/messages, POST /v1/messages/template or POST /v1/messages/email. Use the messageId from the HTTP 202 response to read, reschedule or cancel them.

The REST API returns the list in messages; the SDK returns it in page.data. REST get, reschedule and cancel include the resource in data. The SDK returns that resource directly.

Example

const page = await platic.messages.scheduled.list({ status: ["failed"] });

Read messages in page.data. To continue, send page.nextPageToken as pageToken, or use `platic.messages.scheduled.iterate()

Endpoint summary

OperationEndpointUse
ListGET /v1/messages/scheduledFilter messages and walk through paginated results.
GetGET /v1/messages/scheduled/{messageId}Get a message by its public ID.
ReschedulePATCH /v1/messages/scheduled/{messageId}Change the date or the delay before processing.
CancelDELETE /v1/messages/scheduled/{messageId}Cancel a send before processing.

Create a scheduled message

To create the send, use Send a message, Send a template or Send an email with exactly one of these fields:

  • delay: from 3000 ms to 86400000 ms (24 hours).
  • scheduleTime: a future date in ISO 8601, at most 30 days after the request.

Send one of the two fields. Save the messageId from the HTTP 202 response to manage the send.

Public resource

The resource appears inside data when getting, rescheduling or cancelling. Each item in a list's messages has the same shape. Emails are classified as kind: "service" with messageType: "email":

{
  "messageId": "msg_01JQ91AB7C4D8E2F6G0H",
  "kind": "template",
  "status": "scheduled",
  "channelId": "wb-12345",
  "conversationId": "5215512345678",
  "campaignId": "api",
  "messageType": null,
  "templateName": "appointment_reminder",
  "preview": "Hi Ana, a reminder of your appointment...",
  "phoneNumber": "5215512345678",
  "name": "Ana",
  "executeAt": "2026-10-15T15:45:00.000Z",
  "createdAt": "2026-09-20T20:00:00.000Z",
  "updatedAt": "2026-09-20T20:00:00.000Z",
  "cancelledAt": null,
  "sentAt": null,
  "failedAt": null,
  "error": null,
  "reschedulable": true
}
FieldTypeDescription
messageIdstringPublic, stable identifier of the message.
kindenumservice for service messages or template for templates.
statusenumcreating, delayed, scheduled, processing, sent, cancelled or failed.
channelIdstringChannel the message will be or was sent from.
conversationIdstring | nullAssociated conversation or recipient, when available.
campaignIdstring | nullAttribution campaign, when there is one. It is not used to manage the message.
messageTypestring | nullType of the service message, for example text or image.
templateNamestring | nullTemplate name when kind is template.
previewstring | nullSafe preview of the content. It is not the full payload.
phoneNumberstring | nullRecipient's phone number, when available.
namestring | nullRecipient's name, when available.
executeAtstringExecution date normalized to ISO 8601 UTC.
createdAtstringCreation date in ISO 8601 UTC.
updatedAtstringDate of the last update in ISO 8601 UTC.
cancelledAtstring | nullCancellation date.
sentAtstring | nullDate of the successful send.
failedAtstring | nullDate of the final failure.
errorstring | nullPublic failure information, if the status is failed.
reschedulablebooleanWhether the message still accepts PATCH.

List scheduled messages

Without filters, it returns the active messages with status creating, delayed, scheduled or processing. See the example at the top of the page for the cURL and SDK calls.

Query parameters

ParameterTypeDefaultDescription
workspacestring—Workspace to query. Only required when the API key has access to several workspaces.
statusCSV stringcreating,delayed,scheduled,processingOne or more statuses: creating, delayed, scheduled, processing, sent, cancelled, failed.
kindenum—Filter by service or template.
campaignIdstring—Filter by campaign. It is only a filter; it is not required to manage a message by messageId.
fromISO 8601 string—Start of the executeAt range.
toISO 8601 string—End of the executeAt range.
limitinteger50Results per page, from 1 to 200.
pageTokenstring—Opaque token returned by the previous page.

Example with filters:

curl "https://api.platic.ai/v1/messages/scheduled?status=scheduled,processing&kind=template&from=2026-10-01T00%3A00%3A00Z&to=2026-11-01T00%3A00%3A00Z&limit=50" \
  -H "Authorization: Bearer $PLATIC_API_KEY"

Response

FieldDescription
messagesPublic resources of the current page.
countNumber of elements in messages.
nextPageTokenToken to request the next page. Omitted on the last page.

Pagination

count is the number of items on the current page. If you receive nextPageToken, there is another page: send it as pageToken without changing it or the filters.

curl "https://api.platic.ai/v1/messages/scheduled?status=scheduled,processing&kind=template&limit=50&pageToken=eyJleGVjdXRlQXQiOiIyMDI2LTEwLTE1VDE1OjQ1OjAwLjAwMFoifQ" \
  -H "Authorization: Bearer $PLATIC_API_KEY"

If there is no nextPageToken, you reached the last page.

Get a scheduled message

const message = await platic.messages.scheduled.get("message_123");

Resource parameters

The same parameters apply to the get, reschedule and cancel operations.

ParameterLocationTypeDescriptionRequired
messageIdpathstringID returned when the message was created.✓
workspacequerystringWorkspace of the message. Only required for multi-workspace API keys.—

Response

Returns { "status": "success", "data": … } with the public resource for messageId under data.

{
  "status": "success",
  "data": {
    "messageId": "msg_01JQ91AB7C4D8E2F6G0H",
    "kind": "template",
    "status": "scheduled",
    "...": "…"
  }
}

Reschedule a scheduled message

Send exactly one of scheduleTime or delay. You do not need to send campaignId, runId or the original payload.

await platic.messages.scheduled.reschedule("message_123", {
  scheduleTime: "2030-01-15T16:00:00Z",
});

Request body

Reschedule to an absolute date:

{
  "scheduleTime": "2026-10-16T10:30:00-06:00"
}

Or move it with a delay relative to the moment of the request:

{
  "delay": 3600000
}
FieldTypeRequiredDescription
scheduleTimeISO 8601 string✓¹New future date, at most 30 days after the request. Cannot be combined with delay.
delayinteger✓¹New delay from 3000 to 86400000 ms (24 hours). Cannot be combined with scheduleTime.

¹ Send exactly one.

Response

Returns { "status": "success", "data": … } with the updated public resource inside data, without message. The status becomes scheduled with scheduleTime or delayed with delay.

If reschedulable is false, the message can no longer be rescheduled.

Cancel a scheduled message

Cancels the send and returns the resource with status cancelled.

await platic.messages.scheduled.cancel("message_123");

Response

Returns { "status": "success", "data": … } with the public resource under data, with status: "cancelled", cancelledAt and reschedulable: false. Cancelling is idempotent: repeating DELETE on an already cancelled message returns the same resource and has no other effect.

Errors

See API errors for the format and the common codes.

Statusdetails.codeWhen it happens
400INVALID_REQUESTA filter, limit, from after to, pageToken or messageId (empty or with a /) is invalid. On reschedule, scheduleTime and delay are sent together or neither, or delay is not an integer in range. details.issues says which field
400INVALID_SCHEDULEOn reschedule: scheduleTime is not a valid ISO 8601 date, is in the past or is more than 30 days ahead. details.issues points at scheduleTime
400INVALID_REQUESTYour credential covers several workspaces and you did not send ?workspace=, or you sent one it does not cover. details.available lists the ones you can use and details.requested repeats the one you sent
401UNAUTHENTICATEDThe credential is missing or invalid
403FORBIDDENThe credential does not have the module (Missing <module> permission), or, on the list, the session is limited to its own campaign
403INSUFFICIENT_SCOPEAn OAuth token without the platica:write scope tried to reschedule or cancel. details.requiredScope says which one is missing
404SCHEDULED_MESSAGE_NOT_FOUNDNo scheduled message has that messageId
409SCHEDULE_NOT_RESCHEDULABLEOn reschedule: only creating, delayed and scheduled messages can change. details.status carries the current one
409LEGACY_SCHEDULE_NOT_RESCHEDULABLEOn reschedule: it was created by the previous scheduler. Cancel it and send it again
409SCHEDULE_VERSION_CONFLICTOn reschedule: the message changed while it was being rescheduled. Get it again and retry
409SCHEDULE_NOT_CANCELLABLEOn cancel: it is already processing, sent or failed. details.status carries the current one
409LEGACY_TASK_ALREADY_DISPATCHEDOn cancel: it was created by the previous scheduler and its task already left the queue
502UPSTREAM_ERROROn reschedule: the replacement task could not be created. Try again
502LEGACY_TASK_DELETE_FAILEDOn cancel: the task of a message from the previous scheduler could not be deleted. Try again
{
  "code": 404,
  "error": "Not Found - The resource doesn't exist",
  "details": {
    "code": "SCHEDULED_MESSAGE_NOT_FOUND",
    "message": "Scheduled message not found"
  }
}

On a 409, get the message again and decide from status and reschedulable.

Notes

Statuses and transitions

  • creating normally lasts only a few moments while the task is registered.
  • delayed and scheduled are the same pending state. PATCH lets you switch between them without altering the rest of the flow.
  • While it is pending, DELETE moves it to cancelled.
  • processing means execution has already started; it cannot be rescheduled or cancelled.
  • sent, cancelled and failed are final states.
  • The service window, the contact's blocked status and the channel rules are validated again on execution. An accepted message can end up failed.

Dates and time zones

  • Send scheduleTime, from and to in ISO 8601 format.
  • Include Z or an offset such as -06:00 to avoid ambiguity. When you omit the zone, scheduleTime uses Mexico time.
  • executeAt, createdAt, updatedAt, cancelledAt, sentAt and failedAt are always returned normalized to UTC.
  • delay is computed from the moment the API accepts the request.

Idempotency

GET calls only read data and can be repeated. A PATCH with delay calculates the delay from each request: repeating it changes the date. If you lose the response, get the resource by messageId first.