> ## 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.

# List all SMS templates

> Retrieves all active SMS templates associated with a specific company, grouped by template type (custom, review, refer, cx) plus an all list.




## OpenAPI

````yaml GET /v1/sms/list-templates/{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
externalDocs:
  description: SalesCaptain API Documentation
  url: https://docs.salescaptain.com
paths:
  /v1/sms/list-templates/{company_id}:
    get:
      tags:
        - Templates
      summary: List all SMS templates for a company
      description: >
        Retrieves all active SMS templates associated with a specific company,
        grouped by template type (custom, review, refer, cx) plus an all list.
      operationId: listSmsTemplates
      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
      responses:
        '200':
          description: SMS templates fetched successfully
          content:
            application/json:
              schema:
                type: object
                properties:
                  message:
                    type: string
                    example: SMS templates fetched successfully!
                  templates:
                    $ref: '#/components/schemas/SmsTemplatesGrouped'
              example:
                message: SMS templates fetched successfully!
                templates:
                  custom:
                    - template_sms_id: a1b2c3d4-e5f6-7890-abcd-ef1234567890
                      template_type_: Custom text
                      template_name: Follow up
                      message: Hi {{name}}, just checking in!
                      referral_image: null
                  review:
                    - template_sms_id: b2c3d4e5-f6a7-8901-bcde-f12345678901
                      template_type_: Review request text
                      template_name: Ask for review
                      message: Hi {{name}}, we'd love your feedback!
                      referral_image: null
                  refer: []
                  cx: []
                  all:
                    - template_sms_id: a1b2c3d4-e5f6-7890-abcd-ef1234567890
                      template_type_: Custom text
                      template_name: Follow up
                      message: Hi {{name}}, just checking in!
                      referral_image: null
                    - template_sms_id: b2c3d4e5-f6a7-8901-bcde-f12345678901
                      template_type_: Review request text
                      template_name: Ask for review
                      message: Hi {{name}}, we'd love your feedback!
                      referral_image: null
        '400':
          description: Missing required parameters
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
              example:
                status: failure
                error: 'Required parameters missing: company_id'
        '401':
          $ref: '#/components/responses/UnauthorizedError'
        '403':
          $ref: '#/components/responses/ForbiddenError'
        '429':
          $ref: '#/components/responses/RateLimitError'
        '500':
          $ref: '#/components/responses/InternalServerError'
      security:
        - BearerAuth: []
components:
  schemas:
    SmsTemplatesGrouped:
      type: object
      description: SMS templates grouped by type
      properties:
        custom:
          type: array
          description: Custom text templates
          items:
            $ref: '#/components/schemas/SmsTemplate'
        review:
          type: array
          description: Review request text templates
          items:
            $ref: '#/components/schemas/SmsTemplate'
        refer:
          type: array
          description: Referral text templates
          items:
            $ref: '#/components/schemas/SmsTemplate'
        cx:
          type: array
          description: Customer experience text templates
          items:
            $ref: '#/components/schemas/SmsTemplate'
        all:
          type: array
          description: All active SMS templates
          items:
            $ref: '#/components/schemas/SmsTemplate'
      required:
        - custom
        - review
        - refer
        - cx
        - all
    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
    SmsTemplate:
      type: object
      description: SMS template object
      properties:
        template_sms_id:
          type: string
          format: uuid
          description: Unique identifier for the SMS template
          example: a1b2c3d4-e5f6-7890-abcd-ef1234567890
        template_type_:
          type: string
          description: Type of the SMS template
          enum:
            - Custom text
            - Review request text
            - Referral text
            - Customer experience text
          example: Custom text
        template_name:
          type: string
          description: Display name of the template
          example: Follow up
        message:
          type: string
          description: SMS message body
          example: Hi {{name}}, just checking in!
        referral_image:
          type: string
          nullable: true
          description: Optional referral image URL associated with the template
          example: null
      required:
        - template_sms_id
        - template_type_
        - template_name
        - message
  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.

````