Skip to main content
POST

Overview

Create a new subject (user, agent, API key, or service). Optionally add the subject to scopes and assign roles in a single request using inline memberships.
ID Format: All IDs use a namespaced UUIDv7 format: subject_{uuidv7}. You can optionally provide your own ID.

Request Body

string
Optional client-provided ID. Format: subject_{uuidv7}
string
required
Subject type. One of: user, api_key, service, agent
string
required
External identifier for the subject (e.g., user ID from your auth system)
string
Display name for the subject
object
Optional metadata to associate with the subject
array
Optional inline memberships with role assignments. Creates memberships and role assignments in a single request.
string
required
ID of the scope to add the subject to
array
Optional array of role IDs to assign to the membership

Response

Returns the created subject object. If memberships were provided, includes the created memberships with their role assignments.