# extensions.upload

`POST /api/public/v1/extensions/uploads`

A one-time place to upload an extension file (.crx or a .zip of the extension folder, at most 32 MB, valid 2 hours): PUT the raw file to upload_url, then call extensions.add with upload_path.

- Capability: `extension.manage`
- Command: no
- MCP tool: `extensions_upload`

## Response

`201` with `{ data, correlation_id }`.

| Field | Type | Always present | Description |
|---|---|---|---|
| `data` | object | yes |  |
| `data.upload_path` | string | yes |  |
| `data.upload_url` | string | yes | PUT the raw file here (Content-Type: application/octet-stream) |
| `data.max_bytes` | integer | yes | (min -9007199254740991, max 9007199254740991) |
| `data.expires_in_seconds` | integer | yes | (min -9007199254740991, max 9007199254740991) |
| `correlation_id` | string (uuid) | yes |  |

New fields can appear at any time; ignore the ones you do not know.

## Errors

| Code | HTTP | Retryable |
|---|---|---|
| `UNAUTHENTICATED` | 401 | no |
| `FORBIDDEN` | 403 | no |
| `RATE_LIMITED` | 429 | yes |
| `DEPENDENCY_UNAVAILABLE` | 503 | yes |
| `UNKNOWN` | 500 | no |

## Example (curl)

```bash
curl -X POST "https://browlix.com/api/public/v1/extensions/uploads" \
  -H "Authorization: Bearer $BROWLIX_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{}'
```

## Example (TypeScript SDK)

```ts
import { Browlix } from "@browlix/sdk";

const bx = new Browlix({ apiKey: process.env.BROWLIX_API_KEY! });
const reply = await bx.call("extensions.upload", { body: {} });
console.log(reply.data);
```

## Example (Python)

```python
import os
import requests

r = requests.post(
    "https://browlix.com/api/public/v1/extensions/uploads",
    headers={"Authorization": f"Bearer {os.environ['BROWLIX_API_KEY']}"},
    json={},
    timeout=60,
)
print(r.status_code, r.json())
```

## Example (MCP)

```json
{
  "method": "tools/call",
  "params": {
    "name": "extensions_upload",
    "arguments": {}
  }
}
```
