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

# file.upload

> Creates a file record and returns a presigned upload URL. Upload the file content to the returned `upload_url` via PUT before it expires. Then use the `file.id` as `file_id` in [task.create](https://open.manus.ai/docs/v2/task.create) or [task.sendMessage](https://open.manus.ai/docs/v2/task.sendMessage) message content.

<sup>Questions or issues? Contact us at [api-support@manus.ai](mailto:api-support@manus.ai).</sup>

<Tip>
  **OAuth scope:** `create_task` or `manage_all_tasks` — see the [Open App](https://open.manus.ai/docs/v2/open-app) guide.
</Tip>

<Tip>
  **Upload:** Send file content to the returned `upload_url` via PUT request.

  **Use in tasks:** Pass the `file.id` as `file_id` in [task.create](https://open.manus.ai/docs/v2/task.create) or [task.sendMessage](https://open.manus.ai/docs/v2/task.sendMessage) message content.

  **Expiration:** The `upload_url` expires in 3 minutes. Files are automatically deleted 48 hours after upload.
</Tip>

<Tip>
  **Limits:** Up to **512 MB** per file and **10 GB** total storage per account. Exceeding either limit returns a `QuotaExceededError`. Executable and script file types (e.g. `.exe`, `.sh`, `.bat`, `.dmg`) are not allowed.
</Tip>


## OpenAPI

````yaml POST /v2/file.upload
openapi: 3.1.0
info:
  title: Manus OpenAPI v2
  description: >-
    API for integrating Manus into your workflow. All responses are wrapped with
    {"ok": true, "request_id": "...", ...} for success and {"ok": false,
    "request_id": "...", "error": {"code": "...", "message": "..."}} for errors.
  version: 2.0.0
servers:
  - url: https://api.manus.ai
security:
  - ApiKeyAuth: []
paths:
  /v2/file.upload:
    post:
      summary: UploadFile
      description: >-
        Creates a file record and returns a presigned upload URL. Upload the
        file content to the returned `upload_url` via PUT before it expires.
        Then use the `file.id` as `file_id` in
        [task.create](https://open.manus.ai/docs/v2/task.create) or
        [task.sendMessage](https://open.manus.ai/docs/v2/task.sendMessage)
        message content.
      operationId: openapi.v2.OpenapiV2Service.UploadFile
      parameters:
        - name: x-manus-api-key
          in: header
          required: false
          schema:
            type: string
          description: >-
            API key for direct authentication. Provide either this or
            `Authorization`, not both. See
            [Authentication](https://open.manus.ai/docs/v2/authentication).
        - name: Authorization
          in: header
          required: false
          schema:
            type: string
            example: Bearer {access_token}
          description: >-
            OAuth2 access token in `Bearer {token}` format. Provide either this
            or `x-manus-api-key`, not both. See the [Open
            App](https://open.manus.ai/docs/v2/open-app) guide.
      requestBody:
        required: true
        content:
          application/json:
            schema:
              type: object
              properties:
                filename:
                  type: string
                  description: >-
                    Name of the file to upload, including extension (e.g.,
                    "report.pdf", "data.csv"). The extension helps determine the
                    file type.
              required:
                - filename
      responses:
        '200':
          description: File record created successfully.
          content:
            application/json:
              schema:
                type: object
                properties:
                  ok:
                    type: boolean
                    example: true
                    description: Whether the request was successful.
                  request_id:
                    type: string
                    description: Unique identifier for this API request.
                  file:
                    $ref: '#/components/schemas/File'
                    description: >-
                      The created file record. Status will be pending until the
                      upload completes.
                  upload_url:
                    type: string
                    description: >-
                      Presigned S3 URL for uploading the file content. Send a
                      PUT request with the file bytes as the body. Expires in 3
                      minutes.
                  upload_expires_at:
                    type: integer
                    format: int64
                    description: >-
                      Unix timestamp (seconds) when the upload_url expires.
                      Complete the upload before this time.
        4XX:
          description: Error response.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
      security: []
components:
  schemas:
    File:
      type: object
      description: Basic file information returned in lists and upload responses.
      properties:
        id:
          type: string
          description: >-
            Unique identifier for the file. Use this as file_id when attaching
            to tasks.
        filename:
          type: string
          description: Name of the file.
        status:
          type: string
          enum:
            - pending
            - uploaded
            - deleted
            - error
          description: >-
            File status. "pending" — waiting for upload. "uploaded" — ready to
            use. "deleted" — file has been deleted. "error" — upload failed.
        created_at:
          type: integer
          format: int64
          description: Unix timestamp (seconds) when the file record was created.
    ErrorResponse:
      type: object
      description: Standard error response format returned when a request fails.
      properties:
        ok:
          type: boolean
          example: false
          description: Always false for error responses.
        request_id:
          type: string
          description: >-
            Unique identifier for this API request, useful for debugging with
            support.
        error:
          type: object
          description: Error details.
          properties:
            code:
              type: string
              description: >-
                Machine-readable error code (e.g., "invalid_argument",
                "not_found", "permission_denied", "rate_limited").
            message:
              type: string
              description: Human-readable error description explaining what went wrong.
  securitySchemes:
    ApiKeyAuth:
      type: apiKey
      in: header
      name: x-manus-api-key

````