Docs menu

    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.
    Create key. The new key is shown once.
    The API keys card on Account, with the Key name field filled in as Northwind reader and the Create key button.The API keys card on Account, with the Key name field filled in as Northwind reader and the Create key button.

    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.

    • GET https://usegreenbar.com/api/v1/projects

      Returns: Your clients, newest first. Each has id, name, slug and createdAt.

    • GET https://usegreenbar.com/api/v1/projects/{id}/monitors

      Returns: 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

      Returns: 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.

    • title

      What it does: The title at the top of the page.

    • notice

      What it does: A notice at the top of the page. An empty string or null removes it.

    • language

      What it does: en, es, fr, de or pt. Any language but en needs a paid plan.

    • monitors

      What it does: 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.

    • 400

      Message: css can't be changed through the API. Use the dashboard.

      Why: 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

      Message: Status page languages are on paid plans.

      Why: Your plan doesn't include other languages.

    • 403

      Message: This isn't available yet

      Why: The notice, groups or other languages aren't switched on for Greenbar yet.

    • 404

      Message: Monitor not found in project

      Why: A monitor id isn't one of this client's.

    • 409

      Message: This status page was changed while your request was being handled. Try again.

      Why: 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.

    • period

    • cadence (month or week)

    • periodLabel

    • periodStart

    • periodEnd

    • latestRevision

    • savedAt

    • 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.

    • 400

      Message: period must be a month such as 2026-11, or a week given as its Monday's date such as 2026-11-02

      Why: The period can't be read.

    • 400

      Message: Weekly reports aren't available yet.

      Why: Weeks aren't switched on.

    • 400

      Message: revision must be a whole number of 1 or more

      Why: The revision can't be read.

    • 403

      Message: Client reports are on paid plans.

      Why: The plan doesn't include them.

    • 404

      Message: That revision doesn't exist for this period.

      Why: Use a revision from the list.

    • 503

      Message: This report could not be read. Open it in the dashboard.

      Why: 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.

    OpenAPI description is the file for the API.
    The API keys card with the OpenAPI description link under the introduction, then Key name, What this key can do and Create key.The API keys card with the OpenAPI description link under the introduction, then Key name, What this key can do and Create key.

    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

    • Not found

      Why: The client or monitor is not in this account.

      What to change: Use an id this key's account owns.

    • A valid API key is required

      Why: The Authorization header is missing or is not a live gb_live_ key.

      What to change: Send the key as Bearer.

    • Too many requests

      Why: The key passed 120 requests in 1 minute.

      What to change: Wait 1 minute, then try again.

    • limit must be a whole number from 1 to 100

      Why: limit is not a whole number in the range the message gives. The most is 100.

      What to change: Omit limit, or send a number in that range.