Skip to content

Get started

The grcHero API

Call grcHero from your own code with an API token. Every request is authenticated, rate limited and attributed to the token that made it.

On this page

Make your first request

  1. Create a token

    In grcHero, open Settings, API tokens, and create a token with only the permissions it needs, for example Email checks.

  2. Find your workspace ID

    Every request names the workspace in the X-Organization-ID header.

  3. Call the API

    Terminal
    curl "https://api.grchero.dev/v1/email-checks?domain=mailinator.com" \
      -H "Authorization: Bearer $GRCHERO_API_TOKEN" \
      -H "X-Organization-ID: $GRCHERO_ORGANIZATION_ID"

Note: Keep tokens in a secret store, never in source code or a browser. Revoke one in Settings at any time; it stops working at once.

Authentication

Send the token as Authorization: Bearer grc_... and the workspace as X-Organization-ID. The API host accepts tokens only; it never reads cookies or browser sessions.

A token holds a fixed set of permissions chosen when it is created. A request outside them is refused with 403 token_not_permitted.

Rate limits

Each token has its own per-minute limit, chosen when it is created (600 by default, up to 6,000) and shown beside it in Settings. Over the limit, the API answers 429 rate_limited with Retry-After: 30; wait that many seconds before trying again. The CLI's browser sign-in gets the same 600 a minute; use a token with a higher limit for heavier scripts.

Pagination

Lists that can grow are paged with a cursor. Ask for a page with limit (1 to 100, default 50); the answer is { "items": [...], "next_cursor": "..." }, and you pass next_cursor back as cursor for the next page until it is null. Cursors are opaque; a damaged one is 422 invalid_cursor.

/assets, /risks, /controls, /evidence and /vendors answer the whole list as a plain array unless you send limit or cursor; then they answer a page with total, the whole list's count. Always send limit in scripts so large workspaces stay fast.

Terminal
curl "https://api.grchero.dev/v1/risks?limit=100" \
  -H "Authorization: Bearer $GRCHERO_API_TOKEN" \
  -H "X-Organization-ID: $GRCHERO_ORGANIZATION_ID"
Output
{
  "items": [{ "id": "0193...", "title": "Laptop theft", "status": "open" }],
  "next_cursor": "MjAyNi0xMS0x...",
  "total": 128
}

Errors

Errors share one shape. code is stable and safe to branch on; message is for people; request_id identifies the request if you contact support.

JSON
{
  "error": {
    "code": "token_not_permitted",
    "message": "This token is not allowed to do that.",
    "request_id": "8f2c...",
    "details": {}
  }
}
StatusCodeMeaning
400organization_requiredX-Organization-ID is missing or not a workspace ID
401api_token_requiredNo Authorization: Bearer header was sent
401invalid_credentialThe token is wrong, expired or revoked, or not for this workspace
403token_not_permittedThe token does not hold that permission, or the request deletes something (tokens never delete)
404not_foundNo such record in this workspace, or a path the API host does not serve
422invalid_requestA parameter or field is missing or not valid
429rate_limitedToo many requests; wait for Retry-After seconds
5xxA problem on our side; retry with backoff and quote request_id
grcHero API. Authenticated, rate limited, attributed to your token.