> ## Documentation Index
> Fetch the complete documentation index at: https://developer.z-api.io/llms.txt
> Use this file to discover all available pages before exploring further.

# On Message Received - Sent by Me

> Webhook callback for received messages

<Info>
  The `ReceivedCallback` webhook can be configured in two ways: receiving only messages sent by other users, or also receiving messages sent by you.
</Info>

<Warning>
  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](/en/webhooks/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](/en/webhooks/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](/en/webhooks/update-notify-sent-by-me)** endpoint.
</Warning>

## Overview

This webhook works like the standard callback for received messages, with one difference from the regular **On Message Received**: when configured, it updates the receiving webhook URL so that messages sent by you are also notified.

<Warning>
  Z-API only accepts **HTTPS** webhooks.
</Warning>

<Info>
  Media files remain available for **30 days** in Z-API storage. To see all callback examples by message type, check the [Callback Examples](/en/webhooks/on-message-received-examples) page.
</Info>

***

## Update webhook

### Header

<ParamField path="instanceId" type="string" required>
  Your instance ID. Available in the Z-API panel under **Instances**.
</ParamField>

<ParamField path="token" type="string" required>
  Your Z-API instance token.
</ParamField>

### Body

<ParamField body="value" type="string" required>
  Receiving webhook URL
</ParamField>

### Request Body

```json theme={"theme":{"light":"github-light","dark":"poimandres"}}
{
  "value": "https://your-system-address.com/instance/YOUR_INSTANCE/receive-delivery"
}
```

***

## Response

### 200

```json theme={"theme":{"light":"github-light","dark":"poimandres"}}
{
  "value": true
}
```

### 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".


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.