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

# Vault — Get Upload URL

> Step 1 of the Vault upload flow. Returns a single-use presigned upload (PUT) URL. Upload the file directly to that URL, then register it via POST /v2/vault/confirm.

Step 1 of the Vault upload flow. Returns a single-use presigned upload (PUT) URL.

## Flow

1. **`POST /v2/vault/presigned_url`** → `{ presigned_url, file_key, document_id }`
2. `PUT` the file to `presigned_url` with a matching `Content-Type` header
3. **`POST /v2/vault/confirm`** → registers the document and triggers processing
4. **`GET /v2/vault/status`** → poll until `status` is `Synced` (for the slow tail)

```bash theme={null}
curl --request POST \
  --url 'https://api.linqalpha.com/v2/vault/presigned_url' \
  --header 'X-API-KEY: <api-key>' \
  --header 'Content-Type: application/json' \
  --data '{"file_name":"Q4_report.pdf","content_type":"application/pdf","workspace":"personal"}'
```

<Note>The presigned URL is single-use and expires after \~10 minutes. The `PUT` request's `Content-Type` must match the `content_type` you sent here.</Note>


## OpenAPI

````yaml POST /v2/vault/presigned_url
openapi: 3.0.1
info:
  title: LinqAlpha API
  description: >-
    Linq helps finance professionals make informed decisions using
    Retrieval-Augmented Generation (RAG)-enhanced answers. By leveraging
    cutting-edge Large Language Models (LLM) and supplementary technology, Linq
    provides the most optimized responses based on your queries.
  version: 1.0.0
  license:
    name: MIT
servers:
  - url: https://api.linqalpha.com
security:
  - ApiKeyAuth: []
tags:
  - name: Search
    description: Search and generate responses
  - name: Data
    description: Data retrieval and mapping
  - name: Feedback
    description: Conversation feedback
  - name: RMS
    description: Research Management System
  - name: Source Management
    description: Source batch and file management
  - name: MCP
    description: >-
      LinqAlpha MCP — Financial data tools for AI assistants via Model Context
      Protocol
  - name: Connectors
    description: Customer Connectors — customer-owned MCP connector management
  - name: Briefing
    description: Briefing Agent — automated market briefings with scheduling and delivery
  - name: Status
    description: Sync status — check organization, document, and container sync progress
paths:
  /v2/vault/presigned_url:
    post:
      tags:
        - Vault
      summary: Vault — Get Upload URL
      description: >-
        Step 1 of the Vault upload flow. Returns a single-use presigned upload
        (PUT) URL. Upload the file directly to that URL, then register it via
        POST /v2/vault/confirm.
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/VaultPresignedUrlRequest'
            example:
              file_name: Q4_report.pdf
              content_type: application/pdf
              workspace: personal
      responses:
        '200':
          description: Presigned upload URL generated
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/VaultPresignedUrlResponse'
              example:
                presigned_url: https://<presigned-upload-host>/.../<hash>.pdf?...
                file_key: development/data-original/<hash>.pdf
                document_id: 3a5b47d5-124e-4052-9fa6-0647ddcb1d97
                expiration_seconds: 600
        '400':
          description: Bad request — missing/invalid fields
        '401':
          description: Unauthorized — invalid or missing API key
components:
  schemas:
    VaultPresignedUrlRequest:
      type: object
      required:
        - file_name
        - content_type
      properties:
        file_name:
          type: string
          description: Original file name (with extension).
          example: Q4_report.pdf
        content_type:
          type: string
          description: MIME type of the file.
          example: application/pdf
        workspace:
          type: string
          enum:
            - personal
            - organization
          default: personal
          description: >-
            Vault scope the document is uploaded into. Must match between
            presigned_url and confirm. Note: the analytics SSE search must use
            the same workspace to retrieve the document.
        organization_id:
          type: string
          format: uuid
          description: Organization ID (optional).
        user_id:
          type: string
          format: uuid
          description: User id (optional).
        user_email:
          type: string
          format: email
          description: User email (optional).
        user_name:
          type: string
          description: User name (optional).
    VaultPresignedUrlResponse:
      type: object
      properties:
        presigned_url:
          type: string
          format: uri
          description: >-
            Single-use presigned upload (PUT) URL. Upload the file body via PUT
            with header Content-Type matching the request content_type.
        file_key:
          type: string
          description: Server-generated file key. Pass back to POST /v2/vault/confirm.
        document_id:
          type: string
          description: Document id for this upload. Pass back to confirm.
        expiration_seconds:
          type: integer
          example: 600
  securitySchemes:
    ApiKeyAuth:
      type: apiKey
      in: header
      name: X-API-KEY

````