Account and Instances
Update Instance
Updates the webhook_url and/or metadata of an instance. The metadata is free-form JSON to link the instance to your system (e.g. customer ID, plan, etc). The metadata is automatically included in the webhooks you receive.
PUT
https://api.zapzapapi.com/api/v1/instances/{id}Authentication with the x-api-key and x-api-secret headers.
Parameters
| Name | Type | In | Required | Description |
|---|---|---|---|---|
id | text | path | Yes | Instance ID |
webhook_url | text | body | No | Webhook URL (HTTPS) |
metadata | text | body | No | Free-form data (JSON) |
Request example
curl
curl -X PUT "https://api.zapzapapi.com/api/v1/instances/{id}" \
-H "x-api-key: YOUR_API_KEY" \
-H "x-api-secret: YOUR_API_SECRET" \
-H "Content-Type: application/json" \
-d '{"webhook_url":"https://meusite.com/webhook","metadata":"{\"clientId\":\"123\"}"}'Node.js
const res = await fetch("https://api.zapzapapi.com/api/v1/instances/{id}", {
method: "PUT",
headers: {
"x-api-key": "YOUR_API_KEY",
"x-api-secret": "YOUR_API_SECRET",
"Content-Type": "application/json",
},
body: JSON.stringify({
"webhook_url": "https://meusite.com/webhook",
"metadata": "{\"clientId\":\"123\"}"
}),
});
console.log(await res.json());Python
import requests
res = requests.put(
"https://api.zapzapapi.com/api/v1/instances/{id}",
headers={"x-api-key": "YOUR_API_KEY", "x-api-secret": "YOUR_API_SECRET"},
json={"webhook_url":"https://meusite.com/webhook","metadata":"{\"clientId\":\"123\"}"},
)
print(res.json())Response example
JSON
{
"id": "uuid",
"name": "minha-instancia",
"webhook_url": "https://meusite.com/webhook",
"metadata": {
"clientId": "123"
}
}Values are illustrative; the fields follow the real response format.
Other endpoints in this category
Get your API keys
Create your account, connect a number in minutes and start using the API. R$15 per active number/month, with a welcome credit when you create the account, subject to the current campaign.
