# Provision your extension (/en/api-reference/api-ref/extensions-marketplace/provisioning)

> For AI agents: see the complete documentation index at [llms.txt](/llms.txt).

When your extension is activated or deactivated on Agora Console, Agora passes relevant information to you so that you can take corresponding actions. For this purpose, you need to implement the provisioning API and provide the URLs to Agora.

This page provides a detailed description of the provisioning API.

## Requirements [#requirements]

Before implementing the provisioning API, ensure that your server meets the following requirements:

* Able to handle at least 100 requests per second.
* Follows the standards of HTTP request and response.

Agora waits for 500 milliseconds after sending a request to your server. If there is no response, Agora resends the request for a maximum of two times.

## Create an account [#create-an-account]

When a user activates your extension, Agora calls this method to pass the basic information of this user to you. You can manage users by forming a user information mapping for services such as usage query.

### HTTP request [#http-request]

**URL**

```bash
POST https://{host}/customers/new
```

**Request body**
The request body contains the following fields:

| Field           | Required/Optional | Type   | Data length | Description                                                                                                                                                |
| :-------------- | :---------------- | :----- | :---------- | :--------------------------------------------------------------------------------------------------------------------------------------------------------- |
| `planId`        | Required          | String | 16          | The billing plan that the user selects.                                                                                                                    |
| `customerName`  | Optional          | String | 32          | The company name of the user.                                                                                                                              |
| `customerId`    | Required          | String | N/A         | The account ID of the user on Agora Console.                                                                                                               |
| `customerEmail` | Optional          | String | 32          | The email address of the user.                                                                                                                             |
| `customerPhone` | Optional          | String | 32          | The phone number of the user.                                                                                                                              |
| `apiKey`        | Required          | String | 32          | The API key, used for authentication between you and Agora. You need to generate your own API key and provide it to Agora.                                 |
| `signature`     | Required          | String | N/A         | The signature generated by the [signature algorithm](./signature-algorithm). You need to deploy the algorithm to verify that the request is sent by Agora. |

### HTTP response [#http-response]

The response body contains the following fields:

| Field          | Type   | Description                                                                                  |
| :------------- | :----- | :------------------------------------------------------------------------------------------- |
| `status`       | String | The status of the request:- `success`: The request succeeds.

- `failed`: The request fails. |
| `statusReason` | String | The reason why the request succeeds or fails.                                                |

### Example [#example]

**Request body**

```json
{
    "planId": "ABC",
    "customerName": "AgoraCustomerA",
    "customerId": "12345678910",
    "customerEmail": "AgoraCustomerA",
    "customerPhone": "12345678910",
    "apiKey": "pz**************************gd",
    "signature": "Q7**************************xM"
}
```

**Response body**

```json
{
    "status": "success",
    "statusReason": ""
}
```

## Create a project [#create-a-project]

When a user enables your extension for an Agora project, Agora calls this method to pass the project information to you.

### HTTP request [#http-request-1]

**URL**

```bash
POST https://{host}/customers/{customerId}/projects/new
```

**Path parameter**

`customerId`: String. The account ID of the user on Agora Console.

**Request body**
The request body contains the following fields:

| Field       | Required/Optional | Type   | Data length | Description                                                                                                                                                   |
| :---------- | :---------------- | :----- | :---------- | :------------------------------------------------------------------------------------------------------------------------------------------------------------ |
| `projectId` | Required          | Int    | N/A         | The ID of the Agora project. A user could enable your extension for multiple projects, which means one `customerId` could be mapped to multiple `projectId`s. |
| `apiKey`    | Required          | String | 32          | The API key, used for authentication between you and Agora. You need to generate your own API key and provide it to Agora.                                    |
| `signature` | Required          | String | N/A         | The signature generated by the [signature algorithm](./signature-algorithm). You need to deploy the algorithm to verify that the request is sent by Agora.    |

### HTTP response [#http-response-1]

The response body contains the following fields:

| Field          | Type   | Description                                                                                                                                                                                                                                                                                                                                                                                                                                         |
| :------------- | :----- | :-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| `status`       | String | The status of the request:- `success`: The request succeeds.

- `failed`: The request fails.                                                                                                                                                                                                                                                                                                                                                        |
| `statusReason` | String | The reason why the request succeeds or fails.                                                                                                                                                                                                                                                                                                                                                                                                       |
| `data`         | Object | This object includes the following properties:- `appKey`: String (32–255 bytes). The app key of the project. You use this field to authenticate the user.

- `appSecret`: String (32–255 bytes). The app secret of the project. You use this field to authenticate the user.

- `licenseUrl`: (Optional) String. The license file for authorizing your extension to users. This field applies only if you charge your extension with license files. |

### Example [#example-1]

**Request body**

```json
{
    "projectId": 5****8,
    "apiKey": "pz**************************gd",
    "signature": "Q7**************************xM"
}
```

**Response body**

```json
{
    "status": "success",
    "statusReason": "",
    "data": {
        "appKey": "cf**************************yb",
        "appSecret": "NW**************************M=",
        "licenseUrl": "https://*********"
    }
}
```

## Deactivate the account [#deactivate-the-account]

Once the user deactivates your extension on Agora Console, Agora calls this method to notify you to delete the user's account and stop providing any relevant service.

### HTTP request [#http-request-2]

**URL**

```bash
PUT http://{host}/customers/{customerId}/deactivate
```

**Path parameter**
`customerId`: String. The ID of the user on Agora Console.

**Request body**
The request body contains the following fields:

| Field       | Required/Optional | Type   | Data length | Description                                                                                                                                                |
| :---------- | :---------------- | :----- | :---------- | :--------------------------------------------------------------------------------------------------------------------------------------------------------- |
| `apiKey`    | Required          | String | 32          | The API key of the vendor, used for authentication between Agora and the vendor. You need to generate your own API key and provide it to Agora.            |
| `signature` | Required          | String | N/A         | The signature generated by the [signature algorithm](./signature-algorithm). You need to deploy the algorithm to verify that the request is sent by Agora. |

### HTTP response [#http-response-2]

The response body contains the following fields:

| Field          | Type   | Description                                                                                  |
| :------------- | :----- | :------------------------------------------------------------------------------------------- |
| `status`       | String | The status of the request:- `success`: The request succeeds.

- `failed`: The request fails. |
| `statusReason` | String | The reason why the request succeeds or fails.                                                |

### Example [#example-2]

**Request body**

```json
{
    "apiKey": "pz**************************gd",
    "signature": "Q7**************************xM"
}
```

**Response body**

```json
{
    "status": "success",
    "statusReason": ""
}
```

## Deactivate the project [#deactivate-the-project]

Once the user disables your extension for an Agora project, Agora calls this method to pass the project information to you.

### HTTP request [#http-request-3]

**URL**

```bash
PUT http://{host}//customers/{customerId}/projects/{projectId}/deactivate
```

**Path parameter**

| Parameter    | Type   | Description                                                               |
| :----------- | :----- | :------------------------------------------------------------------------ |
| `customerId` | String | The account ID of the user on Agora Console.                              |
| `projectId`  | Int    | The ID of the project for which the user wants to disable your extension. |

**Request body**
The request body contains the following fields:

| Field       | Required/Optional | Type   | Data length | Description                                                                                                                                                |
| :---------- | :---------------- | :----- | :---------- | :--------------------------------------------------------------------------------------------------------------------------------------------------------- |
| `apiKey`    | Required          | String | 32          | The API key of the vendor, used for authentication between Agora and the vendor. You need to generate your own API key and provide it to Agora.            |
| `signature` | Required          | String | N/A         | The signature generated by the [signature algorithm](./signature-algorithm). You need to deploy the algorithm to verify that the request is sent by Agora. |

### HTTP response [#http-response-3]

The response body contains the following fields:

| Field          | Type   | Description                                                                                  |
| :------------- | :----- | :------------------------------------------------------------------------------------------- |
| `status`       | String | The status of the request:- `success`: The request succeeds.

- `failed`: The request fails. |
| `statusReason` | String | The reason why the request succeeds or fails.                                                |

### Example [#example-3]

**Request body**

```json
{
    "apiKey": "pz**************************gd",
    "signature": "Q7**************************xM"
}
```

**Response body**

```json
{
    "status": "success",
    "statusReason": ""
}
```
