# Update domain

{% hint style="info" %}
For multisite license only
{% endhint %}

{% tabs %}
{% tab title="Shell" %}

```sh
 curl https://api.acymailer.com/api/domains/{domain-id} \
 -X PATCH \
 -H 'Content-Type: application/merge-patch+json' \
 -H 'API-KEY: your-license-key' \
 -H 'Version: external' \
 -d '{"isLimited": true,"creditsAllowed": 10000}'
```

{% endtab %}

{% tab title="PHP" %}

```php
<?php
  
$acymailer = new AcyMailer\SendingService('your-license-key');

$acymailer->updateDomain(2009, true, 10000);
```

{% endtab %}

{% tab title="Node" %}

```javascript
import {AcyMailer} from '@acymailing/sending-service';

const mailer = new AcyMailer('your-license-key');

const domain = {
    id: 2009,
    isLimited: true,
    creditsAllowed: 100000
};

await mailer.updateDomain(domain);
```

{% endtab %}
{% endtabs %}

<mark style="color:green;">`POST`</mark> `/api/domains/{domain-id}`

This endpoint allows you to update the domain limit and credits

**Headers**

| Name         | Value                          |
| ------------ | ------------------------------ |
| Content-Type | `application/merge-patch+json` |
| API-KEY      | `<license-key>`                |
| Version      | `Must be "external"`           |

**Body**

```json
{
    "isLimited": true,
    "creditsAllowed": 10000
}
```

* **isLimited** to limit your domain when sending emails, if you set `false` the limit of credits will be your license
* **creditsAllowed** are the credits allowed to the domain if **isLimited** is set to `true`, if **isLimited** is set to `false` this parameters is not taken into account

**Response**

{% tabs %}
{% tab title="200" %}

```json
NULL
```

{% endtab %}

{% tab title="403" %}

```json
{
  "message": "You are not allowed to update this domain"
}

{
  "message": "You must provide isLimited and creditsAllowed"
}
```

{% endtab %}

{% tab title="404" %}

```json
{
  "message": "Not found"
}
```

{% endtab %}
{% endtabs %}
