---
title: "Upload documentation files"
method: POST
path: "/v2/add/file-upload"
tags: ["Add Library"]
---

# Upload documentation files

`POST /v2/add/file-upload`

## Request

- Base URL: `https://context7.com/api`
- URL: `https://context7.com/api/v2/add/file-upload`
- Auth: HTTP bearer

Upload one or more PDF or DOCX files as one library. Supports up to 50 files, 50MB per file, and 200MB total.

## Request body `multipart/form-data`

- object
  - `documentFiles` string[], required: PDF and DOCX documents
  - `collectionName` string: Name for the file collection
  - `relativePaths` string: JSON array of paths corresponding to documentFiles
  - `projectTitle` string: Custom title for the library
  - `description` string: Description of the library
  - `force` 'true': Set to 'true' to force reprocessing

## Response `200`

Library submitted successfully for processing

- AddLibraryResponse: Response after successfully submitting a library
  - `libraryName` string, required: The library identifier assigned — the URL path of the library on context7.com. `/owner/repo` for GitHub repositories, or `/<source>/<id>` for other sources (e.g., `/vercel/next.js`, `/websites/uploadcare_com`). See [Library ID format](/api-guide#library-id-format).
  - `version` string: Only for websites: the version the URL was added as, when it is a version of an existing library. Request it as `<libraryName>/<version>`.
  - `message` string, required: Human-readable success message

## Other responses

- `400`: Bad Request - Invalid input parameters
- `401`: Unauthorized - Invalid or missing API key
- `403`: Forbidden - Insufficient permissions or plan restrictions
- `409`: Conflict - Resource already exists
- `500`: Internal Server Error
- `504`: Gateway Timeout - Processing timed out waiting for logs

## Changes

- **2026-10-26** `86c04930b016`: 1 info
  - added the optional property `version` to the response with the `200` status
- **2026-09-15** `912d4713d58c`: 1 info
  - endpoint added

[Operation history](https://skmtc.dev/context7/apis/context7-public-api/changes/v2/add/file-upload/post.md)

---

[API](https://skmtc.dev/context7/apis/context7-public-api.md) - [All operations](https://skmtc.dev/context7/apis/context7-public-api/llms.txt) - [OpenAPI document](https://skmtc.dev/context7/apis/context7-public-api/revisions/945f7834fa8c?raw)
