> For clean Markdown of any page, append .md to the page URL.
> For a complete documentation index, see https://docs.youratlas.com/llms.txt.
> For AI client integration (Claude Code, Cursor, etc.), connect to the MCP server at https://docs.youratlas.com/_mcp/server.

# Schedule SMS session

POST https://api.youratlas.com/v1/api/campaign-chat/{campaignId}/sessions/sms/schedule
Content-Type: application/json

Reference: https://docs.youratlas.com/api-reference/atlas-api/campaign-chat/schedule-sms-session

## Authentication

- `api-key` header (required) — Your Atlas API key. Get it from the Atlas Portal under Settings > API Keys.

## Request

### Path parameters

- `campaignId` (string, required)

### Body (application/json)

This endpoint expects an object.

- `customerPhoneNumber` (string, required) — Contact phone number in E.164 format.
- `customerName` (string, required) — Contact first name.
- `customerLastName` (string, optional) — Contact last name.
- `customerInfo` (string, optional) — Key-value pairs of additional contact information (e.g. "EventType=Wedding\nEmail=user@example.com").
- `customMessage` (string, optional) — Custom first message to send instead of the campaign default.
- `scheduledDate` (datetime, optional) — ISO 8601 datetime to schedule the message. If omitted the message is sent immediately.
- `attachments` (list of string, optional) — Up to 3 public HTTPS URLs for image or video attachments (MMS). Each URL must use HTTPS and not exceed 512 characters.

## Response

### 200

Session scheduled

- `campaignId` (string, optional)
- `contactPhoneNumber` (string, optional)
- `sessionId` (string, optional)
- `messageId` (string, optional)
- `scheduledDate` (datetime, optional)
- `sequenceNumber` (integer, optional)

## Errors

### 400 Bad Request Error

Bad request

- `error` (ErrorError, optional)

### 500 Internal Server Error

Internal server error

- `error` (ErrorError, optional)

## Types

### ErrorError

- `message` (string, optional)
- `code` (string, optional)
- `requestId` (string, optional)

## Examples

**Request**

```json
{
  "customerPhoneNumber": "string",
  "customerName": "string"
}
```

**Response**

```json
{
  "campaignId": "string",
  "contactPhoneNumber": "string",
  "sessionId": "string",
  "messageId": "string",
  "scheduledDate": "2024-01-15T09:30:00Z",
  "sequenceNumber": 1
}
```

**SDK Code**

```python
import requests

url = "https://api.youratlas.com/v1/api/campaign-chat/campaignId/sessions/sms/schedule"

payload = {
    "customerPhoneNumber": "string",
    "customerName": "string"
}
headers = {
    "api-key": "<apiKey>",
    "Content-Type": "application/json"
}

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

print(response.json())
```

```javascript
const url = 'https://api.youratlas.com/v1/api/campaign-chat/campaignId/sessions/sms/schedule';
const options = {
  method: 'POST',
  headers: {'api-key': '<apiKey>', 'Content-Type': 'application/json'},
  body: '{"customerPhoneNumber":"string","customerName":"string"}'
};

try {
  const response = await fetch(url, options);
  const data = await response.json();
  console.log(data);
} catch (error) {
  console.error(error);
}
```

```go
package main

import (
	"fmt"
	"strings"
	"net/http"
	"io"
)

func main() {

	url := "https://api.youratlas.com/v1/api/campaign-chat/campaignId/sessions/sms/schedule"

	payload := strings.NewReader("{\n  \"customerPhoneNumber\": \"string\",\n  \"customerName\": \"string\"\n}")

	req, _ := http.NewRequest("POST", url, payload)

	req.Header.Add("api-key", "<apiKey>")
	req.Header.Add("Content-Type", "application/json")

	res, _ := http.DefaultClient.Do(req)

	defer res.Body.Close()
	body, _ := io.ReadAll(res.Body)

	fmt.Println(res)
	fmt.Println(string(body))

}
```

```ruby
require 'uri'
require 'net/http'

url = URI("https://api.youratlas.com/v1/api/campaign-chat/campaignId/sessions/sms/schedule")

http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true

request = Net::HTTP::Post.new(url)
request["api-key"] = '<apiKey>'
request["Content-Type"] = 'application/json'
request.body = "{\n  \"customerPhoneNumber\": \"string\",\n  \"customerName\": \"string\"\n}"

response = http.request(request)
puts response.read_body
```

```java
import com.mashape.unirest.http.HttpResponse;
import com.mashape.unirest.http.Unirest;

HttpResponse<String> response = Unirest.post("https://api.youratlas.com/v1/api/campaign-chat/campaignId/sessions/sms/schedule")
  .header("api-key", "<apiKey>")
  .header("Content-Type", "application/json")
  .body("{\n  \"customerPhoneNumber\": \"string\",\n  \"customerName\": \"string\"\n}")
  .asString();
```

```php
<?php
require_once('vendor/autoload.php');

$client = new \GuzzleHttp\Client();

$response = $client->request('POST', 'https://api.youratlas.com/v1/api/campaign-chat/campaignId/sessions/sms/schedule', [
  'body' => '{
  "customerPhoneNumber": "string",
  "customerName": "string"
}',
  'headers' => [
    'Content-Type' => 'application/json',
    'api-key' => '<apiKey>',
  ],
]);

echo $response->getBody();
```

```csharp
using RestSharp;

var client = new RestClient("https://api.youratlas.com/v1/api/campaign-chat/campaignId/sessions/sms/schedule");
var request = new RestRequest(Method.POST);
request.AddHeader("api-key", "<apiKey>");
request.AddHeader("Content-Type", "application/json");
request.AddParameter("application/json", "{\n  \"customerPhoneNumber\": \"string\",\n  \"customerName\": \"string\"\n}", ParameterType.RequestBody);
IRestResponse response = client.Execute(request);
```

```swift
import Foundation

let headers = [
  "api-key": "<apiKey>",
  "Content-Type": "application/json"
]
let parameters = [
  "customerPhoneNumber": "string",
  "customerName": "string"
] as [String : Any]

let postData = JSONSerialization.data(withJSONObject: parameters, options: [])

let request = NSMutableURLRequest(url: NSURL(string: "https://api.youratlas.com/v1/api/campaign-chat/campaignId/sessions/sms/schedule")! as URL,
                                        cachePolicy: .useProtocolCachePolicy,
                                    timeoutInterval: 10.0)
request.httpMethod = "POST"
request.allHTTPHeaderFields = headers
request.httpBody = postData as Data

let session = URLSession.shared
let dataTask = session.dataTask(with: request as URLRequest, completionHandler: { (data, response, error) -> Void in
  if (error != nil) {
    print(error as Any)
  } else {
    let httpResponse = response as? HTTPURLResponse
    print(httpResponse)
  }
})

dataTask.resume()
```