> ## 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.

# project.addFile

> Copies a file uploaded with [file.upload](https://open.manus.ai/docs/v2/file.upload) into persistent project storage and attaches it to the project so it is available to all tasks in that project. Each project holds at most 199 resources (files and web links combined). The source `file_id` is not consumed.

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

> [!TIP]
>
> **Auth:**
>
> * **API Key:** Full access.
> * **Standard OAuth client:** Requires `manage_all_tasks`. `create_project` alone is not sufficient.
> * **Trusted client:** Full access.
>
> The user must own the project or be a project member with edit permission.

## Upload flow

1. Call [file.upload](https://open.manus.ai/docs/v2/file.upload.md) with the file's name, then `PUT` the file bytes to the returned `upload_url`.
2. After the `PUT` completes, call `project.addFile` with `project_id` and the returned `file.id`. Pass `filename` only if you want to override the display name stored in the project.

The uploaded bytes are copied into persistent project storage so the file remains available in all tasks under the project after the 48-hour `file.upload` expiration window. The source `file_id` is not consumed: it expires on its normal schedule, and deleting it with [file.delete](https://open.manus.ai/docs/v2/file.delete.md) does not affect the project file.

## Limits and rules

* **File size and type:** Inherits [file.upload](https://open.manus.ai/docs/v2/file.upload.md) limits (up to **512 MB**; executable and script extensions are prohibited). Any overridden `filename` must be 1–255 characters, include an allowed file extension, and must not contain path separators (`/`, `\`), `?`, `#`, or control characters.
* **Project resource limit:** Each project holds at most **199** resources in total (files and web links combined). Exceeding the cap returns `429 resource_exhausted`.
* **Web links:** This endpoint attaches files only; managing project web links is not supported via OpenAPI.

## Errors

| Status | Cause |
| - | - |
| `400 invalid_argument` | `project_id` or `file_id` is missing; `file_id` does not exist, belongs to another user, is not yet uploaded, or failed size verification; or `filename` is invalid or uses a prohibited extension. |
| `403 permission_denied` | The user can view the project but cannot edit it, or a Standard OAuth client lacks `manage_all_tasks`. |
| `404 not_found` | The project does not exist or the user is not a member. |
| `429 resource_exhausted` | The project already has 199 resources, or the `project.addFile` rate limit was exceeded; see [Rate Limits](https://open.manus.ai/docs/v2/rate-limits.md). Check `error.message` before retrying. |
| `503 unavailable` | Temporary object storage error while copying the file; retry with backoff. |


## OpenAPI

````yaml POST /v2/project.addFile
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/project.addFile:
    post:
      summary: AddProjectFile
      description: >-
        Copies a file uploaded with
        [file.upload](https://open.manus.ai/docs/v2/file.upload) into persistent
        project storage and attaches it to the project so it is available to all
        tasks in that project. Each project holds at most 199 resources (files
        and web links combined). The source `file_id` is not consumed.
      operationId: openapi.v2.OpenapiV2Service.AddProjectFile
      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. An OAuth client
            requires the `manage_all_tasks` scope unless it is a `Trusted team
            client` or `Trusted public client`; `create_project` alone is not
            sufficient. 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:
                project_id:
                  type: string
                  minLength: 1
                  maxLength: 65
                  description: >-
                    The unique identifier of the target project. Use
                    [project.list](https://open.manus.ai/docs/v2/project.list)
                    to get project IDs.
                file_id:
                  type: string
                  minLength: 1
                  maxLength: 64
                  description: >-
                    ID of a file uploaded with
                    [file.upload](https://open.manus.ai/docs/v2/file.upload).
                    The file must belong to the authenticated user and have
                    status `uploaded`.
                filename:
                  type: string
                  minLength: 1
                  maxLength: 255
                  description: >-
                    Optional display filename override (1–255 characters). Must
                    include an allowed file extension and cannot contain `/`,
                    `\`, `?`, `#`, or control characters. Defaults to the
                    filename used in `file.upload`.
              required:
                - project_id
                - file_id
      responses:
        '200':
          description: Project file added 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/ProjectFile'
                    description: The project file created by this request.
                required:
                  - ok
                  - request_id
                  - file
        4XX:
          description: Error response.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
      security: []
components:
  schemas:
    ProjectFile:
      type: object
      properties:
        id:
          type: string
          description: Unique project file identifier.
        filename:
          type: string
          description: Display filename stored in the project.
        bytes:
          type: string
          pattern: ^[0-9]+$
          example: '1024'
          description: File size in bytes, encoded as a decimal string. Omitted when 0.
        created_at:
          type: string
          pattern: ^[0-9]+$
          example: '1732512000'
          description: >-
            Unix timestamp (seconds) when the file was added to the project,
            encoded as a decimal string.
      required:
        - id
        - filename
        - created_at
    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

````

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