ts.usr.create

Create a new user account.

Create a new user account.

Description

Creates a new user in the system. There are two paths for user creation:

Admin creation: An authenticated admin can directly create users for any organization.

Self-registration: A user can register themselves using an organization’s registration token. This requires:

  • organization_id: The organization to join
  • org_token: A valid registration token for that organization
  • password: The user’s chosen password

Self-registration is useful for onboarding new team members or agents.

Parameters

NameTypeRequiredDefaultDescription
namestringYesUser’s display name
emailstringYesUser’s email address (must be unique)
passwordstringUser’s password (required for self-registration)
organization_idstringOrganization to add user to (required for self-registration)
org_tokenstringOrganization registration token (for self-registration)
resource_idstringLink to existing resource (optional)
external_idstringExternal system ID for SSO integration (optional)
metadataobjectArbitrary key-value pairs (optional)

Response

Returns the created user object.

{
  "created_at": "2026-02-04T15:30:00Z",
  "email": "smith@example.com",
  "id": "usr_01H8X9GHIJKL",
  "name": "Agent Smith",
  "status": "active"
}

Errors

CodeDescription
not_authenticatedNo valid authentication and no org_token provided
invalid_tokenOrganization token is invalid or expired
email_existsA user with this email already exists
invalid_emailEmail format is invalid
weak_passwordPassword does not meet requirements

Examples

Self-registration with org token

Register a new user using an organization’s registration token.

Request:

{
  "email": "smith@example.com",
  "name": "Agent Smith",
  "org_token": "ort_xyz789...",
  "organization_id": "org_01H8X9ABCDEF",
  "password": "SecurePassword123!"
}

Response:

{
  "created_at": "2026-02-04T15:30:00Z",
  "email": "smith@example.com",
  "id": "usr_01H8X9GHIJKL",
  "name": "Agent Smith",
  "status": "active"
}

Admin creates user

An authenticated admin creates a user directly.

Request:

{
  "email": "newagent@example.com",
  "metadata": {
    "role": "analyst"
  },
  "name": "New Agent"
}

Response:

{
  "created_at": "2026-02-04T15:30:00Z",
  "email": "newagent@example.com",
  "id": "usr_01H8X9MNOPQ",
  "name": "New Agent",
  "status": "active"
}