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.
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
The access token received from the authorization server in the OAuth 2.0 flow.
Path Parameters
Workspace identifier (UUID).
Project identifier (UUID).
Virtual key identifier (UUID).
Body
Response
Returns the full virtual key object.
Virtual key identifier.
The last four characters of the virtual key. Use it to identify a key. The full secret is never returned after creation.
Display name of the virtual key.
The type of identity the key is issued to.
user, service_account The user the key is issued to. null when key_type is service_account.
The service account the key is issued to. null when key_type is user.
The workspace the key belongs to.
The project the key is issued for.
Current state of the key. Revoked is permanent.
active, disabled, revoked ISO 8601 UTC.
ID of the caller that created the key.
ISO 8601 UTC. null unless the key is revoked.
ID of the caller that revoked the key. null unless the key is revoked.
Was this page helpful?