# Shared

{% hint style="info" %}
When the service sends all the notifications to only one webhook URL but the webhook has to be registered under a user account, that's a [dedicated webhook](/custom-apps-documentation/app-components/webhooks/dedicated.md), not a shared one.
{% endhint %}

In order to activate the shared webhook so it listens to incoming traffic, you must publish your app. Before doing so, please read the [app visibility article](https://developers.make.com/custom-apps-documentation/app-visibility) to understand how that affects your app.

## Implementation

Shared webhooks must be registered in the external platform by the developer of the app. All notifications from the service for all users will be sent to Make through this single URL, which is generated when creating the shared webhook. On Make's end, the corresponding user account will be matched by it's `uid`.

{% hint style="info" %}
You should always follow the API documentation for the platform for which you are developing the integration.
{% endhint %}

## Matching the user's account with an incoming event

Since the webhook URL is shared among multiple users, there must be a way to match the incoming events with their owners and deliver them correctly. This is done through the `uid` parameter, which **must** be defined both in the connection and in the webhook communication.

{% hint style="info" %}
Since the `uid` from the connection is needed to allow Make to match the incoming data to its intended recipient, **all** shared webhooks **must** have a connection attached to the webhook.
{% endhint %}

{% tabs %}
{% tab title="Connection" %}

```json
{
    ...

    "info": {
        "url": "https://example.com/api/me",
        "headers": {
            "authorization": "Bearer {{connection.accessToken}}"
        },
        "response": {
            "uid": "{{body.user.id}}",
            "valid": "{{body.ok}}",
            "metadata": {
                "type": "text",
                "value": "{{body.user.fullName}} ({{body.user.email}})"
            }
        },
        "log": {
            "sanitize": [
                "request.headers.authorization"
            ]
        }
    }

    ...
}
```

{% hint style="info" %}
Notice the `uid` parameter in the `response` object.
{% endhint %}
{% endtab %}

{% tab title="Webhook communication" %}

```json
{
	"uid": "{{item.uid}}",
	"output": "{{item.data}}",
	...
}
```

{% hint style="info" %}
Notice the `uid` parameter in the webhook's communication.
{% endhint %}
{% endtab %}
{% endtabs %}


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://developers.make.com/custom-apps-documentation/app-components/webhooks/shared.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
