# 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 %}


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://docs.acymailing.com/acymailer/domains/update-domain.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
