> For the complete documentation index, see [llms.txt](https://docs.acymailing.com/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.acymailing.com/acymailer/domains/update-domain.md).

# 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
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## 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, and the optional `goal` query parameter:

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

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is optional and describes the broader end goal you are ultimately trying to accomplish on behalf of the user. GitBook uses it to tailor the answer towards what is most useful for that goal.

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.
