---
docId: doc_cde802c869a242eabfccd1c594b2f572
title: Scheduled messages
description: "Read, reschedule and cancel scheduled messages, emails or templates."
api:
  group: mensajes
  auth: bearer
  operations:
    - operationId: listScheduledMessages
      method: GET
      path: /v1/messages/scheduled
      postmanName: List Scheduled Messages
    - operationId: getScheduledMessage
      method: GET
      path: '/v1/messages/scheduled/{messageId}'
      postmanName: Get a Scheduled Message
    - operationId: rescheduleScheduledMessage
      method: PATCH
      path: '/v1/messages/scheduled/{messageId}'
      postmanName: Reschedule a Scheduled Message
    - operationId: cancelScheduledMessage
      method: DELETE
      path: '/v1/messages/scheduled/{messageId}'
      postmanName: Cancel a Scheduled Message
---

<script>
  import { Ways, Note, Collapsible } from '$lib/components';
</script>

# Scheduled messages

Manage sends created with `delay` or `scheduleTime` through [`POST /v1/messages`](/api-reference/messages/send), [`POST /v1/messages/template`](/api-reference/messages/send-template) or [`POST /v1/messages/email`](/api-reference/messages/send-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

<Ways tabs="api,sdk">
<Ways.Way name="api">

```bash
curl "https://api.platic.ai/v1/messages/scheduled?status=failed" \
  -H "Authorization: Bearer $PLATIC_API_KEY"
```

</Ways.Way>
<Ways.Way name="sdk">

```ts
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()

</Ways.Way>
</Ways>

## Endpoint summary

| Operation | Endpoint | Use |
|-----------|----------|-----|
| List | `GET /v1/messages/scheduled` | Filter messages and walk through paginated results. |
| Get | `GET /v1/messages/scheduled/{messageId}` | Get a message by its public ID. |
| Reschedule | `PATCH /v1/messages/scheduled/{messageId}` | Change the date or the delay before processing. |
| Cancel | `DELETE /v1/messages/scheduled/{messageId}` | Cancel a send before processing. |

<Note type="important">

Responses show a preview, not the full content or internal identifiers such as `taskId`. Manage the send with `messageId`; you do not need `campaignId`, `runId` or other internal IDs.

</Note>

## Create a scheduled message

To create the send, use [Send a message](/api-reference/messages/send), [Send a template](/api-reference/messages/send-template) or [Send an email](/api-reference/messages/send-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"`:

```json
{
  "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
}
```

<Collapsible summary="Public message fields">

| Field | Type | Description |
|-------|------|-------------|
| `messageId` | string | Public, stable identifier of the message. |
| `kind` | enum | `service` for service messages or `template` for templates. |
| `status` | enum | `creating`, `delayed`, `scheduled`, `processing`, `sent`, `cancelled` or `failed`. |
| `channelId` | string | Channel the message will be or was sent from. |
| `conversationId` | string \| null | Associated conversation or recipient, when available. |
| `campaignId` | string \| null | Attribution campaign, when there is one. It is not used to manage the message. |
| `messageType` | string \| null | Type of the service message, for example `text` or `image`. |
| `templateName` | string \| null | Template name when `kind` is `template`. |
| `preview` | string \| null | Safe preview of the content. It is not the full payload. |
| `phoneNumber` | string \| null | Recipient's phone number, when available. |
| `name` | string \| null | Recipient's name, when available. |
| `executeAt` | string | Execution date normalized to ISO 8601 UTC. |
| `createdAt` | string | Creation date in ISO 8601 UTC. |
| `updatedAt` | string | Date of the last update in ISO 8601 UTC. |
| `cancelledAt` | string \| null | Cancellation date. |
| `sentAt` | string \| null | Date of the successful send. |
| `failedAt` | string \| null | Date of the final failure. |
| `error` | string \| null | Public failure information, if the status is `failed`. |
| `reschedulable` | boolean | Whether the message still accepts `PATCH`. |

</Collapsible>

## 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

| Parameter | Type | Default | Description |
|-----------|------|---------|-------------|
| `workspace` | string | — | Workspace to query. Only required when the API key has access to several workspaces. |
| `status` | CSV string | `creating,delayed,scheduled,processing` | One or more statuses: `creating`, `delayed`, `scheduled`, `processing`, `sent`, `cancelled`, `failed`. |
| `kind` | enum | — | Filter by `service` or `template`. |
| `campaignId` | string | — | Filter by campaign. It is only a filter; it is not required to manage a message by `messageId`. |
| `from` | ISO 8601 string | — | Start of the `executeAt` range. |
| `to` | ISO 8601 string | — | End of the `executeAt` range. |
| `limit` | integer | `50` | Results per page, from `1` to `200`. |
| `pageToken` | string | — | Opaque token returned by the previous page. |

Example with filters:

```bash
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

| Field | Description |
|-------|-------------|
| `messages` | Public resources of the current page. |
| `count` | Number of elements in `messages`. |
| `nextPageToken` | Token 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.

```bash
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

<Ways tabs="api,sdk">
<Ways.Way name="api">

```bash
curl https://api.platic.ai/v1/messages/scheduled/$MESSAGE_ID \
  -H "Authorization: Bearer $PLATIC_API_KEY"
```

</Ways.Way>
<Ways.Way name="sdk">

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

</Ways.Way>
</Ways>

### Resource parameters

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

| Parameter | Location | Type | Description | Required |
|-----------|----------|------|-------------|----------|
| `messageId` | path | string | ID returned when the message was created. | ✓ |
| `workspace` | query | string | Workspace of the message. Only required for multi-workspace API keys. | — |

### Response

Returns `{ "status": "success", "data": … }` with the [public resource](#public-resource) for `messageId` under `data`.

```json
{
  "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.

<Ways tabs="api,sdk">
<Ways.Way name="api">

```bash
curl -X PATCH https://api.platic.ai/v1/messages/scheduled/$MESSAGE_ID \
  -H "Authorization: Bearer $PLATIC_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{ "scheduleTime": "2030-01-15T16:00:00Z" }'
```

</Ways.Way>
<Ways.Way name="sdk">

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

</Ways.Way>
</Ways>

### Request body

Reschedule to an absolute date:

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

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

```json
{
  "delay": 3600000
}
```

| Field | Type | Required | Description |
|-------|------|----------|-------------|
| `scheduleTime` | ISO 8601 string | ✓¹ | New future date, at most 30 days after the request. Cannot be combined with `delay`. |
| `delay` | integer | ✓¹ | 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](#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`.

<Ways tabs="api,sdk">
<Ways.Way name="api">

```bash
curl -X DELETE https://api.platic.ai/v1/messages/scheduled/$MESSAGE_ID \
  -H "Authorization: Bearer $PLATIC_API_KEY"
```

</Ways.Way>
<Ways.Way name="sdk">

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

</Ways.Way>
</Ways>

### Response

Returns `{ "status": "success", "data": … }` with the [public resource](#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

<Collapsible summary="Show error codes and fixes">

See [API errors](/api-reference/errors) for the format and the common codes.

| Status | `details.code` | When it happens |
|--------|----------------|-----------------|
| `400` | `INVALID_REQUEST` | A 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 |
| `400` | `INVALID_SCHEDULE` | On 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` |
| `400` | `INVALID_REQUEST` | Your 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 |
| `401` | `UNAUTHENTICATED` | The credential is missing or invalid |
| `403` | `FORBIDDEN` | The credential does not have the module (`Missing <module> permission`), or, on the list, the session is limited to its own campaign |
| `403` | `INSUFFICIENT_SCOPE` | An OAuth token without the `platica:write` scope tried to reschedule or cancel. `details.requiredScope` says which one is missing |
| `404` | `SCHEDULED_MESSAGE_NOT_FOUND` | No scheduled message has that `messageId` |
| `409` | `SCHEDULE_NOT_RESCHEDULABLE` | On reschedule: only `creating`, `delayed` and `scheduled` messages can change. `details.status` carries the current one |
| `409` | `LEGACY_SCHEDULE_NOT_RESCHEDULABLE` | On reschedule: it was created by the previous scheduler. Cancel it and send it again |
| `409` | `SCHEDULE_VERSION_CONFLICT` | On reschedule: the message changed while it was being rescheduled. Get it again and retry |
| `409` | `SCHEDULE_NOT_CANCELLABLE` | On cancel: it is already `processing`, `sent` or `failed`. `details.status` carries the current one |
| `409` | `LEGACY_TASK_ALREADY_DISPATCHED` | On cancel: it was created by the previous scheduler and its task already left the queue |
| `502` | `UPSTREAM_ERROR` | On reschedule: the replacement task could not be created. Try again |
| `502` | `LEGACY_TASK_DELETE_FAILED` | On cancel: the task of a message from the previous scheduler could not be deleted. Try again |

```json
{
  "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`.

</Collapsible>

## Notes

### Statuses and transitions

```mermaid
flowchart LR
  request["Request accepted"] --> creating[creating]
  creating --> pending["delayed / scheduled"]
  pending -->|"executeAt arrives"| processing[processing]
  pending -->|DELETE| cancelled[cancelled]
  processing --> sent[sent]
  processing --> failed[failed]
```

- `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.



<Note type="tip">

Scheduled turns from the [Chat API](/api-reference/chat/send) use `scheduleAt` and are managed separately. These endpoints cover sends created with `POST /v1/messages`, `POST /v1/messages/template` or `POST /v1/messages/email`.

</Note>
