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

# Refresh External Content PDF Upload URL

> Issues a 600-second presigned PUT URL for an existing active PDF source without changing articles, extracted content, metadata, timestamps, or attachment history. The API key must belong to the target organization or its platform. Upload with Content-Type: application/pdf. Missing or invalid sources return an error; never retry using content ingestion. Successful URL issuance does not confirm PDF upload or customer delivery. Error messages use fixed public descriptions and never include upstream response bodies.

Recover a missing PDF attachment for an existing external content source using its organization, source type, and content date.

Pass `source_type` exactly as registered. Refresh does not trim or otherwise normalize this identity.
Both ingestion and refresh require a valid calendar `content_date` in `YYYY-MM-DD` format, with a year from 0001 to 9999. Impossible dates and year 0000 return HTTP 400 at the Public API validation boundary.

The endpoint preserves the source's articles, extracted text, metadata, timestamps, and attachment history. It returns a presigned PUT URL for the existing stored PDF key, valid for 600 seconds. Upload the PDF with `Content-Type: application/pdf`.

The source must already exist, be active, and have a PDF key. The API key must belong to the target organization or its platform. A missing source or failed refresh returns an error; clients must not retry through the content ingestion endpoint because ingestion replaces article content.

Authentication, authorization, missing-source, and validation failures return HTTP 401, 403, 404, and 422 respectively. Upstream server failures, network errors, and timeouts return HTTP 503 and can be retried with bounded backoff.

An unavailable upstream refresh route also returns HTTP 404. Error messages use fixed public descriptions and do not include upstream response bodies.

A successful refresh confirms that an upload URL was issued. Verify the subsequent PUT succeeds before marking the PDF uploaded; this endpoint does not confirm customer delivery.


## OpenAPI

````yaml POST /v1/external_content/refresh_upload_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:
  /v1/external_content/refresh_upload_url:
    post:
      tags:
        - Briefing
      summary: Refresh an existing external content PDF upload URL
      description: >-
        Issues a 600-second presigned PUT URL for an existing active PDF source
        without changing articles, extracted content, metadata, timestamps, or
        attachment history. The API key must belong to the target organization
        or its platform. Upload with Content-Type: application/pdf. Missing or
        invalid sources return an error; never retry using content ingestion.
        Successful URL issuance does not confirm PDF upload or customer
        delivery. Error messages use fixed public descriptions and never include
        upstream response bodies.
      operationId: refreshExternalContentPdfUploadUrl
      requestBody:
        required: true
        content:
          application/json:
            schema:
              type: object
              required:
                - organization_id
                - source_type
                - content_date
              properties:
                organization_id:
                  type: string
                  format: uuid
                source_type:
                  type: string
                  minLength: 1
                  example: bloomberg_market_wrap
                  description: >-
                    Exact source type as registered; refresh does not trim or
                    otherwise normalize this identity.
                content_date:
                  type: string
                  format: date
                  pattern: ^(?!0000)[0-9]{4}-[0-9]{2}-[0-9]{2}$
                  description: >-
                    Valid calendar date in YYYY-MM-DD format; years 0001 through
                    9999 are supported.
                  example: '2026-09-04'
      responses:
        '200':
          description: >-
            Upload URL issued. Check error is null and payload.upload_url exists
            before uploading.
          content:
            application/json:
              schema:
                type: object
                required:
                  - error
                  - payload
                properties:
                  error:
                    type: object
                    nullable: true
                    properties:
                      code:
                        type: string
                      msg:
                        type: string
                      message:
                        type: string
                  payload:
                    type: object
                    required:
                      - id
                      - organization_id
                      - source_type
                      - content_date
                      - status
                      - pdf_file_key
                      - file_extension
                      - upload_url
                    properties:
                      id:
                        type: string
                        format: uuid
                      organization_id:
                        type: string
                        format: uuid
                      source_type:
                        type: string
                      content_date:
                        type: string
                        format: date
                      status:
                        type: string
                        enum:
                          - active
                      pdf_file_key:
                        type: string
                      file_extension:
                        type: string
                        enum:
                          - pdf
                      upload_url:
                        type: string
                        format: uri
                        description: >-
                          Presigned PUT URL; expires in 600 seconds and requires
                          Content-Type: application/pdf.
        '400':
          description: Invalid or missing organization, source type, or content date.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ApiErrorResponse'
        '401':
          description: API key authentication failed.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ApiErrorResponse'
        '403':
          description: API key cannot access the target organization.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ApiErrorResponse'
        '404':
          description: >-
            No active matching source exists, or the upstream refresh endpoint
            is unavailable.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ApiErrorResponse'
        '422':
          description: Invalid content date or source is not a PDF with a stored key.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ApiErrorResponse'
        '503':
          description: >-
            Upload URL temporarily unavailable: upstream server failure,
            timeout, or network error. Retry with bounded backoff.
          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

````