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

# Create Message Automation

> Create a new message automation (drip sequence). By default, includes the standard 5-step SMS + email sequence. Set include_default_steps to false to create an empty automation.

Create a new message automation (drip sequence). By default, the automation is created with the standard 5-step SMS + email sequence. Set `include_default_steps` to `false` to create an empty automation you can populate manually.

```bash cURL theme={null}
curl -X POST https://api.classet.ai/v2/message-automations \
  -H "X-API-KEY: your-api-key" \
  -H "Content-Type: application/json" \
  -d '{
    "title": "HVAC Candidate Outreach",
    "description": "Standard drip for trade roles",
    "is_default": true
  }'
```

```json 201 theme={null}
{
  "data": {
    "id": 12,
    "title": "HVAC Candidate Outreach",
    "description": "Standard drip for trade roles",
    "is_default": true,
    "agent_identity": null,
    "agent_config_id": null,
    "created_at": "2025-01-15T10:30:00Z",
    "steps": [
      {
        "id": 101,
        "name": "Initial Outreach",
        "channel": "sms",
        "message": "Hi {candidate.firstname}, Thanks for applying to the {job.title} role...",
        "delay_hours": 0,
        "enabled": true,
        "order": 1,
        "message_automation_id": 12
      }
    ]
  }
}
```

## Template variables

Messages support these variables:

| Variable | Description |
| - | - |
| `{candidate.firstname}` | Candidate's first name |
| `{job.title}` | Job title |
| `{org.organization_name}` | Organization name |


## OpenAPI

````yaml POST /v2/message-automations
openapi: 3.1.0
info:
  title: Classet API
  version: 2.0.3
  description: >-
    AI-powered recruiting and phone screening API.


    **API key scopes.** `read` covers every GET; any other method needs `write`
    (403 `insufficient_scope`); starting or stopping an interview also needs
    `interviews:send`. A branch-limited key sees and writes only jobs in its
    branches (not jobs with no branch) and their candidates, applications and
    calls; anything outside is a 404. An organization-group key is read-only
    across every organization in its group. Branch-limited and group keys cannot
    use organization configuration (scripts, knowledge, webhooks, message
    automations, agent settings, AI generation, organization): 403
    `restricted_key_unsupported`. `GET /v2/me` reports what the calling key can
    do.
servers:
  - url: https://api.classet.ai
    description: Production
  - url: http://localhost:8081
    description: Local development
security:
  - ApiKeyAuth: []
paths:
  /v2/message-automations:
    post:
      tags:
        - Message Automations
      summary: Create a message automation
      description: >-
        Create a new message automation (drip sequence). By default, includes
        the standard 5-step SMS + email sequence. Set include_default_steps to
        false to create an empty automation.
      requestBody:
        required: true
        content:
          application/json:
            schema:
              type: object
              properties:
                title:
                  type: string
                  minLength: 1
                  example: HVAC Candidate Outreach
                  description: >-
                    Name of the automation (e.g. "HVAC Outreach", "Executive
                    Recruiting").
                description:
                  type: string
                  description: Description of the automation's purpose.
                is_default:
                  type: boolean
                  description: >-
                    Set to `true` to make this the default automation. Only one
                    automation can be the default — setting this unsets others.
                agent_identity:
                  type: string
                  nullable: true
                  description: >-
                    Custom agent personality/identity for outreach messages.
                    Controls how the agent "sounds" in text messages.
                include_default_steps:
                  type: boolean
                  default: true
                  description: >-
                    If `true` (default), creates the automation with a standard
                    5-step drip sequence for both SMS and email:

                    1. **Initial Outreach** — sent immediately

                    2. **First Follow-up** — 3 hours later

                    3. **Second Follow-up** — 22 hours later

                    4. **Third Follow-up** — 22 hours later

                    5. **Final Follow-up** — 22 hours later


                    Set to `false` to create an empty automation.
              required:
                - title
      responses:
        '201':
          description: Created
          content:
            application/json:
              schema:
                type: object
                properties:
                  data:
                    $ref: '#/components/schemas/MessageAutomation'
                required:
                  - data
        '500':
          description: Server error
          content:
            application/json:
              schema:
                type: object
                properties:
                  error:
                    type: string
                    example: Resource not found
                  code:
                    type: string
                    enum:
                      - not_found
                      - validation_error
                      - unauthorized
                      - forbidden
                      - insufficient_scope
                      - restricted_key_unsupported
                      - branch_out_of_scope
                      - key_misconfigured
                      - quota_exceeded
                      - rate_limited
                      - rate_limit_unavailable
                      - conflict
                      - idempotency_key_reuse
                      - candidate_opted_out
                      - recently_contacted
                      - request_in_progress
                      - unprocessable
                      - bad_request
                      - payload_too_large
                      - internal_error
                      - service_unavailable
                    example: not_found
                    description: Stable machine-readable error code.
                  request_id:
                    type: string
                    example: 9f2c1d7e-4a3b-4c8d-9e0f-1a2b3c4d5e6f
                    description: >-
                      Request ID, also echoed in the X-Request-Id response
                      header. Include it when reporting issues.
                required:
                  - error
      security:
        - ApiKeyAuth: []
components:
  schemas:
    MessageAutomation:
      type: object
      properties:
        id:
          type: integer
        title:
          type: string
        description:
          type: string
          nullable: true
        is_default:
          type: boolean
          nullable: true
        agent_identity:
          type: string
          nullable: true
        agent_config_id:
          type: integer
          nullable: true
        created_at:
          type: string
        steps:
          type: array
          items:
            $ref: '#/components/schemas/MessageAutomationStep'
      required:
        - id
        - title
        - description
        - is_default
        - agent_identity
        - agent_config_id
        - created_at
        - steps
      description: Message automation with its steps
    MessageAutomationStep:
      type: object
      properties:
        id:
          type: integer
        name:
          type: string
          nullable: true
        channel:
          type: string
          nullable: true
          enum:
            - sms
            - email
            - whatsapp
            - null
          description: Messaging channel
        message:
          type: string
          nullable: true
        delay_hours:
          type: number
        enabled:
          type: boolean
          nullable: true
        order:
          type: integer
        message_automation_id:
          type: integer
      required:
        - id
        - name
        - channel
        - message
        - delay_hours
        - enabled
        - order
        - message_automation_id
      description: A single step in a message automation sequence
  securitySchemes:
    ApiKeyAuth:
      type: apiKey
      in: header
      name: X-API-KEY
      description: Your Classet API key. Create and rotate keys in Settings → API.

````

This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.