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

# Get contact activity

> Get paginated email activity for a contact with caching support. Returns messages where contact appears in from/to/cc fields



## OpenAPI

````yaml /api-reference/cx/swagger.json get /contacts/{contact}/activity
openapi: 3.0.0
info:
  description: CX API.
  title: CX API
  contact:
    name: API Support
    url: https://stax.ai
    email: support@stax.ai
  version: '1.0'
servers:
  - url: https://api.cx.stax.ai
security: []
paths:
  /contacts/{contact}/activity:
    get:
      tags:
        - contacts
      summary: Get contact activity
      description: >-
        Get paginated email activity for a contact with caching support. Returns
        messages where contact appears in from/to/cc fields
      parameters:
        - description: Contact ID
          name: contact
          in: path
          required: true
          schema:
            type: string
        - description: 'Page number (default: 1)'
          name: page
          in: query
          schema:
            type: integer
        - description: 'Items per page (default: 50, max: 100)'
          name: limit
          in: query
          schema:
            type: integer
      responses:
        '200':
          description: Contact activity with pagination
          content:
            application/json:
              schema:
                $ref: >-
                  #/components/schemas/pkg_routes_contacts.ContactActivityResponse
        '400':
          description: Bad request - invalid contact ID
          content:
            application/json:
              schema:
                type: object
                additionalProperties:
                  type: string
        '401':
          description: Unauthorized
          content:
            application/json:
              schema:
                type: object
                additionalProperties:
                  type: string
        '404':
          description: Contact not found
          content:
            application/json:
              schema:
                type: object
                additionalProperties:
                  type: string
        '500':
          description: Internal server error
          content:
            application/json:
              schema:
                type: object
                additionalProperties:
                  type: string
      security:
        - ApiKeyAuth: []
components:
  schemas:
    pkg_routes_contacts.ContactActivityResponse:
      type: object
      properties:
        activity:
          type: array
          items:
            $ref: '#/components/schemas/pkg_routes_contacts.MessageWithClientNames'
        cached:
          type: boolean
        pagination:
          type: object
          properties:
            limit:
              type: integer
            page:
              type: integer
            pages:
              type: integer
            total:
              type: integer
        query_time_ms:
          type: integer
    pkg_routes_contacts.MessageWithClientNames:
      type: object
      properties:
        _id:
          type: string
        attachments:
          type: array
          items:
            $ref: '#/components/schemas/types.Attachment'
        bcc:
          type: string
        bookmark:
          type: boolean
        brief:
          description: Single-line summary
          type: string
        cc:
          type: string
        checksum:
          description: Checksum for de-duplication
          type: string
        client_names:
          type: array
          items:
            type: string
        clients:
          description: Is this message to/from a client?
          type: array
          items:
            type: string
        created_at:
          type: string
        date:
          type: string
        deleted_at:
          type: string
        domains:
          type: array
          items:
            type: string
        draft:
          type: boolean
        from:
          type: string
        html:
          type: string
        importance:
          type: integer
        in_reply_to:
          type: string
        internal:
          description: Is this message to/from only internal users?
          type: boolean
        message_folders:
          description: >-
            MessageFolders references the `folders` catalog rows this message
            belongs to

            (by their local ObjectID) — the per-mailbox equivalent of Tags
            (which is a

            team-wide label system). Each catalog row carries the provider's
            external_id;

            storing the local _id keeps renames free and gives referential
            integrity.

            Gmail = multi-label, Outlook = single-folder; the array models both.
          type: array
          items:
            type: string
        outbox:
          description: Magical stuff
          type: boolean
        private:
          description: >-
            The private flag is used if the message is from/to only internal
            admins (regardless of how many external users) that have the
            memberships.email.private flag set.

            This prevents other users from seeing external messages that may be
            private.
          type: boolean
        read:
          type: string
        references:
          type: string
        reply:
          type: string
        requires_response:
          type: boolean
        responses:
          type: array
          items:
            type: string
        safe_for_everyone:
          type: boolean
        schedule_id:
          description: >-
            ScheduleID is the Nylas message-schedule id returned by a native
            send_at

            (scheduled) send, used to reconcile the eventual Sent-folder message
            back

            onto this row (Nylas migration, Stage 4). Mirror of
            legacytypes.Message.
          type: string
        schedule_send_at:
          description: Schedule sending this at a specific time
          type: string
        secure:
          type: boolean
        send_failed:
          description: >-
            SendFailed marks a message whose provider-side send failed (Nylas

            message.send_failed webhook — typically a scheduled send) so the UI
            can

            flag it for the user to retry. Mirror of legacytypes.Message.
          type: boolean
        send_scheduled:
          type: boolean
        send_state:
          description: >-
            SendState records the provider-reported delivery state. Mirror of
            legacytypes.Message.
          type: string
        sentiment:
          type: integer
        source:
          type: string
        source_history_id:
          type: string
        source_id:
          type: string
        subject:
          type: string
        summary:
          type: array
          items:
            type: string
        tags:
          type: array
          items:
            type: string
        tasks:
          type: array
          items:
            type: string
        team:
          type: string
        text:
          type: string
        thread:
          type: string
        to:
          type: string
        unique_key:
          type: string
        user:
          type: string
    types.Attachment:
      type: object
      properties:
        content_id:
          type: string
        file:
          type: string
        filename:
          type: string
        isInline:
          type: boolean
        size:
          type: integer
        source_id:
          type: string
        url:
          type: string
  securitySchemes:
    ApiKeyAuth:
      description: CX API key. Create one in CX under Settings → Advanced → API Keys.
      in: header
      name: x-api-key
      type: apiKey

````

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