---
canonical_url: "https://docs.composio.dev/reference/api-reference/files/postFilesUploadRequest"
markdown_url: "https://docs.composio.dev/reference/api-reference/files/postFilesUploadRequest.md"
product: "platform"
version: "3.1"
last_updated: null
---

# Create presigned URL for request file upload to S3

**Documentation:** /reference/api-reference/files/postFilesUploadRequest

> **API version:** This page documents Composio REST API v3.1, the current version, at `https://backend.composio.dev/api/v3.1`. `https://backend.composio.dev/api/v3` is the previous version and remains supported.

Generates a presigned URL for uploading a file to S3. Every request returns a new file ID and storage key, including repeat uploads of the same file.

---

## POST `/api/v3.1/files/upload/request`

**Endpoint:** `https://backend.composio.dev/api/v3.1/files/upload/request`

**Summary:** Create presigned URL for request file upload to S3

Generates a presigned URL for uploading a file to S3. Every request returns a new file ID and storage key, including repeat uploads of the same file.

### Authentication

**ApiKeyAuth** - API Key in `header` header `x-api-key`

### Request Body

**Schema:**

- `toolkit_slug` (string) *(required)*: Slug of the app where this file belongs to. Example: "gmail", "slack", "github"
- `tool_slug` (string) *(required)*: Slug of the action where this file belongs to. Example: "GMAIL_SEND_EMAIL", "SLACK_UPLOAD_FILE"
- `filename` (string) *(required)*: Name of the original file. Example: "quarterly_report.pdf"
- `mimetype` (string) *(required)*: Mime type of the original file. Example: "application/pdf", "image/png"
- `md5` (string) *(required)*: MD5 hash of the file for integrity verification. Example: "a1b2c3d4e5f6a7b8c9d0e1f2a3b4c5d6"

**Example:**

```json
{
  "toolkit_slug": "string",
  "tool_slug": "string",
  "filename": "string",
  "mimetype": "string",
  "md5": "string"
}
```

### Responses

#### 200 - Successfully created upload URL for request file

**Response Schema:**

- `id` (string) *(required)*: ID of the request file. Example: "req_file_9mZn4qR8sXwT"
- `key` (string) *(required)*: Object storage upload location. Example: "projects/pr_1a2b3c4d5e6f/requests/slack/SLACK_UPLOAD_FILE/document_9mZn4q.docx"
- `new_presigned_url` (string) *(required)*: Presigned URL for upload. Example: "https://storage.composio.dev/projects/pr_1a2b3c4d5e6f/requests/slack/document_9mZn4q.docx?X-Amz-Algorithm=AWS4-HMAC-SHA256&X-Amz-Expires=3600..."
- `newPresignedUrl` (string) *(required)*: [DEPRECATED] Use new_presigned_url instead. Presigned URL for upload. Example: "https://storage.composio.dev/projects/pr_1a2b3c4d5e6f/requests/slack/document_9mZn4q.docx?X-Amz-Algorithm=AWS4-HMAC-SHA256&X-Amz-Expires=3600..."
- `type` (enum: "new") *(required)*: [DEPRECATED] Indicates this is a new file that needs to be uploaded
- `metadata` (object) *(required)*
  - `storage_backend` (enum: "s3" | "azure_blob_storage") *(required)*: Storage backend used for the file. If this is azure, use `x-ms-blob-type` header to set the blob type to `BlockBlob` while uploading the file

**Example Response:**

```json
{
  "id": "string",
  "key": "string",
  "new_presigned_url": "string",
  "newPresignedUrl": "string",
  "type": "new",
  "metadata": {
    "storage_backend": "s3"
  }
}
```

#### 400 - Bad Request

**Response Schema:**

- `error` (object) *(required)*
  - `message` (string) *(required)*
  - `code` (number) *(required)*
  - `slug` (string) *(required)*
  - `status` (number) *(required)*
  - `request_id` (string)
  - `suggested_fix` (string)
  - `errors` (array<string>)

#### 401 - Unauthorized

**Response Schema:**

- `error` (object) *(required)*
  - `message` (string) *(required)*
  - `code` (number) *(required)*
  - `slug` (string) *(required)*
  - `status` (number) *(required)*
  - `request_id` (string)
  - `suggested_fix` (string)
  - `errors` (array<string>)

#### 403 - Forbidden

**Response Schema:**

- `error` (object) *(required)*
  - `message` (string) *(required)*
  - `code` (number) *(required)*
  - `slug` (string) *(required)*
  - `status` (number) *(required)*
  - `request_id` (string)
  - `suggested_fix` (string)
  - `errors` (array<string>)

#### 404 - Not Found

**Response Schema:**

- `error` (object) *(required)*
  - `message` (string) *(required)*
  - `code` (number) *(required)*
  - `slug` (string) *(required)*
  - `status` (number) *(required)*
  - `request_id` (string)
  - `suggested_fix` (string)
  - `errors` (array<string>)

#### 410 - Gone

**Response Schema:**

- `error` (object) *(required)*
  - `message` (string) *(required)*
  - `code` (number) *(required)*
  - `slug` (string) *(required)*
  - `status` (number) *(required)*
  - `request_id` (string)
  - `suggested_fix` (string)
  - `errors` (array<string>)

#### 429 - Too Many Requests

**Response Schema:**

- `error` (object) *(required)*
  - `message` (string) *(required)*
  - `code` (number) *(required)*
  - `slug` (string) *(required)*
  - `status` (number) *(required)*
  - `request_id` (string)
  - `suggested_fix` (string)
  - `errors` (array<string>)

#### 500 - Internal Server Error

**Response Schema:**

- `error` (object) *(required)*
  - `message` (string) *(required)*
  - `code` (number) *(required)*
  - `slug` (string) *(required)*
  - `status` (number) *(required)*
  - `request_id` (string)
  - `suggested_fix` (string)
  - `errors` (array<string>)

#### 501 - Not Implemented

**Response Schema:**

- `error` (object) *(required)*
  - `message` (string) *(required)*
  - `code` (number) *(required)*
  - `slug` (string) *(required)*
  - `status` (number) *(required)*
  - `request_id` (string)
  - `suggested_fix` (string)
  - `errors` (array<string>)

### Example requests

Python uses `requests`; TypeScript uses Node.js fetch. Replace sample IDs and values before sending these requests.

Set `COMPOSIO_API_KEY` before running these requests.

#### Python

```python
import os
import requests
import json

response = requests.request("POST", "https://backend.composio.dev/api/v3.1/files/upload/request",
    headers={"Content-Type": "application/json", "x-api-key": os.environ["COMPOSIO_API_KEY"]},
    json=json.loads("{\"toolkit_slug\":\"string\",\"tool_slug\":\"string\",\"filename\":\"string\",\"mimetype\":\"string\",\"md5\":\"string\"}"))
response.raise_for_status()
print(response.text)
```

#### TypeScript

```typescript
const response = await fetch("https://backend.composio.dev/api/v3.1/files/upload/request", {
  method: "POST",
  headers: { "Content-Type": "application/json", "x-api-key": process.env["COMPOSIO_API_KEY"]! },
  body: JSON.stringify({
  "toolkit_slug": "string",
  "tool_slug": "string",
  "filename": "string",
  "mimetype": "string",
  "md5": "string"
}),
});
if (!response.ok) throw new Error(`HTTP ${response.status}: ${await response.text()}`);
console.log(await response.text());
```

#### API

```bash
curl -X POST "https://backend.composio.dev/api/v3.1/files/upload/request" \
  -H "x-api-key: $COMPOSIO_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "toolkit_slug": "string",
    "tool_slug": "string",
    "filename": "string",
    "mimetype": "string",
    "md5": "string"
  }'
```

---

## REST API version

The current REST API version is **v3.1**, served at `https://backend.composio.dev/api/v3.1`. Prefer it for new code and new examples.

`https://backend.composio.dev/api/v3` is the previous version. It is frozen with pinned tool-version defaults and remains supported — existing v3 integrations keep working and do not need to migrate.