openapi: 3.0.0
info:
  title: Integrations API [deprecated]
  description: >-
    Welcome to the Dixa integrations API. Remember to set your credentials using
    the 'Authorize' button. Note that this API is deprecated and equivalent
    functionality can be found in Dixa API.
  version: 1.0.0
servers:
  - url: /
    description: The Server
paths:
  /v1/users:
    get:
      deprecated: true
      summary: Returns a list of users.
      tags:
        - Users
      parameters:
        - name: email
          in: query
          description: email to search for
          required: false
          schema:
            type: string
        - name: phone_number
          in: query
          required: false
          description: phone number to search for
          schema:
            type: string
        - name: limit
          in: query
          required: false
          description: Maximum number of items per page. With upper bound set to 200.
          schema:
            type: integer
            maximum: 200
      responses:
        '200':
          description: A JSON array of users
          content:
            application/json:
              schema:
                type: object
                required:
                  - data
                properties:
                  data:
                    type: array
                    items:
                      $ref: '#/components/schemas/User'
                  paging:
                    $ref: '#/components/schemas/Paging'
    post:
      deprecated: true
      summary: Create a user
      tags:
        - Users
      requestBody:
        description: The user to create
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/CreateUserInput'
      responses:
        '200':
          description: The user was created
          content:
            application/json:
              schema:
                type: object
                required:
                  - data
                properties:
                  data:
                    $ref: '#/components/schemas/User'
                  paging:
                    $ref: '#/components/schemas/Paging'
  /v1/users/{userId}/requested_conversations:
    get:
      deprecated: true
      summary: Returns a list of conversations requested by a specific user.
      tags:
        - Users
      parameters:
        - name: userId
          description: Id of the requester
          in: path
          required: true
          schema:
            type: string
        - name: limit
          in: query
          required: false
          description: Maximum number of items per page. With upper bound set to 200.
          schema:
            type: integer
            maximum: 200
      responses:
        '200':
          description: A JSON array of conversations
          content:
            application/json:
              schema:
                type: object
                required:
                  - data
                properties:
                  data:
                    type: array
                    items:
                      $ref: '#/components/schemas/Conversation'
                  paging:
                    $ref: '#/components/schemas/Paging'
  /v1/tags:
    get:
      deprecated: true
      summary: Get a list of tags
      tags:
        - Tags
      responses:
        '200':
          description: A list of tags for the organization
          content:
            application/json:
              schema:
                type: object
                required:
                  - data
                properties:
                  data:
                    type: array
                    items:
                      $ref: '#/components/schemas/Tag'
                  paging:
                    $ref: '#/components/schemas/Paging'
  /v1/queues:
    get:
      deprecated: true
      summary: Get a list of queues for your organization
      tags:
        - Queues
      responses:
        '200':
          description: A list of queues for the organization
          content:
            application/json:
              schema:
                type: object
                required:
                  - data
                properties:
                  data:
                    type: array
                    items:
                      $ref: '#/components/schemas/Queue'
                  paging:
                    $ref: '#/components/schemas/Paging'
  /v1/queues/{id}:
    get:
      deprecated: true
      summary: Get a queue by id
      tags:
        - Queues
      parameters:
        - name: id
          in: path
          required: true
          schema:
            type: string
      responses:
        '200':
          description: A successful response with a queue
          content:
            application/json:
              schema:
                type: object
                required:
                  - data
                properties:
                  data:
                    $ref: '#/components/schemas/Queue'
        '404':
          description: The queue was not found
  /v1/endpoints:
    get:
      deprecated: true
      summary: Get a list of endpoints.
      tags:
        - Endpoints
      parameters:
        - name: type
          in: query
          required: false
          schema:
            $ref: '#/components/schemas/EndpointType'
      responses:
        '200':
          description: Array of endpoints.
          content:
            application/json:
              schema:
                type: object
                required:
                  - data
                properties:
                  data:
                    type: array
                    items:
                      $ref: '#/components/schemas/Endpoint'
                  paging:
                    $ref: '#/components/schemas/Paging'
  /v1/endpoints/{id}:
    get:
      deprecated: true
      summary: Get an endpoint by id
      tags:
        - Endpoints
      parameters:
        - name: id
          in: path
          required: true
          schema:
            type: string
      responses:
        '200':
          description: A found endpoint
          content:
            application/json:
              schema:
                type: object
                required:
                  - data
                properties:
                  data:
                    $ref: '#/components/schemas/Endpoint'
  /v1/conversations:
    post:
      deprecated: true
      summary: Create a conversation
      tags:
        - Conversations
      requestBody:
        description: >-
          The conversation to create. Only callback and contact form
          conversations are currently supported.
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/CreateConversationInput'
      responses:
        '200':
          description: The conversation was created
          content:
            application/json:
              schema:
                type: object
                required:
                  - data
                properties:
                  data:
                    $ref: '#/components/schemas/Conversation'
  /v1/conversations/{csid}:
    get:
      deprecated: true
      summary: Get a single conversation by csid
      tags:
        - Conversations
      parameters:
        - name: csid
          in: path
          required: true
          schema:
            type: integer
      responses:
        '200':
          description: A single conversation
          content:
            application/json:
              schema:
                type: object
                required:
                  - data
                properties:
                  data:
                    $ref: '#/components/schemas/Conversation'
  /v1/conversations/{csid}/messages:
    get:
      deprecated: true
      summary: Get a list of messages within a conversation
      tags:
        - Conversations
        - Message
      parameters:
        - name: csid
          in: path
          required: true
          schema:
            type: integer
      responses:
        '200':
          description: A list of messages
          content:
            application/json:
              schema:
                type: object
                required:
                  - data
                properties:
                  data:
                    type: array
                    items:
                      $ref: '#/components/schemas/Message'
  /v1/conversations/{csid}/messages/historical:
    post:
      deprecated: true
      summary: Add a historical message to a conversation
      tags:
        - Message
        - Conversations
      parameters:
        - name: csid
          in: path
          required: true
          schema:
            type: integer
      requestBody:
        description: The message to insert.
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/CreateHistoricalMessageInput'
      responses:
        '200':
          description: The message was createde
          content:
            application/json:
              schema:
                type: object
                required:
                  - data
                properties:
                  data:
                    $ref: '#/components/schemas/Message'
  /v1/conversations/{csid}/notes:
    get:
      deprecated: true
      summary: Get a list of internal notes of a conversation
      tags:
        - Conversations
        - Wrapup
        - Note
      parameters:
        - name: csid
          in: path
          required: true
          schema:
            type: integer
      responses:
        '200':
          description: A list of internal notes
          content:
            application/json:
              schema:
                type: object
                required:
                  - data
                properties:
                  data:
                    type: array
                    items:
                      $ref: '#/components/schemas/Note'
  /v1/conversations/{csid}/activitylog:
    get:
      deprecated: true
      summary: Get a list of activitylog events for a conversation
      tags:
        - Conversations
        - ActivityLog
      parameters:
        - name: csid
          in: path
          required: true
          schema:
            type: integer
      responses:
        '200':
          description: A list of activitylog events
          content:
            application/json:
              schema:
                type: object
                required:
                  - data
                properties:
                  data:
                    type: array
                    items:
                      $ref: '#/components/schemas/ActivityLog'
  /v1/conversations/activitylog:
    get:
      deprecated: true
      summary: Get a list of activitylog events
      tags:
        - Conversations
        - ActivityLog
      parameters:
        - name: csids
          in: query
          description: a list of conversation ids associated with events
          required: false
          explode: false
          schema:
            type: array
            items:
              type: integer
              description: The id of the conversation.
      responses:
        '200':
          description: A list of activitylog events
          content:
            application/json:
              schema:
                type: object
                required:
                  - data
                properties:
                  data:
                    type: array
                    items:
                      $ref: '#/components/schemas/ActivityLog'
                  paging:
                    $ref: '#/components/schemas/Paging'
  /v1/flows:
    get:
      deprecated: true
      summary: List the current flows for an organization
      tags:
        - flows
      parameters: []
      responses:
        '200':
          description: A list of flows
          content:
            application/json:
              schema:
                type: object
                properties:
                  data:
                    type: array
                    items:
                      $ref: '#/components/schemas/ConversationFlow'
  /v1/anonymization_request:
    post:
      deprecated: true
      summary: Schedule anonymization for specified entity
      tags:
        - Users
        - Conversations
      requestBody:
        description: Entity info to schedule anonymization
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/CreateAnonymizationRequestInput'
      responses:
        '200':
          description: Scheduled anonymization
          content:
            application/json:
              schema:
                type: object
                properties:
                  data:
                    $ref: '#/components/schemas/ScheduleAnonymizationResponse'
  /v1/anonymization_request/{requestId}:
    get:
      deprecated: true
      summary: Get anonymization request for specified id
      tags:
        - Users
        - Conversations
      parameters:
        - name: requestId
          in: path
          required: true
          schema:
            type: string
      responses:
        '200':
          description: Anonymization request
          content:
            application/json:
              schema:
                type: object
                properties:
                  data:
                    $ref: '#/components/schemas/ScheduleAnonymizationResponse'
components:
  schemas:
    Paging:
      type: object
      required:
        - cursors
      properties:
        cursors:
          type: object
          properties:
            after:
              type: string
              description: >-
                The id of the item immediately after the last item in this
                resultset
            before:
              type: string
              description: >-
                The id of the item immedeately before the first item in this
                resultset
        next_page:
          type: string
          description: The link to the next page of values
        prev_page:
          type: string
          description: The link to the previsous page of results
    User:
      required:
        - id
      properties:
        id:
          type: string
          description: The id of the user
        email:
          type: string
          description: The email address associated with the user
        name:
          type: string
          description: The name of the user
        roles:
          type: array
          items:
            type: string
            description: Can be one of agent, admin and enduser
        avatar_url:
          type: string
          description: A link to the avatar of the user
        phone_number:
          $ref: '#/components/schemas/PhoneNumberString'
    CreateAnonymizationRequestInput:
      required:
        - entity_id
        - entity_type
      properties:
        entity_id:
          description: Id of the entity
          type: string
        entity_type:
          $ref: '#/components/schemas/AnonymizationType'
        force_anonymization:
          type: boolean
          description: >-
            If set to true, anonymizes entity regardless of the status of
            related conversations. Defaults to false
    ScheduleAnonymizationResponse:
      properties:
        id:
          type: string
        target_entity_id:
          description: Id of the entity to anonymize
          type: string
        entity_type:
          $ref: '#/components/schemas/AnonymizationType'
        initiated_at:
          description: A datetime anonymization was initiated
          type: string
        requested_by:
          description: Id of the user requested anonymization
          type: string
        processed_at:
          description: A datetime anonymization was processed
          type: string
    CreateUserInput:
      properties:
        name:
          type: string
        email:
          type: string
          description: >-
            The email address to be associated with the user. Must not be
            associated with any other users.
        phone_number:
          $ref: '#/components/schemas/PhoneNumberString'
    Conversation:
      type: object
      required:
        - id
        - created_at
        - requester_id
        - channel
        - direction
        - status
      properties:
        id:
          type: integer
          description: The id of the conversation. May also be referred to as the csid.
        created_at:
          $ref: '#/components/schemas/Timestamp'
        requester_id:
          $ref: '#/components/schemas/StringId'
        channel:
          $ref: '#/components/schemas/Channel'
        direction:
          $ref: '#/components/schemas/Direction'
        queued_at:
          $ref: '#/components/schemas/Timestamp'
        queue_id:
          $ref: '#/components/schemas/StringId'
        status:
          $ref: '#/components/schemas/Status'
        status_updated_at:
          $ref: '#/components/schemas/Timestamp'
        attributes:
          type: object
        assigned_to:
          $ref: '#/components/schemas/StringId'
        assigned_at:
          $ref: '#/components/schemas/Timestamp'
    MessageAttributes:
      type: object
      properties:
        text:
          type: string
        to_emails:
          type: string
        cc_email:
          type: string
        from_email:
          type: string
        inline_images:
          type: string
        attachments:
          type: string
        direction:
          type: string
        a_phone_number:
          type: string
        b_phone_number:
          type: string
        is_automated_message:
          type: string
        is_auto_reply:
          type: string
    Message:
      type: object
      required:
        - id
        - created_at
        - author_id
        - channel
      properties:
        id:
          $ref: '#/components/schemas/StringId'
        created_at:
          $ref: '#/components/schemas/Timestamp'
        author_id:
          $ref: '#/components/schemas/StringId'
        channel:
          $ref: '#/components/schemas/Channel'
        direction:
          allOf:
            - $ref: '#/components/schemas/Channel'
              description: >-
                Deprecated field. Duplicates `channel`. To get direction check
                `attributes`
              deprecated: true
        attributes:
          allOf:
            - $ref: '#/components/schemas/MessageAttributes'
              description: Map of message attributes
    Note:
      type: object
      required:
        - id
        - created_at
        - author_id
        - text
      properties:
        id:
          $ref: '#/components/schemas/StringId'
        created_at:
          $ref: '#/components/schemas/Timestamp'
        requester_id:
          $ref: '#/components/schemas/StringId'
        text:
          type: string
          description: Text of the note
    CreateConversationInput:
      oneOf:
        - $ref: '#/components/schemas/CreateCallbackConversationInput'
        - $ref: '#/components/schemas/CreateContactFormConversationInput'
    CreateCallbackConversationInput:
      required:
        - channel
        - direction
        - queue_id
        - requester_id
        - endpoint_id
      properties:
        channel:
          allOf:
            - $ref: '#/components/schemas/Channel'
              description: Channel type. Only contact_form and callback are supported.
        direction:
          $ref: '#/components/schemas/Direction'
        queue_id:
          $ref: '#/components/schemas/StringId'
        requester_id:
          $ref: '#/components/schemas/StringId'
        endpoint_id:
          allOf:
            - $ref: '#/components/schemas/StringId'
              description: A valid phone endpoint id.
        tags:
          type: array
          description: A list of tag names.
          items:
            type: string
    CreateContactFormConversationInput:
      required:
        - channel
        - requester_id
        - email_integration_id
      properties:
        channel:
          allOf:
            - $ref: '#/components/schemas/Channel'
              description: Channel type. Only contact_form and callback are supported.
        requester_id:
          $ref: '#/components/schemas/StringId'
        email_integration_id:
          allOf:
            - $ref: '#/components/schemas/StringId'
              description: A valid email endpoint id.
        tags:
          type: array
          description: A list of tag names.
          items:
            type: string
        subject:
          type: string
        message:
          required:
            - text
          properties:
            text:
              type: string
            content_type:
              type: string
              default: Markdown
              enum:
                - Text
                - Markdown
                - Html
    Queue:
      required:
        - id
        - name
        - is_default
      properties:
        id:
          $ref: '#/components/schemas/StringId'
        name:
          type: string
        is_default:
          type: boolean
          description: Whether or not this queue is the default queue for this organization
        priority:
          type: integer
          description: The priority of the queue
    Tag:
      required:
        - id
        - roles
      properties:
        id:
          $ref: '#/components/schemas/StringId'
        name:
          type: string
          description: The name of the tag
        color:
          type: string
          description: The hex color the tag when displayed in the Agent Interface.
    Endpoint:
      oneOf:
        - $ref: '#/components/schemas/EmailAddress'
        - $ref: '#/components/schemas/PhoneNumber'
    EmailAddress:
      type: object
      required:
        - email_address
        - internal_email_address
        - id
      properties:
        email_address:
          type: object
          required:
            - internal_email_address
            - id
          properties:
            id:
              $ref: '#/components/schemas/StringId'
            internal_email_address:
              type: string
              description: The internal email address. Ends in @email.dixa.io
              example: support-dixa@email.dixa.io
            spf_email:
              type: string
              description: The spf email address associated with the email.
              example: support@dixa.com
    PhoneNumber:
      type: object
      required:
        - phone_number
      properties:
        phone_number:
          type: object
          required:
            - id
            - phone_number
          properties:
            phone_number:
              $ref: '#/components/schemas/PhoneNumberString'
            id:
              $ref: '#/components/schemas/StringId'
    EndpointType:
      type: string
      enum:
        - email_address
        - phone_number
    Status:
      type: string
      enum:
        - open
        - closed
        - pending
        - awaiting_pending
    Direction:
      type: string
      description: The direction a conversation can be
      enum:
        - outbound
        - inbound
        - internal
    AnonymizationType:
      type: string
      description: A type of entity for anonymization.
      enum:
        - user
        - conversation
    Channel:
      type: string
      description: The channel a conversation can be conducted on.
      enum:
        - widget_chat
        - phone
        - voice_mail
        - email
        - contact_form
        - callback
        - facebook_messenger
    Timestamp:
      type: string
      example: 2015-11-30T00:00:00:000Z
    StringId:
      type: string
    PhoneNumberString:
      type: string
      description: >-
        A phone number. Always in E.164 format. See
        https://support.twilio.com/hc/en-us/articles/223183008-Formatting-International-Phone-Numbers.
    EmailString:
      type: string
      description: A regular email.
    CreateHistoricalMessageInput:
      description: >-
        Input object for creating historical messages. Required attributes
        depends on the channel chosen.
      type: object
      properties:
        channel:
          $ref: '#/components/schemas/Channel'
        direction:
          $ref: '#/components/schemas/Direction'
        from_email:
          $ref: '#/components/schemas/EmailString'
        to_email:
          $ref: '#/components/schemas/EmailString'
        text:
          type: string
        author_id:
          $ref: '#/components/schemas/StringId'
        attachments:
          type: array
          description: A list of attachments.
          items:
            $ref: '#/components/schemas/AttachmentInput'
    AttachmentInput:
      type: object
      required:
        - url
      properties:
        url:
          type: string
          description: A valid attachment url
    ConversationFlow:
      description: >-
        Conversation flows are used to execute actions to conversation when they
        are made.
      type: object
      required:
        - id
        - name
        - channel
        - endpoint_id
      properties:
        channel:
          $ref: '#/components/schemas/Channel'
        id:
          $ref: '#/components/schemas/StringId'
        name:
          type: string
          description: The name of the flow
        endpoint_id:
          $ref: '#/components/schemas/EndpointId'
    EndpointId:
      oneOf:
        - $ref: '#/components/schemas/EmailString'
        - $ref: '#/components/schemas/PhoneNumberString'
    ActivityLog:
      description: ActivityLog records an event associated with a conversation.
      type: object
      required:
        - id
        - conversation_id
        - activity_timestamp
        - activity_type
      properties:
        id:
          $ref: '#/components/schemas/StringId'
        conversation_id:
          type: integer
        activity_timestmap:
          $ref: '#/components/schemas/Timestamp'
        activity_type:
          $ref: '#/components/schemas/ActivityType'
        author:
          $ref: '#/components/schemas/ActivityLogUser'
        attributes:
          oneOf:
            - $ref: '#/components/schemas/TagAddedAttribute'
            - $ref: '#/components/schemas/TagRemovedAttribute'
            - $ref: '#/components/schemas/ConversationOfferedAttribute'
            - $ref: '#/components/schemas/NoteAddedAttribute'
            - $ref: '#/components/schemas/MessageAddedAttribute'
            - $ref: '#/components/schemas/ConversationAssignedAttribute'
            - $ref: '#/components/schemas/ConversationTransferredAttribute'
            - $ref: '#/components/schemas/ConversationLanguageUpdatedAttribute'
            - $ref: '#/components/schemas/ConversationAutoReplySentAttribute'
            - $ref: '#/components/schemas/ConversationRatingScheduledAttribute'
            - $ref: '#/components/schemas/ConversationRatingOfferedAttribute'
            - $ref: '#/components/schemas/ConversationRatedAttribute'
            - $ref: '#/components/schemas/ConversationClaimedAttribute'
            - $ref: '#/components/schemas/ConversationCreatedAttribute'
            - $ref: '#/components/schemas/ConversationUnassignedAttribute'
    ActivityType:
      type: string
      description: The type of activitylog entry.
      enum:
        - tag_added
        - tag_removed
        - conversation_created_by_customer
        - conversation_created_by_agent
        - conversation_closed
        - conversation_pending
        - conversation_reopened
        - note_added
        - message_added_by_customer
        - message_added_by_agent
        - conversation_assigned
        - conversation_offered
        - conversation_offer_rejected
        - conversation_offer_timeout
        - conversation_offer_accepted
        - transfer_initiated
        - transfer_failed
        - transfer_successful
        - conversation_language_updated
        - followup_added
        - followup_removed
        - followup_expired
        - conversation_autoreply_sent
        - conversation_rating_scheduled
        - conversation_rating_unscheduled
        - conversation_rating_cancelled
        - conversation_rated
        - conversation_claimed
        - conversation_unassigned
    ActivityLogUser:
      type: object
      required:
        - id
      properties:
        id:
          $ref: '#/components/schemas/StringId'
        name:
          type: string
        email:
          $ref: '#/components/schemas/EmailString'
        phone_number:
          $ref: '#/components/schemas/PhoneNumberString'
    TagAddedAttribute:
      type: object
      required:
        - tag_name
      properties:
        tag_name:
          type: string
    TagRemovedAttribute:
      type: object
      required:
        - tag_name
      properties:
        tag_name:
          type: string
    ConversationOfferedAttribute:
      type: object
      required:
        - agent_names
      properties:
        agent_names:
          type: array
          items:
            type: string
    NoteAddedAttribute:
      type: object
      required:
        - note
      properties:
        note:
          type: string
        avatar_url:
          type: string
    MessageAddedAttribute:
      type: object
      required:
        - message_id
      properties:
        message_id:
          $ref: '#/components/schemas/StringId'
        from_endpoint:
          type: string
        avatar_url:
          type: string
    ConversationAssignedAttribute:
      type: object
      required:
        - agent_id
      properties:
        agent_id:
          $ref: '#/components/schemas/StringId'
        agent_name:
          type: string
    ConversationTransferredAttribute:
      type: object
      required:
        - transfer_type
        - destination_type
        - destination_id
      properties:
        transfer_type:
          type: string
        destination_type:
          type: string
        destination_id:
          $ref: '#/components/schemas/StringId'
        destination_label:
          type: string
        reason:
          type: string
    ConversationLanguageUpdatedAttribute:
      type: object
      required:
        - language
      properties:
        language:
          type: string
    ConversationAutoReplySentAttribute:
      type: object
      required:
        - template_name
      properties:
        template_name:
          type: string
    ConversationRatingScheduledAttribute:
      type: object
      required:
        - rating_scheduled_time
      properties:
        rating_scheduled_time:
          $ref: '#/components/schemas/Timestamp'
    ConversationRatingOfferedAttribute:
      type: object
      required:
        - agent
        - user
      properties:
        agent:
          $ref: '#/components/schemas/ActivityLogUser'
        user:
          $ref: '#/components/schemas/ActivityLogUser'
    ConversationRatedAttribute:
      type: object
      required:
        - agent
      properties:
        agent:
          $ref: '#/components/schemas/ActivityLogUser'
        rating_score:
          type: integer
        rating_message:
          type: string
    ConversationClaimedAttribute:
      type: object
      properties:
        claimed_from_label:
          type: string
        claimed_from_type:
          type: string
    ConversationCreatedAttribute:
      type: object
      properties:
        conversation_subject:
          type: string
    ConversationUnassignedAttribute:
      type: object
      required:
        - agent
      properties:
        agent:
          $ref: '#/components/schemas/ActivityLogUser'
  securitySchemes:
    ApiKeyAuth:
      type: apiKey
      in: header
      name: Authorization
    BearerAuth:
      type: http
      scheme: bearer
security:
  - ApiKeyAuth: []
  - BearerAuth: []
