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

# Presigned URL V2

> Generates a temporary presigned URL for secure access to a document file. Supports both external documents (filings, transcripts, news) and RMS documents (Third Bridge transcripts, internal notes, EDS content).

Use `search_type=rms` to access RMS documents. Default is `external` (same behavior as V1).

For platform API keys, pass `organization_id` to specify which org's documents to query. If omitted, defaults to the API key's primary organization.

Generate a temporary download URL for a single document. Supports both external documents (filings, transcripts) and RMS documents (internal notes, Third Bridge transcripts).

## Search Type

Use the `search_type` parameter to specify which document source to query:

| search\_type         | Source             | Document types                                                     |
| -------------------- | ------------------ | ------------------------------------------------------------------ |
| `external` (default) | External documents | SEC filings, earnings transcripts, IR slides, news                 |
| `rms`                | RMS documents      | User-uploaded notes, emails, Third Bridge transcripts, EDS content |

## Quick Start

```bash External document (default) theme={null}
curl --request GET \
  --url 'https://api.linqalpha.com/v2/documents/767d83c9-9990-460d-8725-06d9f1b699ce/presigned_url' \
  --header 'X-API-KEY: <api-key>'
```

```bash RMS document theme={null}
curl --request GET \
  --url 'https://api.linqalpha.com/v2/documents/88ca5d94f625ac981f8a4b93422073b7/presigned_url?search_type=rms&organization_id=b898130a-d85e-4610-939d-c415231df8b7' \
  --header 'X-API-KEY: <api-key>'
```

<Note>
  For platform API keys that access multiple organizations, pass `organization_id` to specify which org's documents to query. If omitted, defaults to the API key's primary organization.
</Note>

<Note>
  Download URLs expire after approximately 1 hour. Generate new URLs when needed.
</Note>


## OpenAPI

````yaml GET /v2/documents/{document_id}/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/documents/{document_id}/presigned_url:
    get:
      tags:
        - Data
      summary: Presigned URL V2
      description: >-
        Generates a temporary presigned URL for secure access to a document
        file. Supports both external documents (filings, transcripts, news) and
        RMS documents (Third Bridge transcripts, internal notes, EDS content).


        Use `search_type=rms` to access RMS documents. Default is `external`
        (same behavior as V1).


        For platform API keys, pass `organization_id` to specify which org's
        documents to query. If omitted, defaults to the API key's primary
        organization.
      parameters:
        - name: document_id
          in: path
          description: Document ID (from search/analytics references)
          required: true
          schema:
            type: string
        - name: search_type
          in: query
          description: >-
            Document source. `external` (default) returns external documents.
            `rms` returns documents from your Research Management System (RMS).
          required: false
          schema:
            type: string
            enum:
              - external
              - rms
            default: external
        - name: organization_id
          in: query
          description: >-
            Organization ID. Recommended for `search_type=rms` and required for
            platform API keys. If omitted, defaults to the API key's primary
            organization.
          required: false
          schema:
            type: string
      responses:
        '200':
          description: Presigned URL with document metadata
          content:
            application/json:
              schema:
                type: object
                properties:
                  error:
                    type: object
                    nullable: true
                  payload:
                    type: object
                    properties:
                      document_id:
                        type: string
                        description: Document ID
                      document_name:
                        type: string
                        nullable: true
                        description: >-
                          Document filename. Populated for RMS, null for
                          external.
                      presigned_url:
                        type: string
                        description: Temporary download URL
                      expiration_seconds:
                        type: integer
                        nullable: true
                        description: >-
                          URL validity in seconds. 3600 for RMS, null for
                          external.
              example:
                error: null
                payload:
                  document_id: 123e4567-e89b-12d3-a456-426614174000
                  document_name: document.pdf
                  presigned_url: https://example.s3.amazonaws.com/...
                  expiration_seconds: 3600
        '400':
          description: Bad Request
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ApiErrorResponse'
              example:
                error:
                  code: INVALID_REQUEST_BODY
                  msg: organization_id is required when search_type is rms
                  message: organization_id is required when search_type is rms
                payload: null
        '401':
          description: Unauthorized
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ApiErrorResponse'
components:
  schemas:
    ApiErrorResponse:
      type: object
      description: Standard error response wrapper
      properties:
        error:
          $ref: '#/components/schemas/ApiError'
        payload:
          description: Always null for error responses
          nullable: true
      required:
        - error
        - payload
    ApiError:
      type: object
      properties:
        code:
          type: string
          description: >-
            Error code indicating the type of error. Common codes:

            - Authentication: `API_KEY_MISSING`, `INVALID_API_KEY`

            - Validation: `INVALID_REQUEST_BODY`, `ORGANIZATION_ID_MISSING`,
            `TICKERS_MISSING`, `CHAT_MESSAGE_ID_MISSING`, `DOCUMENT_ID_MISSING`

            - Service: `SEARCH_FAIL`, `TTS_FAIL`, `CREATE_CONV_FAIL`,
            `GET_STOCK_FAIL`, `CREATE_MSG_FAIL`, `ALPHA_COMP_FAIL`,
            `GET_REF_FAIL`

            - Connectors: `CONNECTOR_LIST_FAIL`, `CONNECTOR_NOT_FOUND`,
            `CONNECTOR_CREATE_FAIL`, `CONNECTOR_UPDATE_FAIL`,
            `CONNECTOR_DELETE_FAIL`, `CONNECTOR_TEST_FAIL`

            - Not Found: `NOT_FOUND`
          example: INVALID_REQUEST_BODY
        msg:
          type: string
          description: Error message (deprecated, use `message` instead)
          example: query is required and must be a string
        message:
          type: string
          description: Error message providing more details about the error
          example: query is required and must be a string
      required:
        - code
  securitySchemes:
    ApiKeyAuth:
      type: apiKey
      in: header
      name: X-API-KEY

````