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

# Generate client activity report

> Generate an Excel report of client activity with filtering and date range (retirement scope required)



## OpenAPI

````yaml /api-reference/cx/swagger.json post /clients/_activity_report
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:
  /clients/_activity_report:
    post:
      tags:
        - clients
      summary: Generate client activity report
      description: >-
        Generate an Excel report of client activity with filtering and date
        range (retirement scope required)
      requestBody:
        content:
          application/json:
            schema:
              $ref: >-
                #/components/schemas/pkg_routes_clients.ClientActivityReportRequest
        description: Activity report request
        required: true
      responses:
        '200':
          description: Excel file with activity report
          content:
            application/vnd.openxmlformats-officedocument.spreadsheetml.sheet:
              schema:
                type: string
                format: binary
        '400':
          description: Bad request - invalid request body
          content:
            application/vnd.openxmlformats-officedocument.spreadsheetml.sheet:
              schema:
                type: object
                additionalProperties: true
        '500':
          description: Internal server error
          content:
            application/vnd.openxmlformats-officedocument.spreadsheetml.sheet:
              schema:
                type: object
                additionalProperties: true
      security:
        - ApiKeyAuth: []
components:
  schemas:
    pkg_routes_clients.ClientActivityReportRequest:
      type: object
      properties:
        after:
          type: string
        before:
          type: string
        filters:
          $ref: '#/components/schemas/pkg_routes_clients.ListClientsFilters'
    pkg_routes_clients.ListClientsFilters:
      type: object
      properties:
        _id:
          type: array
          items:
            type: string
        allow_multiple_payrolls:
          description: >-
            AllowMultiplePayrolls filter: "multiple" or "Multiple connections
            enabled" = only clients with multiple payrolls enabled, "single" =
            only single (false or unset). Omit, null, empty, or invalid = no
            filter. Accepts string or []string.
          type: array
          items:
            type: string
        assignee:
          $ref: >-
            #/components/schemas/stax_ai_cx_cx-api_pkg_routes_filters.IncludeExcludeFilter
        client_tags:
          description: >-
            ClientTags is an alias for Tags so the cx-ui milestones rail can
            post a

            `client_tags` chip on /clients/_list without renaming its store
            keys.

            Anything provided here is merged into Tags before query application.
          allOf:
            - $ref: >-
                #/components/schemas/stax_ai_cx_cx-api_pkg_routes_filters.IncludeExcludeFilter
        data:
          type: array
          items:
            $ref: '#/components/schemas/types.ListFilterData'
        does_not_match_all_roles:
          type: array
          items:
            type: string
        has_billing:
          description: >-
            HasBilling: when true, only companies with a billing record. Used by
            the

            QuickBooks customer match review so the pager total matches the rows
            shown.
          type: boolean
        include_assignee_email_status:
          type: boolean
        payroll_provider:
          $ref: >-
            #/components/schemas/stax_ai_cx_cx-api_pkg_routes_filters.IncludeExcludeFilter
        payroll_status:
          $ref: >-
            #/components/schemas/stax_ai_cx_cx-api_pkg_routes_filters.IncludeExcludeFilter
        plan:
          type: array
          items:
            type: string
        plan_structure:
          $ref: >-
            #/components/schemas/stax_ai_cx_cx-api_pkg_routes_filters.IncludeExcludeFilter
        role_assignee:
          description: >-
            RoleAssignee: companies whose assignee in a role is (or isn't) a
            given user (ENG-9370).
          type: array
          items:
            $ref: >-
              #/components/schemas/stax_ai_cx_cx-api_pkg_routes_filters.RoleAssigneeCondition
        role_labels:
          type: array
          items:
            type: string
        search:
          type: string
        status:
          $ref: >-
            #/components/schemas/stax_ai_cx_cx-api_pkg_routes_filters.IncludeExcludeFilter
        tags:
          $ref: >-
            #/components/schemas/stax_ai_cx_cx-api_pkg_routes_filters.IncludeExcludeFilter
    stax_ai_cx_cx-api_pkg_routes_filters.IncludeExcludeFilter:
      type: object
      properties:
        exclude:
          type: array
          items:
            type: string
        include:
          type: array
          items:
            type: string
    types.ListFilterData:
      type: object
      properties:
        key:
          type: string
        op:
          type: string
        value: {}
    stax_ai_cx_cx-api_pkg_routes_filters.RoleAssigneeCondition:
      type: object
      properties:
        op:
          type: string
        role:
          type: string
        user:
          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.