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

# OpenAPI integration

> Connect any HTTP API from its OpenAPI spec so ewake can call its operations during investigations.

> [!NOTE]
>
> **What you'll get:** ewake can call your own API, an internal gateway, a service catalog, a deploy tool, without an MCP server in front of it. Give it the OpenAPI spec, and each operation you allow becomes a tool ewake can call.

> [!NOTE]
>
> Already run an MCP server for this API? Connect it as a [Custom MCP server](https://docs.ewake.ai/integrations/custom/custom-mcp.md) instead.

***

## Prerequisites

* An **OpenAPI 3** spec of the API, as an HTTPS URL or as JSON or YAML you can paste
* The API reachable from ewake over HTTP or HTTPS (prefer HTTPS)
* Credentials for the API: request headers (an API key, for example), an OAuth client, or a service account of a JWT issuer. Prefer **read-only** credentials.

***

## Configuration

The form has three steps: **Spec**, **Connection** and **Operations**.

**1. Open the OpenAPI integration in ewake**

In your ewake dashboard, go to **Integrations** and click the **OpenAPI** tile under **Add more**.

**2. Spec**

| Field | Value |
| - | - |
| **API name** | A label to tell your APIs apart (e.g. `billing`, `observability`). Ewake names the tools of this API after it. Letters, digits, `-` or `_`, starting with a letter or digit, max 64 characters. |
| **OpenAPI spec** | The HTTPS URL of the spec, or the whole spec pasted as JSON or YAML |

Ewake reads the spec as you type and shows it as a tree, or the line and column of the error. **Next** opens once the spec is read.

> [!NOTE]
>
> Ewake looks for OpenAPI 3. It still reads a Swagger 2.0 spec, with a warning, but rejects each part that doesn't follow OpenAPI 3. Give the base URL yourself in that case.

**3. Connection**

| Field | Value |
| - | - |
| **Base URL** | The URL ewake sends requests to. It starts as the first server of the spec. |
| **Authentication** | **Request headers**, **Client credentials** or **JWT issuer**, see [Authentication](#authentication) |
| **Request headers** | Headers sent with every request, e.g. an API key or a Cloudflare Access service token. Stored encrypted. |

Click **Test connection**. For a JWT issuer, the test also logs in. A successful test opens the next step.

**4. Operations**

Check the **Description**. Ewake fills it from the spec and reads it to decide when to call this API, so say what the API gives access to.

Then choose the operations ewake may call. They are grouped by tag, with a search.

* Reads (`GET`, `HEAD`) start **on**.
* Writes (`POST`, `PUT`, `PATCH`, `DELETE`) start **off**. Turn on each one on purpose.
* Tick **Read-only** on a `POST` that only reads, such as a search.
* An operation ewake can't call shows its reason with no switch, for example a body that isn't JSON.

> [!WARNING]
>
> Ewake can only call the operations you turn on here.

**5. Save**

Click **Save**.

> [!TIP]
>
> The API is connected. Ewake calls it during investigations when the description matches what it's looking for.

***

## Authentication

| Option | Fields | How ewake authenticates |
| - | - | - |
| **Request headers** | The headers only | Sends the headers you set, for example `Authorization: Bearer <key>` or `X-API-Key`. |
| **Client credentials** | **Token URL**, **Scope** (optional), **Client ID**, **Client secret** | Gets an OAuth token from the token URL and renews it before it expires. |
| **JWT issuer** | **Login URL**, **Payload body**, **Token attribute** | Posts the payload body (the JSON credentials of a service account) to the login URL, and sends the token at the **Token attribute** of the answer (`access_token` by default) as a Bearer token. When the answer isn't JSON, ewake sends the whole answer as the `Authorization` header. It logs in again before the token expires. |

The client secret and the payload body are stored encrypted. The headers go with the token in every option.

***

## Writes

A write you turn on is an action. Ewake calls it only when a run may act:

* A question from a member or an admin can call every write you turned on.
* A follow-up action calls only the writes it names.
* An investigation never calls a write.

See [Permissions](https://docs.ewake.ai/security/permissions.md).

***

## Change the operations or add an API

Click **Configure** on the **OpenAPI** card, then the **Tools** button next to the API, to turn its operations on or off.

OpenAPI accepts more than one connection: connect each API with its own name, spec, credentials and operations. Give each a distinct description, ewake matches on it.

***

## Security

* **You choose the operations.** Ewake never calls an operation you left off.
* **Requests stay on the base URL.** Ewake refuses a request whose URL leaves the origin of the base URL, so your headers and token go nowhere else.
* **Secrets are stored encrypted**, the same way integration secrets are.
* **Outbound only.** Ewake calls your API, you open no inbound ports to ewake.

> [card] [How ewake handles permissions and data →](https://docs.ewake.ai/security/permissions.md)

***

Need help connecting an API? Contact [support@ewake.ai](https://docs.ewake.ai/support.md).


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