Creating API credentials⁠

CloudConnexa API credentials allow you to authenticate and make requests to the CloudConnexa API. After creating credentials, you use them to request an OAuth 2.0 access token, which is required for all API calls.

Before you begin⁠

Ensure you have:

  • Access to the CloudConnexa Administration portal.

Create credentials in the Administration portal⁠

  1. Sign in to your WPC's Administration portal by entering your Cloud ID in a web browser (for example, company_name.openvpn.com).

  2. From the CloudConnexa Administration portal, navigate to API & Logs → API .

  3. Click Create Credentials.

  4. Enter a name for the credentials.

  5. Select a lifetime (two weeks, one month, six months, or one year).

  6. (Optional) Restrict access by specifying allowed IP subnet ranges.

  7. Select the permissions (read-only and/or modify access to resources).

  8. Click Create.

    • The API credentials are created, and the client ID and client secret are displayed. If this is your first set of API credentials, API access is enabled automatically.

Save your credentials⁠

Request an Access Token⁠

Use your client ID and client secret to request an OAuth 2.0 access token using the client_credentials grant type.

Request Format⁠

Use the following curl command to obtain an access token:

curl -X POST --location "https://{cloud_id}.api.openvpn.com/api/v1/oauth/token?client_id={client_id}&client_secret={client_secret}&grant_type=client_credentials" --http1.1

Replace:

  • {cloud_id} with your CloudConnexa Cloud ID.

  • {client_id} with the full Public API Client ID, including the prefix.

  • {client_secret} with the Public API Client Secret.

Example Response⁠

If the request is successful, the API will respond with a JSON object containing your access_token:

{
  "access_token": "eyJ0eXAiOiJKV1QiLCJhbGciOi...",
  "token_type": "bearer",
  "expires_in": 43199,
  "scope": "read write"
}

Use the access token⁠

Include the access token in the Authorization header for all API requests:

Authorization: Bearer <access_token>

Token behavior⁠

  • The access_token is valid for the number of seconds specified in expires_in.

  • When the token expires, request a new one using the same credentials.

  • Tokens aren't refreshable; generate a new token as needed.