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

# Get PDF upload URL

> Generate a signed URL for direct PDF upload. Use the returned gcs_path in POST /v2/sources.



## OpenAPI

````yaml /openapi-docs.yaml post /sources/upload-url
openapi: 3.1.0
info:
  title: Nia AI API
  version: 1.1.0
  description: >-
    Nia AI API provides a single, consistent `sources` resource for all indexed
    content.


    ## Core Resources


    **Sources** (`/sources`)

    - `repository`

    - `documentation`

    - `research_paper`

    - `huggingface_dataset`

    - `local_folder`


    **Search** (`/search`)

    - `mode`: query | web | deep | universal


    Legacy endpoints are deprecated and will be removed in a future version.
    Prefer `/sources` and `/search` for new integrations.
servers:
  - url: https://apigcp.trynia.ai/v2
    description: Production API
  - url: http://localhost:8000/v2
    description: Local development
security:
  - ApiKeyAuth: []
tags:
  - name: Auth
    description: API-first signup, login, and API key bootstrapping
  - name: Sources
    description: >-
      Unified source management (repositories, documentation, papers, datasets,
      local folders)
  - name: Search
    description: Unified search endpoint with mode discriminator
  - name: Context Sharing
    description: Cross-agent context management and retrieval
  - name: Categories
    description: Category management for organizing indexed sources
  - name: GitHub Search
    description: Live GitHub search and repository exploration
  - name: Advisor
    description: Context-aware code advisor against indexed documentation
  - name: Dependencies
    description: Dependency analysis and documentation subscription
  - name: Usage
    description: Usage tracking and bulk operations
paths:
  /sources/upload-url:
    post:
      tags:
        - Sources
      summary: Get PDF upload URL
      description: >-
        Generate a signed URL for direct PDF upload. Use the returned gcs_path
        in POST /v2/sources.
      operationId: create_source_upload_url_v2_sources_upload_url_post
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/SourceUploadUrlRequest'
        required: true
      responses:
        '200':
          description: Successful Response
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/SourceUploadUrlResponse'
        '422':
          description: Validation Error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/HTTPValidationError'
components:
  schemas:
    SourceUploadUrlRequest:
      properties:
        filename:
          type: string
          minLength: 1
          title: Filename
          description: Original filename (used for storage object naming)
        content_type:
          type: string
          title: Content Type
          description: MIME type for upload (PDF, CSV, TSV, XLS, XLSX)
          default: application/pdf
      type: object
      required:
        - filename
      title: SourceUploadUrlRequest
    SourceUploadUrlResponse:
      properties:
        upload_url:
          type: string
          title: Upload Url
          description: Signed URL for direct upload (HTTP PUT)
        gcs_path:
          type: string
          title: Gcs Path
          description: GCS path to pass to create-source payload
        expires_in_seconds:
          type: integer
          title: Expires In Seconds
          description: Signed URL expiration in seconds
      type: object
      required:
        - upload_url
        - gcs_path
        - expires_in_seconds
      title: SourceUploadUrlResponse
    HTTPValidationError:
      properties:
        detail:
          items:
            $ref: '#/components/schemas/ValidationError'
          type: array
          title: Detail
      type: object
      title: HTTPValidationError
    ValidationError:
      properties:
        loc:
          items:
            anyOf:
              - type: string
              - type: integer
          type: array
          title: Location
        msg:
          type: string
          title: Message
        type:
          type: string
          title: Error Type
      type: object
      required:
        - loc
        - msg
        - type
      title: ValidationError
  securitySchemes:
    ApiKeyAuth:
      type: http
      scheme: bearer
      bearerFormat: API Key
      description: API key must be provided in the Authorization header

````