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

# Get an upload permission

> First step of a file upload. Returns a presigned url and form fields. Upload the file to that url, a storage host rather than ds.cominty.com, as multipart/form-data. Do not send x-cominty-token to the storage host. filename is at most 255 characters and cannot contain a slash.



## OpenAPI

````yaml /openapi.json get /chat/files/upload
openapi: 3.1.0
info:
  title: cominty/cominty
  description: |

    ### Cominty Meta:

    ```json
    {
      "VERSION_TAG": "eng-997-add-organization-scoped-memory-namespaces.6928eb8",
      "VERSION_AT": "2026-10-07T14:46:28+02:00",
      "DEPLOYED_BY": "github-actions::elfominty",
      "DEPLOYED_AT": "2026-10-07T13:06:50Z",
      "AWS_SECRET_NAME": "cominty-monorepo-dev-python-api",
      "AWS_SECRET_VERSION": "3de071f4-5485-4bf2-a676-0f72bf7aa59f",
      "AWS_SECRET_REGION": "eu-west-3"
    }
    ```
  version: eng-997-add-organization-scoped-memory-namespaces.6928eb8
servers:
  - url: https://ds.cominty.com
security:
  - comintyToken: []
paths:
  /chat/files/upload:
    get:
      tags:
        - chat
        - chat
      summary: Get an upload permission
      description: >-
        First step of a file upload. Returns a presigned url and form fields.
        Upload the file to that url, a storage host rather than ds.cominty.com,
        as multipart/form-data. Do not send x-cominty-token to the storage host.
        filename is at most 255 characters and cannot contain a slash.
      operationId: get_file_upload_permission_chat_files_upload_get
      parameters:
        - name: mimetype
          in: query
          required: true
          schema:
            type: string
            title: Mimetype
          description: Media type of the file.
        - name: filename
          in: query
          required: true
          schema:
            type: string
            maxLength: 255
            pattern: ^[^/]+$
            title: Filename
          description: File name. At most 255 characters, and it cannot contain a slash.
      responses:
        '200':
          description: Successful Response
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/FileUploadPermission'
        '422':
          description: Validation Error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/HTTPValidationError'
components:
  schemas:
    FileUploadPermission:
      properties:
        url:
          type: string
          title: Url
          description: Storage URL to POST the file to. Do not send x-cominty-token there.
        fields:
          additionalProperties: true
          type: object
          title: Fields
          description: Form fields to include with the file in the storage upload.
      type: object
      required:
        - url
        - fields
      title: FileUploadPermission
    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
        input:
          title: Input
        ctx:
          type: object
          title: Context
      type: object
      required:
        - loc
        - msg
        - type
      title: ValidationError
  securitySchemes:
    comintyToken:
      type: apiKey
      in: header
      name: x-cominty-token
      description: >-
        A Cominty Platform API secret. A key created now starts with sk-cmt-.
        Send it as is, or as Bearer sk-cmt-..., with at most one Bearer prefix.
        A key created before the prefix existed has no sk-cmt- and still works.

````

This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.