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

# Get consent receipt (regulator-ready)

> Returns a canonical, version-pinned receipt (`version: "1.0"`) for a single consent. The JSON shape is stable across product versions so the file can be archived as audit evidence and re-fetched years later. Includes the subject, choice, preferences, policy version, geo country/region, user agent, and the evidence timestamps. Counts against monthly API quota.




## OpenAPI

````yaml /openapi.yaml get /consents/{id}/receipt
openapi: 3.0.0
info:
  title: ConsentFly
  version: 1.1.0
  description: >
    API REST do ConsentFly para gerenciar consentimentos e evidências de
    privacidade em escala. Autentique cada chamada com `Authorization: Bearer
    sk-...` (API Key). Cada requisição bem-sucedida consome **1 unidade** da
    cota mensal do plano. Gere sua API Key em `/dashboard/api-keys`.
  contact: {}
servers:
  - url: https://www.consentfly.com.br/api/v1
    description: Produção
security:
  - ApiKeyAuth: []
tags:
  - name: Consents
    description: Capturar, listar, atualizar e auditar registros de consentimento.
  - name: DSAR
    description: >-
      Direito ao esquecimento por titular e recibo canônico para evidência
      regulatória.
  - name: Exports
    description: >-
      Exportação CSV em streaming síncrono ou via job assíncrono para volumes
      grandes.
paths:
  /consents/{id}/receipt:
    get:
      tags:
        - DSAR
      summary: Get consent receipt (regulator-ready)
      description: >
        Returns a canonical, version-pinned receipt (`version: "1.0"`) for a
        single consent. The JSON shape is stable across product versions so the
        file can be archived as audit evidence and re-fetched years later.
        Includes the subject, choice, preferences, policy version, geo
        country/region, user agent, and the evidence timestamps. Counts against
        monthly API quota.
      parameters:
        - name: id
          in: path
          required: true
          description: Consent UUID
          schema:
            type: string
      responses:
        '200':
          description: OK
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/consents.ConsentReceiptDTO'
        '401':
          $ref: '#/components/responses/Unauthorized'
        '402':
          $ref: '#/components/responses/PaymentRequired'
        '403':
          $ref: '#/components/responses/Forbidden'
        '404':
          $ref: '#/components/responses/NotFound'
        '429':
          $ref: '#/components/responses/QuotaExceeded'
        '500':
          $ref: '#/components/responses/InternalError'
      security:
        - ApiKeyAuth: []
components:
  schemas:
    consents.ConsentReceiptDTO:
      type: object
      description: >-
        Recibo canônico de consentimento, pronto para arquivar como evidência
        regulatória. Schema fixo na versão "1.0".
      properties:
        version:
          type: string
          description: Versão do schema do recibo. Estável em "1.0".
          example: '1.0'
        receipt_id:
          type: string
          description: >-
            Identificador único do recibo (separado do consent.id; permite
            reemissão sem perder rastreabilidade).
          example: rcpt_01HK8VV4P9R3T8M2A2YZJ7HQ5Q
        consent_id:
          type: string
          description: Identificador semântico do consentimento.
          example: analytics-2026-05
        subject_id:
          type: string
          description: Identificador opaco do titular.
          example: user_sha256_a1b2c3d4e5f6
        site_id:
          type: string
          format: uuid
          example: 6b8b4567-327a-4d10-92a5-9e8c4f5a7d12
        accepted:
          type: boolean
          example: true
        preferences:
          type: object
          additionalProperties:
            type: boolean
          example:
            analytics: true
            marketing: false
            functional: true
        policy_version:
          type: integer
          example: 3
        country:
          type: string
          example: BR
        region:
          type: string
          example: SP
        user_agent:
          type: string
          example: Mozilla/5.0 (Macintosh; Intel Mac OS X 14_4) AppleWebKit/605.1.15
        created_at:
          type: string
          format: date-time
          example: '2026-05-24T10:30:00Z'
        updated_at:
          type: string
          format: date-time
          example: '2026-05-24T10:30:00Z'
        deleted_at:
          type: string
          format: date-time
          nullable: true
          example: null
    utils.APIErrorResponse:
      type: object
      description: Envelope JSON padrão de erro da API.
      properties:
        error:
          type: string
          description: >-
            Código legível por máquina (ex. `unauthorized`, `quota_exceeded`,
            `plan_required`).
          example: unauthorized
        message:
          type: string
          description: Mensagem legível por humano. Para 5xx é genérica.
          example: Invalid or missing API key
  responses:
    Unauthorized:
      description: Unauthorized
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/utils.APIErrorResponse'
    PaymentRequired:
      description: Plan inactive (payment required)
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/utils.APIErrorResponse'
    Forbidden:
      description: Forbidden (feature gate or plan limit)
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/utils.APIErrorResponse'
    NotFound:
      description: Not Found (cross-tenant access collapses to 404)
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/utils.APIErrorResponse'
    QuotaExceeded:
      description: Monthly API quota exhausted
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/utils.APIErrorResponse'
    InternalError:
      description: Internal Server Error
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/utils.APIErrorResponse'
  securitySchemes:
    ApiKeyAuth:
      type: apiKey
      in: header
      name: Authorization
      description: |
        Autenticação por API Key no formato `Authorization: Bearer sk-...`
        (sempre inclua o prefixo `Bearer`).

        Gere sua chave em `/dashboard/api-keys` após criar a conta e
        verificar o e-mail. A chave é exibida **uma única vez** no momento
        da criação — armazene em variável de ambiente no seu backend.
        Nunca exponha em código client-side.

````