---
title: Request OAuth token
canonical: https://openvpn.net/cloud-docs/developer/cloudconnexa-beta-api-v0-16-0/oauth/request-oauth-token/
product: CloudConnexa Docs
---

# Request OAuth token

`POST /api/beta/oauth/token`

Endpoint for token requests as described in the OAuth2 spec. Clients must be authenticated using a HTTP basic authentication to access this endpoint.

Example:

```
    Authorization: Basic [base64({KEY}:{SECRET})]

    POST http://{GATEWAY_HOST}/api/v1/oauth/token
```

where:

- **{KEY}** - Corresponding OAuth credentials key
- **{SECRET}** - Secret known during OAuth credentials creation

```
For more details related to OAuth protocol please refer the following links:
https://tools.ietf.org/html/rfc6749 https://www.oauth.com/oauth2-servers/access-tokens/
```

## Parameters

| Name | In | Type | Required | Description |
| --- | --- | --- | --- | --- |
| client\_id | query | string | true | client\_id |
| client\_secret | query | string | true | client\_secret |
| grant\_type | query | string | true | grant\_type |

## Responses

| Status | Meaning | Description |
| --- | --- | --- |
| 200 | [OK](https://tools.ietf.org/html/rfc7231#section-6.3.1) | OK |
| 201 | [Created](https://tools.ietf.org/html/rfc7231#section-6.3.2) | Entity created |
| 400 | [Bad Request](https://tools.ietf.org/html/rfc7231#section-6.5.1) | Bad Request |
| 401 | [Unauthorized](https://tools.ietf.org/html/rfc7235#section-3.1) | Unauthorized |
| 403 | [Forbidden](https://tools.ietf.org/html/rfc7231#section-6.5.3) | Access Forbidden |
| 404 | [Not Found](https://tools.ietf.org/html/rfc7231#section-6.5.4) | Not Found |
| 406 | [Not Acceptable](https://tools.ietf.org/html/rfc7231#section-6.5.6) | Not Acceptable |
| 429 | [Too Many Requests](https://tools.ietf.org/html/rfc6585#section-4) | Too Many Requests |
| 500 | [Internal Server Error](https://tools.ietf.org/html/rfc7231#section-6.6.1) | Internal Server Error |

```json
{
  "access_token": "string",
  "expires_in": 0,
  "scope": "string",
  "token_type": "string"
}
```

---

Prev: [OAuth](https://openvpn.net/cloud-docs/developer/cloudconnexa-beta-api-v0-16-0/oauth.md)
Next: [Region](https://openvpn.net/cloud-docs/developer/cloudconnexa-beta-api-v0-16-0/region.md)
Index: https://openvpn.net/cloud-docs/llms.txt
