# Authorization

## Get or refresh tokens

> Use \`grant\_type: password\` to obtain tokens for the first time, or\
> \`grant\_type: refresh\_token\` to rotate them without re-entering credentials.\
> Each refresh resets the access token expiry and issues a new refresh token.<br>

```json
{"openapi":"3.0.3","info":{"title":"Daxium Air API","version":"v1.3"},"tags":[{"name":"auth"}],"servers":[{"url":"https://api.daxium-air.com","description":"Production"}],"security":[{"BearerAuth":[]}],"components":{"securitySchemes":{"BearerAuth":{"type":"http","scheme":"bearer"}},"schemas":{"PasswordGrantRequest":{"type":"object","required":["client_id","client_secret","grant_type","username","password"],"properties":{"client_id":{"type":"string"},"client_secret":{"type":"string"},"grant_type":{"type":"string","enum":["password"]},"username":{"type":"string","format":"email"},"password":{"type":"string","format":"password"}}},"RefreshTokenGrantRequest":{"type":"object","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"}}},"TokenResponse":{"type":"object","properties":{"access_token":{"type":"string"},"refresh_token":{"type":"string"},"expires_in":{"type":"integer","description":"Validity in seconds (3600)"},"token_type":{"type":"string"},"scope":{"type":"string"}}},"ErrorResponse":{"type":"object","properties":{"code":{"type":"string","description":"Unique error code prefixed with `DAERR-`"},"message":{"type":"string"},"url":{"type":"string","format":"uri","description":"Link to the detailed error documentation"},"api_version":{"type":"string"},"infos":{"type":"array","items":{},"description":"Additional context (may be empty)"},"server_time":{"type":"string","description":"Unix timestamp as string"}}}},"responses":{"Unauthorized":{"description":"Invalid or expired token","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}}},"paths":{"/oauth/v2/token":{"post":{"summary":"Get or refresh tokens","description":"Use `grant_type: password` to obtain tokens for the first time, or\n`grant_type: refresh_token` to rotate them without re-entering credentials.\nEach refresh resets the access token expiry and issues a new refresh token.\n","tags":["auth"],"operationId":"getOrRefreshToken","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"}}}},"401":{"$ref":"#/components/responses/Unauthorized"}}}}}}
```


---

# Agent Instructions: 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:

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

The question should be specific, self-contained, and written in natural language.
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.
