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

# Consultar assinatura

> Plano, créditos do ciclo, status da assinatura e snapshot de billing. Escopo `billing:read` na API key.



## OpenAPI

````yaml /es/platform-api/api-reference/openapi-platform.json get /v1/platform/workspaces/{id}/subscription
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}/subscription:
    get:
      tags:
        - 'Platform: Billing'
      summary: Consultar assinatura
      description: >-
        Plano, créditos do ciclo, status da assinatura e snapshot de billing.
        Escopo `billing:read` na API key.
      operationId: ntfPlatform_getWorkspaceSubscription
      parameters:
        - name: id
          in: path
          required: true
          schema:
            type: string
          description: ID do workspace (`workspaceId` retornado no verify).
      responses:
        '200':
          description: Snapshot de assinatura e billing.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/NtfPlatform_SubscriptionResponse'
              example:
                success: true
                data:
                  tierIndex: 1
                  tierName: Basic
                  status: ACTIVE
                  billingType: CREDIT_CARD
                  creditsIncluded: 55000
                  creditsRemaining: 48200
                  creditsUsedThisCycle: 6800
                  cycleStart: '2026-08-01T00:00:00.000Z'
                  cycleEnd: '2026-09-01T00:00:00.000Z'
                  nextBillingAt: '2026-09-01T00:00:00.000Z'
                  balanceCents: 0
                  asaasSubscriptionId: sub_xxx
                  cancelAtPeriodEnd: false
        '401':
          $ref: '#/components/responses/NtfPlatform_Unauthorized'
        '403':
          $ref: '#/components/responses/NtfPlatform_Forbidden'
        '503':
          description: Billing não configurado no ambiente.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/NtfPlatform_Error'
              example:
                success: false
                code: BILLING_NOT_CONFIGURED
components:
  schemas:
    NtfPlatform_SubscriptionResponse:
      type: object
      properties:
        success:
          type: boolean
        data:
          type: object
          description: Snapshot de plano, créditos e assinatura.
          additionalProperties: true
          properties:
            tierIndex:
              type: integer
              example: 1
            tierName:
              type: string
              example: Basic
            status:
              type: string
              example: ACTIVE
            billingType:
              type: string
              example: CREDIT_CARD
            creditsIncluded:
              type: integer
              example: 55000
            creditsRemaining:
              type: integer
              example: 48200
            creditsUsedThisCycle:
              type: integer
              example: 6800
            cycleStart:
              type: string
              example: '2026-08-01T00:00:00.000Z'
            cycleEnd:
              type: string
              example: '2026-09-01T00:00:00.000Z'
            nextBillingAt:
              type: string
              example: '2026-09-01T00:00:00.000Z'
            balanceCents:
              type: integer
              example: 0
            asaasSubscriptionId:
              type: string
              example: sub_xxx
            cancelAtPeriodEnd:
              type: boolean
              example: false
      example:
        success: true
        data: {}
    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_Unauthorized:
      description: Credenciais ou token inválidos.
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/NtfPlatform_Error'
          example:
            success: false
            code: VERIFICATION_TOKEN_INVALID
    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.

````