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

# Upload Drive File

> Upload a file into a drive path. Max file size 100MB. Content type is preserved as provided.



## OpenAPI

````yaml openapi.json post /drives/{driveId}/items
openapi: 3.1.0
info:
  title: Ag.dev API
  description: Public API for Ag.dev
  version: 0.1.0
servers:
  - url: https://api.ag.dev/v0.1
security: []
tags:
  - name: Agents
    description: Agent management and configuration
  - name: Runs
    description: Agent run execution and monitoring
  - name: Versioning
    description: Agent versioning, revisions, and publishing
  - name: MCP Servers
    description: MCP server management and tool discovery
  - name: Settings
    description: Organization settings and API keys
  - name: Users
    description: User information and authentication
  - name: Drives
    description: Drive management and file operations
  - name: Webhooks
    description: Webhook health checks
paths:
  /drives/{driveId}/items:
    post:
      tags:
        - Drives
      summary: Upload Drive File
      description: >-
        Upload a file into a drive path. Max file size 100MB. Content type is
        preserved as provided.
      parameters:
        - name: driveId
          in: path
          required: true
          schema:
            type: string
            description: Drive ID
      requestBody:
        required: true
        content:
          multipart/form-data:
            schema:
              type: object
              properties:
                path:
                  type: string
                  pattern: ^/(?!.*(?:^|/)\.\.(?:/|$)).*$
                  description: >-
                    Destination path for the uploaded file. Must start with "/"
                    and must not include ".." segments
                file:
                  type: string
                  format: binary
                  description: >-
                    File contents (max 100MB). Content type is preserved as
                    provided.
              required:
                - path
                - file
      responses:
        '200':
          description: Uploaded file details
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/DriveFileItem'
        '400':
          description: Invalid request data
        '401':
          description: Authentication required
        '404':
          description: Drive not found
      security:
        - ApiKeyAuth: []
components:
  schemas:
    DriveFileItem:
      type: object
      properties:
        kind:
          type: string
          enum:
            - file
          description: Item type
        id:
          type: string
          description: File ID
        name:
          type: string
          description: File name
        path:
          type: string
          description: File path
        status:
          type: string
          enum:
            - processing
            - ready
            - error
          description: File processing status
        modifiedAt:
          type: string
          format: date-time
          description: Last modified timestamp
        size:
          type: number
          description: File size
        contentType:
          type: string
          description: File content type
        description:
          type:
            - string
            - 'null'
          description: File description
        summary:
          type:
            - string
            - 'null'
          description: File summary
        metadata:
          type: object
          description: Additional file metadata
      required:
        - kind
        - id
        - name
        - path
        - status
        - modifiedAt
  securitySchemes:
    ApiKeyAuth:
      type: apiKey
      in: header
      name: X-API-Key
      description: 'Provide either X-API-Key: <key> or Authorization: Bearer <key>'

````