# Create a reseller customer

Create a new customer workspace from a reseller account.

## Endpoint

<mark style="color:blue;">`POST`</mark> `https://api.signitic.app/reseller/workspace`

## Headers

| Name                                        | Type   | Description             |
| ------------------------------------------- | ------ | ----------------------- |
| x-api-key<mark style="color:red;">\*</mark> | String | Your reseller API key.  |
| Content-Type                                | String | Use `application/json`. |

## Request body

| Name           | Type    | Required | Description                                                                                 |
| -------------- | ------- | -------- | ------------------------------------------------------------------------------------------- |
| email          | String  | Yes      | Main account email for the new customer workspace.                                          |
| firstName      | String  | No       | First name of the main account.                                                             |
| lastName       | String  | No       | Last name of the main account.                                                              |
| socialReason   | String  | No       | Company name. When omitted, the workspace name is derived from the email domain.            |
| language       | String  | No       | Account language. Default: `fr`.                                                            |
| customerAccess | Boolean | No       | When `true`, Signitic sends the onboarding email to the customer account. Default: `false`. |
| demoAccount    | Boolean | No       | When `true`, the workspace is created as a demo account. Default: `false`.                  |

### Example

```json
{
  "email": "admin@acme.com",
  "firstName": "Jane",
  "lastName": "Doe",
  "socialReason": "Acme",
  "language": "en",
  "customerAccess": true,
  "demoAccount": false
}
```

## Success response

### Example request

```http
POST /reseller/workspace HTTP/1.1
Host: api.signitic.app
x-api-key: <your-reseller-api-key>
Content-Type: application/json

{
  "email": "admin@acme.com",
  "firstName": "Jane",
  "lastName": "Doe",
  "socialReason": "Acme",
  "language": "en",
  "customerAccess": true,
  "demoAccount": false
}
```

### `200 OK`

```json
{
  "success": true,
  "message": "Workspace Acme has been created."
}
```

## Error responses

| Status | Internal code | When                                                                                                                                       |
| ------ | ------------- | ------------------------------------------------------------------------------------------------------------------------------------------ |
| 200    | n/a           | The payload is rejected by the reseller provisioning flow. This endpoint can return `success: false` while still responding with `200 OK`. |
| 401    | n/a           | The reseller API key is missing or invalid.                                                                                                |
