API referenceSections

Add a user to the account with a role, or invite one

Generated from the OpenAPI contract. Sessions send the CSRF header on writes; API keys use a Bearer token. Authentication

POST /api/v1/tenants/{tid}/provisioning/accounts/{ref}/users

Add a user to the account with a role, or invite one (ADR 0121)

Sent again for someone already in the account with that role, answers 200 and changes nothing (the add is idempotent by email; an Idempotency-Key is accepted but the answer is not stored, as it may hold an invitation). The same person with another role: 409 PROVISIONING_USER_EXISTS. Permissions: plan.manage, member.invite, and every permission of the role.

Authentication: API key (Authorization: Bearer …) or session cookie __Host-panel_session.

Parameters

NameInTypeRequiredDescription
tidpathstringrequired
refpathstringrequired

The billing system's own reference: 1 to 64 of A-Z a-z 0-9 . _ : -

  • pattern ^[A-Za-z0-9._:-]{1,64}$
Idempotency-Keyheaderstringoptional

Same key and same request within 24 hours: the first answer is replayed (header Idempotent-Replayed: true). Same key, different request: 422 IDEMPOTENCY_KEY_REUSED.

  • max length 255
X-CSRF-Tokenheaderstringoptional

Required on unsafe requests authenticated by session cookie; API keys do not use it.

Request body

required

Content type: application/json

  • email string required
  • role_id string required
    Allowed values: "customer_owner" "developer" "viewer"
  • password string optional

    Makes the user at once; the email must be new to the panel. Left out, an invitation is made instead (7 days), which a person who already has a panel sign-in accepts with their own password

Example
{
  "email": "string",
  "role_id": "customer_owner",
  "password": "string"
}

Responses

200 Already in the account

Content type: application/json

  • user_id string required

    Empty for an invitation not yet accepted

  • email string required
  • role_id string required
    Allowed values: "customer_owner" "developer" "viewer"
  • owner boolean required

    The account's owner, made with the account; changed through the account, never removed here

  • created_at string (date-time) required
  • invited boolean required
  • invitation_token string optional

    Only for an invitation, only in this answer; the panel keeps its hash

  • invitation_url string optional

    The page that accepts the invitation; send it to the person. Only in this answer

  • invitation_expires_at string (date-time) optional
Example
{
  "user_id": "string",
  "email": "string",
  "role_id": "customer_owner",
  "owner": true,
  "created_at": "2026-01-01T00:00:00Z",
  "invited": true,
  "invitation_token": "string",
  "invitation_url": "string",
  "invitation_expires_at": "2026-01-01T00:00:00Z"
}

201 Added or invited

Content type: application/json

Fields of AccountUserAdded are shown above.

Example
{
  "user_id": "string",
  "email": "string",
  "role_id": "customer_owner",
  "owner": true,
  "created_at": "2026-01-01T00:00:00Z",
  "invited": true,
  "invitation_token": "string",
  "invitation_url": "string",
  "invitation_expires_at": "2026-01-01T00:00:00Z"
}

429 Error

Content type: application/json

  • code string required
  • message string required
  • details_redacted boolean required
  • correlation_id string required
  • retryable boolean required

default Error

Content type: application/json

Fields of Error are shown above.