Skip to main content
PUT
On Message Received
The ReceivedCallback webhook can be configured in two ways: receiving only messages sent by other users, or also receiving messages sent by you.
When you configure the webhook through the On Message Received - Sent by Me endpoint, the API automatically starts giving priority to the URL configured there. This means that even if you already have a webhook configured on the On Message Received endpoint, it remains saved, but stops being used while this one is active.To go back to using the URL configured on the On Message Received endpoint and stop receiving messages sent by you, you need to disable the Notify Sent by Me option through the Update Notify Sent by Me endpoint.

Overview

This is the callback webhook for received messages. It’s also triggered when your instance is configured to notify messages sent by you as well.
Z-API only accepts HTTPS webhooks.
Media files remain available for 30 days in Z-API storage. To see all callback examples by message type, check the Callback Examples page.

Update webhook

string
required
Your instance ID. Available in the Z-API panel under Instances.
string
required
Your Z-API instance token.

Body

string
required
Receiving webhook URL

Request Body


Response

200

405

In this case, make sure you’re sending the correct method specification — that is, check whether you sent a POST or PUT as specified at the beginning of this topic.

415

If you receive a 415 error, make sure to add the “Content-Type” of the object you’re sending in the request headers, most commonly “application/json”.