Skip to main content

Connect to the Vega API

How to Connect to the Vega API

The VegaCloud API is a beta version of our application's backend service that allows users to manage policies and permissions within the application. This API provides endpoints for creating, updating, listing, and deleting policies, as well as obtaining lists of permissions for users and roles.

JWT (JSON Web Token) Authentication:

To ensure secure access to the API, we utilize JWT (JSON Web Token) authentication. When users log in, they receive a JWT token, which they must include in the Authorization header of their HTTP requests to access the protected endpoints. The token is validated to verify the user's identity and permissions.


This API is currently in its beta version, and as such, certain aspects and functionalities may be subject to change before the official release of version 1.0. Feedback and insights from users during this beta phase are valuable in enhancing the API's performance, security, and user experience.

Get started by visiting our onboarding guide.

Obtaining a JWT Token

To access all API endpoints, a valid JWT token is required. Depending on your operating system, you can use either curl (for Linux/Mac) or PowerShell (for Windows) to easily retrieve this token.

For Linux or Mac:

read -p "Enter Username: " USERNAME
read -p "Enter Realm: " REALM
echo $REALM
read -sp "Enter Password: " PASSWORD
curl -L -X POST "$REALM/protocol/openid-connect/token" \
-H 'Content-Type: application/x-www-form-urlencoded' \
--data-urlencode "client_id=portal" \
--data-urlencode "grant_type=password" \
--data-urlencode "username=$USERNAME" \
--data-urlencode "password=$PASSWORD" | grep -o '"access_token":"[^"]*"' | awk -F'"' '{print $4}'
export PASSWORD=""

For Windows (Using PowerShell):

$USERNAME = Read-Host -Prompt "Enter Username"
$REALM = Read-Host -Prompt "Enter Realm"
$PASSWORD = Read-Host -Prompt "Enter Password" -AsSecureString
$BSTR = [System.Runtime.InteropServices.Marshal]::SecureStringToBSTR($PASSWORD)
$PlainPassword = [System.Runtime.InteropServices.Marshal]::PtrToStringAuto($BSTR)

$response = Invoke-RestMethod -Method Post `
-Uri "$REALM/protocol/openid-connect/token" `
-ContentType 'application/x-www-form-urlencoded' `
-Body @{
'client_id' = 'portal'
'grant_type' = 'password'
'username' = $USERNAME
'password' = $PlainPassword
$PlainPassword = $null

🔒 Caution: Always ensure sensitive information, such as passwords, are handled with care, especially when working with scripts or command-line utilities.