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

# Redirect to a signed download URL

> Mints a fresh signed JWT (aud=`export:<id>`, 10 min TTL) and 302s to `/api/v1/exports/download/{token}`. Use `curl -L` to follow. The redirect target is publicly reachable (the token is the auth), so it can be passed straight to a browser tab or download manager.




## OpenAPI

````yaml /openapi.yaml get /exports/{id}/download
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:
  /exports/{id}/download:
    get:
      tags:
        - Exports
      summary: Redirect to a signed download URL
      description: >
        Mints a fresh signed JWT (aud=`export:<id>`, 10 min TTL) and 302s to
        `/api/v1/exports/download/{token}`. Use `curl -L` to follow. The
        redirect target is publicly reachable (the token is the auth), so it can
        be passed straight to a browser tab or download manager.
      parameters:
        - name: id
          in: path
          required: true
          description: Export UUID
          schema:
            type: string
      responses:
        '302':
          description: Redirect to the signed download URL
        '401':
          $ref: '#/components/responses/Unauthorized'
        '402':
          $ref: '#/components/responses/PaymentRequired'
        '403':
          $ref: '#/components/responses/Forbidden'
        '404':
          $ref: '#/components/responses/NotFound'
        '409':
          description: Export not ready yet (status is queued/running/failed)
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/utils.APIErrorResponse'
        '410':
          description: Export has expired (cleanup cron deleted the file)
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/utils.APIErrorResponse'
        '500':
          $ref: '#/components/responses/InternalError'
      security:
        - ApiKeyAuth: []
components:
  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'
    InternalError:
      description: Internal Server Error
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/utils.APIErrorResponse'
  schemas:
    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
  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.

````