Update API Key
curl --request PATCH \
--url https://api.vertracloud.app/v1/users/me/api-keys/{id} \
--header 'Content-Type: application/json' \
--data '
{
"name": "<string>",
"scopes": [
"<string>"
],
"allowed_ips": [
"<string>"
]
}
'import requests
url = "https://api.vertracloud.app/v1/users/me/api-keys/{id}"
payload = {
"name": "<string>",
"scopes": ["<string>"],
"allowed_ips": ["<string>"]
}
headers = {"Content-Type": "application/json"}
response = requests.patch(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'PATCH',
headers: {'Content-Type': 'application/json'},
body: JSON.stringify({name: '<string>', scopes: ['<string>'], allowed_ips: ['<string>']})
};
fetch('https://api.vertracloud.app/v1/users/me/api-keys/{id}', 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}",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "PATCH",
CURLOPT_POSTFIELDS => json_encode([
'name' => '<string>',
'scopes' => [
'<string>'
],
'allowed_ips' => [
'<string>'
]
]),
CURLOPT_HTTPHEADER => [
"Content-Type: application/json"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "https://api.vertracloud.app/v1/users/me/api-keys/{id}"
payload := strings.NewReader("{\n \"name\": \"<string>\",\n \"scopes\": [\n \"<string>\"\n ],\n \"allowed_ips\": [\n \"<string>\"\n ]\n}")
req, _ := http.NewRequest("PATCH", url, payload)
req.Header.Add("Content-Type", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.patch("https://api.vertracloud.app/v1/users/me/api-keys/{id}")
.header("Content-Type", "application/json")
.body("{\n \"name\": \"<string>\",\n \"scopes\": [\n \"<string>\"\n ],\n \"allowed_ips\": [\n \"<string>\"\n ]\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.vertracloud.app/v1/users/me/api-keys/{id}")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Patch.new(url)
request["Content-Type"] = 'application/json'
request.body = "{\n \"name\": \"<string>\",\n \"scopes\": [\n \"<string>\"\n ],\n \"allowed_ips\": [\n \"<string>\"\n ]\n}"
response = http.request(request)
puts response.read_body{
"response": {}
}API Keys
Update API Key
Updates a key’s name, scopes and/or allowed IPs. Never changes the secret. Dashboard session only.
PATCH
/
v1
/
users
/
me
/
api-keys
/
{id}
Update API Key
curl --request PATCH \
--url https://api.vertracloud.app/v1/users/me/api-keys/{id} \
--header 'Content-Type: application/json' \
--data '
{
"name": "<string>",
"scopes": [
"<string>"
],
"allowed_ips": [
"<string>"
]
}
'import requests
url = "https://api.vertracloud.app/v1/users/me/api-keys/{id}"
payload = {
"name": "<string>",
"scopes": ["<string>"],
"allowed_ips": ["<string>"]
}
headers = {"Content-Type": "application/json"}
response = requests.patch(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'PATCH',
headers: {'Content-Type': 'application/json'},
body: JSON.stringify({name: '<string>', scopes: ['<string>'], allowed_ips: ['<string>']})
};
fetch('https://api.vertracloud.app/v1/users/me/api-keys/{id}', 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}",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "PATCH",
CURLOPT_POSTFIELDS => json_encode([
'name' => '<string>',
'scopes' => [
'<string>'
],
'allowed_ips' => [
'<string>'
]
]),
CURLOPT_HTTPHEADER => [
"Content-Type: application/json"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "https://api.vertracloud.app/v1/users/me/api-keys/{id}"
payload := strings.NewReader("{\n \"name\": \"<string>\",\n \"scopes\": [\n \"<string>\"\n ],\n \"allowed_ips\": [\n \"<string>\"\n ]\n}")
req, _ := http.NewRequest("PATCH", url, payload)
req.Header.Add("Content-Type", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.patch("https://api.vertracloud.app/v1/users/me/api-keys/{id}")
.header("Content-Type", "application/json")
.body("{\n \"name\": \"<string>\",\n \"scopes\": [\n \"<string>\"\n ],\n \"allowed_ips\": [\n \"<string>\"\n ]\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.vertracloud.app/v1/users/me/api-keys/{id}")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Patch.new(url)
request["Content-Type"] = 'application/json'
request.body = "{\n \"name\": \"<string>\",\n \"scopes\": [\n \"<string>\"\n ],\n \"allowed_ips\": [\n \"<string>\"\n ]\n}"
response = http.request(request)
puts response.read_body{
"response": {}
}This never rotates the secret — a key that leaked stays valid after an update. To invalidate the old secret, use Rotate.
Path
string
required
The key’s ID.
Body
All fields are optional; only what you send is changed.string
1–40 characters.
string[]
Replaces the full IP/CIDR list, up to 20 entries. Empty means any IP.
Response
APIApiKey
The updated key. See List API Keys for the field reference.
Errors
| Status | Code | When |
|---|---|---|
| 400 | API_KEY_INVALID_NAME | Name is empty or longer than 40 characters. |
| 400 | API_KEY_INVALID_SCOPES | scopes is empty or has an entry outside the catalog. |
| 400 | API_KEY_INVALID_IPS | An entry in allowed_ips isn’t a valid IP/CIDR, or there are more than 20. |
| 403 | API_KEY_SCOPE_DENIED | The session is an API key. |
| 404 | API_KEY_NOT_FOUND | No key with that ID on this account. |