> ## 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 aggregate intent stats for the resolved organization over the requested relative time window, optionally narrowed to one trading account. If `time_window` is omitted, `last_day` is used. Service-account callers must provide `x-organization-id` and have `intent:read`; API-key callers need organization intent read permission; user callers need an organization admin, member, or read-only role. Non-service callers can only read their principal organization, and a supplied trading account must belong to the resolved organization.



## 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 - Create
    description: Intent submission operations
  - name: Intents - Get
    description: Single-intent read operations
  - name: Intents - List
    description: Intent action listing operations
  - name: Intents - Stats
    description: Intent aggregate statistics
paths:
  /v1/intents/stats:
    get:
      tags:
        - Intents - Stats
      summary: Get intent stats
      description: >-
        Returns aggregate intent stats for the resolved organization over the
        requested relative time window, optionally narrowed to one trading
        account. If `time_window` is omitted, `last_day` is used.
        Service-account callers must provide `x-organization-id` and have
        `intent:read`; API-key callers need organization intent read permission;
        user callers need an organization admin, member, or read-only role.
        Non-service callers can only read their principal organization, and a
        supplied trading account must belong to the resolved organization.
      operationId: getIntentStats
      parameters:
        - name: trading_account_id
          in: query
          description: >-
            Optional trading account to count actions for. Omitted counts every
            account in the organization.
          required: false
          schema:
            type: string
            format: uuid
        - name: time_window
          in: query
          description: >-
            Optional relative trailing window to count intent actions in.
            Defaults to `last_day`.
          required: false
          schema:
            $ref: '#/components/schemas/RelativeTimeWindow'
        - name: x-organization-id
          in: header
          description: >-
            Organization id required when reading with service-account
            credentials
          required: false
          schema:
            type:
              - string
              - 'null'
            format: uuid
      responses:
        '200':
          description: Intent stats retrieved
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/IntentsStatsResponse'
        '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

````