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

# Send SMS

> Sends an SMS directly to a phone number from the conversation profile (one of your numbers) you choose.

- If no contact exists for `to_phone`, a contact is created.
- If the contact has no conversation on the chosen conversation profile yet, one is created.
- The message is then sent from that profile's number.

Messages can be free-form text written at send time; no pre-approved template is required.
`template_id` is optional and only fills in a saved SMS template (see `/v1/sms/list-templates/{company_id}`).

Sending requires the company's A2P (10DLC) registration to be complete and is subject to the
company's hourly and per-minute messaging limits.
`account_id` is resolved from the authenticated user's account that matches `company_id`.




## OpenAPI

````yaml POST /v1/send-sms/{company_id}
openapi: 3.0.3
info:
  title: SalesCaptain API Documentation Service
  description: >
    API Documentation Service for SalesCaptain platform.

    This service provides endpoints for managing and retrieving company
    information for API documentation purposes.
  version: 0.1.0
  contact:
    name: SalesCaptain API Team
    email: support@salescaptain.com
  license:
    name: Proprietary
    url: https://salescaptain.com/license
servers:
  - url: https://api.salescaptain.com
    description: Production server
security:
  - BearerAuth: []
tags:
  - name: Health
    description: Service health and status endpoints
  - name: Companies
    description: Company management and retrieval operations
  - name: Accounts
    description: Account management and retrieval operations
  - name: Conversation Profiles
    description: Conversation profile management for communication channels
  - name: Conversations
    description: Conversation management and retrieval operations
  - name: Contacts
    description: Contact management and retrieval operations
  - name: Tags
    description: Tag listing, creation, deletion, and contact assignment operations
  - name: Custom Fields
    description: Custom field definition management
  - name: Templates
    description: SMS template retrieval operations
  - name: Analytics
    description: Call analytics and reporting operations
  - name: Stages
    description: >
      Conversation stages (inbox folders). List the stages, read a
      conversation's stage and move a conversation

      to another stage. Stage moves made in the app or through the API fire the
      `conversation.stage_change` webhook.
  - name: Webhooks
    description: >
      **Webhook Subscriptions** send an HTTP request to your URL when an event
      happens in SalesCaptain.

      Subscriptions are created in the SalesCaptain app: pick the events you
      want, your URL and the HTTP

      method (default `POST`). Each request body is the event payload as JSON,
      with the

      event name in `action`.


      | Event | When it fires | Payload schema |

      |---|---|---|

      | `contact.create` | A contact is created | `WebhookContactEvent` |

      | `contact.update` | A contact is updated | `WebhookContactEvent` |

      | `contact.delete` | A contact is deleted | `WebhookContactEvent` |

      | `message.sms` | An SMS is sent or received | `WebhookMessageEvent` |

      | `message.email` | An email is sent or received | `WebhookMessageEvent` |

      | `message.webchat` | A web chat message is sent or received |
      `WebhookMessageEvent` |

      | `message.fb` | A Facebook message is sent or received |
      `WebhookMessageEvent` |

      | `message.ig` | An Instagram message is sent or received |
      `WebhookMessageEvent` |

      | `campaign.opt_out` | A contact opts out of a campaign message |
      `WebhookWorkflowEvent` |

      | `campaign.replied` | A contact replies to a campaign message |
      `WebhookWorkflowEvent` |

      | `automation.opt_out` | A contact opts out of an automation message |
      `WebhookWorkflowEvent` |

      | `automation.replied` | A contact replies to an automation message |
      `WebhookWorkflowEvent` |

      | `conversation.stage_change` | A conversation is moved to a different
      stage | `WebhookStageChangeEvent` |


      Example `message.sms` request body:


      ```json

      {
        "action": "message.sms",
        "direction": "inbound",
        "timestamp": "7/14/2026, 8:43 AM",
        "channel": "sms",
        "body": "Yes, Friday works for me",
        "media": null,
        "from": "+14155551234",
        "to": "+14155559876"
      }

      ```


      Respond with any 2xx status. Failed deliveries are not retried.
externalDocs:
  description: SalesCaptain API Documentation
  url: https://docs.salescaptain.com
paths:
  /v1/send-sms/{company_id}:
    post:
      tags:
        - Conversations
      summary: Send an SMS to a phone number (starts a conversation if needed)
      description: >
        Sends an SMS directly to a phone number from the conversation profile
        (one of your numbers) you choose.


        - If no contact exists for `to_phone`, a contact is created.

        - If the contact has no conversation on the chosen conversation profile
        yet, one is created.

        - The message is then sent from that profile's number.


        Messages can be free-form text written at send time; no pre-approved
        template is required.

        `template_id` is optional and only fills in a saved SMS template (see
        `/v1/sms/list-templates/{company_id}`).


        Sending requires the company's A2P (10DLC) registration to be complete
        and is subject to the

        company's hourly and per-minute messaging limits.

        `account_id` is resolved from the authenticated user's account that
        matches `company_id`.
      operationId: sendSms
      parameters:
        - name: company_id
          in: path
          required: true
          description: Unique identifier for the company
          schema:
            type: string
            format: uuid
            example: a1b2c3d4-e5f6-7890-abcd-ef1234567890
      requestBody:
        required: true
        content:
          application/json:
            schema:
              type: object
              required:
                - to_phone
                - conversation_profile_id
              properties:
                to_phone:
                  type: string
                  description: >-
                    Recipient phone number. E.164 format is recommended (e.g.
                    +14155551234). Spaces, dashes, dots and parentheses are
                    ignored.
                  example: '+14155551234'
                conversation_profile_id:
                  type: string
                  format: uuid
                  description: >-
                    The conversation profile (your number) to send from. Use
                    `/v1/list-conversation-profiles/{company_id}` to list them.
                  example: c3d4e5f6-a7b8-9012-cdef-123456789012
                message_body:
                  type: string
                  description: >-
                    Free-form message text. Required unless `template_id` is
                    provided.
                  example: >-
                    Hi John, your technician is on the way and should arrive in
                    20 minutes.
                template_id:
                  type: string
                  format: uuid
                  description: >-
                    Optional saved SMS template to send instead of / in addition
                    to `message_body`.
                  example: a1b2c3d4-e5f6-7890-abcd-ef1234567890
                contact_name:
                  type: string
                  maxLength: 100
                  description: >-
                    Optional name used when a new contact is created. If the
                    contact already exists, its first name is updated to this
                    value.
                  example: John Smith
            examples:
              free_form:
                summary: Free-form SMS to a new or existing number
                value:
                  to_phone: '+14155551234'
                  conversation_profile_id: c3d4e5f6-a7b8-9012-cdef-123456789012
                  message_body: >-
                    Hi John, your technician is on the way and should arrive in
                    20 minutes.
                  contact_name: John Smith
              template:
                summary: SMS using a saved template
                value:
                  to_phone: '+14155551234'
                  conversation_profile_id: c3d4e5f6-a7b8-9012-cdef-123456789012
                  template_id: a1b2c3d4-e5f6-7890-abcd-ef1234567890
      responses:
        '200':
          description: SMS sent successfully
          content:
            application/json:
              schema:
                type: object
                properties:
                  message:
                    type: string
                    example: SMS sent successfully!
                  data:
                    $ref: '#/components/schemas/OutboundSmsResult'
              example:
                message: SMS sent successfully!
                data:
                  contact_id: e5f6a7b8-c9d0-1234-ef12-345678901234
                  conversation_id: b2c3d4e5-f6a7-8901-bcde-f12345678901
                  conversation_profile_id: c3d4e5f6-a7b8-9012-cdef-123456789012
                  from_number: '+14155559876'
                  to_number: '+14155551234'
                  message:
                    conversation_id: b2c3d4e5-f6a7-8901-bcde-f12345678901
                    author: Jane Doe
                    body: >-
                      Hi John, your technician is on the way and should arrive
                      in 20 minutes.
                    date_created: '2026-11-19T10:30:00.000Z'
                    is_me: true
                    message_type: sms_message
                    sent_by_id: d4e5f6a7-b8c9-0123-def1-234567890123
                    sent_by_username: Jane Doe
                    message_id: a1b2c3d4-e5f6-7890-abcd-ef1234567890
        '400':
          description: Invalid request or the message could not be sent
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
              examples:
                invalid_phone:
                  summary: Invalid phone number
                  value:
                    status: failure
                    error: >-
                      to_phone must be a valid phone number, preferably in E.164
                      format (e.g. +14155551234)
                missing_body:
                  summary: No message body or template
                  value:
                    status: failure
                    error: message_body or template_id must be provided
                unknown_profile:
                  summary: Conversation profile does not belong to the company
                  value:
                    status: failure
                    error: Conversation profile not found for this company
                no_number:
                  summary: Profile has no phone number
                  value:
                    status: failure
                    error: >-
                      This conversation profile has no phone number to send SMS
                      from
                a2p:
                  summary: A2P registration not complete
                  value:
                    status: failure
                    error: A2P not verified!
        '401':
          $ref: '#/components/responses/UnauthorizedError'
        '403':
          $ref: '#/components/responses/ForbiddenError'
        '429':
          $ref: '#/components/responses/RateLimitError'
        '500':
          $ref: '#/components/responses/InternalServerError'
      security:
        - BearerAuth: []
components:
  schemas:
    OutboundSmsResult:
      type: object
      description: Result of sending an SMS to a phone number
      properties:
        contact_id:
          type: string
          format: uuid
          description: Contact the SMS was sent to (created if it did not exist)
        conversation_id:
          type: string
          format: uuid
          description: Conversation the SMS was posted in (created if it did not exist)
        conversation_profile_id:
          type: string
          format: uuid
        from_number:
          type: string
          description: Your number the SMS was sent from
          example: '+14155559876'
        to_number:
          type: string
          description: Recipient number as stored on the contact
          example: '+14155551234'
        message:
          $ref: '#/components/schemas/SentMessage'
    Error:
      type: object
      description: Error response object
      properties:
        error:
          type: string
          description: Error message
          example: Invalid request parameters
        code:
          type: string
          description: Error code for programmatic handling
          example: INVALID_PARAMS
        timestamp:
          type: string
          format: date-time
          description: Timestamp when the error occurred
          example: '2023-12-01T10:30:00Z'
        path:
          type: string
          description: API endpoint path where the error occurred
          example: /v1/fetch-companies
      required:
        - error
    SentMessage:
      type: object
      description: Message as returned after a successful send (chat service response)
      properties:
        conversation_id:
          type: string
          format: uuid
          example: b2c3d4e5-f6a7-8901-bcde-f12345678901
        author:
          type: string
          description: Display name of the message author
          example: Jane Doe
        body:
          type: string
          description: Message text
          example: Hi — this is a test message from the api-doc send endpoint.
        date_created:
          type: string
          format: date-time
          example: '2025-03-23T18:30:00.000Z'
        is_me:
          type: boolean
          description: Whether the message was sent by the authenticated account
          example: true
        message_type:
          type: string
          description: Channel/type of the message
          example: sms_message
        sent_by_id:
          type: string
          description: Account ID of the sender
          example: d4e5f6a7-b8c9-0123-def1-234567890123
        sent_by_username:
          type: string
          example: Jane Doe
        message_id:
          type: string
          description: Unique message identifier from the chat service
          example: a1b2c3d4-e5f6-7890-abcd-ef1234567890
      required:
        - conversation_id
        - author
        - body
        - date_created
        - is_me
        - message_type
        - sent_by_id
        - sent_by_username
        - message_id
  responses:
    UnauthorizedError:
      description: Authentication token is missing or invalid
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/Error'
          example:
            error: Unauthorized access
            code: UNAUTHORIZED
            timestamp: '2023-12-01T10:30:00Z'
            path: /v1/fetch-companies
    ForbiddenError:
      description: Access forbidden - valid token but insufficient permissions
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/Error'
          example:
            error: Forbidden access
            code: FORBIDDEN
            timestamp: '2023-12-01T10:30:00Z'
            path: /v1/fetch-companies
    RateLimitError:
      description: Rate limit exceeded
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/Error'
          example:
            error: Too many requests, please try again later
            code: RATE_LIMIT_EXCEEDED
            timestamp: '2023-12-01T10:30:00Z'
            path: /v1/fetch-companies
      headers:
        X-RateLimit-Limit:
          description: Request limit per time window
          schema:
            type: integer
            example: 30
        X-RateLimit-Remaining:
          description: Remaining requests in current window
          schema:
            type: integer
            example: 0
        X-RateLimit-Reset:
          description: Time when the rate limit resets
          schema:
            type: integer
            example: 1701425400
    InternalServerError:
      description: Internal server error
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/Error'
          example:
            error: Problem encountered while fetching companies!
            code: INTERNAL_ERROR
            timestamp: '2023-12-01T10:30:00Z'
            path: /v1/fetch-companies
  securitySchemes:
    BearerAuth:
      type: http
      scheme: bearer
      bearerFormat: JWT
      description: >
        Authentication token required for accessing protected endpoints.

        The token should be obtained from the main SalesCaptain authentication
        service.

````

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