Skip to content

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", "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

The path user is the side that acts (parent, guardian, delegate, manager) and related_subject_id the one acted for. These are the types the acting-as consent, the relationships claim and guardian approval resolution read.

string
Allowed values: parent_child guardian delegate manager
expires_at

Future expiry in epoch milliseconds; omitted or null for no expiry.

integer | null
key
additional properties
Example
{
"related_subject_id": "user_456",
"relationship_type": "manager",
"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",
"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"
}