コンテンツにスキップ

Create user relationship

POST
/api/admin/users/{id}/relationships
Code sample: Shell / cURL
curl --request POST \
--url https://auth.example.com/api/admin/users/example/relationships \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '{ "related_subject_id": "user_456", "relationship_type": "manager_of", "expires_at": 1770086400000 }'

Creates a validated access-graph relationship from the path user to another subject.

id
required
string

Relationship to create from the path user to the related subject.

Media type application/json
object
related_subject_id
required
string
relationship_type
required
string
Allowed values: parent_of guardian_of manager_of assistant_of delegate_of
expires_at
integer
key
additional properties
Example
{
"related_subject_id": "user_456",
"relationship_type": "manager_of",
"expires_at": 1770086400000
}

User relationship created.

Media type application/json
object
success
required
boolean
message
required
string
relationship
required
object
key
additional properties
key
additional properties
Example
{
"success": true,
"message": "Relationship created successfully",
"relationship": {
"id": "rel_123",
"subject_id": "user_123",
"related_subject_id": "user_456",
"relationship_type": "manager_of",
"expires_at": 1770086400000,
"created_at": 1770000000000
}
}

Error response.

Media type application/json
object
error
string
message
string
error_description
string
key
additional properties
Example generated
{
"error": "example",
"message": "example",
"error_description": "example"
}

Error response.

Media type application/json
object
error
string
message
string
error_description
string
key
additional properties
Example generated
{
"error": "example",
"message": "example",
"error_description": "example"
}

Error response.

Media type application/json
object
error
string
message
string
error_description
string
key
additional properties
Example generated
{
"error": "example",
"message": "example",
"error_description": "example"
}