Create user

Create a new user (staff only).

Endpoint

POST /api/v1/users
Staff

Request

JSON body:

  • username
  • email
  • name
  • is_staff (optional)

Usage

curl \
  --request POST \
  --header "Authorization: Bearer $PEARING_API_TOKEN" \
  --header "Content-Type: application/json" \
  --data '{"username": "janedoe", "email": "jane@example.com", "name": "Jane Doe"}' \
  "$PEARING_API_URL/v1/users"

Success

201 Created with created user. The email field is part of this staff-only response.

{
  "uuid": "...",
  "username": "janedoe",
  "email": "<private>",
  "name": "Jane Doe",
  "is_active": true
}

Errors

  • 409 Conflict for duplicate username/email or validation constraints.

Common auth errors are documented on the API overview page.