Skip to content

API authentication

Every request except one carries your API key in the Authorization header. The one exception is GET /api/v1/openapi.json, which needs no key. See Keys for how to make an API key (it starts with ijk_; an assistant key, mcp_, is refused here).

The header is Authorization: Bearer <key>:

Terminal window
curl https://insightjet.ai/api/v1/ticket-runs \
-H "Authorization: Bearer $INSIGHTJET_API_KEY"

Keep the key in an environment variable or your CI’s secret store.

Expected result: 200 with {"ticketRuns": [...]} (an empty list if you have started none).

To try a key without writing any code, paste it into the API tab of the API playground.

A key that cannot be used is answered 401 in the usual error shape, and nothing is done:

CodeWhy
missing_keyThere is no Authorization: Bearer header.
unknown_keyThe text is not an InsightJet API key.
expired_keyThe key has expired. Make a new one in InsightJet’s settings.
revoked_keyThe key was revoked. The message adds “Make a new one in Settings → Keys.”
mcp_keyThe key is an assistant (MCP) key; the API needs an API key.

For example:

{
"error": {
"code": "missing_key",
"message": "Send your API key in the header \"Authorization: Bearer <key>\"."
}
}

Two more refusals come after the key is accepted, because every request also checks the key’s owner:

  • 403 key_not_usable: the owner has left the team the key was made for. Make a new key.
  • 503 team_unchecked: InsightJet could not check the owner’s team just now. Nothing was done; try again in a minute.

A key made by default works for 365 days. The new-key screen asks only for a name.

Open Settings → Keys → API keys and click Revoke next to the key, then Revoke key to confirm. The key is checked on every request, so it stops working at once. A revoked key answers 401 revoked_key.

No daily run limit. Unlike an assistant key, which may start 20 ticket runs in 24 hours, an API key has no daily cap on starting runs. A start is still refused when the owner is out of agent-hours or has as many agents working as their plan allows; see Errors and limits.

Request speed. The owner of a key may make 120 reads and 30 changes a minute, counted for the owner across all of their API keys. A read is a GET or HEAD; every other request is a change. Past that, a request is answered 429 too_many_requests with a Retry-After header giving the seconds to wait. A refused request is not counted.

Expected result of going over: status 429, header Retry-After: <seconds>, and the code too_many_requests.