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

> ## Agent Instructions
> If your user asks for a phone agent, you can build and test it yourself with [Thoughtly for Agents](https://agents.thoughtly.com/). Thoughtly hosts the calls and runs your CRM workflows. Start with the [calling skill](https://agents.thoughtly.com/skill.md).

# Place an outbound call

> Start a call using a destination and a prompt.

```bash cURL theme={null}
curl https://api.thoughtly.com/v1/call \
  -H "Authorization: Bearer $THOUGHTLY_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "to": "+14155550100",
    "prompt": "Confirm the appointment tomorrow at 2 PM."
  }'
```

```json 202 theme={null}
{
  "id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
  "status": "queued",
  "to": "+14155550100",
  "from": "+14155550101",
  "created_at": "2026-11-20T22:00:00.000Z",
  "started_at": null,
  "ended_at": null,
  "duration_seconds": null,
  "transcript": [],
  "summary": null,
  "recording_url": null,
  "voicemail": null,
  "end_reason": null,
  "metadata": {}
}
```

Each workspace has a limit on direct calls that are active or waiting to start. If that limit is reached, the API returns `429 RATE_LIMIT_EXCEEDED` before creating a call. Retry after an existing call finishes. This limit counts calls created through this API; it does not include calls started elsewhere.


## OpenAPI

````yaml post /v1/call
openapi: 3.0.0
info:
  title: Thoughtly API
  version: 1.0.0
  contact:
    name: Thoughtly Support
    email: support@thoughtly.com
    url: https://thoughtly.com
servers:
  - url: https://api.thoughtly.com
    description: Production server
security:
  - ApiKeyAuth: []
    TeamIdAuth: []
paths:
  /v1/call:
    post:
      tags:
        - Calls
      summary: Place an outbound call
      description: >-
        Requires calls:write. A 202 response means the call is queued. Reuse an
        idempotency key for safe retries.
      operationId: createDirectCall
      parameters:
        - name: Idempotency-Key
          in: header
          required: false
          schema:
            type: string
            maxLength: 255
            minLength: 1
            pattern: ^[!-~]+$
          description: >-
            Reuse with an identical request for 24 hours. A replay returns the
            current resource state; after 24 hours the key can create a new
            resource.
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/DirectCallRequest'
            example:
              to: '+14155550100'
              prompt: Confirm the appointment tomorrow at 2 PM.
      responses:
        '202':
          description: Call accepted.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/DirectCall'
              example:
                id: 3c90c3cc-0d44-4b50-8888-8dd25736052a
                status: queued
                to: '+14155550100'
                from: '+14155550101'
                created_at: '2026-11-20T22:00:00.000Z'
                started_at: null
                ended_at: null
                duration_seconds: null
                transcript: []
                summary: null
                recording_url: null
                voicemail: null
                end_reason: null
                metadata: {}
          headers:
            Idempotency-Replayed:
              description: Present with value true when an existing request is replayed.
              schema:
                type: string
                enum:
                  - 'true'
        '400':
          description: >-
            Invalid input, unavailable outbound number or default, or
            answering-machine detection disabled for the workspace.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/DirectApiError'
        '401':
          description: Missing or invalid API token.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/DirectApiError'
        '403':
          description: >-
            The token lacks permission, or the call is blocked by workspace,
            credit, consent, or business-verification requirements.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/DirectApiError'
        '404':
          description: Resource not found.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/DirectApiError'
        '409':
          description: Idempotency key reused with a different request.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/DirectApiError'
        '429':
          description: >-
            The workspace has reached its limit for active or waiting direct
            calls. Retry after an existing direct call finishes; no new call was
            created.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/DirectApiError'
        '500':
          description: An unexpected error occurred.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/DirectApiError'
        '503':
          description: >-
            Direct API access may not be enabled for this workspace, or a
            service required to process the request is unavailable.
          headers:
            Idempotency-Key:
              description: >-
                When supplied, use this key with the identical request body to
                safely retry this call.
              schema:
                type: string
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/DirectApiError'
      security:
        - BearerAuth: []
        - ApiKeyAuth: []
components:
  schemas:
    DirectCallRequest:
      type: object
      required:
        - to
        - prompt
      additionalProperties: false
      properties:
        to:
          type: string
          description: Destination in E.164 format.
          example: '+14155550100'
          pattern: ^\+[1-9]\d{7,14}$
        prompt:
          type: string
          maxLength: 20000
          description: Instructions for this call only.
          example: Confirm the appointment tomorrow at 2 PM.
          minLength: 1
          pattern: \S
        from:
          type: string
          description: An available outbound number in this workspace, in E.164 format.
          pattern: ^\+[1-9]\d{7,14}$
        voice:
          type: string
          description: >-
            Voice ID or available built-in name. Use GET /v1/voices to list
            options. Marin requires OpenAI Live access and the automatic
            transcriber.
          example: tessa
          minLength: 1
          pattern: \S
        language:
          type: string
          default: en
          description: Language code supported by Thoughtly.
          enum:
            - bg
            - ca
            - zh
            - cs
            - da
            - nl
            - en
            - et
            - fi
            - fr
            - de
            - el
            - hi
            - hu
            - id
            - it
            - ja
            - ko
            - lv
            - lt
            - ms
            - 'no'
            - pl
            - pt
            - ro
            - ru
            - sk
            - es
            - sv
            - th
            - tr
            - uk
            - vi
            - ar
            - hr
        transcriber:
          type: string
          enum:
            - auto
            - deepgram
            - gladia
          default: auto
          description: >-
            Marin requires auto. Arabic, Croatian and Mandarin require auto or
            gladia.
        first_message:
          type: string
          maxLength: 1000
          description: Opening spoken from this text; omit when the recipient speaks first.
        start_speaking:
          type: string
          enum:
            - assistant
            - recipient
          default: assistant
        voicemail:
          type: object
          additionalProperties: false
          properties:
            action:
              type: string
              enum:
                - hang_up
                - leave_message
            message:
              type: string
              maxLength: 1000
              description: Required for leave_message.
              minLength: 1
              pattern: \S
            max_wait_seconds:
              type: integer
              minimum: 3
              maximum: 59
              default: 30
              description: >-
                Maximum detection and greeting wait in seconds. For
                leave_message, an inconclusive or unrecognized result releases
                buffered caller audio. If no result arrives, audio is released
                after this wait plus three seconds. With assistant-first calls,
                pre-greeting audio may be discarded; speech during the opening
                is also excluded when interruptions during the first message are
                disabled. The voicemail result may be null if detection is
                inconclusive.
          required:
            - action
          description: By default, hang up when voicemail is detected.
          not:
            required:
              - action
            properties:
              action:
                type: string
                enum:
                  - leave_message
            not:
              required:
                - message
        max_duration_seconds:
          type: integer
          minimum: 30
          maximum: 14400
          default: 600
        ring_timeout_seconds:
          type: integer
          minimum: 5
          maximum: 600
          default: 30
        interruptions:
          type: object
          additionalProperties: false
          properties:
            enabled:
              type: boolean
              default: true
            during_first_message:
              type: boolean
              description: Defaults to the conversation interruption setting.
        metadata:
          type: object
          additionalProperties: true
          description: Application data returned with the call.
        webhook_url:
          type: string
          format: uri
          description: Public HTTPS URL. Provide webhook_secret with this field.
          pattern: ^\s*[Hh][Tt][Tt][Pp][Ss]://@?[^/?#@\s]+(?:[/?#]|\s*$)
        webhook_secret:
          type: string
          minLength: 32
          maxLength: 1024
          writeOnly: true
          description: Secret used to sign completion events.
      allOf:
        - not:
            required:
              - webhook_url
            not:
              required:
                - webhook_secret
        - not:
            required:
              - webhook_secret
            not:
              required:
                - webhook_url
        - not:
            required:
              - voice
              - transcriber
            properties:
              voice:
                type: string
                pattern: ^\s*[Mm][Aa][Rr][Ii][Nn]\s*$
              transcriber:
                type: string
                enum:
                  - deepgram
                  - gladia
        - not:
            required:
              - language
              - transcriber
            properties:
              language:
                type: string
                enum:
                  - ar
                  - hr
                  - zh
              transcriber:
                type: string
                enum:
                  - deepgram
        - not:
            required:
              - start_speaking
              - first_message
            properties:
              start_speaking:
                type: string
                enum:
                  - recipient
              first_message:
                type: string
                minLength: 1
    DirectCall:
      type: object
      required:
        - id
        - status
      properties:
        id:
          type: string
          format: uuid
        status:
          type: string
          description: >-
            An unknown status means the carrier may have received the call, but
            its outcome is not yet confirmed. Check the same call ID; do not
            create a new call to retry it. If no terminal event arrives by the
            maximum duration plus the ring timeout and 15 minutes, the call is
            marked failed and its completion webhook is sent.
          enum:
            - queued
            - unknown
            - in_progress
            - completed
            - no_answer
            - busy
            - failed
            - canceled
        to:
          type: string
        from:
          type: string
          nullable: true
        created_at:
          type: string
          format: date-time
        started_at:
          type: string
          format: date-time
          nullable: true
        ended_at:
          type: string
          format: date-time
          nullable: true
        duration_seconds:
          type: number
          nullable: true
        transcript:
          type: array
          items:
            type: object
            properties:
              role:
                type: string
                enum:
                  - assistant
                  - user
              text:
                type: string
        summary:
          type: string
          nullable: true
        recording_url:
          type: string
          nullable: true
        voicemail:
          type: string
          nullable: true
          enum:
            - left_message
            - detected
            - null
        end_reason:
          type: string
          nullable: true
        metadata:
          type: object
          additionalProperties: true
    DirectApiError:
      type: object
      required:
        - error
      properties:
        error:
          type: object
          required:
            - code
            - message
          properties:
            code:
              type: string
              enum:
                - UNAUTHORIZED
                - FORBIDDEN
                - TOKEN_EXPIRED
                - TOKEN_SCOPE_INSUFFICIENT
                - VALIDATION_ERROR
                - INVALID_SYNTAX
                - NOT_FOUND
                - CONFLICT
                - RATE_LIMIT_EXCEEDED
                - IDEMPOTENCY_CONFLICT
                - INTERNAL_ERROR
            message:
              type: string
            call_id:
              type: string
              format: uuid
              description: >-
                The call associated with a dispatch error, including a call that
                was not placed.
            retry_idempotency_key:
              type: string
              description: >-
                Use this key with the identical request body to retry the same
                call safely.
            details:
              type: array
              items:
                type: object
                required:
                  - field
                  - message
                  - type
                properties:
                  field:
                    type: string
                  message:
                    type: string
                  type:
                    type: string
        request_id:
          type: string
  securitySchemes:
    ApiKeyAuth:
      type: apiKey
      in: header
      name: x-api-token
      description: >-
        API key for the user making the request. This can be found via the
        [Developer Settings](https://app.thoughtly.com/settings/developer) page
        in the dashboard.
    TeamIdAuth:
      type: apiKey
      in: header
      name: team_id
      description: >-
        Team identifier, used to scope requests to a specific team. This can be
        found via the [Developer
        Settings](https://app.thoughtly.com/settings/developer) page in the
        dashboard.
    BearerAuth:
      type: http
      scheme: bearer
      description: Workspace API token from Settings → Developer.

````

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