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

# Create a presigned upload URL

> Create a presigned S3 PUT URL for one file. Upload the raw bytes to the returned url with an HTTP PUT and no Authorization header; the body must be exactly the declared size. Then trigger POST /v1/files/index to make the file searchable via /v1/search with scope.indexes ["workspace"].



## OpenAPI

````yaml /api-reference/openapi.json post /v1/files/presign
openapi: 3.1.0
info:
  description: >-
    Local implementation of the v1 search, document, feedback, and internal
    operational APIs.
  title: Agent Search API (Public)
  version: 0.1.0
servers:
  - description: Staging
    url: https://alpha.api.trycaesar.com
  - description: Local development
    url: http://localhost:8080
security: []
tags:
  - description: Public search APIs.
    name: Search
  - description: Public document inspection APIs.
    name: Documents
  - description: Public feedback ingestion APIs.
    name: Feedback
  - description: Asynchronous deep-research APIs.
    name: Research
  - description: Internal health, readiness, and metrics APIs.
    name: Operations
paths:
  /v1/files/presign:
    post:
      tags:
        - Files
      summary: Create a presigned upload URL
      description: >-
        Create a presigned S3 PUT URL for one file. Upload the raw bytes to the
        returned url with an HTTP PUT and no Authorization header; the body must
        be exactly the declared size. Then trigger POST /v1/files/index to make
        the file searchable via /v1/search with scope.indexes ["workspace"].
      operationId: presign-file-upload
      parameters:
        - description: Optional client session identifier.
          in: header
          name: X-Session-ID
          schema:
            description: Optional client session identifier.
            type: string
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/FilePresignRequest'
        required: true
      responses:
        '200':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/FilePresignResponse'
          description: Presigned upload URL.
        '400':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorEnvelope'
          description: Validation error.
        '401':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorEnvelope'
          description: Missing or invalid API key.
        '403':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorEnvelope'
          description: API key does not have the required scope.
        '413':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorEnvelope'
          description: File exceeds the size limit.
        '415':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorEnvelope'
          description: Unsupported file type.
        '429':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorEnvelope'
          description: Rate limited.
        '502':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorEnvelope'
          description: File service unreachable.
        '503':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorEnvelope'
          description: File endpoints are not configured.
      security:
        - bearerApiKey: []
components:
  schemas:
    FilePresignRequest:
      additionalProperties: false
      properties:
        $schema:
          description: A URL to the JSON Schema for this object.
          examples:
            - https://alpha.api.trycaesar.com/FilePresignRequest.json
          format: uri
          readOnly: true
          type: string
        content_type:
          description: Optional MIME type recorded on the object.
          maxLength: 255
          type: string
        filename:
          description: >-
            Filename to upload. Sanitized server-side; the response echoes the
            stored name.
          maxLength: 512
          minLength: 1
          type: string
        size:
          description: >-
            Exact file size in bytes. The presigned URL binds this length, so
            the PUT body must match it.
          format: int64
          minimum: 0
          type: integer
      required:
        - filename
        - size
      type: object
    FilePresignResponse:
      additionalProperties: false
      properties:
        $schema:
          description: A URL to the JSON Schema for this object.
          examples:
            - https://alpha.api.trycaesar.com/FilePresignResponse.json
          format: uri
          readOnly: true
          type: string
        expires_in_seconds:
          description: Seconds until the presigned URL expires.
          format: int64
          type: integer
        max_object_bytes:
          description: Per-file upload size limit in bytes.
          format: int64
          type: integer
        name:
          description: Sanitized filename the upload will be stored and listed under.
          type: string
        url:
          description: >-
            Presigned S3 PUT URL. Upload the raw file bytes to this URL with an
            HTTP PUT (no Authorization header); the body must be exactly the
            declared size.
          type: string
      required:
        - url
        - name
        - expires_in_seconds
        - max_object_bytes
      type: object
    ErrorEnvelope:
      additionalProperties: false
      properties:
        $schema:
          description: A URL to the JSON Schema for this object.
          examples:
            - https://alpha.api.trycaesar.com/ErrorEnvelope.json
          format: uri
          readOnly: true
          type: string
        error:
          $ref: '#/components/schemas/ErrorBody'
          description: Error details.
        request_id:
          description: Server request identifier.
          type: string
        type:
          description: Envelope discriminator.
          enum:
            - error
          type: string
      required:
        - type
        - request_id
        - error
      type: object
    ErrorBody:
      additionalProperties: false
      properties:
        code:
          description: Stable machine-readable error code.
          type: string
        details:
          additionalProperties: {}
          description: Optional structured error details.
          type: object
        message:
          description: Human-readable error message.
          type: string
      required:
        - code
        - message
      type: object
  securitySchemes:
    bearerApiKey:
      bearerFormat: API key
      scheme: bearer
      type: http

````