> For the complete documentation index, see [llms.txt](https://www.center.daxium-air.com/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://www.center.daxium-air.com/api-reference/authorization.md).

# Authorization

Obtain and refresh OAuth2 tokens

## Legacy alias of the POST method.

> The parameters are read from the request body, so this method is kept for backward compatibility only. Use \`POST\`.

```json
{"openapi":"3.0.0","info":{"title":"Daxium Air API","version":"v1.3"},"tags":[{"name":"auth"}],"servers":[{"url":"https://api.daxium-air.com","description":"Production"}],"security":[],"paths":{"/oauth/v2/token":{"get":{"tags":["auth"],"summary":"Legacy alias of the POST method.","description":"The parameters are read from the request body, so this method is kept for backward compatibility only. Use `POST`.","operationId":"getOrRefreshTokenLegacy","parameters":[{"$ref":"#/components/parameters/XAcceptVersion"}],"requestBody":{"required":true,"content":{"application/x-www-form-urlencoded":{"schema":{"oneOf":[{"$ref":"#/components/schemas/PasswordGrantRequest"},{"$ref":"#/components/schemas/RefreshTokenGrantRequest"}]}}}},"responses":{"200":{"description":"Token pair issued successfully","content":{"application/json":{"schema":{"$ref":"#/components/schemas/TokenResponse"}}}},"400":{"description":"Unknown or missing grant type, missing credentials for the requested grant, or a user who signs in through SSO.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/BasicErrorResponse"}}}},"429":{"description":"Too many login attempts for this username and IP address.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}},"deprecated":true}}},"components":{"parameters":{"XAcceptVersion":{"name":"X-Accept-Version","in":"header","description":"API version to apply. Defaults to `v1.0` when omitted; an unknown value falls back to the latest version.","required":false,"schema":{"type":"string","default":"v1.3","enum":["v1.0","v1.1","v1.2","v1.3"]}}},"schemas":{"PasswordGrantRequest":{"required":["client_id","client_secret","grant_type","username","password"],"properties":{"client_id":{"description":"OAuth2 application id.","type":"string"},"client_secret":{"description":"OAuth2 secret key.","type":"string"},"grant_type":{"type":"string","enum":["password"]},"username":{"description":"Email address of the user.","type":"string"},"password":{"type":"string"}},"type":"object"},"RefreshTokenGrantRequest":{"required":["client_id","client_secret","grant_type","refresh_token"],"properties":{"client_id":{"type":"string"},"client_secret":{"type":"string"},"grant_type":{"type":"string","enum":["refresh_token"]},"refresh_token":{"type":"string"}},"type":"object"},"TokenResponse":{"properties":{"access_token":{"description":"Token to send in the `Authorization` header.","type":"string"},"refresh_token":{"description":"Token to keep in order to refresh the access token.","type":"string"},"expires_in":{"description":"Lifetime of the access token, in seconds.","type":"integer"},"token_type":{"description":"Always \"bearer\". Unused.","type":"string"},"scope":{"description":"Unused.","type":"string"}},"type":"object"},"BasicErrorResponse":{"description":"Reduced error body, returned by the few endpoints that build the response themselves instead of letting the REST exception subscriber format it — the token endpoint notably, since that subscriber only runs on the API host.","properties":{"code":{"type":"integer"},"message":{"type":"string"}},"type":"object"},"ErrorResponse":{"description":"Standardised error body returned by the REST exception subscriber.","properties":{"code":{"description":"Daxium error code.","type":"string"},"message":{"type":"string"},"url":{"description":"Link to the error code in the error reference.","type":"string"},"api_version":{"type":"string"},"infos":{"description":"Additional context about the error, when the exception carries any.","type":"array","items":{}},"server_time":{"type":"integer"}},"type":"object"}}}}
```

## Get or refresh tokens

> Every other endpoint is authenticated with the \`access\_token\` returned here, sent as \`Authorization: Bearer \<token>\`.\
> \
> The \`access\_token\` is valid for one hour, the \`refresh\_token\` for 42 days. Refreshing resets the expiry of the\
> access token and issues a new refresh token, so a client that refreshes often is never logged out.\
> \
> Parameters are sent in the request body, encoded as \`application/x-www-form-urlencoded\`.

```json
{"openapi":"3.0.0","info":{"title":"Daxium Air API","version":"v1.3"},"tags":[{"name":"auth"}],"servers":[{"url":"https://api.daxium-air.com","description":"Production"}],"security":[],"paths":{"/oauth/v2/token":{"post":{"tags":["auth"],"summary":"Get or refresh tokens","description":"Every other endpoint is authenticated with the `access_token` returned here, sent as `Authorization: Bearer <token>`.\n\nThe `access_token` is valid for one hour, the `refresh_token` for 42 days. Refreshing resets the expiry of the\naccess token and issues a new refresh token, so a client that refreshes often is never logged out.\n\nParameters are sent in the request body, encoded as `application/x-www-form-urlencoded`.","operationId":"getOrRefreshToken","parameters":[{"$ref":"#/components/parameters/XAcceptVersion"}],"requestBody":{"required":true,"content":{"application/x-www-form-urlencoded":{"schema":{"oneOf":[{"$ref":"#/components/schemas/PasswordGrantRequest"},{"$ref":"#/components/schemas/RefreshTokenGrantRequest"}]}}}},"responses":{"200":{"description":"Token pair issued successfully","content":{"application/json":{"schema":{"$ref":"#/components/schemas/TokenResponse"}}}},"400":{"description":"Unknown or missing grant type, missing credentials for the requested grant, or a user who signs in through SSO.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/BasicErrorResponse"}}}},"429":{"description":"Too many login attempts for this username and IP address.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}}}}},"components":{"parameters":{"XAcceptVersion":{"name":"X-Accept-Version","in":"header","description":"API version to apply. Defaults to `v1.0` when omitted; an unknown value falls back to the latest version.","required":false,"schema":{"type":"string","default":"v1.3","enum":["v1.0","v1.1","v1.2","v1.3"]}}},"schemas":{"PasswordGrantRequest":{"required":["client_id","client_secret","grant_type","username","password"],"properties":{"client_id":{"description":"OAuth2 application id.","type":"string"},"client_secret":{"description":"OAuth2 secret key.","type":"string"},"grant_type":{"type":"string","enum":["password"]},"username":{"description":"Email address of the user.","type":"string"},"password":{"type":"string"}},"type":"object"},"RefreshTokenGrantRequest":{"required":["client_id","client_secret","grant_type","refresh_token"],"properties":{"client_id":{"type":"string"},"client_secret":{"type":"string"},"grant_type":{"type":"string","enum":["refresh_token"]},"refresh_token":{"type":"string"}},"type":"object"},"TokenResponse":{"properties":{"access_token":{"description":"Token to send in the `Authorization` header.","type":"string"},"refresh_token":{"description":"Token to keep in order to refresh the access token.","type":"string"},"expires_in":{"description":"Lifetime of the access token, in seconds.","type":"integer"},"token_type":{"description":"Always \"bearer\". Unused.","type":"string"},"scope":{"description":"Unused.","type":"string"}},"type":"object"},"BasicErrorResponse":{"description":"Reduced error body, returned by the few endpoints that build the response themselves instead of letting the REST exception subscriber format it — the token endpoint notably, since that subscriber only runs on the API host.","properties":{"code":{"type":"integer"},"message":{"type":"string"}},"type":"object"},"ErrorResponse":{"description":"Standardised error body returned by the REST exception subscriber.","properties":{"code":{"description":"Daxium error code.","type":"string"},"message":{"type":"string"},"url":{"description":"Link to the error code in the error reference.","type":"string"},"api_version":{"type":"string"},"infos":{"description":"Additional context about the error, when the exception carries any.","type":"array","items":{}},"server_time":{"type":"integer"}},"type":"object"}}}}
```


---

# 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 by asking a question.

Perform an HTTP GET request on the following URL with the `ask` and `goal` query parameters:

```
GET https://www.center.daxium-air.com/api-reference/authorization.md?ask=<question>&goal=<user_goal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is what the user is ultimately trying to achieve, the reason they need the answer. Sharing it helps GitBook give you a better, more relevant answer. A goal is most helpful when it describes the outcome the user wants rather than restating the question. For example, with `ask=how do I create an API token`, a goal like `automate deployments from our CI pipeline` lets GitBook tailor the answer to that use case.

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.
