---
title: "Schedule an SMS message for delivery"
description: "Schedules a message to be sent via the queue service"
---

> Documentation Index
> Fetch the complete documentation index at: https://developer.channelautomations.com/llms.txt
> Use this file to discover all available pages before exploring further.

Path: Channel Automation API › Queue

`POST /api/queue/schedule-sms`

Schedules a message to be sent via the queue service

## Authentication

- `bearerAuth`

## Request body

_Required._

- `to` (`post/api/queue/schedule-sms.to`; string, required) — Recipient phone number
- `content` (`post/api/queue/schedule-sms.content`; string, required) — Message content
- `workspaceId` (`post/api/queue/schedule-sms.workspaceId`; string, required) — Workspace ID
- `contactId` (`post/api/queue/schedule-sms.contactId`; string, optional) — Contact ID (optional)
- `scheduledFor` (`post/api/queue/schedule-sms.scheduledFor`; string, optional) — When to send the message (optional, immediate if not specified)
  - format `date-time`
- `metadata` (`post/api/queue/schedule-sms.metadata`; object, optional) — Additional metadata for the message

## Example request

```json
{
  "to": "string",
  "content": "string",
  "workspaceId": "string",
  "contactId": "string",
  "scheduledFor": "2019-08-24T14:15:22Z",
  "metadata": {}
}
```

## Code samples

### cURL

```bash
curl --request POST \
  --url https://api.channelautomation.com/api/queue/schedule-sms \
  --header 'Content-Type: application/json' \
  --data '
{
  "to": "string",
  "content": "string",
  "workspaceId": "string",
  "contactId": "string",
  "scheduledFor": "2019-08-24T14:15:22Z",
  "metadata": {}
}
'
```

### TypeScript

```typescript
const url = 'https://api.channelautomation.com/api/queue/schedule-sms';
const options = {
  method: 'POST',
  headers: {'Content-Type': 'application/json'},
  body: JSON.stringify({
    to: 'string',
    content: 'string',
    workspaceId: 'string',
    contactId: 'string',
    scheduledFor: '2019-08-24T14:15:22Z',
    metadata: {}
  })
};

fetch(url, options)
  .then(res => res.json())
  .then(json => console.log(json))
  .catch(err => console.error(err));
```

### Python

```python
import requests

url = "https://api.channelautomation.com/api/queue/schedule-sms"

payload = {
    "to": "string",
    "content": "string",
    "workspaceId": "string",
    "contactId": "string",
    "scheduledFor": "2019-08-24T14:15:22Z",
    "metadata": {}
}
headers = {"Content-Type": "application/json"}

response = requests.post(url, json=payload, headers=headers)

print(response.text)
```

## Responses

### 200

Message scheduled successfully

#### Example

```json
{
  "success": true,
  "jobId": "string",
  "scheduledFor": "2019-08-24T14:15:22Z"
}
```

- `success` (`post/api/queue/schedule-sms.response.200.success`; boolean, optional)
- `jobId` (`post/api/queue/schedule-sms.response.200.jobId`; string, optional) — Queue job ID for tracking
- `scheduledFor` (`post/api/queue/schedule-sms.response.200.scheduledFor`; string, optional) — When the message is scheduled to be sent
  - format `date-time`

### 400

Invalid input

### 401

Unauthorized

### 500

Internal server error


Source: https://developer.channelautomations.com/api/post-api-queue-schedule-sms/index.md
