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

# List activity segments

> Returns the stored activity segments of the agent's current Help Desk operators, unmerged and unrounded, so totals can differ slightly from the Activity export. One item per ticket, untracked or idle stretch, listed only in the range where it started. Both reports share a limit of 30 calls per 10 seconds per account.



## OpenAPI

````yaml /api-v2-openapi.json get /agents/{agentId}/helpdesk/activity
openapi: 3.1.0
info:
  title: Chatbase API v2
  version: 2.0.0
  description: >-
    Chatbase API v2 - A robust, structured API for managing agents,
    conversations, and the helpdesk.
servers:
  - url: https://www.chatbase.co/api/v2
    description: Chatbase API v2
security: []
paths:
  /agents/{agentId}/helpdesk/activity:
    get:
      tags:
        - Helpdesk
      summary: List activity segments
      description: >-
        Returns the stored activity segments of the agent's current Help Desk
        operators, unmerged and unrounded, so totals can differ slightly from
        the Activity export. One item per ticket, untracked or idle stretch,
        listed only in the range where it started. Both reports share a limit of
        30 calls per 10 seconds per account.
      operationId: listActivitySegments
      parameters:
        - schema:
            type: string
            minLength: 1
            description: The agent ID
            example: 5QHA6VB-DIAbBhxwqxfdi
          required: true
          description: The agent ID
          name: agentId
          in: path
        - schema:
            type: string
            description: Opaque cursor from a previous response to fetch the next page
            example: eyJ0IjoiMjAyNC0wMS0xNVQxMDozMDowMC4wMDBaIiwiaWQiOiJhYmMxMjMifQ==
          required: false
          description: Opaque cursor from a previous response to fetch the next page
          name: cursor
          in: query
        - schema:
            type: integer
            minimum: 1
            maximum: 1000
            default: 100
            description: Number of items per page (1 to 1000, default 100)
            example: 100
          required: false
          description: Number of items per page (1 to 1000, default 100)
          name: limit
          in: query
        - schema:
            type: string
            format: date
            description: >-
              First day to return (`YYYY-MM-DD`), as a calendar day in
              `timezone`. At most 396 days ago.
            example: '2026-10-29'
          required: true
          description: >-
            First day to return (`YYYY-MM-DD`), as a calendar day in `timezone`.
            At most 396 days ago.
          name: startDate
          in: query
        - schema:
            type: string
            format: date
            description: >-
              Last day to return (`YYYY-MM-DD`), inclusive. Not after today in
              `timezone`, and at most 31 days from `startDate` counting both.
            example: '2026-10-30'
          required: true
          description: >-
            Last day to return (`YYYY-MM-DD`), inclusive. Not after today in
            `timezone`, and at most 31 days from `startDate` counting both.
          name: endDate
          in: query
        - schema:
            type: string
            description: >-
              IANA time zone that decides where each day starts and ends, the
              same as the time zone picker on the dashboard.
            example: Africa/Cairo
          required: true
          description: >-
            IANA time zone that decides where each day starts and ends, the same
            as the time zone picker on the dashboard.
          name: timezone
          in: query
      responses:
        '200':
          description: Activity segments, by start, then segment ID
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ActivitySegmentListResponse'
        '400':
          description: Invalid request
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
              examples:
                VALIDATION_INVALID_BODY:
                  summary: >-
                    The request body failed schema validation. Inspect the
                    `details` object in the error response for field-level
                    errors.
                  value:
                    error:
                      code: VALIDATION_INVALID_BODY
                      message: Invalid request
                VALIDATION_INVALID_CURSOR:
                  summary: >-
                    The `cursor` could not be decoded. Pass the exact
                    `pagination.cursor` value from a previous response, without
                    modification.
                  value:
                    error:
                      code: VALIDATION_INVALID_CURSOR
                      message: Invalid pagination cursor
                VALIDATION_CURSOR_QUERY_MISMATCH:
                  summary: >-
                    The cursor was issued for a different `query` or filter set.
                    Keep every search parameter except `cursor` and `limit`
                    constant across a cursor walk, or drop the cursor to restart
                    from the first page.
                  value:
                    error:
                      code: VALIDATION_CURSOR_QUERY_MISMATCH
                      message: Cursor does not match the requested search
        '401':
          description: >-
            No Authorization header present. Provide a valid API key as a Bearer
            token in the Authorization header: `Authorization: Bearer
            <api-key>`.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
              example:
                error:
                  code: AUTH_MISSING_API_KEY
                  message: Authentication required
        '403':
          description: Forbidden
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
              examples:
                HELPDESK_NOT_ENABLED:
                  summary: >-
                    The agent exists but help desk is not activated for it.
                    Enable help desk before calling its endpoints.
                  value:
                    error:
                      code: HELPDESK_NOT_ENABLED
                      message: Help desk is not enabled for this agent
                AUTH_INSUFFICIENT_PERMISSIONS:
                  summary: >-
                    The API key does not have the required permissions for this
                    operation. Ensure the key's account has the appropriate plan
                    and role.
                  value:
                    error:
                      code: AUTH_INSUFFICIENT_PERMISSIONS
                      message: You don't have permission to perform this action
                SUBSCRIPTION_API_RESTRICTED_PLAN:
                  summary: >-
                    Your current plan does not include API access. Upgrade to
                    the Basic plan or higher to use the API.
                  value:
                    error:
                      code: SUBSCRIPTION_API_RESTRICTED_PLAN
                      message: A Basic plan or higher is required to access the API
        '404':
          description: >-
            No agent matches the provided `agentId`, or it does not belong to
            the authenticated account.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
              example:
                error:
                  code: AGENT_NOT_FOUND
                  message: Agent not found
        '429':
          description: >-
            Rate limit exceeded. Check the `X-RateLimit-Reset` response header
            for the Unix epoch seconds when the limit resets.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
              example:
                error:
                  code: RATE_LIMIT_TOO_MANY_REQUESTS
                  message: Too many requests, please try again later
        '500':
          description: >-
            An unhandled server error occurred. If the issue persists, contact
            support with the `x-request-id` response header value for debugging.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
              example:
                error:
                  code: INTERNAL_SERVER_ERROR
                  message: Something went wrong, please try again
        '503':
          description: >-
            Chatbase is undergoing scheduled maintenance and the API is
            temporarily rejecting requests. This is transient; retry after a
            short delay. Requests are rejected before any data is read or
            written, so no partial changes are applied.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
              example:
                error:
                  code: SERVICE_UNDER_MAINTENANCE
                  message: >-
                    The API is temporarily unavailable for scheduled
                    maintenance, please try again later
      security:
        - bearerAuth: []
components:
  schemas:
    ActivitySegmentListResponse:
      type: object
      properties:
        data:
          type: array
          items:
            $ref: '#/components/schemas/ActivitySegment'
        pagination:
          $ref: '#/components/schemas/HelpdeskReportPagination'
      required:
        - data
        - pagination
    ErrorResponse:
      type: object
      properties:
        error:
          type: object
          properties:
            code:
              type: string
              description: Machine-readable error code
            message:
              type: string
              description: Human-readable error message
            details:
              type: object
              additionalProperties:
                type: string
              description: Field-level validation errors
          required:
            - code
            - message
      required:
        - error
    ActivitySegment:
      type: object
      properties:
        id:
          type: string
          description: Segment ID
        operator:
          $ref: '#/components/schemas/AttendanceOperator'
        kind:
          type: string
          enum:
            - ticket
            - untracked
            - idle
          description: >-
            `ticket` while a ticket was open, `untracked` while logged in
            without a ticket open, `idle` after 10 minutes without input
        ticketNumber:
          type:
            - integer
            - 'null'
          description: >-
            Ticket number for a `ticket` segment, or null for other kinds and
            for deleted tickets
        startedAt:
          type: string
          description: ISO 8601 time the segment started
          example: '2026-10-29T07:02:13.418Z'
        lastSeenAt:
          type: string
          description: >-
            ISO 8601 time the segment was last refreshed. An open segment is
            refreshed every few minutes while the operator is active.
          example: '2026-10-29T07:16:40.102Z'
        endedAt:
          type:
            - string
            - 'null'
          description: ISO 8601 time the segment ended, or null while it is still open
          example: '2026-10-29T07:17:05.733Z'
      required:
        - id
        - operator
        - kind
        - ticketNumber
        - startedAt
        - lastSeenAt
        - endedAt
    HelpdeskReportPagination:
      type: object
      properties:
        cursor:
          type:
            - string
            - 'null'
          description: Cursor for the next page, or null if no more pages
        hasMore:
          type: boolean
          description: Whether more pages follow
      required:
        - cursor
        - hasMore
    AttendanceOperator:
      type: object
      properties:
        id:
          type: string
          description: User ID of the operator
        name:
          type: string
          description: Operator name
        email:
          type: string
          description: Operator email
      required:
        - id
        - name
        - email
  securitySchemes:
    bearerAuth:
      type: http
      scheme: bearer
      description: API key from your account settings

````

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