create_principal
POST
/admin/principals
curl --request POST \ --url http://localhost:3001/admin/principals \ --header 'Authorization: Bearer <token>' \ --header 'Content-Type: application/json' \ --data '{"code":"string","display_name":null,"external_subject":null,"principal_type":"string","status":"string"}'import requests
url = "http://localhost:3001/admin/principals"
payload = { "code": "string", "display_name": None, "external_subject": None, "principal_type": "string", "status": "string"}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";
let payload = json!({ "code": "string", "display_name": json!(null), "external_subject": json!(null), "principal_type": "string", "status": "string" });
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”Request Bodyrequired
Section titled “Request Bodyrequired”Media typeapplication/json
object
code
required
string
display_name
string
external_subject
string
principal_type
required
string
status
required
string
Example generated
{ "code": "example", "display_name": "example", "external_subject": "example", "principal_type": "example", "status": "example"}Responses
Section titled “Responses”Created
Media typeapplication/json
object
code
required
string
created_at
required
string format: date-time
display_name
string
external_subject
string
id
required
string format: uuid
principal_type
required
string
status
required
string
updated_at
required
string format: date-time
Example generated
{ "code": "example", "created_at": "2026-04-15T12:00:00Z", "display_name": "example", "external_subject": "example", "id": "2489E9AD-2EE2-8E00-8EC9-32D5F69181C0", "principal_type": "example", "status": "example", "updated_at": "2026-04-15T12:00:00Z"}Already exists