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

# Create a new sequence.

POST /v1/sequences
Content-Type: application/json

Reference: https://docs.meetgail.com/api-reference/api-reference/sequences/createsequence

## Authentication

- `X-API-Key` header (required) — API Key authentication. Generate your API key in the Gail Portal under General > Integrations > API Keys.

## Request

### Body (application/json)

- `name` (string, optional, nullable)
- `description` (string, optional, nullable)
- `criteria` (string, optional, nullable)
- `schedules` (list of object, optional, nullable)
  - `dayOffset` (integer, optional)
  - `hour` (integer, optional)
  - `minute` (integer, optional)
  - `delayInMinutes` (integer, optional)
  - `sequenceScripts` (list of string, optional, nullable)
- `timezone` (string, optional, nullable)

## Response

### 201

Created

- `id` (string, optional)
- `status` (string, optional, nullable)
- `name` (string, optional, nullable)
- `description` (string, optional, nullable)
- `criteria` (string, optional, nullable)
- `schedules` (list of object, optional, nullable)
  - `dayOffset` (integer, optional)
  - `hour` (integer, optional)
  - `minute` (integer, optional)
  - `delayInMinutes` (integer, optional)
  - `phoneScript` (object, optional) — Represetns a phone script response.
    - `agentName` (string, required, nullable) — Gets or sets the agent's name.
    - `greeting` (string, required, nullable) — Gets or sets the greeting.
    - `goodbye` (string, required, nullable) — Gets or sets the goodBye.
    - `useCaseAssociations` (list of object, required, nullable) — Gets or sets the UseCase associations.
      - `id` (string, optional)
      - `order` (integer, optional)
      - `status` (enum, optional)
        - Allowed values: `active`, `inactive`
    - `giveSurvey` (boolean, required) — Gets or sets the GiveSurvey indicator.
    - `faqs` (list of object, required, nullable) — Gets or sets the faq.
      - `question` (string, optional, nullable)
      - `answer` (string, optional, nullable)
      - `details` (string, optional, nullable)
    - `postCallScripts` (list of object, required, nullable) — Gets or sets the list of post-call script actions to run after call ends.
      - `textScriptId` (string, required)
      - `description` (string, required, nullable)
    - `voicemail` (string, optional, nullable) — Gets or sets the voicemail.
    - `voice` (string, optional, nullable) — Gets or sets the voice.
    - `voiceProvider` (object, optional)
      - `value` (string, optional, nullable)
    - `knowledgeBase` (object, optional)
      - `documentIds` (list of string, optional, nullable) — Gets or sets the document Ids.
      - `documentTags` (list of string, optional, nullable) — Gets or sets the document tags.
  - `emailScript` (object, optional) — Represents email script response.
    - `subject` (string, optional, nullable) — Gets or sets the subject.
    - `body` (string, optional, nullable) — Gets or sets the body.
  - `textScript` (object, optional) — Represents text script response.
    - `message` (string, optional, nullable) — Gets or sets the message.
  - `blasterScript` (object, optional) — Represents blaster script response.
    - `message` (string, required, nullable) — Get or sets blaster script message.
  - `scripts` (list of object or object or object or object, optional, nullable)
    - EmailScript
      - `subject` (string, optional, nullable) — Gets or sets the subject.
      - `body` (string, optional, nullable) — Gets or sets the body.
    - TextScript
      - `message` (string, optional, nullable) — Gets or sets the message.
    - PhoneScript
      - `agentName` (string, required, nullable) — Gets or sets the agent's name.
      - `greeting` (string, required, nullable) — Gets or sets the greeting.
      - `goodbye` (string, required, nullable) — Gets or sets the goodBye.
      - `useCaseAssociations` (list of object, required, nullable) — Gets or sets the UseCase associations.
        - `id` (string, optional)
        - `order` (integer, optional)
        - `status` (enum, optional)
          - Allowed values: `active`, `inactive`
      - `giveSurvey` (boolean, required) — Gets or sets the GiveSurvey indicator.
      - `faqs` (list of object, required, nullable) — Gets or sets the faq.
        - `question` (string, optional, nullable)
        - `answer` (string, optional, nullable)
        - `details` (string, optional, nullable)
      - `postCallScripts` (list of object, required, nullable) — Gets or sets the list of post-call script actions to run after call ends.
        - `textScriptId` (string, required)
        - `description` (string, required, nullable)
      - `voicemail` (string, optional, nullable) — Gets or sets the voicemail.
      - `voice` (string, optional, nullable) — Gets or sets the voice.
      - `voiceProvider` (object, optional)
        - `value` (string, optional, nullable)
      - `knowledgeBase` (object, optional)
        - `documentIds` (list of string, optional, nullable) — Gets or sets the document Ids.
        - `documentTags` (list of string, optional, nullable) — Gets or sets the document tags.
    - BlasterScript
      - `message` (string, required, nullable) — Get or sets blaster script message.
- `timezone` (string, optional, nullable)

## Examples

**Request**

```json
{}
```

**Response**

```json
{
  "id": "a3f1c9d2-4b7e-4f8a-9c3d-2e5b7f6a8d9e",
  "status": "active",
  "name": "Appointment Reminder Sequence",
  "description": "Sequence to remind customers about upcoming appointments and follow up for feedback.",
  "criteria": "contact.status == 'active' AND contact.hasUpcomingAppointment == true",
  "schedules": [
    {
      "dayOffset": 0,
      "hour": 9,
      "minute": 0,
      "delayInMinutes": 0,
      "phoneScript": {
        "agentName": "Sarah Chen",
        "greeting": "Hello, this is Sarah from Acme Health. We're calling to remind you of your appointment scheduled for tomorrow.",
        "goodbye": "Thank you for your time. Have a great day!",
        "useCaseAssociations": [
          {
            "id": "d4e5f6a7-b8c9-4d0e-9f1a-2b3c4d5e6f70",
            "order": 1,
            "status": "active"
          }
        ],
        "giveSurvey": true,
        "faqs": [
          {
            "question": "What should I bring to my appointment?",
            "answer": "Please bring a valid ID and your insurance card.",
            "details": "If you have any recent medical records, please bring those as well."
          }
        ],
        "postCallScripts": [
          {
            "textScriptId": "f1e2d3c4-b5a6-7890-1234-56789abcdef0",
            "description": "Send follow-up SMS with appointment details."
          }
        ],
        "voicemail": "Hi, this is Sarah from Acme Health. We wanted to remind you about your appointment tomorrow. Please call us back if you need to reschedule.",
        "voice": "female",
        "voiceProvider": {
          "value": "Amazon Polly - Joanna"
        },
        "knowledgeBase": {
          "documentIds": [
            "123e4567-e89b-12d3-a456-426614174000"
          ],
          "documentTags": [
            "appointment",
            "reminder",
            "healthcare"
          ]
        },
        "$type": "PhoneScript",
        "direction": "outbound",
        "id": "b7c8d9e0-f1a2-3456-7890-abcdef123456",
        "name": "Appointment Reminder Call Script",
        "status": "active",
        "type": "phone"
      },
      "emailScript": {
        "subject": "Reminder: Your Appointment is Tomorrow",
        "body": "Dear Marcus Johnson,\n\nThis is a friendly reminder that you have an appointment scheduled for tomorrow at 10:00 AM.\n\nPlease let us know if you need to reschedule.\n\nBest regards,\nAcme Health Team",
        "$type": "EmailScript",
        "direction": "outbound",
        "id": "c1d2e3f4-a5b6-7890-cdef-1234567890ab",
        "name": "Appointment Reminder Email",
        "status": "active",
        "type": "phone"
      },
      "textScript": {
        "message": "Hi Marcus, this is a reminder from Acme Health about your appointment tomorrow at 10 AM. Reply YES to confirm or call us to reschedule.",
        "$type": "TextScript",
        "direction": "outbound",
        "id": "d2e3f4a5-b678-90cd-ef12-34567890abcd",
        "name": "Appointment Reminder SMS",
        "status": "active",
        "type": "phone"
      },
      "blasterScript": {
        "message": "Reminder: Your appointment at Acme Health is scheduled for tomorrow. Please confirm or reschedule.",
        "$type": "BlasterScript",
        "direction": "outbound",
        "id": "e3f4a5b6-7890-cdef-1234-567890abcdef",
        "name": "Appointment Reminder Blaster",
        "status": "active",
        "type": "phone"
      },
      "scripts": [
        {
          "$type": "EmailScript",
          "body": "Dear Marcus Johnson,\n\nWe hope your appointment went well. Please take a moment to provide feedback on your experience.\n\nThank you,\nAcme Health Team",
          "direction": "outbound",
          "id": "f4a5b678-90cd-ef12-3456-7890abcdef12",
          "name": "Post-Appointment Feedback Email",
          "status": "active",
          "subject": "Follow-up: How was your appointment?",
          "type": "phone"
        }
      ]
    }
  ],
  "timezone": "America/New_York"
}
```

**SDK Code**

```python
import requests

url = "https://api.example.com/v1/sequences"

payload = {}
headers = {
    "X-API-Key": "<apiKey>",
    "Content-Type": "application/json"
}

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

print(response.json())
```

```javascript
const url = 'https://api.example.com/v1/sequences';
const options = {
  method: 'POST',
  headers: {'X-API-Key': '<apiKey>', 'Content-Type': 'application/json'},
  body: '{}'
};

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.example.com/v1/sequences"

	payload := strings.NewReader("{}")

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

	req.Header.Add("X-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.example.com/v1/sequences")

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

request = Net::HTTP::Post.new(url)
request["X-API-Key"] = '<apiKey>'
request["Content-Type"] = 'application/json'
request.body = "{}"

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.example.com/v1/sequences")
  .header("X-API-Key", "<apiKey>")
  .header("Content-Type", "application/json")
  .body("{}")
  .asString();
```

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

$client = new \GuzzleHttp\Client();

$response = $client->request('POST', 'https://api.example.com/v1/sequences', [
  'body' => '{}',
  'headers' => [
    'Content-Type' => 'application/json',
    'X-API-Key' => '<apiKey>',
  ],
]);

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

```csharp
using RestSharp;

var client = new RestClient("https://api.example.com/v1/sequences");
var request = new RestRequest(Method.POST);
request.AddHeader("X-API-Key", "<apiKey>");
request.AddHeader("Content-Type", "application/json");
request.AddParameter("application/json", "{}", ParameterType.RequestBody);
IRestResponse response = client.Execute(request);
```

```swift
import Foundation

let headers = [
  "X-API-Key": "<apiKey>",
  "Content-Type": "application/json"
]
let parameters = [] as [String : Any]

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

let request = NSMutableURLRequest(url: NSURL(string: "https://api.example.com/v1/sequences")! 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()
```