← all test cases

Revoked API key

A key revoked by the agent (or by AirIQ) answers 401 at generate-token at once.

  1. 1 Generate token: failed 401
▸1. Generate tokenPOST /generate-tokenfailed 401
What this step returned(click to expand)
  • Failed with HTTP 401: Authentication required (Invalid API key)
  • This reply is the sample: later steps of the case were not called with it.
Request body
{
  "api_key": "<redacted>"
}
Reply (failed, HTTP 401)
{
  "code": 9001,
  "message": "Authentication required",
  "detail": "Invalid API key",
  "traceId": "6c3be70b6e70e9a2f3dd37c476c76ae0"
}
Keys and what they mean
Request
keytypewhen presentimportancemeaning
api_keystringrequiredmust readYour API key (starts with aiqo_). Keep it on your server; never send it from a browser or app.
Total: 1 keys
Reply
keytypewhen presentimportancemeaning
tokenstringalwaysmust readSend it as Authorization: Bearer <token> on every other call.
token_typestringalwaysinformationalAlways Bearer.
expires_inintegeralwaysmust readSeconds the token lives (14400 = 4 hours). Get a new token before it ends; a call with an expired token answers 401.
expires_atdatetimealwaysusefulThe same end as a time (UTC).
Total: 4 keys
Errors this call answers with (4)
HTTPcodemessagedetailwhen
4019001Authentication requiredInvalid api_keyUnknown key, suspended user, or the API has no API-key routes (today). Observed on the local stack.
4019001Authentication requiredApi_key required
4005000Invalid request(Huma's text)Malformed JSON or wrong content type.
4299004Too many requestsRate limit, when configured.
Questions developers ask (2)
How long does a token last?
4 hours (expires_in, expires_at). Renew before it ends; an expired token answers 401 with code 9001.
Can I call the API from a browser or a mobile app?
No. The API key must stay on your server; call the API from there.