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

# Export session events

> Pull recorded events across all sessions for reporting and periodic syncs, with optional date ranges, message type filters, and cursor pagination.

Export recorded activity across all sessions in your organization, including
messages, internal notes, and system events. Requires an API key with
`chat-sessions:read`.

Use `created_after` and `created_before` to select a date window. Both accept
ISO 8601 timestamps with a timezone and are optional. The lower bound is inclusive;
the upper bound is exclusive and must be later than the lower bound.

Use `include_message_types` to select recorded types, such as
`agent_reopened_session,agent_comment`, or `exclude_message_types` to omit types,
such as `message,agent_message`. Both accept comma-separated values.
`include_message_types` takes precedence when both are provided. With neither
filter, all recorded types are returned.

Results are ordered oldest first by `created_at`, then by event `id` when
timestamps match. The default `limit` is 100 events; it accepts whole numbers
from 1 to 250. Pass the response's `next` value as `cursor` to continue, keeping
the same organization, date window, and type filters until `next` is `null`.
Deduplicate overlapping exports by event `id`.

Each item uses the same `id`, `created_at`, and typed `event` format as
[session history](/api-reference/chat-sessions/list_history), with `session_id`,
`contact_id`, `message_type`, `actor`, and `details` added for exports.
The session and contact IDs can be `null` when unavailable.

Filter on `message_type`, which is the recorded type. It can differ from the
normalized `event.type`. For example, `agent_reopened_session` can return
`{"type":"human_agent_reopened_session","human_agent_id":77}` in `event`.

Use `actor` to identify who performed the action:

| Type | Identifier |
| - | - |
| `human` | Human user ID in `actor.id`, as a string. Typed event payloads can use numeric human IDs. |
| `contact` | Contact ID when recorded. |
| `workflow` | Workflow ID and `workflow_run_id` when recorded. |
| `ai` | AI actor; no human user ID. |
| `api`, `system`, `integration` | Source of the recorded action. |
| `unknown` | The historical actor could not be identified. |

The assignment recipient is separate from the actor: `details.target` describes
a `human`, `ai`, `team`, or `none` target with an optional string `id`.
`details` also contains recorded message text, `sub_status_id`, `workflow_id`,
`workflow_run_id`, `edited_at`, and `deleted_at`. Unavailable values are `null`.

Events without a history mapping are retained as `event.type: "unmapped_event"`,
with their recorded `message_type` and text `content` when available.
State checkpoint events return `payload: null`.

Date filters use the original event time, including microsecond precision.
Historical imports can arrive later, and edits do not change the original
creation time. Re-export earlier windows to reconcile late imports and edits.
This endpoint exports recorded history; it does not capture every session or
contact attribute change or reconstruct missing historical identities.


## OpenAPI

````yaml get /chat/sessions/events
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: http://localhost:8080
    description: Development
  - url: https://api.open.cx
    description: Production
security:
  - bearerAuth: []
paths:
  /chat/sessions/events:
    get:
      summary: Export session events
      description: >-
        Pull existing session history across your organization, including system
        events and internal notes. Uses the same id, created_at and typed event
        structure as GET /chat/sessions/{session_id}/history, with
        session/contact IDs, the stored message_type and export metadata. Types
        without a history mapping are retained as unmapped_event; checkpoint
        payloads are omitted. created_after is inclusive; created_before is
        exclusive. Both date bounds are optional. include_message_types
        overrides exclude_message_types; neither filter returns all message
        types. Returns recorded actor identities, assignment targets, sub-status
        IDs and workflow details when available. Does not reconstruct missing
        historical identities or track session/contact attribute changes. Use a
        fixed date window when paging, retain the same filters, and deduplicate
        by event ID. Timestamps are event times: historical imports can arrive
        later and edits do not change original creation times; reconcile
        previously exported windows to pick up late or edited history. Requires
        chat-sessions:read.
      operationId: listSessionEvents
      parameters:
        - schema:
            type: string
            format: date-time
            pattern: >-
              ^(?:(?:\d\d[2468][048]|\d\d[13579][26]|\d\d0[48]|[02468][048]00|[13579][26]00)-02-29|\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\d|30)|(?:02)-(?:0[1-9]|1\d|2[0-8])))T(?:(?:[01]\d|2[0-3]):[0-5]\d(?::[0-5]\d(?:\.\d+)?)?(?:Z|([+-](?:[01]\d|2[0-3]):[0-5]\d)))$
          in: query
          name: created_after
          required: false
          description: Inclusive event timestamp lower bound.
        - schema:
            type: string
            format: date-time
            pattern: >-
              ^(?:(?:\d\d[2468][048]|\d\d[13579][26]|\d\d0[48]|[02468][048]00|[13579][26]00)-02-29|\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\d|30)|(?:02)-(?:0[1-9]|1\d|2[0-8])))T(?:(?:[01]\d|2[0-3]):[0-5]\d(?::[0-5]\d(?:\.\d+)?)?(?:Z|([+-](?:[01]\d|2[0-3]):[0-5]\d)))$
          in: query
          name: created_before
          required: false
          description: Exclusive event timestamp upper bound.
        - schema:
            anyOf:
              - type: string
              - type: array
                items:
                  type: string
          in: query
          name: include_message_types
          required: false
          description: >-
            Comma-separated types to include. When present,
            exclude_message_types is ignored.
        - schema:
            anyOf:
              - type: string
              - type: array
                items:
                  type: string
          in: query
          name: exclude_message_types
          required: false
          description: >-
            Comma-separated types to exclude. With neither filter, all event
            types are returned.
        - schema:
            default: 100
            type: integer
            minimum: 1
            maximum: 250
          in: query
          name: limit
          required: false
        - schema:
            type: string
            maxLength: 4096
          in: query
          name: cursor
          required: false
      responses:
        '200':
          description: Default Response
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/SessionEventsPublicResponse'
        '500':
          description: Internal Server Error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorDto'
components:
  schemas:
    SessionEventsPublicResponse:
      $schema: https://json-schema.org/draft/2020-12/schema
      $id: '#/components/schemas/SessionEventsPublicResponse'
      type: object
      properties:
        items:
          type: array
          items:
            type: object
            properties:
              id:
                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)$
              created_at:
                anyOf:
                  - type: string
                    format: date-time
                    pattern: >-
                      ^(?:(?:\d\d[2468][048]|\d\d[13579][26]|\d\d0[48]|[02468][048]00|[13579][26]00)-02-29|\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\d|30)|(?:02)-(?:0[1-9]|1\d|2[0-8])))T(?:(?:[01]\d|2[0-3]):[0-5]\d(?::[0-5]\d(?:\.\d+)?)?(?:Z|([+-](?:[01]\d|2[0-3]):[0-5]\d)))$
              event:
                anyOf:
                  - type: object
                    properties:
                      type:
                        type: string
                        const: unmapped_event
                        description: >-
                          A recorded event without a typed history mapping.
                          Included in organization exports so no history rows
                          are lost.
                      message_type:
                        type: string
                        enum:
                          - agent_assigned_by_integration
                          - agent_assigned_by_system
                          - agent_assigned_by_user
                          - agent_changed
                          - agent_comment
                          - agent_initiated_session
                          - agent_joined
                          - agent_message
                          - agent_reopened_session
                          - agent_took_session_from_ai
                          - agent_unassigned_by_integration
                          - agent_unassigned_by_system
                          - agent_unassigned_by_user
                          - ai_assumed_the_session_resolved
                          - ai_decided_to_not_reply
                          - ai_decided_to_resolve_the_issue
                          - ai_follow_up_cancelled
                          - ai_follow_up_fired
                          - ai_follow_up_scheduled
                          - ai_reopened_session
                          - ai_response_cancelled
                          - ai_resumed_by_system
                          - ai_suggestion
                          - call_history
                          - call_transferred
                          - closed_resolved_by_agent
                          - closed_resolved_by_api
                          - closed_resolved_by_contact
                          - closed_resolved_by_integration
                          - closed_resolved_by_system
                          - closed_unresolved_by_agent
                          - closed_unresolved_by_api
                          - closed_unresolved_by_system
                          - contact_data_updated
                          - csat_request_cancelled
                          - csat_requested
                          - csat_submitted
                          - email_draft_message
                          - handoff
                          - handoff_to_salesforce_miaw
                          - handoff_to_third_party_failed
                          - handoff_to_zendesk
                          - integration_reopened_session
                          - ivr_selection
                          - message
                          - pii_attachment_removed
                          - prohibited_topic_detected
                          - quoted_content_modified
                          - salesforce_fields_updated
                          - sequence_message
                          - session_forwarded
                          - session_language_changed_by_agent
                          - session_language_changed_by_api
                          - session_language_changed_by_integration
                          - session_language_changed_by_system
                          - session_priority_changed_by_agent
                          - session_priority_changed_by_system
                          - session_snoozed
                          - session_unsnoozed
                          - skills_added_by_system
                          - sla_applied_by_agent
                          - sla_applied_by_system
                          - sla_first_reply_breached
                          - sla_first_reply_completed_after_breach
                          - sla_first_reply_fulfilled
                          - sla_first_reply_metric_started
                          - sla_freezed_office_hours_ended
                          - sla_freezed_snoozed
                          - sla_next_reply_breached
                          - sla_next_reply_completed_after_breach
                          - sla_next_reply_fulfilled
                          - sla_next_reply_metric_started
                          - sla_removed_by_agent
                          - sla_removed_by_system
                          - sla_resolution_breached
                          - sla_resolution_completed_after_breach
                          - sla_resolution_fulfilled
                          - sla_resolution_metric_started
                          - sla_resolution_paused_resolved
                          - sla_resolution_paused_waiting_on_customer
                          - sla_resolution_resumed_customer_replied
                          - sla_resolution_resumed_reopened
                          - sla_resumed_office_hours_started
                          - sla_resumed_snooze_cancelled
                          - sla_resumed_snooze_expired
                          - state_checkpoint
                          - sub_session_created
                          - sub_session_linked_by_agent
                          - sub_session_linked_by_api
                          - sub_session_linked_by_integration
                          - sub_session_linked_by_system
                          - sub_session_unlinked_by_agent
                          - sub_session_unlinked_by_api
                          - sub_session_unlinked_by_integration
                          - sub_session_unlinked_by_system
                          - sub_status_removed_by_agent
                          - sub_status_removed_by_api
                          - sub_status_removed_by_integration
                          - sub_status_removed_by_system
                          - sub_status_set_by_agent
                          - sub_status_set_by_api
                          - sub_status_set_by_integration
                          - sub_status_set_by_system
                          - system_reopened_session
                          - tag_added_by_agent
                          - tag_added_by_api
                          - tag_added_by_integration
                          - tag_added_by_system
                          - tag_removed_by_agent
                          - tag_removed_by_api
                          - tag_removed_by_integration
                          - tag_removed_by_system
                          - team_assigned_by_integration
                          - team_assigned_by_system
                          - team_assigned_by_user
                          - team_unassigned_by_integration
                          - team_unassigned_by_system
                          - team_unassigned_by_user
                          - user_confirmed_the_session_resolved
                          - voice_call_ai_joined
                          - voice_call_ai_left
                          - voice_call_contact_answered
                          - voice_call_contact_joined
                          - voice_call_contact_left
                          - voice_call_ended
                          - voice_call_failed_to_start
                          - voice_call_human_answered
                          - voice_call_human_joined
                          - voice_call_human_left
                          - voice_call_started
                          - workflow_message
                          - workflow_note
                          - workflow_triggered
                      content:
                        anyOf:
                          - type: object
                            properties:
                              type:
                                type: string
                                const: text
                              text:
                                type: string
                            required:
                              - type
                              - text
                            additionalProperties: false
                          - type: 'null'
                    required:
                      - type
                      - message_type
                      - content
                    additionalProperties: false
                  - type: object
                    properties:
                      type:
                        type: string
                        const: ai_comment
                        description: An internal note authored by AI.
                      content:
                        type: object
                        properties:
                          type:
                            type: string
                            const: text
                          text:
                            type: string
                        required:
                          - type
                          - text
                        additionalProperties: false
                      comment_thread_id:
                        anyOf:
                          - 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)$
                          - type: 'null'
                    required:
                      - type
                      - content
                      - comment_thread_id
                    additionalProperties: false
                  - type: object
                    properties:
                      type:
                        type: string
                        const: message
                      sender:
                        $ref: '#/components/schemas/ChatMessageSender'
                      content:
                        type: object
                        properties:
                          type:
                            type: string
                            const: text
                          text:
                            type: string
                        required:
                          - type
                          - text
                        additionalProperties: false
                      context:
                        type: object
                        propertyNames:
                          type: string
                        additionalProperties: {}
                      custom_data:
                        description: >-
                          Custom data attached to this message by the sender
                          (e.g. via the widget SDK)
                        type: object
                        propertyNames:
                          type: string
                        additionalProperties: {}
                      attachments:
                        type: array
                        items:
                          $ref: '#/components/schemas/PublicChatAttachment'
                      options:
                        description: >-
                          Agent messages sent from a macro with options: the
                          options the contact can tap. Report a tap with
                          `message.option_reply` on Send a message.
                        type: array
                        items:
                          $ref: '#/components/schemas/MessageOptionDto'
                    required:
                      - type
                      - sender
                      - content
                      - attachments
                    additionalProperties: false
                  - type: object
                    properties:
                      type:
                        type: string
                        const: ai_suggestion
                        description: >-
                          An AI draft reply produced in assist mode — suggested
                          to the human support team, never delivered to the
                          contact.
                      content:
                        type: object
                        properties:
                          type:
                            type: string
                            const: text
                          text:
                            type: string
                        required:
                          - type
                          - text
                        additionalProperties: false
                      attachments:
                        type: array
                        items:
                          $ref: '#/components/schemas/PublicChatAttachment'
                    required:
                      - type
                      - content
                      - attachments
                    additionalProperties: false
                  - type: object
                    properties:
                      type:
                        type: string
                        const: workflow_message
                      workflow_id:
                        anyOf:
                          - type: string
                          - type: 'null'
                      workflow_run_id:
                        anyOf:
                          - type: string
                          - type: 'null'
                      content:
                        type: object
                        properties:
                          type:
                            type: string
                            const: text
                          text:
                            type: string
                        required:
                          - type
                          - text
                        additionalProperties: false
                    required:
                      - type
                      - workflow_id
                      - workflow_run_id
                      - content
                    additionalProperties: false
                  - type: object
                    properties:
                      type:
                        type: string
                        const: sequence_message
                      sequence_id:
                        anyOf:
                          - type: string
                          - type: 'null'
                      content:
                        type: object
                        properties:
                          type:
                            type: string
                            const: text
                          text:
                            type: string
                        required:
                          - type
                          - text
                        additionalProperties: false
                    required:
                      - type
                      - sequence_id
                      - content
                    additionalProperties: false
                  - type: object
                    properties:
                      type:
                        type: string
                        const: handoff
                      integration:
                        type: object
                        properties:
                          type:
                            type: string
                            enum:
                              - zendesk
                              - salesforce-miaw
                        required:
                          - type
                        additionalProperties: false
                    required:
                      - type
                    additionalProperties: false
                  - type: object
                    properties:
                      type:
                        type: string
                        const: closed_resolved_by_agent
                    required:
                      - type
                    additionalProperties: false
                  - type: object
                    properties:
                      type:
                        type: string
                        const: closed_resolved_by_system
                    required:
                      - type
                    additionalProperties: false
                  - type: object
                    properties:
                      type:
                        type: string
                        const: closed_resolved_by_api
                    required:
                      - type
                    additionalProperties: false
                  - type: object
                    properties:
                      type:
                        type: string
                        const: closed_unresolved_by_agent
                    required:
                      - type
                    additionalProperties: false
                  - type: object
                    properties:
                      type:
                        type: string
                        const: closed_unresolved_by_system
                    required:
                      - type
                    additionalProperties: false
                  - type: object
                    properties:
                      type:
                        type: string
                        const: closed_unresolved_by_api
                    required:
                      - type
                    additionalProperties: false
                  - type: object
                    properties:
                      type:
                        type: string
                        const: closed_resolved_by_contact
                    required:
                      - type
                    additionalProperties: false
                  - type: object
                    properties:
                      type:
                        type: string
                        const: closed_resolved_by_integration
                    required:
                      - type
                    additionalProperties: false
                  - type: object
                    properties:
                      type:
                        type: string
                        const: sub_status_set_by_agent
                      sub_status_id:
                        anyOf:
                          - type: string
                          - type: 'null'
                    required:
                      - type
                      - sub_status_id
                    additionalProperties: false
                  - type: object
                    properties:
                      type:
                        type: string
                        const: sub_status_set_by_system
                      sub_status_id:
                        anyOf:
                          - type: string
                          - type: 'null'
                    required:
                      - type
                      - sub_status_id
                    additionalProperties: false
                  - type: object
                    properties:
                      type:
                        type: string
                        const: sub_status_set_by_api
                      sub_status_id:
                        anyOf:
                          - type: string
                          - type: 'null'
                    required:
                      - type
                      - sub_status_id
                    additionalProperties: false
                  - type: object
                    properties:
                      type:
                        type: string
                        const: sub_status_removed_by_agent
                      sub_status_id:
                        anyOf:
                          - type: string
                          - type: 'null'
                    required:
                      - type
                      - sub_status_id
                    additionalProperties: false
                  - type: object
                    properties:
                      type:
                        type: string
                        const: sub_status_removed_by_system
                      sub_status_id:
                        anyOf:
                          - type: string
                          - type: 'null'
                    required:
                      - type
                      - sub_status_id
                    additionalProperties: false
                  - type: object
                    properties:
                      type:
                        type: string
                        const: sub_status_removed_by_api
                      sub_status_id:
                        anyOf:
                          - type: string
                          - type: 'null'
                    required:
                      - type
                      - sub_status_id
                    additionalProperties: false
                  - type: object
                    properties:
                      type:
                        type: string
                        const: sub_status_set_by_integration
                      sub_status_id:
                        anyOf:
                          - type: string
                          - type: 'null'
                    required:
                      - type
                      - sub_status_id
                    additionalProperties: false
                  - type: object
                    properties:
                      type:
                        type: string
                        const: sub_status_removed_by_integration
                      sub_status_id:
                        anyOf:
                          - type: string
                          - type: 'null'
                    required:
                      - type
                      - sub_status_id
                    additionalProperties: false
                  - type: object
                    properties:
                      type:
                        type: string
                        enum:
                          - tag_added_by_system
                          - tag_added_by_agent
                          - tag_added_by_api
                          - tag_added_by_integration
                          - tag_removed_by_system
                          - tag_removed_by_agent
                          - tag_removed_by_api
                          - tag_removed_by_integration
                      tags:
                        type: array
                        items:
                          type: object
                          properties:
                            name:
                              type: string
                          required:
                            - name
                          additionalProperties: false
                    required:
                      - type
                      - tags
                    additionalProperties: false
                  - type: object
                    properties:
                      type:
                        type: string
                        const: ai_resolved_issue
                    required:
                      - type
                    additionalProperties: false
                  - type: object
                    properties:
                      type:
                        type: string
                        const: ai_assumed_issue_resolved
                    required:
                      - type
                    additionalProperties: false
                  - type: object
                    properties:
                      type:
                        type: string
                        const: user_confirmed_issue_resolved
                    required:
                      - type
                    additionalProperties: false
                  - type: object
                    properties:
                      type:
                        type: string
                        const: human_agent_comment
                      human_agent_id:
                        type: number
                      content:
                        type: object
                        properties:
                          type:
                            type: string
                            const: text
                          text:
                            type: string
                        required:
                          - type
                          - text
                        additionalProperties: false
                      comment_thread_id:
                        anyOf:
                          - 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)$
                          - type: 'null'
                    required:
                      - type
                      - human_agent_id
                      - content
                      - comment_thread_id
                    additionalProperties: false
                  - type: object
                    properties:
                      type:
                        type: string
                        const: workflow_note
                      workflow_id:
                        anyOf:
                          - type: string
                          - type: 'null'
                      workflow_run_id:
                        anyOf:
                          - type: string
                          - type: 'null'
                      content:
                        type: object
                        properties:
                          type:
                            type: string
                            const: text
                          text:
                            type: string
                        required:
                          - type
                          - text
                        additionalProperties: false
                    required:
                      - type
                      - workflow_id
                      - workflow_run_id
                      - content
                    additionalProperties: false
                  - type: object
                    properties:
                      type:
                        type: string
                        const: human_agent_joined
                      human_agent_id:
                        type: number
                    required:
                      - type
                      - human_agent_id
                    additionalProperties: false
                  - type: object
                    properties:
                      type:
                        type: string
                        const: human_agent_takeover
                      human_agent_id:
                        type: number
                    required:
                      - type
                      - human_agent_id
                    additionalProperties: false
                  - type: object
                    properties:
                      type:
                        type: string
                        const: human_agent_reopened_session
                      human_agent_id:
                        type: number
                    required:
                      - type
                      - human_agent_id
                    additionalProperties: false
                  - type: object
                    properties:
                      type:
                        type: string
                        const: system_reopened_session
                      workflow_id:
                        anyOf:
                          - type: string
                          - type: 'null'
                      workflow_run_id:
                        anyOf:
                          - type: string
                          - type: 'null'
                    required:
                      - type
                      - workflow_id
                      - workflow_run_id
                    additionalProperties: false
                  - type: object
                    properties:
                      type:
                        type: string
                        const: integration_reopened_session
                    required:
                      - type
                    additionalProperties: false
                  - type: object
                    properties:
                      type:
                        type: string
                        const: ai_reopened_session
                    required:
                      - type
                    additionalProperties: false
                  - type: object
                    properties:
                      type:
                        type: string
                        const: state_checkpoint
                      payload: {}
                    required:
                      - type
                      - payload
                    additionalProperties: false
                  - type: object
                    properties:
                      type:
                        type: string
                        const: csat_requested
                    required:
                      - type
                    additionalProperties: false
                  - type: object
                    properties:
                      type:
                        type: string
                        const: csat_submitted
                      payload:
                        type: object
                        properties:
                          score:
                            type: number
                          feedback:
                            anyOf:
                              - type: string
                              - type: 'null'
                        required:
                          - score
                          - feedback
                        additionalProperties: false
                    required:
                      - type
                      - payload
                    additionalProperties: false
                  - type: object
                    properties:
                      type:
                        type: string
                        const: agent_changed
                    required:
                      - type
                    additionalProperties: false
                  - type: object
                    properties:
                      type:
                        type: string
                        const: prohibited_topic_detected
                      topic:
                        anyOf:
                          - type: string
                          - type: 'null'
                    required:
                      - type
                      - topic
                    additionalProperties: false
                  - type: object
                    properties:
                      type:
                        type: string
                        const: agent_assigned_by_system
                      assigned_agent_id:
                        type: number
                    required:
                      - type
                    additionalProperties: false
                  - type: object
                    properties:
                      type:
                        type: string
                        const: agent_assigned_by_integration
                      assigned_agent_id:
                        type: number
                    required:
                      - type
                    additionalProperties: false
                  - type: object
                    properties:
                      type:
                        type: string
                        const: agent_assigned_by_user
                      assigned_agent_id:
                        type: number
                      actor_id:
                        type: number
                    required:
                      - type
                    additionalProperties: false
                  - type: object
                    properties:
                      type:
                        type: string
                        const: agent_unassigned_by_system
                      unassigned_agent_id:
                        type: number
                    required:
                      - type
                    additionalProperties: false
                  - type: object
                    properties:
                      type:
                        type: string
                        const: agent_unassigned_by_integration
                      unassigned_agent_id:
                        type: number
                    required:
                      - type
                    additionalProperties: false
                  - type: object
                    properties:
                      type:
                        type: string
                        const: agent_unassigned_by_user
                      unassigned_agent_id:
                        type: number
                      actor_id:
                        type: number
                    required:
                      - type
                    additionalProperties: false
                  - type: object
                    properties:
                      type:
                        type: string
                        const: team_assigned_by_system
                      assigned_team_id:
                        type: string
                    required:
                      - type
                    additionalProperties: false
                  - type: object
                    properties:
                      type:
                        type: string
                        const: team_assigned_by_integration
                      assigned_team_id:
                        type: string
                    required:
                      - type
                    additionalProperties: false
                  - type: object
                    properties:
                      type:
                        type: string
                        const: team_assigned_by_user
                      assigned_team_id:
                        type: string
                      actor_id:
                        type: number
                    required:
                      - type
                    additionalProperties: false
                  - type: object
                    properties:
                      type:
                        type: string
                        const: team_unassigned_by_system
                      unassigned_team_id:
                        type: string
                    required:
                      - type
                    additionalProperties: false
                  - type: object
                    properties:
                      type:
                        type: string
                        const: team_unassigned_by_integration
                      unassigned_team_id:
                        type: string
                    required:
                      - type
                    additionalProperties: false
                  - type: object
                    properties:
                      type:
                        type: string
                        const: team_unassigned_by_user
                      unassigned_team_id:
                        type: string
                      actor_id:
                        type: number
                    required:
                      - type
                    additionalProperties: false
                  - type: object
                    properties:
                      type:
                        type: string
                        enum:
                          - sla_applied_by_system
                          - sla_applied_by_agent
                          - sla_removed_by_agent
                          - sla_removed_by_system
                          - sla_first_reply_metric_started
                          - sla_first_reply_fulfilled
                          - sla_first_reply_breached
                          - sla_first_reply_completed_after_breach
                          - sla_next_reply_metric_started
                          - sla_next_reply_fulfilled
                          - sla_next_reply_breached
                          - sla_next_reply_completed_after_breach
                          - sla_resolution_metric_started
                          - sla_resolution_paused_waiting_on_customer
                          - sla_resolution_paused_resolved
                          - sla_resolution_resumed_customer_replied
                          - sla_resolution_resumed_reopened
                          - sla_resolution_fulfilled
                          - sla_resolution_breached
                          - sla_resolution_completed_after_breach
                          - sla_freezed_office_hours_ended
                          - sla_resumed_office_hours_started
                          - sla_freezed_snoozed
                          - sla_resumed_snooze_expired
                          - sla_resumed_snooze_cancelled
                      elapsed_ms:
                        anyOf:
                          - type: number
                          - type: 'null'
                    required:
                      - type
                      - elapsed_ms
                    additionalProperties: false
                  - type: object
                    properties:
                      type:
                        type: string
                        const: workflow_triggered
                      workflow_id:
                        anyOf:
                          - type: string
                          - type: 'null'
                      workflow_run_id:
                        anyOf:
                          - type: string
                          - type: 'null'
                    required:
                      - type
                      - workflow_id
                      - workflow_run_id
                    additionalProperties: false
                  - type: object
                    properties:
                      type:
                        type: string
                        const: contact_data_updated
                      fields:
                        type: object
                        propertyNames:
                          type: string
                        additionalProperties:
                          type: string
                    required:
                      - type
                      - fields
                    additionalProperties: false
              session_id:
                anyOf:
                  - type: string
                  - type: 'null'
              contact_id:
                anyOf:
                  - type: string
                  - type: 'null'
              message_type:
                type: string
                enum:
                  - agent_assigned_by_integration
                  - agent_assigned_by_system
                  - agent_assigned_by_user
                  - agent_changed
                  - agent_comment
                  - agent_initiated_session
                  - agent_joined
                  - agent_message
                  - agent_reopened_session
                  - agent_took_session_from_ai
                  - agent_unassigned_by_integration
                  - agent_unassigned_by_system
                  - agent_unassigned_by_user
                  - ai_assumed_the_session_resolved
                  - ai_decided_to_not_reply
                  - ai_decided_to_resolve_the_issue
                  - ai_follow_up_cancelled
                  - ai_follow_up_fired
                  - ai_follow_up_scheduled
                  - ai_reopened_session
                  - ai_response_cancelled
                  - ai_resumed_by_system
                  - ai_suggestion
                  - call_history
                  - call_transferred
                  - closed_resolved_by_agent
                  - closed_resolved_by_api
                  - closed_resolved_by_contact
                  - closed_resolved_by_integration
                  - closed_resolved_by_system
                  - closed_unresolved_by_agent
                  - closed_unresolved_by_api
                  - closed_unresolved_by_system
                  - contact_data_updated
                  - csat_request_cancelled
                  - csat_requested
                  - csat_submitted
                  - email_draft_message
                  - handoff
                  - handoff_to_salesforce_miaw
                  - handoff_to_third_party_failed
                  - handoff_to_zendesk
                  - integration_reopened_session
                  - ivr_selection
                  - message
                  - pii_attachment_removed
                  - prohibited_topic_detected
                  - quoted_content_modified
                  - salesforce_fields_updated
                  - sequence_message
                  - session_forwarded
                  - session_language_changed_by_agent
                  - session_language_changed_by_api
                  - session_language_changed_by_integration
                  - session_language_changed_by_system
                  - session_priority_changed_by_agent
                  - session_priority_changed_by_system
                  - session_snoozed
                  - session_unsnoozed
                  - skills_added_by_system
                  - sla_applied_by_agent
                  - sla_applied_by_system
                  - sla_first_reply_breached
                  - sla_first_reply_completed_after_breach
                  - sla_first_reply_fulfilled
                  - sla_first_reply_metric_started
                  - sla_freezed_office_hours_ended
                  - sla_freezed_snoozed
                  - sla_next_reply_breached
                  - sla_next_reply_completed_after_breach
                  - sla_next_reply_fulfilled
                  - sla_next_reply_metric_started
                  - sla_removed_by_agent
                  - sla_removed_by_system
                  - sla_resolution_breached
                  - sla_resolution_completed_after_breach
                  - sla_resolution_fulfilled
                  - sla_resolution_metric_started
                  - sla_resolution_paused_resolved
                  - sla_resolution_paused_waiting_on_customer
                  - sla_resolution_resumed_customer_replied
                  - sla_resolution_resumed_reopened
                  - sla_resumed_office_hours_started
                  - sla_resumed_snooze_cancelled
                  - sla_resumed_snooze_expired
                  - state_checkpoint
                  - sub_session_created
                  - sub_session_linked_by_agent
                  - sub_session_linked_by_api
                  - sub_session_linked_by_integration
                  - sub_session_linked_by_system
                  - sub_session_unlinked_by_agent
                  - sub_session_unlinked_by_api
                  - sub_session_unlinked_by_integration
                  - sub_session_unlinked_by_system
                  - sub_status_removed_by_agent
                  - sub_status_removed_by_api
                  - sub_status_removed_by_integration
                  - sub_status_removed_by_system
                  - sub_status_set_by_agent
                  - sub_status_set_by_api
                  - sub_status_set_by_integration
                  - sub_status_set_by_system
                  - system_reopened_session
                  - tag_added_by_agent
                  - tag_added_by_api
                  - tag_added_by_integration
                  - tag_added_by_system
                  - tag_removed_by_agent
                  - tag_removed_by_api
                  - tag_removed_by_integration
                  - tag_removed_by_system
                  - team_assigned_by_integration
                  - team_assigned_by_system
                  - team_assigned_by_user
                  - team_unassigned_by_integration
                  - team_unassigned_by_system
                  - team_unassigned_by_user
                  - user_confirmed_the_session_resolved
                  - voice_call_ai_joined
                  - voice_call_ai_left
                  - voice_call_contact_answered
                  - voice_call_contact_joined
                  - voice_call_contact_left
                  - voice_call_ended
                  - voice_call_failed_to_start
                  - voice_call_human_answered
                  - voice_call_human_joined
                  - voice_call_human_left
                  - voice_call_started
                  - workflow_message
                  - workflow_note
                  - workflow_triggered
                description: >-
                  Stored event type used by include/exclude filters; it can
                  differ from the normalized event.type.
              actor:
                type: object
                properties:
                  type:
                    type: string
                    enum:
                      - human
                      - api
                      - workflow
                      - system
                      - integration
                      - ai
                      - contact
                      - unknown
                  id:
                    type: string
                  workflow_run_id:
                    type: string
                required:
                  - type
                additionalProperties: false
              details:
                type: object
                properties:
                  message:
                    anyOf:
                      - type: string
                      - type: 'null'
                  target:
                    anyOf:
                      - type: object
                        properties:
                          type:
                            type: string
                            enum:
                              - human
                              - ai
                              - team
                              - none
                          id:
                            type: string
                        required:
                          - type
                        additionalProperties: false
                      - type: 'null'
                  sub_status_id:
                    anyOf:
                      - type: string
                      - type: 'null'
                  workflow_id:
                    anyOf:
                      - type: string
                      - type: 'null'
                  workflow_run_id:
                    anyOf:
                      - type: string
                      - type: 'null'
                  edited_at:
                    anyOf:
                      - type: string
                      - type: 'null'
                  deleted_at:
                    anyOf:
                      - type: string
                      - type: 'null'
                required:
                  - message
                  - target
                  - sub_status_id
                  - workflow_id
                  - workflow_run_id
                  - edited_at
                  - deleted_at
                additionalProperties: false
            required:
              - id
              - created_at
              - event
              - session_id
              - contact_id
              - message_type
              - actor
              - details
            additionalProperties: false
        next:
          anyOf:
            - type: string
            - type: 'null'
      required:
        - items
        - next
      additionalProperties: false
    ErrorDto:
      type: object
      properties:
        statusCode:
          type: integer
        message:
          type: string
        error:
          type: string
    ChatMessageSender:
      $schema: https://json-schema.org/draft/2020-12/schema
      $id: '#/components/schemas/ChatMessageSender'
      anyOf:
        - type: object
          properties:
            type:
              type: string
              const: contact
            name:
              type: string
          required:
            - type
          additionalProperties: false
        - type: object
          properties:
            type:
              type: string
              const: ai
            name:
              type: string
          required:
            - type
          additionalProperties: false
        - type: object
          properties:
            type:
              type: string
              const: human_agent
            name:
              type: string
          required:
            - type
          additionalProperties: false
    PublicChatAttachment:
      $schema: https://json-schema.org/draft/2020-12/schema
      $id: '#/components/schemas/PublicChatAttachment'
      type: object
      properties:
        id:
          type: string
        name:
          type: string
        size:
          type: number
        type:
          type: string
        url:
          type: string
      required:
        - id
        - name
        - size
        - type
        - url
      additionalProperties: false
    MessageOptionDto:
      $schema: https://json-schema.org/draft/2020-12/schema
      $id: '#/components/schemas/MessageOptionDto'
      type: object
      properties:
        id:
          type: string
        label:
          type: string
        type:
          $ref: '#/components/schemas/MessageOptionType'
      required:
        - id
        - label
        - type
      additionalProperties: false
    MessageOptionType:
      $schema: https://json-schema.org/draft/2020-12/schema
      $id: '#/components/schemas/MessageOptionType'
      type: string
      enum:
        - text
        - workflow
  securitySchemes:
    bearerAuth:
      type: http
      scheme: bearer
      bearerFormat: JWT

````

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