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

# Get presigned upload URL

> Creates a document record and returns a presigned URL for uploading the file. After uploading, call `POST /documents/{id}/confirm` to finalize. The upload URL expires in 15 minutes.



## OpenAPI

````yaml /openapi.json post /documents/upload
openapi: 3.1.0
info:
  title: Vocobase Partner API
  version: '2.0'
  description: >-
    API for managing voice AI agents, documents, and calls on the Vocobase
    platform.
servers:
  - url: https://api.vocobase.com/api/v2
    description: Production
security:
  - bearerAuth: []
tags:
  - name: Config
    description: >-
      Read and update partner configuration, webhook settings, and telephony
      credentials.
  - name: Agents
    description: Create, read, update, and delete voice AI agents.
  - name: Voices
    description: >-
      List voice tiers, available voices, and stream preview audio for agent
      configuration.
  - name: Documents
    description: Upload, manage, and delete knowledge base documents.
  - name: Agent Documents
    description: Link and unlink documents to agents for knowledge base integration.
  - name: Calls
    description: Initiate outbound calls and view call history.
  - name: Phone Numbers
    description: >-
      Import DIDs, assign agents for inbound routing, and re-sync carrier
      Application bindings.
  - name: Inbound Routing Policies
    description: >-
      Define pre-answer routing decisions for inbound calls before AI sessions
      are created.
  - name: Telephony Connections
    description: Create, list, rename, and disconnect named V2 telephony connections.
  - name: VoiceLink Management
    description: Manage VoiceLink reseller clients, DID mapping, and readiness sync.
  - name: Projects
    description: Organize agents into projects. Every agent belongs to exactly one project.
  - name: Dictionaries
    description: Speech-recognition dictionary CRUD and agent attachment.
  - name: Sessions
    description: Browser-initiated WebRTC voice sessions for in-app voice agents.
paths:
  /documents/upload:
    post:
      tags:
        - Documents
      summary: Get presigned upload URL
      description: >-
        Creates a document record and returns a presigned URL for uploading the
        file. After uploading, call `POST /documents/{id}/confirm` to finalize.
        The upload URL expires in 15 minutes.
      operationId: getUploadUrl
      requestBody:
        required: true
        content:
          application/json:
            schema:
              type: object
              required:
                - name
                - file_size
                - mime_type
              properties:
                name:
                  type: string
                  minLength: 1
                  maxLength: 100
                  description: Document display name.
                  example: Product FAQ.pdf
                file_size:
                  type: integer
                  minimum: 1
                  maximum: 52428800
                  description: File size in bytes (max 50 MB).
                  example: 1048576
                mime_type:
                  type: string
                  enum:
                    - application/pdf
                    - >-
                      application/vnd.openxmlformats-officedocument.wordprocessingml.document
                    - text/plain
                    - text/markdown
                    - image/png
                    - image/jpeg
                    - image/gif
                    - image/webp
                  description: MIME type of the file.
                  example: application/pdf
      responses:
        '201':
          description: Upload URL generated.
          content:
            application/json:
              schema:
                type: object
                properties:
                  success:
                    type: boolean
                    const: true
                  data:
                    type: object
                    properties:
                      document_id:
                        type: string
                        format: uuid
                      upload_url:
                        type: string
                        format: uri
                        description: Presigned PUT URL.
                      expires_in:
                        type: integer
                        description: URL expiry in seconds.
                        example: 900
              example:
                success: true
                data:
                  document_id: d1234567-abcd-1234-abcd-123456789012
                  upload_url: https://uploads.example.com/path?signature=...
                  expires_in: 900
        '400':
          $ref: '#/components/responses/ValidationError'
        '401':
          $ref: '#/components/responses/Unauthorized'
        '500':
          $ref: '#/components/responses/InternalError'
components:
  responses:
    ValidationError:
      description: Validation error in request body or parameters.
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/ErrorResponse'
          example:
            success: false
            error:
              code: VALIDATION_ERROR
              message: agent_name is required and must be max 50 characters
    Unauthorized:
      description: Missing or invalid API key.
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/ErrorResponse'
          example:
            success: false
            error:
              code: UNAUTHORIZED
              message: Invalid or missing API key
    InternalError:
      description: Unexpected server error.
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/ErrorResponse'
          example:
            success: false
            error:
              code: INTERNAL_ERROR
              message: An unexpected error occurred
  schemas:
    ErrorResponse:
      type: object
      properties:
        success:
          type: boolean
          const: false
        error:
          type: object
          properties:
            code:
              type: string
            message:
              type: string
          required:
            - code
            - message
      required:
        - success
        - error
  securitySchemes:
    bearerAuth:
      type: http
      scheme: bearer
      description: >-
        API key in format: `rg_live_xxxx`. Pass as a Bearer token in the
        Authorization header.

````