> For the complete documentation index, see [llms.txt](https://docs.zapfy.me/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.zapfy.me/integrando-com-a-api/instance/atualizar-url-de-webhook-delivery.md).

# Atualizar url de webhook delivery

Cada instância possui uma webhookUrl para receber atualizações sobre a instância e ações realizadas, é possível alterar essa webhookUrl nessa rota.

###

## Atualizando a url de webhook delivery de uma instância

<mark style="color:green;">`POST`</mark> `https://api.zapfy.me/v1/instance/{{instanceKey}}/token/{{instanceToken}}/updateWebhook`

Permite atualizar a url de chamada do webhook delivery de uma instância, dado os parâmetros `instanceKey` e `instanceToken`.&#x20;

#### Path Parameters

| Name                                            | Type   | Description                         |
| ----------------------------------------------- | ------ | ----------------------------------- |
| instanceKey <mark style="color:red;">\*</mark>  | String | O key de identificação da instância |
| instanceToken<mark style="color:red;">\*</mark> | String | O token de acesso da instância      |

#### Request Body

| Name                                         | Type   | Description                                                  |
| -------------------------------------------- | ------ | ------------------------------------------------------------ |
| webhookUrl<mark style="color:red;">\*</mark> | String | A nova url a ser tratada como o endereço do webhook delivery |

{% tabs %}
{% tab title="200: OK Webhook url alterado com sucesso" %}

```javascript
{
    "result": {
        "id": 28903,
        "key": "b08f4262-b74f-4b7b-9958-1c7d5d1dc5e7",
        "token": "75ab5839-5b63-41a8-95ab-cbcaab46a018",
        "status": "connected",
        "name": "Instance 01",
        "webhookUrl": "www.meuwebhook.com",
        "userId": 28372,
        "createdAt": "2023-01-21T15:34:32.015Z",
        "updatedAt": "2023-01-21T15:34:32.015Z",
        "deletedAt": null,
        "expirationDate": "2023-01-28T15:34:32.003Z",
        "source": "core"
    },
    "isValid": true
}
```

{% endtab %}

{% tab title="400: Bad Request Caso não seja informado uma url correta" %}

```javascript
{
    "result": {},
    "message": "INVALID_WEBHOOK_URL",
    "isValid": false
}
```

{% endtab %}
{% endtabs %}
