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

# Get intent stats

> Returns the number of intent actions in a trailing time window. Results can be narrowed to one trading account and default to the last day.



## OpenAPI

````yaml /api-reference/intents.openapi.json get /v1/intents/stats
openapi: 3.1.0
info:
  title: intents
  description: ''
  license:
    name: ''
  version: 0.1.0
servers:
  - url: https://api.anthid.com
    description: Production
security: []
tags:
  - name: Intents
    description: Submit create, replace, and cancel commands
  - name: Intents
    description: Read intent actions and their dispatch state
  - name: Intents
    description: Read aggregate intent activity
paths:
  /v1/intents/stats:
    get:
      tags:
        - Intents
      summary: Get intent stats
      description: >-
        Returns the number of intent actions in a trailing time window. Results
        can be narrowed to one trading account and default to the last day.
      operationId: getIntentStats
      parameters:
        - name: trading_account_id
          in: query
          description: Trading account to count actions for
          required: false
          schema:
            type: string
            format: uuid
          example: 550e8400-e29b-41d4-a716-446655440000
        - name: time_window
          in: query
          description: Trailing window; defaults to `last_day`
          required: false
          schema:
            $ref: '#/components/schemas/RelativeTimeWindow'
          example: last_day
        - name: x-organization-id
          in: header
          description: Organization ID required for service-account credentials
          required: false
          schema:
            type:
              - string
              - 'null'
            format: uuid
          example: 550e8400-e29b-41d4-a716-446655440222
      responses:
        '200':
          description: Intent stats retrieved
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/IntentsStatsResponse'
              example:
                intent_count: 148
        '400':
          description: Query parameters or organization scope are invalid
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
        '401':
          description: Missing or invalid authentication credentials
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
        '403':
          description: >-
            Caller lacks read permission, organization access, or ownership of
            the requested trading account
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
        '404':
          description: No trading account exists for the provided trading account id
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
        '429':
          description: Caller exceeded the request rate limit
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
        '500':
          description: Unexpected server error while reading intent stats
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
      security:
        - bearerAuth: []
        - clientCredentials: []
        - apiKeyAuth: []
components:
  schemas:
    RelativeTimeWindow:
      type: string
      enum:
        - last_hour
        - last_day
        - last_week
        - last_month
        - last_year
    IntentsStatsResponse:
      type: object
      required:
        - intent_count
      properties:
        intent_count:
          type: integer
          format: int64
    Error:
      oneOf:
        - type: object
          required:
            - EncryptionError
          properties:
            EncryptionError:
              type: string
        - type: object
          required:
            - WorkOsError
          properties:
            WorkOsError:
              type: string
        - type: object
          required:
            - KvError
          properties:
            KvError:
              type: string
        - type: object
          required:
            - StreamError
          properties:
            StreamError:
              type: string
        - type: object
          required:
            - InternalError
          properties:
            InternalError:
              type: string
        - type: object
          required:
            - ThirdPartyError
          properties:
            ThirdPartyError:
              type: string
        - type: object
          required:
            - ParseError
          properties:
            ParseError:
              type: string
        - type: object
          required:
            - NotFound
          properties:
            NotFound:
              type: string
        - type: object
          required:
            - AlreadyExists
          properties:
            AlreadyExists:
              type: string
        - type: object
          required:
            - BadRequest
          properties:
            BadRequest:
              type: string
        - type: object
          required:
            - Forbidden
          properties:
            Forbidden:
              type: string
        - type: object
          required:
            - Unauthorized
          properties:
            Unauthorized:
              type: string
        - type: object
          required:
            - Database
          properties:
            Database:
              type: string
        - type: object
          required:
            - TooManyRequests
          properties:
            TooManyRequests:
              type: string
        - type: object
          required:
            - BrokerError
          properties:
            BrokerError:
              type: string
        - type: object
          required:
            - AuthError
          properties:
            AuthError:
              type: string
        - type: object
          required:
            - InvalidInput
          properties:
            InvalidInput:
              type: string
        - type: object
          required:
            - ConnectionLimitExceeded
          properties:
            ConnectionLimitExceeded:
              type: string
  securitySchemes:
    bearerAuth:
      type: http
      scheme: bearer
      bearerFormat: JWT
    clientCredentials:
      type: http
      scheme: bearer
      bearerFormat: JWT
      description: Machine bearer token minted via the client_credentials grant.
    apiKeyAuth:
      type: apiKey
      in: header
      name: x-api-key

````