Documents

Generate pre-signed URL for document

Generate a pre-signed URL for accessing a document. The URL is valid for 60 seconds and allows secure temporary access to the document file.

post/documents/{id}/presigned-url

Request

  • Base URL
    https://api.midday.ai
  • URL
    https://api.midday.ai/documents/{id}/presigned-url
  • Auth
    • OAuth 2
      Authorization code: https://app.midday.ai/oauth/authorize
      Token URL: https://api.midday.ai/oauth/token
    • or HTTP bearer

Path parameters

idstring uuid required

Unique identifier of the document to generate a pre-signed URL for

Example:b3b7c1e2-4c2a-4e7a-9c1a-2b7c1e24c2a4

Query parameters

downloadboolean nullable

Whether to force download the file. If true, the file will be downloaded. If false or omitted, the file will be displayed in the browser if possible.

Example:true

Response

Pre-signed URL generated successfully

urlstring uri required

Pre-signed URL for accessing the document, valid for 60 seconds

expiresAtstring date-time required

ISO 8601 timestamp when the URL expires

fileNamestring nullable required

Original filename of the document

Example response

{
  "url": "https://service.midday.ai/storage/v1/object/sign/vault/documents/2024/invoice.pdf?token=abc123&expires=1640995200",
  "expiresAt": "2024-04-15T10:01:00.000Z",
  "fileName": "invoice-april-2024.pdf"
}

Changes

No recorded changes to this operation across all 1 revision of this API.