> ## Documentation Index
> Fetch the complete documentation index at: https://docs.vibraniumlabs.ai/llms.txt
> Use this file to discover all available pages before exploring further.

# Invoke REST connection

## What It Does

Use Invoke REST connection to send alert or incident data to an external HTTP endpoint from an automation — and, on the alert-created trigger, to read values out of the response and write them back onto the alert.

The action starts with a saved REST connection, which supplies the HTTP method, base URL, preset headers, and timeout. In the automation, you can customize the path, query parameters, extra headers, and JSON body for that specific request.

> [!NOTE]
>
> Keep reusable connection details in **Settings → Global → Connections**. Use this action's **Request settings** pane only for values that change per automation.

## When To Use It

Use this action when you want to:

* create or update records in another system when an alert or incident changes
* send event details to an internal webhook
* forward selected fields to a custom workflow or event pipeline
* call a team-owned API without duplicating connection credentials in every automation
* enrich a new alert with details only another system knows — the owner of a host, the environment it runs in

## Before You Start

* Create and enable a REST connection in **Settings → Global → Connections**.
* Choose one of the supported triggers: **Alert is created**, **Alert timeline is updated**, **Incident is created**, or **Incident timeline is updated**.
* Use a **POST**, **PATCH**, or **PUT** connection if the endpoint needs a JSON body. **GET** and **DELETE** requests do not show the JSON body field.
* The placeholder list follows the trigger: alert triggers offer alert fields; incident triggers offer incident fields.
* Optional: set a **Signing secret** on the connection if your endpoint should verify that each request really comes from Vibe. See [Connections](https://docs.vibraniumlabs.ai/alerts/connections.md).

## Configure the Action

1. Go to **Settings → Global → Automation Actions**, then create a new automation or open an existing one.
2. Choose a supported trigger.
3. Select **Add action → Invoke REST connection**.
4. In **Connection template**, choose the saved REST connection to call.
5. Under **Customize the request**, add any path, query parameters, headers, or JSON body the endpoint expects.
6. Add optional **Step conditions** if this request should run only for matching events.
7. Select **Create** or **Save changes**.

![Invoke01](https://mintcdn.com/vibranium-labs/I_0RvV65IgQ7VVWJ/images/Invoke01.png?fit=max\&auto=format\&n=I_0RvV65IgQ7VVWJ\&q=85\&s=bf2e0ce11176e99f03fbd4a13bbdc71a)

## Request Settings

| **Setting** | **What it controls** |
| - | - |
| **Connection template** | The saved REST connection. The pane shows its method, full URL, preset headers, and timeout. |
| **Path template** | An optional path appended to the connection URL. It must start with `/` and cannot contain a query string or URL fragment. |
| **Params** | Optional query parameters. Keys are plain text; values can use placeholders. |
| **Headers** | Optional request headers sent in addition to the connection's preset headers. Each row needs both a key and a value. |
| **JSON body** | Optional valid JSON for POST, PATCH, and PUT requests. Placeholders work inside JSON values. |
| **Step conditions** | Optional filters for this action only. Both the automation conditions and step conditions must match. |
| **Response mapping** | Optional. Reads values out of the response and writes them onto the alert. Shown on the alert-created trigger only. |

## Insert Placeholders

Press **/** in a path, parameter value, header value, or JSON body to open the placeholder picker. Select a field and Vibe inserts the double-brace expression for you.

![Invoke02](https://mintcdn.com/vibranium-labs/I_0RvV65IgQ7VVWJ/images/Invoke02.png?fit=max\&auto=format\&n=I_0RvV65IgQ7VVWJ\&q=85\&s=e5bac3fa223205ebf686824bf9f19ae5)

Placeholder rules:

* Placeholder names use double braces, for example `{{ alert_id }}`.
* Spaces inside the braces are allowed.
* Parameter and header keys are plain text; placeholders go in their values.
* The path picker hides values that cannot safely form a URL path, such as titles, descriptions, and incident service lists.
* In JSON, a value that is exactly one placeholder keeps its original type. A placeholder inside longer text becomes a string.
* For alert metadata that is not in the picker, enter a dotted path manually, such as `{{ alert_metadata.service.name }}`. The request fails if that path is missing at runtime.

## Alert Placeholders

These fields are available for alert-created and alert-timeline triggers.

| **Placeholder** | **Value** |
| - | - |
| `alert_id` | Internal alert ID |
| `alert_external_id` | Alert ID from the source system |
| `alert_provider` | Alert source or provider |
| `alert_title` | Alert title |
| `alert_description` | Alert description |
| `alert_severity` | Alert severity |
| `alert_status` | Alert status |
| `alert_dedup_key` | Alert deduplication key |
| `alert_team_id` | Team ID linked to the alert |
| `alert_created_at` | Alert creation time in ISO format |
| `alert_updated_at` | Last alert update time in ISO format |
| `alert_source_url` | Link to the alert in its source system |

## Incident Placeholders

These fields are available for incident-created and incident-timeline triggers.

| **Placeholder** | **Value** |
| - | - |
| `incident_id` | Internal incident ID |
| `incident_external_id` | Incident ID used outside Vibe |
| `incident_org_sequence_id` | Incident number within your organization |
| `incident_title` | Incident title |
| `incident_description` | Incident description |
| `incident_status` | Incident status |
| `incident_severity` | Incident severity |
| `incident_service_ids` | List of affected service IDs; use this in the JSON body |
| `incident_created_at` | Incident creation time in ISO format |
| `incident_updated_at` | Last incident update time in ISO format |

## Event Placeholders

Every trigger also offers two placeholders that describe the delivery itself. In the picker they appear as **Event ID** and **Event type**.

| Placeholder | Value |
| - | - |
| `event_id` | An ID for this delivery — the same value sent in the `X-Vibe-Event-Id` header. It stays the same on every retry, so your endpoint can drop duplicates. |
| `event_type` | The trigger that fired — `ALERT_CREATED`, `ALERT_TIMELINE_UPDATED`, `INCIDENT_CREATED`, `INCIDENT_TIMELINE_UPDATED`, or `USER_TRIGGER` for a custom alert action. The same value is sent in `X-Vibe-Event-Type`. |

These two placeholders exist only in this action. Email and channel message templates do not offer them.

## Example

```json theme={null}
{
  "id": "{{ alert_id }}",
  "provider": "{{ alert_provider }}",
  "title": "{{ alert_title }}",
  "severity": "{{ alert_severity }}",
  "sourceUrl": "{{ alert_source_url }}"
}
```

## Validation and Limits

* A path override must start with `/` and cannot contain `?` or `#`.
* Query parameter keys cannot contain spaces, `&`, `=`, `?`, or `#`.
* Header rows require both a key and a value.
* The JSON body must be valid JSON.
* Unknown or disallowed placeholders are rejected before the automation is saved.
* Blank request sections are omitted. Leave the body empty when the endpoint does not expect one.

## Delivery

When the trigger and all conditions match, Vibe renders the placeholders and sends the request through the selected REST connection. Each attempt waits up to the connection's **Timeout (ms)** for a response.

### Retries

When an attempt fails in a way that trying again can fix, Vibe sends the request again — up to **three attempts** in total, waiting 250 ms after the first failure and 500 ms after the second.

| Retried | Not retried |
| - | - |
| A `5xx` response | Any other `4xx` response |
| A `429` response | A response larger than 1 MB |
| No response within the timeout | An address that cannot be resolved or is not allowed |
| A connection that was refused, reset, or dropped | A request that could not be built, such as a missing `alert_metadata` path |

If every attempt fails, the step fails and the steps after it in the same automation are skipped.

### Delivery Headers

Every request carries two headers, added after your own headers so a header of yours with the same name cannot replace them:

| Header | Value |
| - | - |
| `X-Vibe-Event-Id` | 32 hexadecimal characters. The same on every retry of a step; different for each step and each run. |
| `X-Vibe-Event-Type` | The trigger that fired, for example `ALERT_CREATED`. |

Delivery is **at least once**. A request that timed out may already have been processed by your endpoint by the time Vibe sends it again. Keep the event IDs your endpoint has handled and ignore a request whose `X-Vibe-Event-Id` you have already seen.

### Signed Requests

If the connection has a **Signing secret**, every attempt also carries `X-Vibe-Timestamp` and `X-Vibe-Signature`, signed with HMAC-SHA256. Each retry gets a new timestamp and a new signature, so verify every attempt on its own. How the signature is computed, test values, and how to verify it are on the [Connections](https://docs.vibraniumlabs.ai/alerts/connections.md) page.

Without a signing secret, no signature headers are sent. The event ID and event type headers are sent either way.

### Execution Log

In the automation action's **Execution Logs** tab, each run shows the **Event ID** it sent and lists every attempt under **Attempt count** — the status or error, then how long it took:

![](https://mintcdn.com/vibranium-labs/z6cYEzz6lasH-USn/images/automations/5.png?fit=max\&auto=format\&n=z6cYEzz6lasH-USn\&q=85\&s=5ad948f66a4283f98b43f7af2613804e)

## Write the Response Back to the Alert

By default the response is discarded. Add one or more **Response mappings** and Vibe reads values out of the response body and writes them onto the alert that triggered the automation — which turns an outgoing webhook into enrichment.

> [!NOTE]
>
> Response mappings only run on the **Alert is created** trigger, which is the one that has an alert to write onto. On any other trigger the section is not shown at all.

Each mapping is two fields:

| Field | What it does |
| - | - |
| Response path | Where to read in the response body, for example `results[0].server.host_name`. |
| Alert metadata key | The key on the alert to write the value under, for example `hostName`. |

A path the response does not carry is skipped rather than failing the step, and a key an earlier step already wrote is left alone. That is what lets several mappings — or several steps — act as a chain of fallbacks.

### Map each element

A single value is copied across as it is. When the response answers with a **list of records** — a CMDB returning everyone who owns a host, say — switch on **Map each element** on that mapping row. The response path must then point at a list, and every element is rebuilt from the fields you name instead of being copied verbatim.

Two groups of rows build each element:

| Rows | What they do |
| - | - |
| Fields per element | **Field name** plus **Path within the element**. The path is read inside each element, not from the top of the response. |
| Fixed fields | **Fixed field name** plus **Fixed value**, added to every element with the same value — for the parts of the shape the response has no equivalent for. |

For example, an endpoint answers with:

```json theme={null}
{
  "results": [
    {
      "server": {
        "project": {
          "project_owner": [
            { "user": { "user": "jhkim", "user_name": "Kim", "email": "jhkim@example.com" } },
            { "user": { "user": "sylee", "user_name": "Lee", "email": "sylee@example.com" } }
          ]
        }
      }
    }
  ]
}
```

Set **Response path** to `results[0].server.project.project_owner`, **Alert metadata key** to `owners`, switch on **Map each element**, add fields per element of `external_id` → `user.user`, `name` → `user.user_name` and `email` → `user.email`, and one fixed field `kind` = `person`. The alert then carries:

```json theme={null}
[
  { "kind": "person", "external_id": "jhkim", "name": "Kim", "email": "jhkim@example.com" },
  { "kind": "person", "external_id": "sylee", "name": "Lee", "email": "sylee@example.com" }
]
```

Rules for a projection:

* The response path must resolve to a list. If it points at a single object, the mapping is skipped.
* An element carrying none of the named fields is left out. If no element carries any of them, nothing is written.
* At most 100 elements are written.
* A path missing from one element is simply absent from that element — the rest of that element is still written.

The form refuses a projection that cannot work, before you can save it:

* Name at least one field per element, or remove the projection.
* Reserved metadata keys are refused — on the alert metadata key, and on per-element and fixed field names alike.
* A duplicate field name is flagged on the later row, because only the first one is kept.
* A fixed field whose name is also a per-element field is flagged, because the per-element value would always overwrite it.

## Troubleshooting

> [accordion] I cannot see the JSON body field.
>
> * The selected connection uses GET or DELETE. Choose POST, PATCH, or PUT when the endpoint needs a body.

> [accordion] The automation will not save.
>
> * Fix the highlighted path, parameter, header, or JSON error.
> * Check placeholder spelling and make sure the placeholder belongs to the selected trigger.

> [accordion] The request fails at runtime.
>
> * Confirm the connection is enabled and still points to a valid endpoint.
> * If you typed an `alert_metadata` path manually, confirm every matching alert contains that path.
> * Check the endpoint's required headers and JSON shape.
> * A `4xx` response other than `429` is not retried. Open the step's execution log, fix what the endpoint rejected, and run it again.

> [accordion] My endpoint received the same request more than once.
>
> * After a timeout, a `5xx`, or a `429`, Vibe sends the request again. All attempts carry the same `X-Vibe-Event-Id` — ignore one you have already handled.

> [accordion] The signature does not match.
>
> * Each retry has its own timestamp and signature. Verify each attempt with the `X-Vibe-Timestamp` it carries, not the first one's.
> * For everything else, see the signature troubleshooting on the [Connections](https://docs.vibraniumlabs.ai/alerts/connections.md) page.

> [accordion] The endpoint received an unexpected type.
>
> * Use a placeholder as the entire JSON value to preserve numbers, booleans, arrays, objects, or null.
> * Put the placeholder inside longer text only when you want a string.

> [accordion] Nothing was written onto the alert.
>
> * Response mappings run on the **Alert is created** trigger only.
> * Check the response path against a real response. A path the body does not carry is skipped quietly — deliberately, so a partial response still enriches partially.
> * A key another step already wrote is left alone. When two steps target the same key, the first to run wins.
> * For a projection, confirm the path points at a list and that at least one element carries one of the named fields.

> [accordion] My projection saves but writes nothing.
>
> * Paths under **Fields per element** are read inside each element. Against the example above, `user.email` is right and `results[0].user.email` is wrong.


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