# Set Settings

**if you need to set instance settings such as webhook URL or other settings use this point**

## To set settings to your instance

<mark style="color:green;">`POST`</mark> `https://api.cartat.net/instance/settings`

#### Headers

| Name                                            | Type             | Description                                                                           |
| ----------------------------------------------- | ---------------- | ------------------------------------------------------------------------------------- |
| Accept<mark style="color:red;">\*</mark>        | application/json |                                                                                       |
| Content-Type<mark style="color:red;">\*</mark>  | application/json |                                                                                       |
| Authorization<mark style="color:red;">\*</mark> | Bearer {{token}} | you can find your access token [here](https://docs.cartat.net/cartat-api/get-started) |

#### Request Body

| Name                       | Type             | Description                                                                                                                                                                                             |
| -------------------------- | ---------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| archive                    | true             | <p><mark style="color:blue;">True/False</mark></p><p>set to true to put any sent message </p><p>to the archive on WhatsApp automatically.</p>                                                           |
| webhook\[is\_active]       | true             | <p><mark style="color:blue;">True/False</mark></p><p>to active/deactivate webhook events</p>                                                                                                            |
| webhook\[ack\_events]      | true             | <p><mark style="color:blue;">True/False</mark></p><p>to active/deactivate read indicators events, eg: when messages are read, the ack event will trigger.</p>                                           |
| webhook\[webhook\_url]     | <https://ex.com> | <p><mark style="color:blue;">URL</mark></p><p>the webhook URL that you will receive events on it</p><p>you can use test endpoint on <a data-footnote-ref href="#user-content-fn-1">webhook.site</a></p> |
| webhook\[instance\_events] | true             | <p><mark style="color:blue;">True/False</mark></p><p>to active/deactivate receiving instance events such as qr, ready, etc ... <a href="../get-instance-status">reference</a></p>                       |
| webhook\[messages\_events] | true             | <p><mark style="color:blue;">True/False</mark></p><p>to active/deactivate receiving messages events, when a new message arrived we will send the message payload to your webhook URL</p>                |

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

```json
{
    "archive": true,
    "webhook": {
        "is_active": true,
        "ack_events": true,
        "webhook_url": "https://webhook.site",
        "instance_events": true,
        "messages_events": true
    }
}
```

{% endtab %}
{% endtabs %}

{% hint style="info" %}
settings explain
{% endhint %}

<table data-column-title-hidden data-view="cards"><thead><tr><th>Setting</th><th>usage</th><th></th></tr></thead><tbody><tr><td><strong>archive</strong></td><td><p><mark style="color:blue;">True/False</mark></p><p>set to true to put any sent message </p><p>to the archive on WhatsApp automatically.</p></td><td></td></tr><tr><td><strong>webhook->is_active</strong></td><td><p><mark style="color:blue;">True/False</mark></p><p>to active/deactive webhook events</p></td><td></td></tr><tr><td><strong>webhook->ack_events</strong></td><td><p><mark style="color:blue;">True/False</mark></p><p>to active/deactive read indecators events, eg: when message are read, the ack event will trigger.</p></td><td></td></tr><tr><td><strong>webhook->webhook_url</strong></td><td><p><mark style="color:blue;">URL</mark></p><p>the webhook URL that you will receive events on it</p></td><td></td></tr><tr><td><strong>webhook->instance_events</strong></td><td><mark style="color:blue;">True/False</mark></td><td>to active/deactive receiving instance events such as : qr, ready etc ... <a href="../get-instance-status">reference</a></td></tr><tr><td><strong>webhook->messages_events</strong></td><td><mark style="color:blue;">True/False</mark></td><td>to active/deactive receiving  messages events, when new message arrived we will send the message payload to your webhook URL</td></tr></tbody></table>

[^1]: webhook.site
