# Create external file

```http
POST /projects/{project_reference}/external-files/{provider}
```

Create external file.

## Parameters

| Name                | In     | Required | Description                                                |
| ------------------- | ------ | -------- | ---------------------------------------------------------- |
| `project_reference` | path   | Yes      | Project slug, UUID, or domain that identifies the project. |
| `provider`          | path   | Yes      |                                                            |
| `idempotency-key`   | header |          |                                                            |

## Request body

| Field              | Type   | Required | Description                                                                                                                                                                                                          |
| ------------------ | ------ | -------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| `folder_id`        | string | Yes      | Folder item ID, or `root`. SharePoint uses `sp-site:{siteId}` for a site and `{siteId}\|{itemId}` inside one.                                                                                                        |
| `name`             | string | Yes      | File name, 1-255 characters without a slash. Creates a new file without replacing an existing one. OneDrive and SharePoint return conflict for an existing name; Google Drive creates a new item with the same name. |
| `content`          | string | Yes      | File content, at most 10000000 characters as sent.                                                                                                                                                                   |
| `content_encoding` | string |          | Encoding of content: `utf8` (default) or `base64`.                                                                                                                                                                   |
| `mime_type`        | string |          | MIME type. Defaults from the name, else text/plain (utf8) or application/octet-stream (base64).                                                                                                                      |

## Responses

| Status | Description           |
| ------ | --------------------- |
| 201    | The created file.     |
| 400    | Bad request           |
| 401    | Unauthorized          |
| 402    | Payment required      |
| 403    | Forbidden             |
| 404    | Not found             |
| 409    | Conflict              |
| 413    | Payload too large     |
| 428    | Precondition required |
| 429    | Rate limit exceeded   |
| 500    | Server error          |
| 503    | Service unavailable   |
