> ## Documentation Index
> Fetch the complete documentation index at: https://docs.scrapengine.io/llms.txt
> Use this file to discover all available pages before exploring further.

# Upload Extension

> Upload a Chrome extension archive so it can be loaded into future browser sessions.

## Overview

Stores a Chrome extension for this account. Once uploaded, the returned `id` can be passed in `extensions` when creating a session via [`POST /browser/sessions`](/api-reference/endpoint/sessions-create).

The extension archive must be base64-encoded and sent inline in the JSON body.

## Body

<ParamField body="name" type="string" required={true}>
  Human-readable extension name (used in listings).
</ParamField>

<ParamField body="file" type="string" required={true}>
  Base64-encoded bytes of the Chrome `.crx` archive (full archive, not a URL).
</ParamField>

## Example Request

<CodeGroup>
  ```bash cURL theme={null}
  curl -X POST "https://api.scrapengine.io/api/v1/browser/extensions" \
    -H "Authorization: Bearer $SCRAPENGINE_API_KEY" \
    -H "Content-Type: application/json" \
    -d "{
      \"name\": \"ublock-origin\",
      \"file\": \"$(base64 -w 0 ublock.crx)\"
    }"
  ```
</CodeGroup>

## Response

### Success Response (201)

<ResponseField name="id" type="string">
  Extension ID. Pass this in `extensions` when creating a session.
</ResponseField>

<ResponseField name="name" type="string">
  Echoed name.
</ResponseField>

<ResponseField name="manifest" type="object">
  Parsed `manifest.json` from the archive.
</ResponseField>

<ResponseField name="createdAt" type="string">
  ISO-8601 timestamp.
</ResponseField>

<ResponseField name="updatedAt" type="string">
  ISO-8601 timestamp.
</ResponseField>

**Example Response:**

```json theme={null}
{
  "id": "ext-9e1ab4d6",
  "name": "ublock-origin",
  "manifest": { "manifest_version": 3, "name": "uBlock Origin", "version": "1.55.0" },
  "createdAt": "2025-04-24T12:00:00.000Z",
  "updatedAt": "2025-04-24T12:00:00.000Z"
}
```

### Error Responses

| Status | Description                                                                           |
| ------ | ------------------------------------------------------------------------------------- |
| `400`  | Missing `name` or `file`, or `file` is not valid base64 / not a valid `.crx` archive. |
| `401`  | Unauthorized — invalid or missing API key.                                            |
