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.
Make your first request
Create a token
In grcHero, open Settings, API tokens, and create a token with only the permissions it needs, for example Email checks.
Find your workspace ID
Every request names the workspace in the
X-Organization-IDheader.Call the API
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.
curl "https://api.grchero.dev/v1/risks?limit=100" \
-H "Authorization: Bearer $GRCHERO_API_TOKEN" \
-H "X-Organization-ID: $GRCHERO_ORGANIZATION_ID"{
"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.
{
"error": {
"code": "token_not_permitted",
"message": "This token is not allowed to do that.",
"request_id": "8f2c...",
"details": {}
}
}| Status | Code | Meaning |
|---|---|---|
400 | organization_required | X-Organization-ID is missing or not a workspace ID |
401 | api_token_required | No Authorization: Bearer header was sent |
401 | invalid_credential | The token is wrong, expired or revoked, or not for this workspace |
403 | token_not_permitted | The token does not hold that permission, or the request deletes something (tokens never delete) |
404 | not_found | No such record in this workspace, or a path the API host does not serve |
422 | invalid_request | A parameter or field is missing or not valid |
429 | rate_limited | Too many requests; wait for Retry-After seconds |
5xx | A problem on our side; retry with backoff and quote request_id |