Inbound Webhook connector
The Inbound Webhook connector lets any tool that can send an HTTP POST request start Kibana workflows. Each request starts the workflows that subscribe to the connector, and those workflows can read the request body. Use it with tools that have no built-in way to start a Kibana workflow, such as Prometheus Alertmanager, a CI/CD system, or an in-house service.
You can use this connector in Workflows only, as a trigger rather than a step.
To receive requests with this connector, you need:
- On Elastic Cloud Serverless, a project feature tier that includes Workflows. The Security Analytics Essentials and Observability Logs Essentials tiers don't include it.
- On Elastic Stack, an Enterprise license, which Workflows requires.
- On self-managed, Elastic Cloud Enterprise, and Elastic Cloud on Kubernetes deployments, the
xpack.actions.inboundEvents.enabledsetting inkibana.ymlset totrue, which is the default. When it'sfalse, the Inbound Webhook connector type isn't available. - A Kibana URL that the external tool can reach.
To create an Inbound Webhook connector:
Go to the Connectors page using the navigation menu or the global search field.
Select Create connector, then Inbound Webhook connector.
In Connector name, enter a name that identifies the tool that sends the requests, such as Zabbix production. Kibana fills in Connector ID from the name. If you want a different ID, edit it now, because you can't change it after you save. For the ID rules, refer to Connector configuration.
Save the connector.
In Connector settings, copy the Webhook URL and the Ingest token. Save them somewhere secure, such as a password manager.
Kibana shows the ingest token only once. If you lose it, rotate the token to get a new one.
If the flyout warns that the webhook URL is missing the Kibana host, add the host so that external tools can reach the URL.
Follow these steps:
In
kibana.yml, setserver.publicBaseUrlto the URL that the tool uses to reach Kibana, such ashttps://kibana.example.com.Include the protocol, the host, the port if it isn't the default for the protocol, and your
server.basePathvalue if you set one. Don't add a query string. Leave the URL unquoted or use straight quotation marks, because curly quotation marks become part of the URL.Restart Kibana.
Open the connector again and copy the Webhook URL. The ingest token that you copied earlier still works.
If you can't change kibana.yml, add the URL that the tool uses to reach Kibana to the start of the webhook path instead. Include your server.basePath value if you set one. For the full format, refer to Webhook URL.
Inbound Webhook connectors have the following configuration properties:
- Connector name
- The name that the connectors list shows. You can change it at any time without changing the connector's ID, webhook URL, or ingest token.
- Connector ID
- A unique ID that Kibana fills in from the name. You can change it before you save the connector, but not afterward. It can be up to 36 characters long and contain only lowercase letters, numbers, and hyphens, and it must start and end with a letter or number. The ID is the last part of the webhook URL, and workflows use it to subscribe to the connector.
To start a workflow from the connector's requests, add an inboundWebhook.received trigger with the connector's ID to the workflow:
triggers:
- type: inboundWebhook.received
connector-id: "<connector-id>"
To check the connection before you configure the external tool, send a sample request with curl. Replace <webhook-url> and <ingest-token> with the Webhook URL and Ingest token that you copied when you created the connector:
curl -X POST \
'<webhook-url>' \
-H 'Authorization: Bearer <ingest-token>' \
-H 'Content-Type: application/json' \
-d '{
"alert_name": "High CPU",
"status": "firing",
"host": "web-1"
}'
When Kibana accepts the request, it returns HTTP 202 with {"ok": true} and starts the subscribed workflows. To confirm that a workflow ran, open the workflow and select Executions.
After the sample request works, set up the external tool's webhook or notification settings to send requests to the connector. Each tool names these settings differently, so use the tool's documentation to find where to enter the following values.
Enter the webhook URL that you copied when you created the connector. The URL uses one of the following formats. URLs in the default space have no /s/<space-id> prefix. If you set server.basePath, add it after <kibana-host>.
https://<kibana-host>/api/actions/events/.inboundWebhook/<connector-id>
https://<kibana-host>/s/<space-id>/api/actions/events/.inboundWebhook/<connector-id>
Set the request's Content-Type header to one of the following types. Kibana parses the body and passes the result to workflows as event.body:
| Content type | event.body |
|---|---|
application/json |
The parsed JSON value |
application/x-www-form-urlencoded |
An object of the form fields |
text/plain |
The body as a string |
If the request has no Content-Type header, Kibana parses the body as JSON. Requests with any other content type return HTTP 415.
The ingest token is a secret that Kibana creates when you create the connector, and again each time you rotate it. Send it with each request in one of these ways:
- If the tool lets you set headers, send an
Authorization: Bearer <ingest-token>header. This method keeps the token out of URLs. - If the tool can't set headers, append
?token=<ingest-token>to the URL. Kibana reads this parameter only when the request has noAuthorizationheader.
Protect the ingest token like a password. Anyone who has the token can start the connector's workflows, and those workflows run with the privileges of the last user who saved the connector. To run them as a different user, have that user open the connector, make a change such as editing its name, and save it. Save stays inactive until something changes.
Some tools send a verification request to confirm a webhook URL before they send data. The connector answers with HTTP 200 and {"challenge": "<value>"}, where <value> is the value that the tool sent, and doesn't start any workflows.
The connector treats a request as a verification request when the body has a top-level challenge field whose value is a string of 1 to 1,024 characters.
If you lose the ingest token or someone else might have it, rotate it:
- Open the connector and select Rotate ingest token.
- Select Rotate token to confirm. The previous token stops working immediately.
- Copy the new token. Kibana shows it only once.
- Update the external tool with the new token.
The response that the tool gets shows what happened to a request:
| Status | What it means |
|---|---|
| No response | The tool couldn't connect to Kibana, such as a connection error or a timeout. To fix it, refer to Requests don't reach Kibana. |
| 200 | The connector answered a verification request and didn't start any workflows. |
| 202 | Kibana accepted the request. If no workflow runs, refer to No workflow runs after a 202 response. |
| 400 | The request is invalid, such as a body that isn't valid JSON, a connector ID that's too long, or an empty token query parameter. The response message says which part to fix. |
| 404 | Kibana rejected the URL or the token. For possible causes, refer to Requests return 404. |
| 413 | The body is larger than the maximum size, which is 1 MB by default. Configure the tool to send a smaller body. |
| 415 | The connector doesn't accept the request's content type. Set the Content-Type header to one of the types in Request body. |
| 429 | The tool sent too many requests. To fix it, refer to Requests return 429. |
| 500 | Kibana couldn't process the request. Send the request again. If it keeps failing, check the Kibana logs for an error that starts with Inbound events outcome= and includes the connector ID. The line's detail field shows the cause. |
If the sample request works but the tool's requests fail with a connection error or a timeout, the tool can't reach your Kibana URL. For example, a tool hosted on the internet can't send requests to localhost or to an address that works only inside your network.
To fix it, configure the tool with a Kibana URL that it can reach from where it runs. If Kibana is reachable only inside your network, make it reachable from the tool's network, for example through a reverse proxy.
If Kibana accepts a request but no workflow runs, check that the workflow:
- Is enabled.
- Is in the same space as the connector.
- Has a trigger whose
connector-idis the connector's ID or"*". - Has no
on.condition, or has one that matches the request body.
If the workflow passes these checks, Kibana might not have a user to run it as. Open the connector, make a change such as editing its name, and save it. Save stays inactive until something changes.
A 404 response has one of these causes:
- The ingest token is missing or incorrect, or someone rotated it. Copy the current token into the tool again. If you no longer have it, rotate the token.
- The tool sends its own
Authorizationheader, such as for basic authentication, and the token in a?token=query parameter. Kibana ignores the query parameter when the request has anAuthorizationheader. Remove the tool'sAuthorizationheader, or send the token asAuthorization: Bearer <ingest-token>instead. - The URL has the wrong connector ID or space. Copy the Webhook URL from the connector again.
- The address that sends the requests made too many failed authentication attempts, which is 10 within 1 minute by default. Kibana returns 404 for that connector until the failed-authentication window passes, even when the token is correct. Fix the token in the tool, then wait for the window to pass.
xpack.actions.inboundEvents.enabledisfalse. In this case, every webhook URL returns 404. On self-managed, Elastic Cloud Enterprise, and Elastic Cloud on Kubernetes deployments, set it totrueinkibana.ymland restart Kibana.
Wait for the number of seconds in the Retry-After response header, then send the request again.
Kibana returns 429 when a request exceeds one of the following limits, which each Kibana process applies separately:
- Authenticated requests per minute for one connector
- Requests in progress at once for one connector
- Requests in progress at once across all connectors
If the tool keeps exceeding a limit, configure it to spread out its requests or, on Elastic Stack, raise the matching setting.