> 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/authorization-endpoint/error-responses.md).

# Error Responses

* 401 - Unauthorized
  * For example, if passing in an unknown `client_id`, the endpoint returns a response like:

    >

    ```json
        {
        "type": "https://tools.ietf.org/html/rfc9110#section-15.5.2",
        "title": "Unauthorized",
        "status": 401,
        "traceId": "00-676e4f60e893d3cf6bb37b9262dda023-7d0ef785dd85a317-00"
        }
    ```
  * With Parameters:
    1. `type`: string url - Link to the RFC
    2. `title`: string - Human-readable name of the error
    3. `status`: int - The Error Code
    4. `traceId`: string - The id of the trace with which to use to check the stack trace later on.
* Note: It’s recommended to also include a "state" parameter (in our case: `code`) in the authorization URL (not shown above) to maintain state between the request and callback (protecting against CSRF attacks). The AIRisk authorization server will return this state value unmodified in the redirect. This is part of OAuth2 best practices, though for brevity the examples here focus on the core parameters.


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## Querying This Documentation
If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter, and the optional `goal` query parameter:

```
GET https://docs.aicrisk.com/api-overview/airisk-api-oauth2-authentication/authorization-endpoint/error-responses.md?ask=<question>&goal=<endgoal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is optional and describes the broader end goal you are ultimately trying to accomplish on behalf of the user. GitBook uses it to tailor the answer towards what is most useful for that goal.

The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
