> ## 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 a drive upload permission

> First step of a file upload to a drive. Returns a presigned url and form fields. Upload the file to that url, a storage host, as multipart/form-data with the fields. Do not send x-cominty-token to the storage host. filename cannot contain a slash. A drive holds at most 50 files: past that, the call returns 400 Too many files, or Too many pending files.



## OpenAPI

````yaml /openapi.json get /drives/{drive_pid}/upload
openapi: 3.1.0
info:
  title: Cominty API
  description: >-
    The HTTP API behind the Cominty Python SDK: chat and threads, memory, MCP
    integrations, agents, skills, document sources, and documents. Send your API
    key in the x-cominty-token header.
  version: main.5359267
servers:
  - url: https://ds.cominty.com
security:
  - comintyToken: []
paths:
  /drives/{drive_pid}/upload:
    get:
      tags:
        - drives
      summary: Get a drive upload permission
      description: >-
        First step of a file upload to a drive. Returns a presigned url and form
        fields. Upload the file to that url, a storage host, as
        multipart/form-data with the fields. Do not send x-cominty-token to the
        storage host. filename cannot contain a slash. A drive holds at most 50
        files: past that, the call returns 400 Too many files, or Too many
        pending files.
      operationId: get_file_upload_permission_drives__drive_pid__upload_get
      parameters:
        - name: drive_pid
          in: path
          required: true
          schema:
            type: string
            title: Drive Pid
          description: Identifier of the drive that receives the file.
        - 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
            pattern: ^[^/]+$
            title: Filename
          description: File name. It cannot contain a slash.
      responses:
        '200':
          description: Successful Response
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/UploadPermission'
        '422':
          description: Validation Error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/HTTPValidationError'
components:
  schemas:
    UploadPermission:
      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 send with the file to the storage URL.
      type: object
      required:
        - url
        - fields
      title: UploadPermission
    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.