Update Virtual Key
curl --request PATCH \
--url https://cloud.cdata.com/api/v1/admin/workspaces/{workspace_id}/projects/{project_id}/virtual-keys/{virtual_key_id} \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"status": "disabled"
}
'import requests
url = "https://cloud.cdata.com/api/v1/admin/workspaces/{workspace_id}/projects/{project_id}/virtual-keys/{virtual_key_id}"
payload = { "status": "disabled" }
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.patch(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'PATCH',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({status: 'disabled'})
};
fetch('https://cloud.cdata.com/api/v1/admin/workspaces/{workspace_id}/projects/{project_id}/virtual-keys/{virtual_key_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://cloud.cdata.com/api/v1/admin/workspaces/{workspace_id}/projects/{project_id}/virtual-keys/{virtual_key_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([
'status' => 'disabled'
]),
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>",
"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://cloud.cdata.com/api/v1/admin/workspaces/{workspace_id}/projects/{project_id}/virtual-keys/{virtual_key_id}"
payload := strings.NewReader("{\n \"status\": \"disabled\"\n}")
req, _ := http.NewRequest("PATCH", url, payload)
req.Header.Add("Authorization", "Bearer <token>")
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://cloud.cdata.com/api/v1/admin/workspaces/{workspace_id}/projects/{project_id}/virtual-keys/{virtual_key_id}")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"status\": \"disabled\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://cloud.cdata.com/api/v1/admin/workspaces/{workspace_id}/projects/{project_id}/virtual-keys/{virtual_key_id}")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Patch.new(url)
request["Authorization"] = 'Bearer <token>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"status\": \"disabled\"\n}"
response = http.request(request)
puts response.read_body{
"virtual_key_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"last_four": "<string>",
"name": "<string>",
"key_type": "user",
"user_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"service_account_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"workspace_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"project_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"status": "active",
"created_at": "2023-11-07T05:31:56Z",
"created_by": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"revoked_at": "2023-11-07T05:31:56Z",
"revoked_by": "3c90c3cc-0d44-4b50-8888-8dd25736052a"
}Update Virtual Key
Rename, disable, or re-enable a virtual key. The request follows JSON Merge Patch (RFC 7396) rules: only fields included in the request body are modified. You cannot set status to revoked with this call; use DELETE to revoke a key. Requests that use a disabled key are refused within seconds, and within 5 minutes at most. A revoked key cannot be changed.
PATCH
/
workspaces
/
{workspace_id}
/
projects
/
{project_id}
/
virtual-keys
/
{virtual_key_id}
Update Virtual Key
curl --request PATCH \
--url https://cloud.cdata.com/api/v1/admin/workspaces/{workspace_id}/projects/{project_id}/virtual-keys/{virtual_key_id} \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"status": "disabled"
}
'import requests
url = "https://cloud.cdata.com/api/v1/admin/workspaces/{workspace_id}/projects/{project_id}/virtual-keys/{virtual_key_id}"
payload = { "status": "disabled" }
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.patch(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'PATCH',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({status: 'disabled'})
};
fetch('https://cloud.cdata.com/api/v1/admin/workspaces/{workspace_id}/projects/{project_id}/virtual-keys/{virtual_key_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://cloud.cdata.com/api/v1/admin/workspaces/{workspace_id}/projects/{project_id}/virtual-keys/{virtual_key_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([
'status' => 'disabled'
]),
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>",
"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://cloud.cdata.com/api/v1/admin/workspaces/{workspace_id}/projects/{project_id}/virtual-keys/{virtual_key_id}"
payload := strings.NewReader("{\n \"status\": \"disabled\"\n}")
req, _ := http.NewRequest("PATCH", url, payload)
req.Header.Add("Authorization", "Bearer <token>")
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://cloud.cdata.com/api/v1/admin/workspaces/{workspace_id}/projects/{project_id}/virtual-keys/{virtual_key_id}")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"status\": \"disabled\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://cloud.cdata.com/api/v1/admin/workspaces/{workspace_id}/projects/{project_id}/virtual-keys/{virtual_key_id}")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Patch.new(url)
request["Authorization"] = 'Bearer <token>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"status\": \"disabled\"\n}"
response = http.request(request)
puts response.read_body{
"virtual_key_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"last_four": "<string>",
"name": "<string>",
"key_type": "user",
"user_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"service_account_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"workspace_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"project_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"status": "active",
"created_at": "2023-11-07T05:31:56Z",
"created_by": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"revoked_at": "2023-11-07T05:31:56Z",
"revoked_by": "3c90c3cc-0d44-4b50-8888-8dd25736052a"
}Authorizations
oauth2basicAuth
Path Parameters
Body
application/json
Response
Returns the full virtual key object.
Last modified on November 5, 2026
Was this page helpful?