# Authorization

## Get Token

> Get token to authorize API operations&#x20;

```json
{"openapi":"3.0.1","info":{"title":"Authorization","version":"1.0"},"tags":[{"name":"Authorization","description":"Authorization endpoints"}],"servers":[{"description":"Test Auth","url":"https://b2b.auth.platform-test.tradevest.ai"},{"description":"Pretest Auth","url":"https://b2b.auth.platform-pretest.tradevest.ai"}],"paths":{"/oauth2/token":{"post":{"summary":"Get Token","responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"$ref":"#/components/schemas/AuthResponse"}}}},"400":{"description":"Bad Request","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string","enum":["invalid_request","invalid_client","invalid_grant","unauthorized_client","unsupported_grant_type"]}},"required":["error"]}}}}},"operationId":"get-token","description":"Get token to authorize API operations ","tags":["Authorization"],"parameters":[{"schema":{"type":"string","default":"application/x-www-form-urlencoded"},"in":"header","name":"Content-Type","description":"Must always be 'application/x-www-form-urlencoded'","required":true}],"requestBody":{"content":{"application/x-www-form-urlencoded":{"schema":{"$ref":"#/components/schemas/AuthRequest"}}},"description":""}}}},"components":{"schemas":{"AuthResponse":{"title":"Authentication Response","type":"object","properties":{"access_token":{"type":"string","readOnly":true},"expires_in":{"type":"integer","default":3600,"readOnly":true},"token_type":{"type":"string","default":"Bearer","readOnly":true}},"required":["access_token","expires_in","token_type"]},"AuthRequest":{"title":"Authorization Request","type":"object","properties":{"client_id":{"type":"string","description":"Provided client_id for partner"},"client_secret":{"type":"string","description":"Provided client secret for partner"},"grant_type":{"type":"string","default":"client_credentials","description":"Grant type, always use 'client_credentials'"}},"required":["client_id","client_secret","grant_type"]}}}}
```


---

# 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://docs.tradevest.ai/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.
