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.
Authorizations
Section titled “Authorizations ”Parameters
Section titled “ Parameters ”Path Parameters
Section titled “Path Parameters ” id
required
string
Request Body required
Section titled “Request Body required ”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
expires_at
integer
key
additional properties
Example
{ "related_subject_id": "user_456", "relationship_type": "manager_of", "expires_at": 1770086400000}Responses
Section titled “ Responses ”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"}