register_principal_key
POST
/admin/principals/{id}/keys
curl --request POST \ --url http://localhost:3001/admin/principals/00000000-0000-0000-0000-000000000000/keys \ --header 'Authorization: Bearer <token>' \ --header 'Content-Type: application/json' \ --data '{"name":null}'import requests
url = "http://localhost:3001/admin/principals/00000000-0000-0000-0000-000000000000/keys"
payload = { "name": None }headers = { "Authorization": "Bearer <token>", "Content-Type": "application/json"}
response = requests.post(url, json=payload, headers=headers)
print(response.json())use serde_json::json;use reqwest;
#[tokio::main]pub async fn main() { let url = "http://localhost:3001/admin/principals/00000000-0000-0000-0000-000000000000/keys";
let payload = json!({"name": json!(null)});
let mut headers = reqwest::header::HeaderMap::new(); headers.insert("Authorization", "Bearer <token>".parse().unwrap()); headers.insert("Content-Type", "application/json".parse().unwrap());
let client = reqwest::Client::new(); let response = client.post(url) .headers(headers) .json(&payload) .send() .await;
let results = response.unwrap() .json::<serde_json::Value>() .await .unwrap();
dbg!(results);}Authorizations
Section titled “Authorizations”Parameters
Section titled “Parameters”Path Parameters
Section titled “Path Parameters”id
required
string format: uuid
Principal ID
Request Bodyrequired
Section titled “Request Bodyrequired”Media typeapplication/json
object
name
string
Example generated
{ "name": "example"}Responses
Section titled “Responses”Created — plaintext secret included once
Media typeapplication/json
object
created_at
required
string format: date-time
id
required
string format: uuid
key_id
required
string
name
string
principal_id
required
string format: uuid
secret
string
Example generated
{ "created_at": "2026-04-15T12:00:00Z", "id": "2489E9AD-2EE2-8E00-8EC9-32D5F69181C0", "key_id": "example", "name": "example", "principal_id": "2489E9AD-2EE2-8E00-8EC9-32D5F69181C0", "secret": "example"}