# Update white-label settings

`POST https://api.chat-data.com/api/v2/update-white-label`

Canonical: https://www.chat-data.com/api-reference/update-white-label

## Authentication

Send an API key as a Bearer token: `Authorization: Bearer $CHAT_DATA_API_KEY`. Workspace keys reach every chatbot in the workspace; chatbot-scoped keys reach only their chatbot. Keep keys on the server.

## Description

This API endpoint allows you to update white label settings for your chatbot. Only the fields you send are changed.

`showPowerby`, `powerbyText`, `company` and `companyUrl` require your [plan](/pricing) to include Remove Brand or Remove Label. `embeddingDomain` and `fromEmail` require Remove Brand. Sending a field your plan does not include returns a 403.

## Request body (`application/json`)

| Field | Type | Required | Description |
| --- | --- | --- | --- |
| chatbotId | string | yes | The ID of the chatbot to update. |
| showPowerby | boolean | no | Whether to show the "Powered by" text. |
| powerbyText | string | no | Custom "Powered by" text. |
| company | string | no | Company name for white labeling. |
| companyUrl | string | no | Company URL for white labeling. |
| embeddingDomain | string | no | Custom domain for embedding the chatbot, with or without `https://`. Its DNS must be unused or already point to `www.chat-data.com`. The response lists the DNS records to add. |
| fromEmail | string | no | Custom sender address for emails to your users. The response lists the DNS records that verify its domain. Set it to `admin@chat-data.com` to go back to the default sender. |

Send only the fields you want to set; optional fields you omit are left unchanged.

## Example request

```bash
curl 'https://api.chat-data.com/api/v2/update-white-label' \
  -H "Authorization: Bearer $CHAT_DATA_API_KEY" \
  -H 'Content-Type: application/json' \
  -d '{
  "chatbotId": "6650f1c2a9e4b83d2c7a1f05"
}'
```

## Example response (200)

```json
{
  "status": "success",
  "domainDnsRecords": [
    {
      "type": "cname",
      "host": "_acme-challenge.chat.example.com",
      "data": "chat.example.com.e7c5afd44f1a18fb.dcv.cloudflare.com",
      "status": true
    },
    {
      "type": "cname",
      "host": "chat.example.com",
      "data": "www.chat-data.com",
      "status": true
    }
  ],
  "emailDnsRecords": [
    {
      "type": "cname",
      "host": "k7q2m4._domainkey.example.com",
      "data": "k7q2m4.dkim.amazonses.com",
      "status": true
    },
    {
      "type": "cname",
      "host": "p3x8w1._domainkey.example.com",
      "data": "p3x8w1.dkim.amazonses.com",
      "status": true
    },
    {
      "type": "cname",
      "host": "r9d5t6._domainkey.example.com",
      "data": "r9d5t6.dkim.amazonses.com",
      "status": true
    }
  ]
}
```

## Responses

| Status | Description |
| --- | --- |
| 200 | Successful response. |
| 400 | The settings could not be saved. For example: `embeddingDomain` starts with `http://` or `https://` but is not a valid URL, its DNS already points to another server, `fromEmail` is not a valid email address, or `fromEmail` uses a Chat Data domain. |
| 401 | Authentication failed: the `Authorization` header is missing or not in the `Bearer <key>` format, the API key does not exist, its workspace is unavailable or has no owner, or the workspace's plan does not include API access. `message` says which. |
| 403 | The API key cannot access the requested chatbot. A chatbot-scoped key used with another chatbot's ID gets `Access denied to this chatbot`. A workspace key gets `Chatbot <id> was not found in this API key's workspace. It may have been deleted or moved to another workspace.` when the chatbot does not exist or belongs to another workspace. Also returned when the plan does not include the requested change: `You do not have permission to update white label settings. Please upgrade your plan to access these features.` for `showPowerby`, `powerbyText`, `company` or `companyUrl`, and `You do not have permission to customize domain or email settings. Please upgrade your plan to access these features.` for `embeddingDomain` or `fromEmail`. |
| 404 | `chatbotId` was not provided. |
| 429 | The workspace sent more than 600 API requests in the last minute (wait the seconds in `Retry-After`), or it set up more than 20 new sender domains for `fromEmail` in the last hour. The sender-domain response also carries the wait in seconds as `retryAfter`. |
| 500 | The sender-domain rate limiter for `fromEmail` is temporarily unavailable. This response is the server's default error page, not JSON. |
