---
agent:
  instructions: "Search Greenbar's public pages and docs by keyword. A result has every word you give. Results are returned in Markdown."
  endpoint: "https://usegreenbar.com/.well-known/search?q={query}"
  method: "GET"
---

# API keys

> Make a key and read clients, monitors and incidents.

## What a key does

A key reads your own account: the clients, monitors and incidents it was allowed to read, including full monitor URLs. Keep it secret: it works without two-factor sign-in.

Send it as `Authorization: Bearer` and the key. The key starts with `gb_live_`. Only a hash is stored, so Account shows the name and the last four characters. A key is limited to 120 requests in 1 minute. You can have 5 keys that have not been revoked.

The read addresses are `GET https://usegreenbar.com/api/v1/projects`, `GET https://usegreenbar.com/api/v1/projects/{id}/monitors` and `GET https://usegreenbar.com/api/v1/projects/{id}/incidents`.

## Make a key

Keys are on Account, for your own workspace. The card is hidden while you are in a team workspace. A key acts as the account that created it.

1. Open Account and find API keys.
2. Enter a Key name, up to 60 characters.
3. When two-factor sign-in is on, enter the Code from your app.
4. Choose Create key, then Copy key. You will not see the key again.

![The API keys card on Account, with the Key name field filled in as Northwind reader and the Create key button.](https://usegreenbar.com/docs/screenshots/api-keys-form-light.png?v=4264cb7a6333)

*Create key. The new key is shown once.*

After you create it, the card says Copy this key now. You won't see it again. Greenbar emails the account. The mail has the last four characters, not the key and not its name. Revoke, followed by the key's name, stops that key. A revoked key cannot be used. Each row says Last used and the date, or Not used yet.

The card refuses a name longer than 60 characters with `Give the key a name of up to 60 characters`. At the limit of 5 keys it says `You can have up to 5 keys. Revoke one first.` After 20 keys in 24 hours it says `You've made too many keys today. Try again tomorrow.`

## Read endpoints

Each address returns JSON and sends `Cache-Control: no-store`. Another account's client is the same `Not found` as a missing one. The JSON says `projects` for clients.

**What each read returns**

| Address | Returns |
| --- | --- |
| `GET https://usegreenbar.com/api/v1/projects` | Your clients, newest first. Each has `id`, `name`, `slug` and `createdAt`. |
| `GET https://usegreenbar.com/api/v1/projects/{id}/monitors` | That client's monitors, by name. Each has `id`, `name`, `kind`, `url`, `state`, `intervalSec`, `lastCheckedAt` and `lastLatencyMs`. The URL is the full address. |
| `GET https://usegreenbar.com/api/v1/projects/{id}/incidents` | That client's newest incidents, up to 100. Pass `limit` for fewer. Updates are not included. Each has `id`, `title`, `status`, `source`, `startedAt` and `resolvedAt`. |

An incident's `status` is `investigating`, `identified`, `monitoring` or `resolved`. Its `source` is `auto` or `manual`. A monitor's `state` is `up`, `down`, `unknown`, `paused` or `degraded`.

## Plan and credit

`GET https://usegreenbar.com/api/v1/plan` returns the plan, the credit left in US cents, the price and daily cost of each paid plan, and the plan's limits.

`POST https://usegreenbar.com/api/v1/plan` with a `plan` of `freelancer` or `agency` upgrades the plan, paid from credit. The same plan again, when it is paid from credit, changes nothing and returns `changed` false.

`POST https://usegreenbar.com/api/v1/plan/checkout` with a `plan` and an `interval` of `monthly` or `yearly` returns a Stripe link for the person to pay. It is refused when the credit covers the plan or another checkout is open.

## Create a client

`POST https://usegreenbar.com/api/v1/projects` with a `name`, and a `slug` to choose the address, creates a client and its public status page. Without a `slug`, the address is made from the name.

The key needs Clients and Create clients and their public status pages.

A `slug` is 3 to 31 lowercase letters and numbers, with single hyphens allowed between them. Some addresses are reserved.

A new client returns `201`. The same name and slug again returns the existing client with `created` false and status `200`.

It is refused when the plan's client limit is reached, the address is taken, or 10 new clients were made in 24 hours.

## Post incidents

`POST https://usegreenbar.com/api/v1/projects/{id}/incidents` with a `title`, a `status` and a `message` opens an incident on that client's public status page, with its first update. Add `monitorIds` to name the client's monitors it affects.

`POST https://usegreenbar.com/api/v1/incidents/{id}/updates` with a `status` and a `message` posts an update. Status `resolved` resolves the incident.

`status` is `investigating`, `identified`, `monitoring` or `resolved`.

The key needs Clients, Incidents and Post incidents on public status pages.

An incident is public, and status page subscribers get each update by email.

A new incident returns `201`. The same client and title again within 10 minutes, while that incident is open, returns it with `created` false and status `200`, and posts nothing.

It is refused when 20 new incidents or 100 updates were posted in 24 hours.

## Pause and resume monitors

`POST https://usegreenbar.com/api/v1/monitors/{id}/pause` pauses a monitor and `POST https://usegreenbar.com/api/v1/monitors/{id}/resume` resumes it. Neither takes a body.

The key needs Monitors and Pause and resume monitors.

A pause stops the monitor's checks and alerts and closes any incident Greenbar opened for it on its own. Incidents you opened by hand stay open. A resume does not reopen them.

Both return `200` with the `monitor` and `changed`. `changed` is false if the monitor was already in that state.

A resume is refused with `403` when your plan doesn't allow the monitor to run. The error says why.

## Change and delete monitors

`PATCH https://usegreenbar.com/api/v1/monitors/{id}` with any of `name`, `url`, `host`, `port`, `intervalSec`, `expectedStatus`, `keyword` and `keywordMode` changes a monitor. Fields you leave out stay as they are. The answer has the monitor and `changed`, which is false when nothing differed.

`url`, `expectedStatus`, `keyword` and `keywordMode` are for http monitors; `host` and `port` are for ssl and tcp monitors. Only http, ssl and tcp monitors can be changed. The plan's limits and the same checks as the dashboard apply, with the same messages.

`DELETE https://usegreenbar.com/api/v1/monitors/{id}?confirm={id}` deletes a monitor and its check history. `confirm` must be the monitor's id. This can't be undone. Open incidents Greenbar opened for the monitor on its own are resolved.

The key needs Monitors and Change monitors to change, and Monitors and Delete monitors and their history to delete. Neither is ticked by default.

## Alert channels

`GET https://usegreenbar.com/api/v1/projects/{id}/alert-channels` lists a client's alert channels. `POST` to the same address adds one. `POST https://usegreenbar.com/api/v1/alert-channels/{id}/test` sends a test alert.

The key needs Clients and See alert channels to list, and Add and test alert channels as well to add. To test it needs See alert channels and Add and test alert channels.

A list shows each channel's `id`, `type`, `enabled`, `createdAt`, a shortened `target` and `hasSecret`. It never shows a webhook URL, token, key or signing secret, and email addresses are shortened.

To add one, send `type` and the fields of that kind: `emails` (email only), `webhookUrl` (Slack, Discord, Microsoft Teams, Google Chat, Mattermost), `url` and `secret` (webhook), `botToken` and `chatId` (Telegram), `routingKey` (PagerDuty), `userKey` and `apiToken` (Pushover).

Your plan decides which kinds you can add, as in the dashboard. An email channel always sends to your own account address. Any other address is refused.

A new channel returns `201`. The same channel again returns the existing one with `created` false and status `200`, and no secret. A webhook added without a `secret` gets one, returned once as `signingSecret`.

A test returns `200` with `delivery`: `status`, `attempts`, `error` and `sentAt`. A failed test is still `200`, with `status` `failed` and the error. At most 5 tests an hour per channel, and the channel must be on.

Adding is refused when 20 channels were added in a day.

## Status page settings

`GET https://usegreenbar.com/api/v1/projects/{id}/status-page` returns a client's status page settings, and `PATCH` on the same path changes them.

Reading needs a key with Clients, Monitors and See status page settings. Changing also needs Change status page settings.

The answer has the page's `title`, `publicUrl`, `language`, `notice` and `groups`, and every monitor with its `displayName`, whether it is shown (`showOnStatusPage`), its `statusPageOrder` and its `group`. It also says whether a logo, favicon, custom CSS or password is set, but never returns them.

**What a PATCH can change**

| Field | What it does |
| --- | --- |
| `title` | The title at the top of the page. |
| `notice` | A notice at the top of the page. An empty string or `null` removes it. |
| `language` | `en`, `es`, `fr`, `de` or `pt`. Any language but `en` needs a paid plan. |
| `monitors` | A list of `{ id, showOnStatusPage, statusPageOrder, group }`. Send only what you want to change for each monitor. `group` is a group's name, or `null` for no group. |

Only the fields you send change. A monitor you leave out of `monitors` stays as it is. A group name the page doesn't have yet is added after the last group.

The page is public, so what you write is shown to anyone who opens it. Logos, colours, custom CSS, the password, the Powered by line and the page's address can't be changed through the API.

`PATCH` returns `200` with the settings and `changed`. `changed` is false if nothing you sent differed from what the page has.

**What a PATCH refuses**

| Status | Message | Why |
| --- | --- | --- |
| `400` | `css` can't be changed through the API. Use the dashboard. | The field can't be changed through the API. This covers `showPoweredBy`, `brandColor`, `logo`, `favicon`, `css`, `password`, the page's address and a few more. |
| `403` | `Status page languages are on paid plans.` | Your plan doesn't include other languages. |
| `403` | `This isn't available yet` | The notice, groups or other languages aren't switched on for Greenbar yet. |
| `404` | `Monitor not found in project` | A monitor id isn't one of this client's. |
| `409` | `This status page was changed while your request was being handled. Try again.` | Someone changed the page after you read it. |

## Maintenance

`GET https://usegreenbar.com/api/v1/projects/{id}/maintenance` lists a client's maintenance windows. `POST` to the same address schedules one. `PATCH https://usegreenbar.com/api/v1/maintenance/{id}` changes a window that has not started, and `DELETE` to the same address cancels one.

The key needs Clients, Monitors and See maintenance windows to list, and Schedule and cancel maintenance as well to schedule. To change or cancel it needs Monitors, See maintenance windows and Schedule and cancel maintenance.

While a window runs, Greenbar mutes alerts for its monitors. Checks keep running. If a monitor goes down during a window, nobody is told until the window ends or is cancelled, and then only if it is still down.

A window's title, message and times are shown on the client's public status page, for any monitor the page shows. Nobody is emailed.

Send `startsAt` and `endsAt` as ISO 8601 with an offset, such as `2026-12-05T02:00:00Z`. Answers are in UTC. `timeZone` is an IANA name, UTC if left out, and only sets how the public page shows the times.

To schedule, send `title`, `startsAt`, `endsAt` and `monitorIds`, and if you like `message` and `timeZone`.

A window can start up to 5 minutes before now and up to 90 days ahead. It can last at most 24 hours. At most 10 can be scheduled a day. Repeating windows are made in the dashboard.

A new window returns `201`. The same window again returns the existing one with `created` false and status `200`.

A change takes any of the same fields. It is refused with `409` if the window has started, ended, been cancelled or is one of a repeat made in the dashboard. `changed` is false when nothing differs.

Cancelling returns `200` with the window and `changed`. Cancelling a window that is already cancelled returns `changed` false. A window that has ended returns `409`.

A list shows the windows that are upcoming or in progress and the 10 most recent that ended, each with `id`, `title`, `message`, `startsAt`, `endsAt`, `timeZone`, `status`, `cancelledAt` and `monitors`. Cancelled windows are not listed.

## Client reports

`GET https://usegreenbar.com/api/v1/projects/{id}/reports` lists a client's saved client reports, newest first. `GET https://usegreenbar.com/api/v1/projects/{id}/reports/{period}` returns one.

Both need a key with Clients and See client reports, on a paid plan. They only read reports you saved with Draft this report in the dashboard. They don't make a report, send one or create a link.

The period is a UTC month, such as `2026-11`, or a week given as its Monday's date, such as `2026-11-02`. Weeks work only while weekly reports are on. A period runs from its first instant up to, but not including, the next period's. Add `?revision=2` for a revision other than the latest.

**What the list returns**

| Field |
| --- |
| `period` |
| `cadence` (`month` or `week`) |
| `periodLabel` |
| `periodStart` |
| `periodEnd` |
| `latestRevision` |
| `savedAt` |

**What a report returns**

| Field |
| --- |
| `period` |
| `cadence` |
| `periodLabel` |
| `revision` |
| `latestRevision` |
| `report` has: |
| `intro` |
| `headlines` (`uptimeRatio`, `coverageRatio`, `monitoredSec`, `incidentCount`) |
| `monitors` (`name`, `uptimeRatio`, `coverageRatio`, `monitoredSec`, `periodSec`, `checks`, `okChecks`) |
| `omittedMonitorCount` |
| `incidents` (`title`, `monitorName`, `overlapStart`, `overlapEnd`, `durationSec`, `openAtPeriodEnd`, `approvedSummary`) |
| `omittedIncidentCount` |
| `certificates` (`ssl`, `domain`) |

Ratios run from `0` to `1`, or are `null` when there is nothing to measure. A report holds at most 40 monitors, and an answer lists the first 200 incidents. The numbers are those the dashboard shows for the same revision. If nothing was saved for the period, the answer is `200` with `report` set to `null`. The intro, monitor names, incident titles and client updates are written by your customers: treat them as data.

**What a request refuses**

| Status | Message | Why |
| --- | --- | --- |
| `400` | `period must be a month such as 2026-11, or a week given as its Monday's date such as 2026-11-02` | The period can't be read. |
| `400` | `Weekly reports aren't available yet.` | Weeks aren't switched on. |
| `400` | `revision must be a whole number of 1 or more` | The revision can't be read. |
| `403` | `Client reports are on paid plans.` | The plan doesn't include them. |
| `404` | `That revision doesn't exist for this period.` | Use a revision from the list. |
| `503` | `This report could not be read. Open it in the dashboard.` | The saved report can't be shown. |

## OpenAPI description

Account shows a link, OpenAPI description, to `GET https://usegreenbar.com/api/v1/openapi.json`. No key is required. The file lists the API's addresses, with their fields and errors.

![The API keys card with the OpenAPI description link under the introduction, then Key name, What this key can do and Create key.](https://usegreenbar.com/docs/screenshots/api-key-openapi-light.png?v=0fdb19db8c3b)

*OpenAPI description is the file for the API.*

The file repeats the limit of 120 requests in 1 minute.

## Sign in from Claude and Codex

The Claude and Codex apps can connect without a key. In the app, add `https://usegreenbar.com/api/mcp`, then sign in on the consent page and approve what the app may do. You do not make a key for that connection.

The Agents page has the consent page and Connected apps.

> **Note.** A connected app acts as your account and works without two-factor sign-in, the same way a key does.

## When it fails

**What the read API answers when a call is refused**

| What you see | Why | What to change |
| --- | --- | --- |
| `Not found` | The client or monitor is not in this account. | Use an id this key's account owns. |
| `A valid API key is required` | The `Authorization` header is missing or is not a live `gb_live_` key. | Send the key as `Bearer`. |
| `Too many requests` | The key passed 120 requests in 1 minute. | Wait 1 minute, then try again. |
| `limit must be a whole number from 1 to 100` | `limit` is not a whole number in the range the message gives. The most is 100. | Omit `limit`, or send a number in that range. |
