Upsert Provider Credential
curl --request PUT \
--url https://api.cyberdesk.io/v1/provider-credentials/{slot} \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"api_key": "<string>",
"service_account_json": "<string>",
"aws_access_key_id": "<string>",
"aws_secret_access_key": "<string>",
"aws_region": "<string>"
}
'import requests
url = "https://api.cyberdesk.io/v1/provider-credentials/{slot}"
payload = {
"api_key": "<string>",
"service_account_json": "<string>",
"aws_access_key_id": "<string>",
"aws_secret_access_key": "<string>",
"aws_region": "<string>"
}
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.put(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'PUT',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({
api_key: '<string>',
service_account_json: '<string>',
aws_access_key_id: '<string>',
aws_secret_access_key: '<string>',
aws_region: '<string>'
})
};
fetch('https://api.cyberdesk.io/v1/provider-credentials/{slot}', 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.cyberdesk.io/v1/provider-credentials/{slot}",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "PUT",
CURLOPT_POSTFIELDS => json_encode([
'api_key' => '<string>',
'service_account_json' => '<string>',
'aws_access_key_id' => '<string>',
'aws_secret_access_key' => '<string>',
'aws_region' => '<string>'
]),
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://api.cyberdesk.io/v1/provider-credentials/{slot}"
payload := strings.NewReader("{\n \"api_key\": \"<string>\",\n \"service_account_json\": \"<string>\",\n \"aws_access_key_id\": \"<string>\",\n \"aws_secret_access_key\": \"<string>\",\n \"aws_region\": \"<string>\"\n}")
req, _ := http.NewRequest("PUT", 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.put("https://api.cyberdesk.io/v1/provider-credentials/{slot}")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"api_key\": \"<string>\",\n \"service_account_json\": \"<string>\",\n \"aws_access_key_id\": \"<string>\",\n \"aws_secret_access_key\": \"<string>\",\n \"aws_region\": \"<string>\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.cyberdesk.io/v1/provider-credentials/{slot}")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Put.new(url)
request["Authorization"] = 'Bearer <token>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"api_key\": \"<string>\",\n \"service_account_json\": \"<string>\",\n \"aws_access_key_id\": \"<string>\",\n \"aws_secret_access_key\": \"<string>\",\n \"aws_region\": \"<string>\"\n}"
response = http.request(request)
puts response.read_body{
"slot": "anthropic",
"display_name": "<string>",
"source": "cyberdesk",
"covered_providers": [
"<string>"
],
"status": "active",
"auth_type": "api_key",
"display_metadata": {
"key_last4": "<string>",
"project_id": "<string>",
"client_email": "<string>",
"aws_region": "<string>",
"access_key_id_last4": "<string>"
},
"last_error": "<string>",
"activated_at": "2023-11-07T05:31:56Z",
"last_validated_at": "2023-11-07T05:31:56Z",
"created_at": "2023-11-07T05:31:56Z",
"updated_at": "2023-11-07T05:31:56Z"
}{
"detail": [
{
"loc": [
"<string>"
],
"msg": "<string>",
"type": "<string>",
"input": "<unknown>",
"ctx": {}
}
]
}provider-credentials
Upsert Provider Credential
Add or replace the organization’s credential for a provider slot.
Once a slot has a credential, Cyberdesk stops using its own keys for that provider.
PUT
/
v1
/
provider-credentials
/
{slot}
Upsert Provider Credential
curl --request PUT \
--url https://api.cyberdesk.io/v1/provider-credentials/{slot} \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"api_key": "<string>",
"service_account_json": "<string>",
"aws_access_key_id": "<string>",
"aws_secret_access_key": "<string>",
"aws_region": "<string>"
}
'import requests
url = "https://api.cyberdesk.io/v1/provider-credentials/{slot}"
payload = {
"api_key": "<string>",
"service_account_json": "<string>",
"aws_access_key_id": "<string>",
"aws_secret_access_key": "<string>",
"aws_region": "<string>"
}
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.put(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'PUT',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({
api_key: '<string>',
service_account_json: '<string>',
aws_access_key_id: '<string>',
aws_secret_access_key: '<string>',
aws_region: '<string>'
})
};
fetch('https://api.cyberdesk.io/v1/provider-credentials/{slot}', 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.cyberdesk.io/v1/provider-credentials/{slot}",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "PUT",
CURLOPT_POSTFIELDS => json_encode([
'api_key' => '<string>',
'service_account_json' => '<string>',
'aws_access_key_id' => '<string>',
'aws_secret_access_key' => '<string>',
'aws_region' => '<string>'
]),
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://api.cyberdesk.io/v1/provider-credentials/{slot}"
payload := strings.NewReader("{\n \"api_key\": \"<string>\",\n \"service_account_json\": \"<string>\",\n \"aws_access_key_id\": \"<string>\",\n \"aws_secret_access_key\": \"<string>\",\n \"aws_region\": \"<string>\"\n}")
req, _ := http.NewRequest("PUT", 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.put("https://api.cyberdesk.io/v1/provider-credentials/{slot}")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"api_key\": \"<string>\",\n \"service_account_json\": \"<string>\",\n \"aws_access_key_id\": \"<string>\",\n \"aws_secret_access_key\": \"<string>\",\n \"aws_region\": \"<string>\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.cyberdesk.io/v1/provider-credentials/{slot}")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Put.new(url)
request["Authorization"] = 'Bearer <token>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"api_key\": \"<string>\",\n \"service_account_json\": \"<string>\",\n \"aws_access_key_id\": \"<string>\",\n \"aws_secret_access_key\": \"<string>\",\n \"aws_region\": \"<string>\"\n}"
response = http.request(request)
puts response.read_body{
"slot": "anthropic",
"display_name": "<string>",
"source": "cyberdesk",
"covered_providers": [
"<string>"
],
"status": "active",
"auth_type": "api_key",
"display_metadata": {
"key_last4": "<string>",
"project_id": "<string>",
"client_email": "<string>",
"aws_region": "<string>",
"access_key_id_last4": "<string>"
},
"last_error": "<string>",
"activated_at": "2023-11-07T05:31:56Z",
"last_validated_at": "2023-11-07T05:31:56Z",
"created_at": "2023-11-07T05:31:56Z",
"updated_at": "2023-11-07T05:31:56Z"
}{
"detail": [
{
"loc": [
"<string>"
],
"msg": "<string>",
"type": "<string>",
"input": "<unknown>",
"ctx": {}
}
]
}Authorizations
Headers
Body
application/json
Credential material for one slot. Which fields are required depends on the slot.
Response
Successful Response
State of one BYOK slot. Never includes secret material.
Was this page helpful?