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

> Get a sequence. Use when driving the outbound-sequencing engine programmatically.

# Get a sequence



## OpenAPI

````yaml get /sequences/{sequence_id}
openapi: 3.1.0
info:
  title: OpenCX API
  description: >

    OpenCX is an AI-powered, all-in-one platform for customer support and
    outbound communications.


    Use this API to manage your OpenCX organization's AI agents, actions,
    conversations, contacts, and more.


    To get started, generate a new API key from the dashboard.


    ## Authentication

    All API endpoints require authentication using a Bearer token. You can
    generate an API key from your OpenCX dashboard.


    ## Rate Limiting

    API requests are rate limited to ensure fair usage. The current limits are:

    - 100 requests per minute for standard endpoints

    - 1000 requests per minute for streaming endpoints


    ## Error Handling

    The API uses standard HTTP status codes and returns detailed error messages
    in the response body.
  version: 1.0-beta
  license:
    name: MIT
    url: https://opensource.org/licenses/MIT
servers:
  - url: https://api.open.cx
    description: Production
security:
  - bearerAuth: []
paths:
  /sequences/{sequence_id}:
    get:
      summary: Get a sequence
      operationId: getSequence
      parameters:
        - schema:
            type: string
          in: path
          name: sequence_id
          required: true
          description: The unique identifier of the sequence
      responses:
        '200':
          description: Default Response
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/GetSequenceOutput'
        '500':
          description: Internal Server Error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorDto'
components:
  schemas:
    GetSequenceOutput:
      $ref: '#/components/schemas/SequenceDto'
      $schema: https://json-schema.org/draft/2020-12/schema
      $id: '#/components/schemas/GetSequenceOutput'
    ErrorDto:
      type: object
      properties:
        statusCode:
          type: integer
        message:
          type: string
        error:
          type: string
    SequenceDto:
      $schema: https://json-schema.org/draft/2020-12/schema
      $id: '#/components/schemas/SequenceDto'
      type: object
      properties:
        id:
          type: string
        name:
          type: string
        org_id:
          type: string
        custom_id:
          anyOf:
            - type: string
              maxLength: 50
            - type: 'null'
        filter:
          anyOf:
            - type: object
              properties:
                or:
                  minItems: 1
                  type: array
                  items:
                    type: object
                    properties:
                      and:
                        type: array
                        items:
                          $ref: '#/components/schemas/ContactsFilter'
                    required:
                      - and
                    additionalProperties: false
              required:
                - or
              additionalProperties: false
            - type: 'null'
        steps:
          type: array
          items:
            $ref: '#/components/schemas/SequenceStep'
        is_continuous:
          type: boolean
        started_at:
          anyOf:
            - type: string
              format: date-time
            - type: 'null'
        canceled_at:
          anyOf:
            - type: string
              format: date-time
            - type: 'null'
        ended_at:
          anyOf:
            - type: string
              format: date-time
            - type: 'null'
        status:
          anyOf:
            - $ref: '#/components/schemas/SequenceStatus'
            - type: 'null'
      required:
        - id
        - name
        - org_id
        - custom_id
        - filter
        - steps
        - is_continuous
        - started_at
        - canceled_at
        - ended_at
        - status
      additionalProperties: false
    ContactsFilter:
      $schema: https://json-schema.org/draft/2020-12/schema
      $id: '#/components/schemas/ContactsFilter'
      anyOf:
        - type: object
          properties:
            type:
              type: string
              const: all_contacts
          required:
            - type
          additionalProperties: false
        - type: object
          properties:
            type:
              type: string
              const: contact_id_in
            contact_ids:
              type: array
              items:
                type: string
                format: uuid
                pattern: >-
                  ^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$
          required:
            - type
            - contact_ids
          additionalProperties: false
        - type: object
          properties:
            type:
              type: string
              const: contacts_created_at_between
            after:
              type: string
              format: date-time
            before:
              type: string
              format: date-time
          required:
            - type
          additionalProperties: false
        - type: object
          properties:
            type:
              type: string
              const: contacts_email_domain_name_in
            domain_name_in:
              type: array
              items:
                type: string
          required:
            - type
            - domain_name_in
          additionalProperties: false
        - type: object
          properties:
            type:
              type: string
              const: contacts_affected_by_sequence
            sequence_id:
              type: string
          required:
            - type
            - sequence_id
          additionalProperties: false
        - type: object
          properties:
            type:
              type: string
              const: contacts_name_in
            name_in:
              type: array
              items:
                type: string
          required:
            - type
            - name_in
          additionalProperties: false
        - type: object
          properties:
            type:
              type: string
              const: contacts_phone_number_in
            phone_number_in:
              type: array
              items:
                type: string
          required:
            - type
            - phone_number_in
          additionalProperties: false
        - type: object
          properties:
            type:
              type: string
              const: contacts_email_in
            email_in:
              type: array
              items:
                type: string
          required:
            - type
            - email_in
          additionalProperties: false
        - type: object
          properties:
            type:
              type: string
              const: contacts_attributes_in
            attributes:
              type: array
              items:
                type: object
                propertyNames:
                  type: string
                additionalProperties:
                  type: string
          required:
            - type
          additionalProperties: false
        - type: object
          properties:
            type:
              type: string
              const: contacts_sessions_attributes_in
            attributes:
              type: array
              items:
                type: object
                propertyNames:
                  type: string
                additionalProperties:
                  type: string
          required:
            - type
          additionalProperties: false
        - type: object
          properties:
            type:
              type: string
              const: contact_belongs_to_segment
            segment_id:
              type: string
          required:
            - type
            - segment_id
          additionalProperties: false
        - type: object
          properties:
            type:
              type: string
              const: last_contacted_at_between
            after:
              type: string
              format: date-time
            before:
              type: string
              format: date-time
          required:
            - type
          additionalProperties: false
        - type: object
          properties:
            type:
              type: string
              const: last_contacted_at_with_handoff_between
            after:
              type: string
              format: date-time
            before:
              type: string
              format: date-time
          required:
            - type
          additionalProperties: false
    SequenceStep:
      $schema: https://json-schema.org/draft/2020-12/schema
      $id: '#/components/schemas/SequenceStep'
      type: object
      properties:
        action:
          anyOf:
            - type: object
              properties:
                type:
                  type: string
                  const: send_emails
                data:
                  type: object
                  properties:
                    from_email:
                      type: string
                    email_subject:
                      type: string
                    email_body:
                      type: string
                    email_sender_name:
                      type: string
                    email_is_transactional:
                      type: boolean
                  required:
                    - from_email
                    - email_subject
                    - email_body
                    - email_sender_name
                    - email_is_transactional
                  additionalProperties: false
              required:
                - type
                - data
              additionalProperties: false
            - type: object
              properties:
                type:
                  type: string
                  const: make_phone_calls
                data:
                  type: object
                  properties:
                    aiPhoneAgentId:
                      type: string
                  required:
                    - aiPhoneAgentId
                  additionalProperties: false
              required:
                - type
                - data
              additionalProperties: false
            - type: object
              properties:
                type:
                  type: string
                  const: send_sms_messages
                data:
                  type: object
                  properties:
                    message:
                      type: string
                  required:
                    - message
                  additionalProperties: false
              required:
                - type
                - data
              additionalProperties: false
            - type: object
              properties:
                type:
                  type: string
                  const: send_whatsapp_messages
                data:
                  type: object
                  properties:
                    phone_number_id:
                      type: string
                    template:
                      type: object
                      properties:
                        name:
                          type: string
                        language:
                          type: string
                        parameters:
                          $ref: '#/components/schemas/WhatsAppTemplateMappingDto'
                      required:
                        - name
                        - language
                        - parameters
                      additionalProperties: false
                  required:
                    - phone_number_id
                    - template
                  additionalProperties: false
              required:
                - type
                - data
              additionalProperties: false
        delay_in_minutes:
          type: number
          minimum: 0
        started_at:
          type: string
          format: date-time
        ended_at:
          type: string
          format: date-time
      required:
        - action
      additionalProperties: false
    SequenceStatus:
      $schema: https://json-schema.org/draft/2020-12/schema
      $id: '#/components/schemas/SequenceStatus'
      type: string
      enum:
        - pending
        - complete
        - canceled
        - active
    WhatsAppTemplateMappingDto:
      $schema: https://json-schema.org/draft/2020-12/schema
      $id: '#/components/schemas/WhatsAppTemplateMappingDto'
      type: object
      properties:
        header:
          type: object
          properties:
            type:
              type: string
              const: header
            parameters:
              type: array
              items:
                oneOf:
                  - type: object
                    properties:
                      type:
                        type: string
                        const: text
                      text:
                        $ref: '#/components/schemas/WhatsAppTemplateVariableDto'
                      parameter_name:
                        description: Required if parameters are named
                        type: string
                    required:
                      - type
                      - text
                    additionalProperties: false
                  - type: object
                    properties:
                      type:
                        type: string
                        const: image
                        description: JPEG, JPG, PNG
                      image:
                        type: object
                        properties:
                          link:
                            $ref: '#/components/schemas/WhatsAppTemplateVariableDto'
                        required:
                          - link
                        additionalProperties: false
                    required:
                      - type
                      - image
                    additionalProperties: false
                  - type: object
                    properties:
                      type:
                        type: string
                        const: video
                        description: MP4
                      video:
                        type: object
                        properties:
                          link:
                            $ref: '#/components/schemas/WhatsAppTemplateVariableDto'
                        required:
                          - link
                        additionalProperties: false
                    required:
                      - type
                      - video
                    additionalProperties: false
                  - type: object
                    properties:
                      type:
                        type: string
                        const: document
                        description: PDF
                      document:
                        type: object
                        properties:
                          link:
                            $ref: '#/components/schemas/WhatsAppTemplateVariableDto'
                        required:
                          - link
                        additionalProperties: false
                    required:
                      - type
                      - document
                    additionalProperties: false
                  - type: object
                    properties:
                      type:
                        type: string
                        const: location
                      location:
                        type: object
                        properties:
                          latitude:
                            $ref: '#/components/schemas/WhatsAppTemplateVariableDto'
                          longitude:
                            $ref: '#/components/schemas/WhatsAppTemplateVariableDto'
                          name:
                            $ref: '#/components/schemas/WhatsAppTemplateVariableDto'
                          address:
                            $ref: '#/components/schemas/WhatsAppTemplateVariableDto'
                        required:
                          - latitude
                          - longitude
                          - name
                          - address
                        additionalProperties: false
                    required:
                      - type
                      - location
                    additionalProperties: false
          required:
            - type
            - parameters
          additionalProperties: false
        body:
          type: object
          properties:
            type:
              type: string
              const: body
            parameters:
              type: array
              items:
                type: object
                properties:
                  type:
                    type: string
                    const: text
                  text:
                    $ref: '#/components/schemas/WhatsAppTemplateVariableDto'
                  parameter_name:
                    description: Required if parameters are named
                    type: string
                required:
                  - type
                  - text
                additionalProperties: false
          required:
            - type
            - parameters
          additionalProperties: false
        buttons:
          type: array
          items:
            type: object
            properties:
              type:
                type: string
                const: button
              index:
                type: string
                enum:
                  - '0'
                  - '1'
                  - '2'
                  - '3'
                  - '4'
                  - '5'
                  - '6'
                  - '7'
                  - '8'
                  - '9'
              sub_type:
                type: string
                const: url
              parameters:
                type: array
                items:
                  type: object
                  properties:
                    type:
                      type: string
                      const: text
                    text:
                      $ref: '#/components/schemas/WhatsAppTemplateVariableDto'
                  required:
                    - type
                    - text
                  additionalProperties: false
            required:
              - type
              - index
              - sub_type
              - parameters
            additionalProperties: false
      additionalProperties: false
    WhatsAppTemplateVariableDto:
      $schema: https://json-schema.org/draft/2020-12/schema
      $id: '#/components/schemas/WhatsAppTemplateVariableDto'
      oneOf:
        - type: object
          properties:
            type:
              type: string
              const: GLOBAL_DYNAMIC
            ref:
              type: string
              enum:
                - CONTACT_NAME
                - CONTACT_EMAIL
                - CONTACT_NUMBER
            fallback:
              type: string
          required:
            - type
            - ref
            - fallback
          additionalProperties: false
        - type: object
          properties:
            type:
              type: string
              const: DYNAMIC
            ref:
              type: string
            fallback:
              type: string
          required:
            - type
            - ref
            - fallback
          additionalProperties: false
        - type: object
          properties:
            type:
              type: string
              const: CONSTANT
            value:
              type: string
          required:
            - type
            - value
          additionalProperties: false
  securitySchemes:
    bearerAuth:
      type: http
      scheme: bearer
      bearerFormat: JWT

````