# Add a website (https://webmetic.de/docs/api/referenz/partner/customers-account-id-websites)

## POST /partner/customers/{account_id}/websites

Add a domain to a customer.

`website` is reduced to the main domain in lower case, as on create. Data only starts
arriving once the tracking code with this customer's account_id runs on the domain.

Note: This endpoint is rate-limited to 30 requests per minute.

### Parameter

| Name | Ort | Typ | Pflicht | Beschreibung |
| --- | --- | --- | --- | --- |
| `account_id` | path | string | ja | Account id of the customer, from create-customer or the customer list |

### Anfrage

`application/json`

| Feld | Typ | Pflicht | Beschreibung |
| --- | --- | --- | --- |
| `website` | string | ja | Domain or full URL; stored as the main domain in lower case |

### Antworten

| Status | Beschreibung |
| --- | --- |
| 200 | All domains of the customer, the new one included |
| 400 | INVALID_WEBSITE: `website` has no domain with a valid suffix, e.g. localhost or an IP address |
| 403 | API_KEY_MISSING, API_KEY_INVALID, API_KEY_NOT_FOUND, or NOT_A_PARTNER: the key does not belong to a partner account |
| 404 | CUSTOMER_NOT_FOUND: no customer of your partner account has this account id |
| 409 | WEBSITE_ALREADY_EXISTS: the customer already has this domain, or an account that is not onboarding, cancelled or failed holds it |
| 422 | VALIDATION_ERROR: `website` is missing; `errors` lists each problem |
| 429 | RATE_LIMITED: more than 30 requests per minute to this endpoint |
| 500 | INTERNAL_ERROR: unexpected server error |

Felder der Antwort 200:

| Feld | Typ | Pflicht | Beschreibung |
| --- | --- | --- | --- |
| `account_id` | string | ja | Account id of the customer |
| `websites` | string[] | ja | All domains of the customer after the change |

### Beispiel

```bash
curl -X POST 'https://hub.webmetic.de/partner/customers/<account_id>/websites' \
  -H 'Authorization: wmtc_IHR_API_SCHLUESSEL'
```