> For the complete documentation index, see [llms.txt](https://docs.aicrisk.com/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.aicrisk.com/api-overview/airisk-api-oauth2-authentication/tokens/error-handling.md).

# Error Handling

**Error Handling**: If any step fails (e.g., missing parameters, invalid code, or user denies access), an error will be returned instead of an access token. Error responses are yielded as HTTP Reponses with a `status_code` int, and a `reason` string explaining the error. Some endpoints like `/api/oauth2` return a response with json bodies containing fields for further understanding and debugging the error.
