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

# Upload a file

> Multipart upload (field `file`, max 25 MB). Returned URLs are signed and expire — attach them to a message promptly and never persist them. Idempotency-Key is not supported on multipart uploads (re-uploading is safe: every upload mints a fresh URL).



## OpenAPI

````yaml /openapi/s2s-openapi.json post /s2s/uploads
openapi: 3.0.0
info:
  title: Gleap Server-to-Server Conversations API
  version: '2026-08-01'
  description: >-
    Headless access to Gleap conversations: contacts, conversations, messages,
    workflows, uploads, webhooks and the realtime stream — authenticated with
    your project's service account token.
servers:
  - url: https://api.gleap.io/v3
security: []
paths:
  /s2s/uploads:
    post:
      tags:
        - S2S Uploads
      summary: Upload a file
      description: >-
        Multipart upload (field `file`, max 25 MB). Returned URLs are signed and
        expire — attach them to a message promptly and never persist them.
        Idempotency-Key is not supported on multipart uploads (re-uploading is
        safe: every upload mints a fresh URL).
      operationId: S2SUpload
      requestBody:
        required: true
        content:
          multipart/form-data:
            schema:
              type: object
              properties:
                file:
                  type: string
                  format: binary
              required:
                - file
      responses:
        '201':
          description: Stored
          content:
            application/json:
              schema:
                type: object
                properties:
                  url:
                    type: string
                  name:
                    type: string
                  size:
                    type: number
                  contentType:
                    type: string
        '401':
          description: Missing, invalid or revoked service account token.
          content:
            application/problem+json:
              schema:
                $ref: '#/components/schemas/Problem'
        '404':
          description: The addressed resource does not exist in this project.
          content:
            application/problem+json:
              schema:
                $ref: '#/components/schemas/Problem'
        '413':
          description: File exceeds the 25 MB limit.
          content:
            application/problem+json:
              schema:
                $ref: '#/components/schemas/Problem'
        '422':
          description: Idempotency-Key reuse with a different request body.
          content:
            application/problem+json:
              schema:
                $ref: '#/components/schemas/Problem'
        '429':
          description: Rate limit exceeded — honor the Retry-After header.
          content:
            application/problem+json:
              schema:
                $ref: '#/components/schemas/Problem'
        default:
          description: >-
            Any other error, including validation_failed (400) and
            internal_error (500).
          content:
            application/problem+json:
              schema:
                $ref: '#/components/schemas/Problem'
      security:
        - s2s: []
components:
  schemas:
    Problem:
      type: object
      description: >-
        RFC 9457 problem details — every error response uses this shape
        (application/problem+json).
      properties:
        type:
          type: string
          example: https://docs.gleap.io/s2s/problems/conversation_closed
        title:
          type: string
        status:
          type: number
        code:
          type: string
          example: conversation_closed
        detail:
          type: string
        request_id:
          type: string
          example: req_66c0ffee0000000000000001
      required:
        - type
        - title
        - status
        - code
  securitySchemes:
    s2s:
      type: http
      scheme: bearer
      bearerFormat: Service account token (JWT)

````