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

# Histórico detalhado de uso de créditos

> Ledger de créditos/saldo com fallback por canal. Escopo: `billing:read`.



## OpenAPI

````yaml /es/platform-api/api-reference/openapi-platform.json get /v1/platform/workspaces/{id}/credits/usage
openapi: 3.0.3
info:
  title: Notifique API Platform
  description: >-
    Conta, billing, API keys, equipe e tudo que o painel faz — via API. Rotas
    públicas: `register`, `verify`, `login`. Autentique o restante com
    `Authorization: Bearer sk_live_...` ou `x-api-key`. Escopos: `api_keys:*`,
    `billing:*`, `workspace:members:*` conforme a rota.
  version: 1.0.0
servers:
  - url: https://api.notifique.dev
    description: Produção
security:
  - ntfPlatformBearerAuth: []
  - ntfPlatformApiKeyHeader: []
tags:
  - name: 'Platform: Conta'
    description: Registro, verificação de telefone e login.
  - name: 'Platform: Billing'
    description: >-
      Assinatura, saldo, recarga e histórico de uso de créditos (`billing:read`
      / `billing:manage`).
  - name: 'Platform: API Keys'
    description: Gestão de chaves do workspace (`api_keys:read` / `api_keys:manage`).
  - name: 'Platform: Workspace'
    description: Listagem de workspaces (sessão) e recursos por workspace.
  - name: 'Platform: Equipe'
    description: >-
      Membros e convites (`workspace:members:read` /
      `workspace:members:manage`).
  - name: Sandbox
    description: Mensajes de prueba interceptados en el entorno sandbox.
paths:
  /v1/platform/workspaces/{id}/credits/usage:
    get:
      tags:
        - 'Platform: Billing'
      summary: Histórico detalhado de uso de créditos
      description: 'Ledger de créditos/saldo com fallback por canal. Escopo: `billing:read`.'
      operationId: ntfPlatform_getCreditsUsage
      parameters:
        - name: id
          in: path
          required: true
          schema:
            type: string
        - name: page
          in: query
          schema:
            type: string
        - name: limit
          in: query
          schema:
            type: string
        - name: chargedAs
          in: query
          schema:
            type: string
            enum:
              - credits
              - prepaid
      responses:
        '200':
          description: Uso paginado.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/NtfPlatform_CreditsUsageResponse'
              example:
                success: true
                data:
                  credits: 48200
                  creditsRenewedAt: '2026-08-01T00:00:00.000Z'
                  balanceCents: 5000
                  usage:
                    - id: clusg_01H...
                      at: '2026-08-14T19:00:00.000Z'
                      type: whatsapp
                      description: WhatsApp outbound
                      chargedAs: credits
                      chargeAmount: 12
                      correlationId: corr_01H...
                      apiKeyId: clkey_01H...
                  pricing:
                    whatsapp:
                      credits: 12
                      cents: 8
                pagination:
                  page: 1
                  limit: 20
                  total: 128
                  totalPages: 7
        '403':
          $ref: '#/components/responses/NtfPlatform_Forbidden'
components:
  schemas:
    NtfPlatform_CreditsUsageResponse:
      type: object
      properties:
        success:
          type: boolean
        data:
          type: object
          properties:
            credits:
              type: number
            creditsRenewedAt:
              type: string
              nullable: true
            balanceCents:
              type: integer
            usage:
              type: array
              items:
                $ref: '#/components/schemas/NtfPlatform_UsageEntry'
            pricing:
              type: object
              additionalProperties: true
              properties:
                whatsapp:
                  type: object
                  additionalProperties: true
                  example:
                    credits: 12
                    cents: 8
                  properties:
                    credits:
                      type: integer
                      example: 12
                    cents:
                      type: integer
                      example: 8
        pagination:
          $ref: '#/components/schemas/NtfPlatform_Pagination'
      example:
        success: true
        data:
          credits: 1
          creditsRenewedAt: string
          balanceCents: 1
          usage:
            - id: clxx...
              at: '2025-02-10T14:00:00.000Z'
              type: text
              description: string
              chargedAs: credits
              direction: CREDIT
              chargeAmount: 1
              correlationId: clxx...
              apiKeyId: clxx...
          pricing: {}
        pagination:
          page: 1
          limit: 1
          total: 1
          totalPages: 1
    NtfPlatform_UsageEntry:
      type: object
      properties:
        id:
          type: string
        at:
          type: string
          format: date-time
        type:
          type: string
        description:
          type: string
        chargedAs:
          type: string
          enum:
            - credits
            - prepaid
        direction:
          type: string
          enum:
            - CREDIT
            - DEBIT
        chargeAmount:
          type: number
        correlationId:
          type: string
          nullable: true
        apiKeyId:
          type: string
          nullable: true
      example:
        id: clxx...
        at: '2025-02-10T14:00:00.000Z'
        type: text
        description: string
        chargedAs: credits
        direction: CREDIT
        chargeAmount: 1
        correlationId: clxx...
        apiKeyId: clxx...
    NtfPlatform_Pagination:
      type: object
      properties:
        page:
          type: integer
        limit:
          type: integer
        total:
          type: integer
        totalPages:
          type: integer
      example:
        page: 1
        limit: 1
        total: 1
        totalPages: 1
    NtfPlatform_Error:
      type: object
      properties:
        success:
          type: boolean
          example: false
        error:
          type: string
        code:
          type: string
        message:
          type: string
          example: Campo inválido ou ausente.
        retryAfter:
          type: integer
          example: 60
      example:
        success: false
        error: string
        code: string
  responses:
    NtfPlatform_Forbidden:
      description: Escopo ausente ou sem acesso ao workspace.
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/NtfPlatform_Error'
          example:
            success: false
            code: FORBIDDEN
  securitySchemes:
    ntfPlatformBearerAuth:
      type: http
      scheme: bearer
      description: API key (`sk_live_...`) ou `sessionToken` de login.
    ntfPlatformApiKeyHeader:
      type: apiKey
      in: header
      name: x-api-key
      description: Alternativa ao Bearer.

````