Sites & Organisation

Users

A User represents a user of the Trybe platform.

get/api-users

Get all API users

listAllApiUsers

Use this endpoint to retrieve all API users

Query parameters

  • pageintegeroptional

    The page to retrieve results from

  • per_pageintegeroptional

    The number of results to return per page

  • site_idstringoptional

    Filter results by the site they belong to

  • organisation_iduuidoptional

    Filter users by the organisation they belong to

  • sortstringoptional

    The field to order results by.

  • querystringoptional

    Filter users by their name or email

  • include_inactivebooleanoptional

    Filter users according to whether they are active or not.

Responses

  • 200

    A list of API users

  • 401

    The user is unauthenticated

post/api-users

Create an API user

createApiUser

Create a new API user (a non-human account intended to authenticate integrations) within the caller's organisation. The new user is attached to the supplied site_id, given the organisation's default API role, has their email pre-verified, and is issued a personal access token in the response — store it securely because Trybe will never return it again.

Requires the caller's site-user to hold the users:manage permission on the target site. The name must be unique across API users in the organisation.

Request body

  • namestringrequired

    Human-readable label for the API user. Shown in the API users list and recorded against audit-log entries so operators can identify which integration made a change. Pick something descriptive like "Mailchimp sync" or "POS terminal 3". Must be unique across API users in the organisation.

  • site_iduuidrequired

    Identifier of the site to attach the new API user to. The caller must hold the users:manage permission on this site; the user inherits the organisation that owns the site. Additional sites can be granted later by an organisation admin.

Responses

  • 200

    A newly created API user, including the access token. The token field is only returned on the create response — it is not persisted by Trybe in a retrievable form, so store it securely as soon as you receive it.

  • 401

    The user is unauthenticated

  • 403

    The authenticated user does not have permission.

  • 422

    The request didn't pass validation

get/api-users/{userId}

Get an API user

getApiUser

This endpoint retrieves an API user in Trybe

Path parameters

  • userIduuidrequired

    The ID of the user

Responses

  • 200

    An API User

  • 401

    The user is unauthenticated

  • 404

    The resource couldn't be found

put/api-users/{userId}

Update an API user

updateApiUser

Rename an existing API user. The user's site memberships, roles and access token are left unchanged — only the human-readable label is updated. The new name must remain unique across API users in the organisation.

Requires the caller's site-user to hold the users:manage permission on a site that the API user belongs to.

Path parameters

  • userIduuidrequired

    The ID of the user

Request body

  • namestringrequired

    New human-readable label for the API user. Must be unique across API users in the organisation.

  • site_iduuidrequired

    Identifier of the API user's primary site. Used to validate uniqueness of name within the owning organisation; the user's existing site memberships are not changed by this field.

Responses

  • 200

    An API User

  • 401

    The user is unauthenticated

  • 403

    The authenticated user does not have permission.

  • 404

    The resource couldn't be found

  • 422

    The request didn't pass validation

delete/api-users/{userId}

Delete an API user

deleteApiUser

Permanently delete an API user and invalidate any access tokens issued to them. Use this when an integration is retired or its credentials are believed to be compromised.

Requires the caller's site-user to hold the users:manage permission on a site that the API user belongs to. The operation cannot be undone.

Path parameters

  • userIduuidrequired

    The ID of the user

Responses

  • 204

    The API user was deleted.

  • 401

    The user is unauthenticated

  • 403

    The authenticated user does not have permission.

  • 404

    The resource couldn't be found

get/users

Get all users

listAllUsers

Use this endpoint to retrieve all users

Query parameters

  • pageintegeroptional

    The page to retrieve results from

  • per_pageintegeroptional

    The number of results to return per page

  • site_idstringoptional

    Filter results by the site they belong to

  • organisation_iduuidoptional

    Filter users by the organisation they belong to

  • sortstringoptional

    The field to order results by.

  • querystringoptional

    Filter users by their name or email

  • twofa_enabledbooleanoptional

    Filter users according to whether they have two-factor authentication enabled.

  • twofa_disabledbooleanoptional

    Filter users according to whether they do not shave two-factor authentication enabled.

  • managed_by_ssobooleanoptional

    Filter users according to whether they are managed by SSO.

  • not_managed_by_ssobooleanoptional

    Filter users according to whether they are not managed by SSO.

  • include_inactivebooleanoptional

    Filter users according to whether they are active or not.

Responses

  • 200

    A list of users

  • 401

    The user is unauthenticated

post/users

Create a new user

createUser

This endpoint creates a new user in Trybe

Request body

  • emailemailrequired

    The email address of the user

  • first_namestringrequired

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

  • last_namestringrequired

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

  • organisation_iduuidoptional

    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_iduuidoptional

    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.

Responses

  • 200

    A User

  • 401

    The user is unauthenticated

  • 403

    The authenticated user does not have permission.

  • 422

    The request didn't pass validation

get/users/{userId}

Get a user

getUser

Use this endpoint to retrieve a user.

Path parameters

  • userIduuidrequired

    The ID of the user

Responses

  • 200

    A User

  • 401

    The user is unauthenticated

  • 404

    The resource couldn't be found

put/users/{userId}

Update a user

updateUser

This endpoint updates an API user in Trybe

Path parameters

  • userIduuidrequired

    The ID of the user

Request body

  • emailemailoptional

    The email address of the user

  • first_namestringoptional

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

  • last_namestringoptional

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

  • organisation_iduuidoptional

    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_iduuidoptional

    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.

  • site_idsstring[]optional

    The IDs of the sites to add the user to

Responses

  • 200

    A User

  • 401

    The user is unauthenticated

  • 403

    The authenticated user does not have permission.

  • 404

    The resource couldn't be found

  • 422

    The request didn't pass validation

delete/users/{userId}

Delete a user

deleteUser

This endpoint deletes a user in Trybe

Path parameters

  • userIduuidrequired

    The ID of the user

Responses

  • 204

    No content

  • 401

    The user is unauthenticated

  • 403

    The authenticated user does not have permission.

  • 404

    The resource couldn't be found

get/users/{userId}/site-roles

Retrieve User Roles

listUserSiteRoles

Use this endpoint to retrieve all the Roles a User has.

Path parameters

  • userIduuidrequired

    The ID of the user

Responses

  • 200

    Roles were successfully retrieved.

  • 401

    The user is unauthenticated

  • 403

    The authenticated user does not have permission.

  • 404

    The resource couldn't be found

put/users/{userId}/site-roles

Assign User to Role

actionAssignUserSiteRole

Use this endpoint to assign a Role to a User.

Path parameters

  • userIduuidrequired

    The ID of the user

Request body

  • site_idstringrequired

    Identifier of the site to grant the role at. Site roles scope permissions to a single site; the user only receives the role's permissions when acting on this site. The caller's API key must have access to it.

  • role_idstringrequired

    Identifier of the role to assign. The role's permissions apply only when the user is operating in the context of the specified site_id.

Responses

  • 201

    The role was successfully assigned.

  • 401

    The user is unauthenticated

  • 403

    The authenticated user does not have permission.

  • 404

    The resource couldn't be found

  • 422

    The request didn't pass validation

delete/users/{userId}/site-roles

Unassign User from Role

deleteUserSiteRole

Use this endpoint to remove a Role from a User.

Path parameters

  • userIduuidrequired

    The ID of the user

Request body

  • site_idstringrequired

    Identifier of the site from which the role should be removed. Only the assignment at this site is revoked; the user's roles at other sites are unaffected.

  • role_idstringrequired

    Identifier of the role to revoke. Must match a role currently assigned to the user at the given site_id; no-op if the user does not hold this role at this site.

Responses

  • 204

    The role was successfully removed.

  • 400

    The request didn't pass validation

  • 401

    The user is unauthenticated

  • 403

    The authenticated user does not have permission.

  • 404

    The resource couldn't be found

  • 422

    The request didn't pass validation

get/users/{userId}/sites

Get a user's Sites

getUserSites

Use this endpoint to get a user's Sites

Path parameters

  • userIduuidrequired

    The ID of the user

Responses

  • 200

    The user's sites were successfully retrieved

  • 401

    The user is unauthenticated

  • 404

    The resource couldn't be found

get/shop/my-notification-config

Get the authenticated user's notification config

getMyNotificationConfig

Returns the authenticated user's per-site automated-report subscription state. Today this only exposes the end-of-day summary preference — whether the calling user is currently a recipient of the daily end-of-day email for the site.

The site is resolved from the request authentication context; no site_id query parameter is required. Sub-resources under /shop/my-notification-config toggle individual subscriptions.

Responses

  • 200

    The authenticated user's notification config.

  • 401

    The user is unauthenticated

  • 403

    The authenticated user does not have permission.

post/shop/my-notification-config/end-of-day-summary

Subscribe to the end-of-day summary

createMyEndOfDaySummarySubscription

Adds the authenticated user as a recipient of the site's end-of-day summary email — the daily wrap-up report sent to subscribed operators after close of business.

Calls are idempotent: re-subscribing an already-subscribed user is a no-op and still returns 204 No Content. The site is resolved from the request authentication context.

Responses

  • 204

    The user is now subscribed to the end-of-day summary.

  • 401

    The user is unauthenticated

  • 403

    The authenticated user does not have permission.

delete/shop/my-notification-config/end-of-day-summary

Unsubscribe from the end-of-day summary

deleteMyEndOfDaySummarySubscription

Removes the authenticated user from the site's end-of-day summary email recipients. Calls are idempotent: unsubscribing a user who isn't subscribed is a no-op and still returns 204 No Content. The site is resolved from the request authentication context.

Responses

  • 204

    The user is no longer subscribed to the end-of-day summary.

  • 401

    The user is unauthenticated

  • 403

    The authenticated user does not have permission.

get/personal-access-tokens

Get the personal access tokens for the authenticated user

listPersonalAccessTokens

Returns metadata for every personal-access token issued to the currently authenticated user. The raw token values are never returned by this endpoint — use the token IDs together with deletePersonalAccessToken to revoke a token, or createPersonalAccessToken to issue a new one.

Responses

  • 200

    A list of personal access tokens

  • 401

    The user is unauthenticated

post/personal-access-tokens

Create a personal access token for the authenticated user

createPersonalAccessToken

Issues a new personal-access token for the currently authenticated user. The raw token value is included in the response; subsequent reads will only expose the metadata. Treat the response as sensitive.

Request body

  • idstringoptional

    Stable identifier for the personal-access token. Use this to revoke the token later via deletePersonalAccessToken. The ID is safe to log; the raw secret is only ever returned at creation as accessToken.

  • namestringrequired

    A human-readable label for the token, used to distinguish it from other tokens issued to the same user.

  • created_atdate-timeoptional

    The date and time the personal access token was created.

Responses

  • 200

    A newly issued personal access token

  • 401

    The user is unauthenticated

  • 403

    The authenticated user does not have permission.

  • 422

    The request didn't pass validation

delete/personal-access-tokens/{tokenId}

Delete a personal access token for the authenticated user

deletePersonalAccessToken

Revokes a personal-access token issued to the currently authenticated user. The revocation takes effect immediately — any in-flight requests using the token will continue to succeed, but subsequent requests will be rejected.

Path parameters

  • tokenIdstringrequired

    Stable identifier for the personal-access token. Only the user who owns the token (or an admin acting on their behalf) can read or revoke it. Use this to scope deletePersonalAccessToken calls to a specific token.

Responses

  • 204

    The personal access token was successfully deleted.

  • 401

    The user is unauthenticated

  • 403

    The authenticated user does not have permission.

  • 404

    The resource couldn't be found

get/user-options

Get all options for the current user

getCurrentUserOptions

Returns the stored UI preferences for the currently authenticated user. Options are an opaque key/value map — see the UserOptions schema for details.

Responses

  • 200

    A map of options for a user

  • 400

    The options could not be retrieved.

  • 401

    The user is unauthenticated

put/user-options

Update options for the current user

updateCurrentUserOptions

Replaces or extends the stored UI preferences for the currently authenticated user. The request body is merged with any existing options at the top level — keys that are not present in the request are left untouched, but nested objects are replaced wholesale.

Request body

No request body

Responses

  • 200

    A map of options for a user

  • 401

    The user is unauthenticated

  • 403

    The authenticated user does not have permission.

  • 422

    The request didn't pass validation

post/user/confirmed-two-factor-authentication

Confirm 2FA enrolment for the authenticated user

actionConfirmCurrentUserTwoFactorAuthentication

Completes the two-factor-authentication enrolment flow by submitting the six-digit code from the user's authenticator app. Once confirmed, 2FA is active for subsequent logins.

Request body

  • codestringrequired

    The 2FA code from the user's authenticator app.

Responses

  • 200

    2FA was successfully confirmed.

  • 401

    The user is unauthenticated

  • 403

    The authenticated user does not have permission.

  • 422

    The request didn't pass validation

post/user/two-factor-authentication

Enable 2FA for the authenticated user

createCurrentUserTwoFactorAuthentication

Starts the two-factor-authentication enrolment flow for the currently authenticated user. The shared secret and QR code can be fetched via getCurrentUserTwoFactorQrCode / getCurrentUserTwoFactorSecretKey. The user must then confirm enrolment via actionConfirmCurrentUserTwoFactorAuthentication before 2FA is fully active.

Request body

No request body

Responses

  • 200

    2FA enrolment was successfully started.

  • 401

    The user is unauthenticated

  • 403

    The authenticated user does not have permission.

  • 422

    The request didn't pass validation

delete/user/two-factor-authentication

Disable 2FA for the authenticated user

deleteCurrentUserTwoFactorAuthentication

Removes the registered second factor for the currently authenticated user. The user can re-enrol later via createCurrentUserTwoFactorAuthentication.

Request body

No request body

Responses

  • 200

    2FA was successfully disabled.

  • 401

    The user is unauthenticated

  • 403

    The authenticated user does not have permission.

  • 422

    The request didn't pass validation

get/user/two-factor-qr-code

Get the QR code for the authenticated user's 2FA enrolment

getCurrentUserTwoFactorQrCode

Returns a fresh QR code the user can scan with their authenticator app to register the shared secret. The QR code is returned both as an otpauth:// URL and as an inline SVG ready for embedding in HTML.

Responses

  • 200

    The QR code was successfully retrieved.

  • 401

    The user is unauthenticated

get/user/two-factor-recovery-codes

Get the recovery codes for the authenticated user's 2FA

getCurrentUserTwoFactorRecoveryCodes

Returns the user's two-factor recovery codes — single-use codes the user can fall back to if they lose access to their authenticator app. Treat the response as sensitive; the codes should be displayed once and stored by the user offline.

Responses

  • 200

    The recovery codes were successfully retrieved.

  • 401

    The user is unauthenticated

get/user/two-factor-secret-key

Get the secret key for the authenticated user's 2FA enrolment

getCurrentUserTwoFactorSecretKey

Returns the base32-encoded shared secret for the user's 2FA enrolment. Use this if the user is configuring their authenticator app by typing the secret in by hand rather than scanning the QR code returned by getCurrentUserTwoFactorQrCode.

Responses

  • 200

    The secret key was successfully retrieved.

  • 401

    The user is unauthenticated

  • 404

    The resource couldn't be found

post/users/{userId}/password-reset

Reset a user's password

actionResetUserPassword

Triggers a password-reset flow for the target user. The user receives an email containing a one-time link they can use to choose a new password. This endpoint does not return the new password and does not invalidate existing sessions until the reset link is followed.

Path parameters

  • userIduuidrequired

    The ID of the user

Responses

  • 200

    The password reset was successfully triggered.

  • 401

    The user is unauthenticated

  • 403

    The authenticated user does not have permission.

  • 404

    The resource couldn't be found

  • 422

    The request didn't pass validation

delete/users/{userId}/two-factor-authentication

Disable 2FA for a user

deleteUserTwoFactorAuthentication

Administratively disables two-factor authentication for the target user, removing any registered authenticator and recovery codes. Use this when a user has lost access to their second factor and the caller has verified the user's identity through another channel.

Path parameters

  • userIduuidrequired

    The ID of the user

Query parameters

  • site_iduuidrequired

    The site id the action is being performed on.

Responses

  • 204

    2FA was successfully disabled for the user.

  • 401

    The user is unauthenticated

  • 403

    The authenticated user does not have permission.

  • 404

    The resource couldn't be found

get/token-info

Get the current bearer token info

getTokenInfo

Decode the bearer token used to make this request and return its standard JWT claims (aud, jti, iat, nbf, exp, sub). Useful as an introspection endpoint when a client needs to know when its token expires or which user the token is currently bound to without parsing the JWT itself.

The token is verified with Trybe's signing key before the claims are returned, so a successful response also confirms the token is currently valid. The response only includes the six claims listed above; custom claims and private extensions are intentionally stripped.

Responses

  • 200

    The decoded JWT claims for the caller's bearer token.

  • 401

    The user is unauthenticated

get/customers/user

Get the current user

getCurrentUser

Returns the authenticated User derived from the bearer token on the request — i.e. a "whoami" probe for confirming credentials are valid and inspecting the caller's identity, organisation and site access.

Although the endpoint is mounted under the api-public middleware (no auth required for the route to resolve), the response body is meaningful only when a bearer token is supplied — without one, the body is null. Use this in clients that need to test "is my token still good?" without committing to a heavier authenticated request.

Responses

  • 200

    The current user, or null if the request is unauthenticated.