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

# List usage records

> Lists usage records, newest first. Filter by project, number (`session`), call (`callId`), meter or calendar month; without `period`, records from every month are listed. A call has one `call.duration` record, and an outgoing Cloud API call also a `call.cloud_pulses` record. Pass `nextCursor` as `cursor` to read the next page with the same filters.

Requires `sessions:read`. Project tokens only access resources in their own project.



## OpenAPI

````yaml api-reference/features/operate.json GET /platform/usage/records
openapi: 3.0.3
info:
  title: Operate API methods
  version: 1.0.0
  description: Task-focused operate methods across supported Polymorfa connection types.
servers: []
security: []
paths:
  /platform/usage/records:
    get:
      tags:
        - Usage
      summary: List usage records
      description: >-
        Lists usage records, newest first. Filter by project, number
        (`session`), call (`callId`), meter or calendar month; without `period`,
        records from every month are listed. A call has one `call.duration`
        record, and an outgoing Cloud API call also a `call.cloud_pulses`
        record. Pass `nextCursor` as `cursor` to read the next page with the
        same filters.


        Requires `sessions:read`. Project tokens only access resources in their
        own project.
      operationId: managementListUsageRecords
      parameters:
        - name: projectId
          in: query
          required: false
          description: >-
            Filter records to this project. Omit to list records from every
            project you can access.
          schema:
            type: string
        - name: session
          in: query
          required: false
          schema:
            type: string
            minLength: 1
            maxLength: 128
            description: Number (session name).
          description: |-
            Identifier of the connected Polymorfa session.

            <!-- polymorfa-input-table -->
            **Value constraints**
            | Constraint | Accepted input |
            | --- | --- |
            | String length | `1` through `128` characters |
        - name: callId
          in: query
          required: false
          schema:
            type: string
            minLength: 1
            maxLength: 128
            pattern: ^[\x21-\x7e]+$
          description: |-
            Identifier of the WhatsApp call.

            <!-- polymorfa-input-table -->
            **Value constraints**
            | Constraint | Accepted input |
            | --- | --- |
            | String length | `1` through `128` characters |
            | Pattern | `^[\x21-\x7e]+$` |
        - name: meter
          in: query
          required: false
          schema:
            $ref: '#/components/schemas/management__UsageMeter'
          description: |-
            Specifies meter for this query parameter.

            <!-- polymorfa-input-table -->
            **Allowed values**
            | Value | Meaning |
            | --- | --- |
            | `call.duration` | Call.duration. |
            | `call.cloud_pulses` | Call.cloud pulses. |
            | `campaign.call` | Campaign.call. |
            | `tts.characters` | Tts.characters. |
            | `tts.seconds` | Tts.seconds. |
            | `stt.seconds` | Stt.seconds. |
            | `agent.seconds` | Agent.seconds. |
            | `agent.tokens` | Agent.tokens. |
            | `agent.provider_cost` | Agent.provider cost. |
            | `channels.peak` | Channels.peak. |
            | `storage.byte_days` | Storage.byte days. |
        - name: period
          in: query
          required: false
          schema:
            type: string
            pattern: ^\d{4}-(0[1-9]|1[0-2])$
            description: >-
              Calendar month in UTC, `YYYY-MM`. Omit it to list records from
              every month.
          description: |-
            Specifies period for this query parameter.

            <!-- polymorfa-input-table -->
            **Value constraints**
            | Constraint | Accepted input |
            | --- | --- |
            | Pattern | `^\d{4}-(0[1-9]\|1[0-2])$` |
        - name: limit
          in: query
          required: false
          schema:
            type: integer
            minimum: 1
            maximum: 100
            default: 25
          description: |-
            Specifies limit for this query parameter.

            <!-- polymorfa-input-table -->
            **Value constraints**
            | Constraint | Accepted input |
            | --- | --- |
            | Numeric value | `1` through `100` (inclusive) |
        - name: cursor
          in: query
          required: false
          schema:
            type: string
            minLength: 1
            maxLength: 256
          description: |-
            Specifies cursor for this query parameter.

            <!-- polymorfa-input-table -->
            **Value constraints**
            | Constraint | Accepted input |
            | --- | --- |
            | String length | `1` through `256` characters |
      responses:
        '200':
          description: Success
          headers:
            X-Request-Id:
              schema:
                type: string
              description: Stable request correlation identifier.
            Polymorfa-Version:
              schema:
                type: string
              description: API version applied to this response.
          content:
            application/json:
              schema:
                type: object
                additionalProperties: false
                properties:
                  data:
                    allOf:
                      - $ref: '#/components/schemas/management__UsageRecordPage'
                    description: Structured data carried by this object.
                required:
                  - data
        '400':
          $ref: '#/components/responses/management__BadRequest'
        '401':
          $ref: '#/components/responses/management__Unauthorized'
        '403':
          $ref: '#/components/responses/management__Forbidden'
      security:
        - management__ApiKeyAuth: []
      servers:
        - url: https://api.polymorfa.com
components:
  schemas:
    management__UsageMeter:
      type: string
      enum:
        - call.duration
        - call.cloud_pulses
        - campaign.call
        - tts.characters
        - tts.seconds
        - stt.seconds
        - agent.seconds
        - agent.tokens
        - agent.provider_cost
        - channels.peak
        - storage.byte_days
      description: >-
        What was measured. Calls record `call.duration` (seconds) and, for
        outgoing Cloud API calls, `call.cloud_pulses` (6-second pulses). The
        other meters belong to voice automation and have no records yet.
    management__UsageRecordPage:
      type: object
      additionalProperties: false
      properties:
        records:
          type: array
          maxItems: 100
          items:
            $ref: '#/components/schemas/management__UsageRecord'
          description: |-
            Records associated with this management usage record page.

            <!-- polymorfa-input-table -->
            **Value constraints**
            | Constraint | Accepted input |
            | --- | --- |
            | Array size | At most `100` items |
        nextCursor:
          type: string
          nullable: true
          description: |-
            Pass as `cursor` for the next page; null on the last page.

            <!-- polymorfa-input-table -->
            **Accepted alternatives**
            | Alternative | Accepted input |
            | --- | --- |
            | Alternative 1 | Type: `string` |
            | Alternative 2 | `null` |
      required:
        - records
        - nextCursor
    management__UsageRecord:
      type: object
      additionalProperties: false
      properties:
        id:
          type: string
          format: uuid
          description: |-
            Identifier for this resource.

            <!-- polymorfa-input-table -->
            **Value constraints**
            | Constraint | Accepted input |
            | --- | --- |
            | Format | `uuid` |
        meter:
          allOf:
            - $ref: '#/components/schemas/management__UsageMeter'
          description: |-
            Specifies meter for this management usage record.

            <!-- polymorfa-input-table -->
            **Allowed values**
            | Value | Meaning |
            | --- | --- |
            | `call.duration` | Call.duration. |
            | `call.cloud_pulses` | Call.cloud pulses. |
            | `campaign.call` | Campaign.call. |
            | `tts.characters` | Tts.characters. |
            | `tts.seconds` | Tts.seconds. |
            | `stt.seconds` | Stt.seconds. |
            | `agent.seconds` | Agent.seconds. |
            | `agent.tokens` | Agent.tokens. |
            | `agent.provider_cost` | Agent.provider cost. |
            | `channels.peak` | Channels.peak. |
            | `storage.byte_days` | Storage.byte days. |
        quantity:
          type: number
          minimum: 0
          description: |-
            Number of units included for this item.

            <!-- polymorfa-input-table -->
            **Value constraints**
            | Constraint | Accepted input |
            | --- | --- |
            | Numeric value | `0` or greater |
        unit:
          allOf:
            - $ref: '#/components/schemas/management__UsageUnit'
          description: |-
            Specifies unit for this management usage record.

            <!-- polymorfa-input-table -->
            **Allowed values**
            | Value | Meaning |
            | --- | --- |
            | `second` | Second. |
            | `pulse` | Pulse. |
            | `call` | Call. |
            | `character` | Character. |
            | `token` | Token. |
            | `provider_unit` | Provider unit. |
            | `channel` | Channel. |
            | `byte_day` | Byte day. |
        dimensions:
          type: object
          additionalProperties:
            oneOf:
              - type: string
              - type: number
              - type: boolean
          description: >-
            Closed, per-meter attributes. Call meters carry `direction`,
            `upstream` (`linked_device` or `cloud_api`), `origin`,
            `participants`, `connections`, `sipLegs` and `video`.
        keySource:
          allOf:
            - $ref: '#/components/schemas/management__UsageKeySource'
          description: |-
            Specifies key source for this management usage record.

            <!-- polymorfa-input-table -->
            **Allowed values**
            | Value | Meaning |
            | --- | --- |
            | `none` | None. |
            | `managed` | Managed. |
            | `customer` | Customer. |
        sourceKind:
          type: string
          enum:
            - call
            - attempt
            - flow_run
            - conversation
            - asset
            - team
          description: |-
            Category assigned to source.

            <!-- polymorfa-input-table -->
            **Allowed values**
            | Value | Meaning |
            | --- | --- |
            | `call` | Call. |
            | `attempt` | Attempt. |
            | `flow_run` | Flow run. |
            | `conversation` | Conversation. |
            | `asset` | Asset. |
            | `team` | Team. |
        sourceId:
          type: string
          description: The call id for call meters.
        projectId:
          type: string
          format: uuid
          nullable: true
          description: >-
            Original owning project, preserved across usage revisions and number
            deletion. Null when unknown; project-filtered reads exclude
            unattributed records.


            <!-- polymorfa-input-table -->

            **Accepted alternatives**

            | Alternative | Accepted input |

            | --- | --- |

            | Alternative 1 | Type: `string`; Format: `uuid` |

            | Alternative 2 | `null` |


            **Value constraints**

            | Constraint | Accepted input |

            | --- | --- |

            | Format | `uuid` |
        session:
          type: string
          nullable: true
          description: |-
            The number (session name) the usage belongs to.

            <!-- polymorfa-input-table -->
            **Accepted alternatives**
            | Alternative | Accepted input |
            | --- | --- |
            | Alternative 1 | Type: `string` |
            | Alternative 2 | `null` |
        occurredAt:
          type: string
          format: date-time
          description: |-
            When the usage happened. For calls, when the call ended.

            <!-- polymorfa-input-table -->
            **Value constraints**
            | Constraint | Accepted input |
            | --- | --- |
            | Format | `date-time` |
        recordedAt:
          type: string
          format: date-time
          description: |-
            Timestamp for recorded at.

            <!-- polymorfa-input-table -->
            **Value constraints**
            | Constraint | Accepted input |
            | --- | --- |
            | Format | `date-time` |
        revision:
          type: integer
          minimum: 1
          description: >-
            Increases when a later observation corrects the record, for example
            a call end reported after a lost connection.


            <!-- polymorfa-input-table -->

            **Value constraints**

            | Constraint | Accepted input |

            | --- | --- |

            | Numeric value | `1` or greater |
        pricingState:
          type: string
          enum:
            - unpriced
            - priced
            - waived
            - settled
          description: |-
            `unpriced` while usage is measured but not charged.

            <!-- polymorfa-input-table -->
            **Allowed values**
            | Value | Meaning |
            | --- | --- |
            | `unpriced` | Unpriced. |
            | `priced` | Priced. |
            | `waived` | Waived. |
            | `settled` | Settled. |
        rateCard:
          type: object
          nullable: true
          additionalProperties: false
          properties:
            id:
              type: string
              format: uuid
              description: |-
                Identifier for this resource.

                <!-- polymorfa-input-table -->
                **Value constraints**
                | Constraint | Accepted input |
                | --- | --- |
                | Format | `uuid` |
            version:
              type: integer
              description: Specifies version for this rate card.
          required:
            - id
            - version
          description: >-
            The rate card that applied when the usage was recorded. Null while
            no rate card exists.


            <!-- polymorfa-input-table -->

            **Accepted alternatives**

            | Alternative | Accepted input |

            | --- | --- |

            | Alternative 1 | Type: `object`; Required fields: `id`, `version` |

            | Alternative 2 | `null` |
        pricedCredits:
          type: number
          nullable: true
          description: |-
            Credits charged for the record. Null until the record is priced.

            <!-- polymorfa-input-table -->
            **Accepted alternatives**
            | Alternative | Accepted input |
            | --- | --- |
            | Alternative 1 | Type: `number` |
            | Alternative 2 | `null` |
      required:
        - id
        - meter
        - quantity
        - unit
        - dimensions
        - keySource
        - sourceKind
        - sourceId
        - projectId
        - session
        - occurredAt
        - recordedAt
        - revision
        - pricingState
        - rateCard
        - pricedCredits
    management__ErrorEnvelope:
      type: object
      required:
        - error
        - data
        - docs
      properties:
        error:
          type: object
          required:
            - type
            - code
            - message
            - param
            - request_id
          properties:
            type:
              type: string
              enum:
                - invalid_request_error
                - authentication_error
                - permission_error
                - conflict_error
                - rate_limit_error
                - api_error
                - upstream_error
              description: |-
                Type discriminator for this object.

                <!-- polymorfa-input-table -->
                **Allowed values**
                | Value | Meaning |
                | --- | --- |
                | `invalid_request_error` | Invalid request error. |
                | `authentication_error` | Authentication error. |
                | `permission_error` | Permission error. |
                | `conflict_error` | Conflict error. |
                | `rate_limit_error` | Rate limit error. |
                | `api_error` | Api error. |
                | `upstream_error` | Upstream error. |
            code:
              type: string
              description: Stable failure code. Use this value for programmatic handling.
            message:
              type: string
              description: Safe explanation of the failure.
            param:
              type: string
              nullable: true
              description: |-
                Invalid request field, or null when no field applies.

                <!-- polymorfa-input-table -->
                **Accepted alternatives**
                | Alternative | Accepted input |
                | --- | --- |
                | Alternative 1 | Type: `string` |
                | Alternative 2 | `null` |
            request_id:
              type: string
              description: >-
                Matches the X-Request-Id response header. Include it when you
                contact support.
            request_log_url:
              type: string
              format: uri
              description: >-
                Console page that shows this request. Returned only to
                organization and project credentials whose request was logged.


                <!-- polymorfa-input-table -->

                **Value constraints**

                | Constraint | Accepted input |

                | --- | --- |

                | Format | `uri` |
          description: Error details returned when the operation fails.
        data:
          type: string
          nullable: true
          enum:
            - null
          description: |-
            Always null for a failed request.

            <!-- polymorfa-input-table -->
            **Allowed values**
            | Value | Meaning |
            | --- | --- |
            | `null` | Null. |

            **Accepted alternatives**
            | Alternative | Accepted input |
            | --- | --- |
            | Alternative 1 | Type: `string` |
            | Alternative 2 | `null` |
        docs:
          type: string
          format: uri
          description: |-
            Documentation link to this failure code.

            <!-- polymorfa-input-table -->
            **Value constraints**
            | Constraint | Accepted input |
            | --- | --- |
            | Format | `uri` |
    management__UsageUnit:
      type: string
      enum:
        - second
        - pulse
        - call
        - character
        - token
        - provider_unit
        - channel
        - byte_day
    management__UsageKeySource:
      type: string
      enum:
        - none
        - managed
        - customer
      description: >-
        Whose provider key produced the usage. `none` for usage without a
        provider key, such as calls.
  responses:
    management__BadRequest:
      description: A path, query, or request-body value did not pass validation.
      headers:
        X-Request-Id:
          schema:
            type: string
          description: Stable request correlation identifier.
        Polymorfa-Version:
          schema:
            type: string
          description: API version applied to this response.
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/management__ErrorEnvelope'
    management__Unauthorized:
      description: Missing/invalid credential for this audience.
      headers:
        X-Request-Id:
          schema:
            type: string
          description: Stable request correlation identifier.
        Polymorfa-Version:
          schema:
            type: string
          description: API version applied to this response.
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/management__ErrorEnvelope'
    management__Forbidden:
      description: Authenticated but lacks the required scope/role/audience.
      headers:
        X-Request-Id:
          schema:
            type: string
          description: Stable request correlation identifier.
        Polymorfa-Version:
          schema:
            type: string
          description: API version applied to this response.
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/management__ErrorEnvelope'
  securitySchemes:
    management__ApiKeyAuth:
      type: http
      scheme: bearer
      description: >-
        Send your team API key or project token as `Authorization: Bearer
        <token>`. The credential must have the required permissions. Project
        tokens can access only their own project.

````