GET /requests/{requestId}/export

Generate a collated PDF for a given request and get a temporary download URL. Authentication: Same as the rest of the API (API key e.g. Authorization: Basic <base64(apiKey:)> or ?api_key=..., or OAuth Bearer token). The authenticated user must have requests-download permission for the request. Default export (templateId omitted): All uploaded documents for that request, in item order. Forms are not included. Custom template (templateId set): Export follows the template (documents, static pages, PDFs, forms, order, "do not include if form has no answers", etc.). Template IDs are shown in the app in "Manage your PDF exports" (list and in the template detail modal when editing). The client should use the returned url with a simple GET (e.g. redirect or fetch) to download the PDF. The link is valid for 15 minutes; after that a new export must be requested.

Path parameters

  • requestId string Required

    ID of the request to export.

Query parameters

  • templateId string

    ID of the export template to use. If omitted, the default export is used (all uploaded documents in item order, no forms). Custom template IDs are shown in the app in "Manage your PDF exports".

Responses

  • 200 application/json

    Pre-signed URL to download the generated PDF.

    Hide response attributes Show response attributes object
    • url string Required

      Pre-signed S3 URL to download the generated PDF.

    • expiresIn integer Required

      Validity of the URL in seconds (always 900, i.e. 15 minutes).

  • 400 application/json

    Nothing to export (e.g. template results in an empty list, or export not supported for this storage).

    Hide response attributes Show response attributes object
    • error integer
    • message string

      Reason for the error

  • 401

    Unauthorized -- Your API key is wrong.

  • 403 application/json

    Forbidden — user not allowed to download this request (e.g. missing requests-download permission).

    Hide response attributes Show response attributes object
    • error integer
    • message string
  • 404 application/json

    Not found — invalid or unknown requestId, or template not found when templateId is provided.

    Hide response attributes Show response attributes object
    • error integer
    • message string

      Not found, or "Export template not found" when templateId is invalid.

  • 429

    Too Many Requests -- You're requesting too many objects! Slow down!

  • 500 application/json

    Server or Lambda error during export or URL generation.

    Hide response attributes Show response attributes object
    • error integer
    • message string

      Error reason

  • 503

    Service Unavailable -- We're temporarily offline for maintenance. Please try again later.

GET /requests/{requestId}/export
curl \
 --request GET 'https://api.usecollect.com/v1/requests/{requestId}/export' \
 --user "username:password"
Response examples (200)
{
  "url": "https://collecttempseu.s3.eu-west-3.amazonaws.com/export-abc123.pdf?X-Amz-Algorithm=...",
  "expiresIn": 900
}
Response examples (400)
{
  "error": 400,
  "message": "string"
}
Response examples (403)
{
  "error": 403,
  "message": "Forbidden"
}
Response examples (404)
{
  "error": 404,
  "message": "string"
}
Response examples (500)
{
  "error": 500,
  "message": "string"
}