Internal User management

Bulk Create Users Route

Create up to 500 internal users in one request, optionally adding each one to teams.

Every entry in users takes the same fields as /user/new, with two differences: auto_create_key defaults to false (opt in per user to also get a virtual key back) and send_invite_email is not supported. Unknown fields are rejected with 422. Rows are validated together (duplicate ids or emails, unknown teams, roles the caller may not grant), inserted in one statement, and each referenced team is written once for all of its new members.

Rows fail independently: a bad row is reported in data with success: false and an error, and the other rows still get created. A user that was created but could not be added to one of its teams is reported with success: true, teams listing where they did land, and error naming the failed team. The whole request is refused with a 403 problem document only if creating the valid rows would exceed the license seat limit.

Example curl:

curl -X POST "http://localhost:4000/management/v1/users/bulk" \
-H "Content-Type: application/json" \
-H "Authorization: Bearer sk-1234" \
-d '{
    "users": [
        {"user_email": "a@example.com", "user_role": "internal_user", "teams": ["team-1"]},
        {"user_email": "b@example.com", "user_role": "internal_user", "auto_create_key": true}
    ]
}'

Returns data (one entry per input row, in order, with user_id, user_email, success, teams, key, error) and meta with total_requested, created and failed.

post/management/v1/users/bulk

Request body

Response

Successful Response

Changes