Users

Create a new user

This endpoint creates a new user in Trybe

post/users

Request body

emailstring email required

The email address of the user

first_namestring required

The user's given name. Shown in the admin UI alongside the surname and used in notification templates as the personalised greeting.

last_namestring required

The user's surname. Combined with first_name to display a full name in admin lists and email footers.

organisation_idstring uuid

Identifier of the organisation to scope this user's access to. The caller must have organisation-admin permissions on this organisation; the user will only see sites that belong to it.

cashier_idstring uuid

Identifier of the cashier record this user is linked to. Cashier IDs map operator activity (sales, refunds, till opens) back to a real person for reporting and audit.

Example request

{
  "first_name": "Dan",
  "last_name": "Smith"
}

Response

A User

Example response

{
  "data": {
    "id": "5e1e3f6c-2a44-4f6e-8c61-9c1f7d2e1c11",
    "name": "John Smith",
    "given_name": "John",
    "family_name": "Smith",
    "email": "john.smith@example.com",
    "email_verified": true,
    "organisation_id": "9c3ad1e2-2d1b-4f4f-9e07-6d6c4f3a2b1a",
    "organisation_name": "Trybe Spa Group",
    "avatar_id": "7d2a1f9c-5b3e-4d8c-9f0a-2c4e6f8b1d3a",
    "avatar": {
      "file_name": "super-cool-photo.jpg",
      "mime_type": "image/jpeg",
      "original_url": "https://example.com/media/super-cool-photo.jpg",
      "size": 84256,
      "url": "https://example.com/media/super-cool-photo-thumbnail@2x.jpg"
    },
    "cashier_id": "cashier-042",
    "status": "active",
    "2fa_enabled": true,
    "twofa_enabled": true,
    "created_at": "2020-01-01T00:00:00.000Z",
    "updated_at": "2020-01-01T00:00:00.000Z",
    "managed_by_sso": true
  }
}

Changes

No recorded changes to this endpoint across all 1 revision of this API.