# Webhook Authentication

## Default Behaviour

By default, requests to execute a webhook do not need to be authenticated. The knowledge of the specific flow’s ID and the corresponding webhook URL is assumed to be sufficient authorization. Of course, this means that the webhook URL should be treated as sensitive information and not be freely exposed.

## Enabling Authentication

In cases where additional security is desired, templates and flows can be set to require authentication on webhook requests. This can be set in the Template Editor for templates of the type “Incoming Webhook”, here:

<figure><img src="/files/PBnI9ghh2CIFsKbtsZ2Y" alt=""><figcaption></figcaption></figure>

In the template’s and flow’s JSON representation, this corresponds to the property `flowSettings.webhooks.requireWebhookAuth` :

```json
{
	"description": "Authenticated Flow",
	"graph": { ... },
	"flowSettings": {
	  "webhooks": {
      "requireWebhookAuth": true
    }
  }
}
```

### Authenticated Behavior

If a flow is set to require webhook auth, all webhook requests must be authenticated using a valid Bearer token in the `Authorization` header, in the same manner as all other Flowmate API requests. This flow can only be executed by these accounts:

* The end-user who created and owns the flow
* Any tenant-admin partner account of the same tenant as that end-user

If no bearer token is supplied, or any other account attempts to execute the flow, the API will respond with a code 403 and the response body

```json
{ "error": "Unauthorized" }
```


---

# 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://flowmate.gitbook.io/flowmate-documentation/webhooks/webhook-authentication.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.
