Rotate API Key
curl --request POST \
--url https://api.vertracloud.app/v1/users/me/api-keys/{id}/rotateimport requests
url = "https://api.vertracloud.app/v1/users/me/api-keys/{id}/rotate"
response = requests.post(url)
print(response.text)const options = {method: 'POST'};
fetch('https://api.vertracloud.app/v1/users/me/api-keys/{id}/rotate', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://api.vertracloud.app/v1/users/me/api-keys/{id}/rotate",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"net/http"
"io"
)
func main() {
url := "https://api.vertracloud.app/v1/users/me/api-keys/{id}/rotate"
req, _ := http.NewRequest("POST", url, nil)
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.post("https://api.vertracloud.app/v1/users/me/api-keys/{id}/rotate")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.vertracloud.app/v1/users/me/api-keys/{id}/rotate")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
response = http.request(request)
puts response.read_body{
"response": {
"id": "b7e2d1a4-...",
"name": "CI deploy",
"prefix": "vc_live_9c8b7a6d",
"last4": "11ff",
"scopes": ["apps:read", "apps:write"],
"allowed_ips": [],
"created_at": "2026-09-11T12:00:00Z",
"last_used_at": null,
"api_key": "vc_live_9c8b7a6d...11ff"
}
}
API Keys
Rotate API Key
Issues a new secret for an existing key, keeping its id, name, scopes and allowed IPs. Dashboard session only.
POST
/
v1
/
users
/
me
/
api-keys
/
{id}
/
rotate
Rotate API Key
curl --request POST \
--url https://api.vertracloud.app/v1/users/me/api-keys/{id}/rotateimport requests
url = "https://api.vertracloud.app/v1/users/me/api-keys/{id}/rotate"
response = requests.post(url)
print(response.text)const options = {method: 'POST'};
fetch('https://api.vertracloud.app/v1/users/me/api-keys/{id}/rotate', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://api.vertracloud.app/v1/users/me/api-keys/{id}/rotate",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"net/http"
"io"
)
func main() {
url := "https://api.vertracloud.app/v1/users/me/api-keys/{id}/rotate"
req, _ := http.NewRequest("POST", url, nil)
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.post("https://api.vertracloud.app/v1/users/me/api-keys/{id}/rotate")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.vertracloud.app/v1/users/me/api-keys/{id}/rotate")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
response = http.request(request)
puts response.read_body{
"response": {
"id": "b7e2d1a4-...",
"name": "CI deploy",
"prefix": "vc_live_9c8b7a6d",
"last4": "11ff",
"scopes": ["apps:read", "apps:write"],
"allowed_ips": [],
"created_at": "2026-09-11T12:00:00Z",
"last_used_at": null,
"api_key": "vc_live_9c8b7a6d...11ff"
}
}
The old secret stops working the moment this responds. As with creation, the new secret is shown once here and never again.
Path
string
required
The key’s ID.
Response
APIApiKeyCreated
Same key (
id, name, scopes, allowed_ips unchanged), new prefix/last4/api_key. See Create API Key for the field reference.{
"response": {
"id": "b7e2d1a4-...",
"name": "CI deploy",
"prefix": "vc_live_9c8b7a6d",
"last4": "11ff",
"scopes": ["apps:read", "apps:write"],
"allowed_ips": [],
"created_at": "2026-09-11T12:00:00Z",
"last_used_at": null,
"api_key": "vc_live_9c8b7a6d...11ff"
}
}
Errors
| Status | Code | When |
|---|---|---|
| 403 | API_KEY_SCOPE_DENIED | The session is an API key. |
| 404 | API_KEY_NOT_FOUND | No key with that ID on this account. |