# 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"]}}}}
```
