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

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



## OpenAPI

````yaml post /documents/{id}/presigned-url
openapi: 3.1.0
info:
  version: 0.0.1
  title: Abacus API
  description: Abacus is the operating system for Merchant Cash Advance businesses.
  contact:
    name: Abacus Support
    email: support@abacuslabs.co
    url: https://abacuslabs.co
  license:
    name: AGPL-3.0 license
    url: https://github.com/Suphian/abacus/blob/main/LICENSE
servers:
  - url: https://api.abacuslabs.co
    description: Production API
security:
  - oauth2: []
  - token: []
paths:
  /documents/{id}/presigned-url:
    post:
      tags:
        - Documents
      summary: Generate pre-signed URL for document
      description: >-
        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.
      operationId: getDocumentPreSignedUrl
      parameters:
        - schema:
            type: string
            format: uuid
            description: Unique identifier of the document to generate a pre-signed URL for
            example: b3b7c1e2-4c2a-4e7a-9c1a-2b7c1e24c2a4
          required: true
          description: Unique identifier of the document to generate a pre-signed URL for
          in: path
          name: id
        - schema:
            type: boolean
            nullable: true
            description: >-
              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
          required: false
          description: >-
            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.
          in: query
          name: download
      responses:
        '200':
          description: Pre-signed URL generated successfully
          content:
            application/json:
              schema:
                type: object
                properties:
                  url:
                    type: string
                    format: uri
                    description: >-
                      Pre-signed URL for accessing the document, valid for 60
                      seconds
                    example: >-
                      https://example.supabase.co/storage/v1/object/sign/vault/documents/2024/invoice.pdf?token=abc123&expires=1640995200
                  expiresAt:
                    type: string
                    format: date-time
                    description: ISO 8601 timestamp when the URL expires
                    example: '2024-04-15T10:01:00.000Z'
                  fileName:
                    type: string
                    nullable: true
                    description: Original filename of the document
                    example: invoice-april-2024.pdf
                required:
                  - url
                  - expiresAt
                  - fileName
        '400':
          description: Bad request - Document file path not available
          content:
            application/json:
              schema:
                type: object
                properties:
                  error:
                    type: string
                required:
                  - error
        '404':
          description: Document not found
          content:
            application/json:
              schema:
                type: object
                properties:
                  error:
                    type: string
                required:
                  - error
        '500':
          description: Internal server error - Failed to generate pre-signed URL
          content:
            application/json:
              schema:
                type: object
                properties:
                  error:
                    type: string
                required:
                  - error
components:
  securitySchemes:
    token:
      type: http
      scheme: bearer
      description: Default authentication mechanism
      x-speakeasy-example: ABACUS_API_KEY

````

This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.