|
| 1 | +# Web Services & Tokens |
| 2 | + |
| 3 | +The Virak Cloud Web Services allows developers to integrate with our platform programmatically. |
| 4 | +You can use the API to manage instances, networks, storage, and more. |
| 5 | + |
| 6 | + |
| 7 | +## 1. Authentication |
| 8 | + |
| 9 | +All requests to the Web Services require authentication using an **API token**. |
| 10 | +Include your token in the `Authorization` header: |
| 11 | + |
| 12 | +```http |
| 13 | +Authorization: Bearer YOUR_TOKEN |
| 14 | +``` |
| 15 | + |
| 16 | +> ⚠️ For security reasons, the token value is shown **only once** when it is created. |
| 17 | +
|
| 18 | + |
| 19 | +## 2. API Tokens List |
| 20 | + |
| 21 | +<DarkModeImage |
| 22 | + dark-src="/images/guides/en/dark/public-api/tokens-list.webp" |
| 23 | + light-src="/images/guides/en/light/public-api/tokens-list.webp" |
| 24 | + alt="Web Services - Token List" |
| 25 | +/> |
| 26 | + |
| 27 | +On the **Tokens** page, you will see all tokens you have generated. |
| 28 | +The list contains the following information: |
| 29 | + |
| 30 | +| Name | Last Used | Expiration Date | Abilities | |
| 31 | +| -------------- | ---------------- | --------------- | ----------------------------------------------------------- | |
| 32 | +| My First Token | 2025-08-05 14:22 | 2025-12-31 | `dns:domain:list, instance:create, kubernetes:cluster:list` | |
| 33 | +| Backup Token | 2025-08-07 09:10 | Never | `object_storage:bucket:create, network:firewall:ipv4:list` | |
| 34 | + |
| 35 | + |
| 36 | +* **Name** – The label you assigned to the token when creating it. |
| 37 | +* **Last Used** – The last time this token was used in an API request. |
| 38 | +* **Expiration Date** – The date when the token becomes invalid. |
| 39 | +* **Abilities** – The set of actions the token can perform. |
| 40 | + |
| 41 | + |
| 42 | +## 3. Creating a Token |
| 43 | + |
| 44 | +<DarkModeImage |
| 45 | + dark-src="/images/guides/en/dark/public-api/create-token.webp" |
| 46 | + light-src="/images/guides/en/light/public-api/create-token.webp" |
| 47 | + alt="Web Services - Token List" |
| 48 | +/> |
| 49 | + |
| 50 | +To create a new API token: |
| 51 | + |
| 52 | +1. From the left sidebar, select **Web Service**. |
| 53 | +2. On the **Web Service** page, click **Create Token**. |
| 54 | +3. Provide a **Name**, select an **Expiration Date**, and choose **Scopes**. |
| 55 | +4. After creating, copy the token and store it securely — it will not be shown again. |
| 56 | + |
| 57 | + |
| 58 | +### Example API Request – Create Token |
| 59 | + |
| 60 | +```bash |
| 61 | +curl --request GET \ |
| 62 | + --get "http://public-api.virakcloud.com/api/external/zones" \ |
| 63 | + --header "Authorization: Bearer {YOUR_AUTH_KEY}" \ |
| 64 | + --header "Content-Type: application/json" \ |
| 65 | + --header "Accept: application/json" |
| 66 | +``` |
| 67 | + |
| 68 | + |
| 69 | +## 4. Full API Reference |
| 70 | + |
| 71 | +For the complete API documentation (including all endpoints and parameters), |
| 72 | +visit the **Web Services Reference**: |
| 73 | + |
| 74 | +<div style="text-align: left;"> |
| 75 | + <a href="https://api-docs.virakcloud.com">https://api-docs.virakcloud.com</a> |
| 76 | +</div> |
0 commit comments