Create an agent key
curl --request POST \
--url http://localhost:8787/v1/account/workspaces/{ws}/keys \
--header 'Content-Type: application/json' \
--cookie claros_session= \
--data '
{
"name": "<string>"
}
'import requests
url = "http://localhost:8787/v1/account/workspaces/{ws}/keys"
payload = { "name": "<string>" }
headers = {
"cookie": "claros_session=",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {cookie: 'claros_session=', 'Content-Type': 'application/json'},
body: JSON.stringify({name: '<string>'})
};
fetch('http://localhost:8787/v1/account/workspaces/{ws}/keys', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_PORT => "8787",
CURLOPT_URL => "http://localhost:8787/v1/account/workspaces/{ws}/keys",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_POSTFIELDS => json_encode([
'name' => '<string>'
]),
CURLOPT_COOKIE => "claros_session=",
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 := "http://localhost:8787/v1/account/workspaces/{ws}/keys"
payload := strings.NewReader("{\n \"name\": \"<string>\"\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("cookie", "claros_session=")
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.post("http://localhost:8787/v1/account/workspaces/{ws}/keys")
.header("cookie", "claros_session=")
.header("Content-Type", "application/json")
.body("{\n \"name\": \"<string>\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("http://localhost:8787/v1/account/workspaces/{ws}/keys")
http = Net::HTTP.new(url.host, url.port)
request = Net::HTTP::Post.new(url)
request["cookie"] = 'claros_session='
request["Content-Type"] = 'application/json'
request.body = "{\n \"name\": \"<string>\"\n}"
response = http.request(request)
puts response.read_body{}{
"detail": [
{
"loc": [
"<string>"
],
"msg": "<string>",
"type": "<string>",
"input": "<unknown>",
"ctx": {}
}
]
}Accounts
Create an agent key
An agent key for this workspace, made by (and listed for) the caller. The raw key is in this answer only.
POST
/
v1
/
account
/
workspaces
/
{ws}
/
keys
Create an agent key
curl --request POST \
--url http://localhost:8787/v1/account/workspaces/{ws}/keys \
--header 'Content-Type: application/json' \
--cookie claros_session= \
--data '
{
"name": "<string>"
}
'import requests
url = "http://localhost:8787/v1/account/workspaces/{ws}/keys"
payload = { "name": "<string>" }
headers = {
"cookie": "claros_session=",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {cookie: 'claros_session=', 'Content-Type': 'application/json'},
body: JSON.stringify({name: '<string>'})
};
fetch('http://localhost:8787/v1/account/workspaces/{ws}/keys', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_PORT => "8787",
CURLOPT_URL => "http://localhost:8787/v1/account/workspaces/{ws}/keys",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_POSTFIELDS => json_encode([
'name' => '<string>'
]),
CURLOPT_COOKIE => "claros_session=",
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 := "http://localhost:8787/v1/account/workspaces/{ws}/keys"
payload := strings.NewReader("{\n \"name\": \"<string>\"\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("cookie", "claros_session=")
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.post("http://localhost:8787/v1/account/workspaces/{ws}/keys")
.header("cookie", "claros_session=")
.header("Content-Type", "application/json")
.body("{\n \"name\": \"<string>\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("http://localhost:8787/v1/account/workspaces/{ws}/keys")
http = Net::HTTP.new(url.host, url.port)
request = Net::HTTP::Post.new(url)
request["cookie"] = 'claros_session='
request["Content-Type"] = 'application/json'
request.body = "{\n \"name\": \"<string>\"\n}"
response = http.request(request)
puts response.read_body{}{
"detail": [
{
"loc": [
"<string>"
],
"msg": "<string>",
"type": "<string>",
"input": "<unknown>",
"ctx": {}
}
]
}Authorizations
Web session cookie (the WorkOS session, sealed by the server); non-GET calls also need the X-CSRF-Token header
Path Parameters
Body
application/json
Response
Successful Response
The response is of type Response Keys Create V1 Account Workspaces Ws Keys Post · object.