Auth internal API
Users
11 endpoints.
/api/v1/internal/usersList Users
Authentication
X-Internal-Api-Key header.
Parameters
| Name | In | Type | Description |
|---|---|---|---|
role_idrequired | query | integer | Filter by Heimdal role_id |
exclude_guests | query | boolean | Leave out guests (an email on GUEST_EMAIL_DOMAIN) default false |
limit | query | integer | default 100 |
offset | query | integer | default 0 |
Responses
200Successful Responseapplication/jsonInternalUserListResponse| Field | Type | Description | |||||||||||||||||||||||||||||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
usersrequired | InternalUserRecord[] | InternalUserRecord[] fields
|
4XXRefused: `code` says why5XXFailed: `code` says why
Error bodies: ErrorBody. See Errors.
/api/v1/internal/users/{user_id}Update User
sor's update of an account. A new email or phone is held as ``pending_email`` / ``pending_phone`` and sent a code (``contact/confirm`` takes it). ``invite_accept`` leaves email and phone alone.
Authentication
X-Internal-Api-Key header.
Parameters
| Name | In | Type | Description |
|---|---|---|---|
user_idrequired | path | string (uuid) |
Request bodyrequired
application/jsonInternalUserUpdateRequest| Field | Type | Description |
|---|---|---|
first_name | string | null | |
last_name | string | null | |
phone | string | null | |
email | string (email) | null | |
role_id | integer | null | |
is_active | boolean | null | |
invite_accept | boolean | default false |
Responses
200Successful Responseapplication/jsonInternalUserRecordInternalUserRecord, expanded above.
4XXRefused: `code` says why5XXFailed: `code` says why
Error bodies: ErrorBody. See Errors.
/api/v1/internal/users/{user_id}/contact/codeSend Contact Code
Send again the code to the account's pending email or phone. 404 NO_PENDING_CHANGE when none waits; 429 ``cooldown_active`` with ``retry_in_seconds`` too soon or past the account's (or ``client_ip``'s) hourly limit.
Authentication
X-Internal-Api-Key header.
Parameters
| Name | In | Type | Description |
|---|---|---|---|
user_idrequired | path | string (uuid) |
Request bodyrequired
application/jsonInternalContactCodeRequest| Field | Type | Description |
|---|---|---|
channelrequired | enum | one of "email", "phone" |
client_ip | string | null |
Responses
200Successful Responseapplication/jsonInternalCodeSentResponse| Field | Type | Description |
|---|---|---|
resend_in_secondsrequired | integer |
4XXRefused: `code` says why5XXFailed: `code` says why
Error bodies: ErrorBody. See Errors.
/api/v1/internal/users/{user_id}/contact/confirmConfirm Contact
The code the pending email or phone received, entered where sor took it (the person, or the admin who changed it, told it by them): the address becomes the account's and signs in from now on. 400 INVALID_OTP, 404 NO_PENDING_CHANGE, 409 taken meanwhile, 429 TOO_MANY_CODE_ATTEMPTS.
Authentication
X-Internal-Api-Key header.
Parameters
| Name | In | Type | Description |
|---|---|---|---|
user_idrequired | path | string (uuid) |
Request bodyrequired
application/jsonInternalContactConfirmRequest| Field | Type | Description |
|---|---|---|
channelrequired | enum | one of "email", "phone" |
coderequired | string | min length 1 · max length 12 |
Responses
200Successful Responseapplication/jsonInternalUserRecordInternalUserRecord, expanded above.
4XXRefused: `code` says why5XXFailed: `code` says why
Error bodies: ErrorBody. See Errors.
/api/v1/internal/users/{user_id}/guestDelete Guest
Delete a guest whose business went to the account it signed in to, with its sessions and codes. Any other account is a 404.
Authentication
X-Internal-Api-Key header.
Parameters
| Name | In | Type | Description |
|---|---|---|---|
user_idrequired | path | string (uuid) |
Responses
204Successful Response4XXRefused: `code` says why5XXFailed: `code` says why
Error bodies: ErrorBody. See Errors.
/api/v1/internal/users/{user_id}/guest-claim/codeSend Guest Claim Code
Email the person behind a guest a code: one to make the guest theirs, or to sign in to the account that has the email already (`existing`). 409 when the email is another guest's; 429 ``cooldown_active`` past the guest's hourly limit, or the visitor's (``client_ip``, when sor gives it).
Authentication
X-Internal-Api-Key header.
Parameters
| Name | In | Type | Description |
|---|---|---|---|
user_idrequired | path | string (uuid) |
Request bodyrequired
application/jsonInternalGuestClaimCodeSendRequest| Field | Type | Description |
|---|---|---|
emailrequired | string (email) | |
client_ip | string | null |
Responses
200Successful Responseapplication/jsonInternalGuestClaimCodeResponse| Field | Type | Description |
|---|---|---|
existingrequired | boolean |
4XXRefused: `code` says why5XXFailed: `code` says why
Error bodies: ErrorBody. See Errors.
/api/v1/internal/users/{user_id}/guest-claim/verifyVerify Guest Claim
The guest's code is right: the account is theirs now, and signed in afresh; or, the code was the sign-in code of the account that has the email, that account (`user`, not the guest) signed in. 400 INVALID_OTP otherwise.
Authentication
X-Internal-Api-Key header.
Parameters
| Name | In | Type | Description |
|---|---|---|---|
user_idrequired | path | string (uuid) |
Request bodyrequired
application/jsonInternalGuestClaimVerifyRequest| Field | Type | Description |
|---|---|---|
emailrequired | string (email) | |
coderequired | string | max length 12 |
Responses
200Successful Responseapplication/jsonInternalGuestClaimVerifyResponse| Field | Type | Description |
|---|---|---|
userrequired | InternalUserRecord | InternalUserRecord fieldsInternalUserRecord, expanded above. |
access_tokenrequired | string | |
refresh_tokenrequired | string | |
token_typerequired | string |
4XXRefused: `code` says why5XXFailed: `code` says why
Error bodies: ErrorBody. See Errors.
/api/v1/internal/users/{user_id}/guest-sessionIssue Guest Session
A session for a guest (the account opened for a business no one has signed up for yet). Any other account is a 404: the internal key never signs in a person.
Authentication
X-Internal-Api-Key header.
Parameters
| Name | In | Type | Description |
|---|---|---|---|
user_idrequired | path | string (uuid) |
Responses
200Successful Responseapplication/jsonInternalGuestSessionResponse| Field | Type | Description |
|---|---|---|
access_tokenrequired | string | |
refresh_tokenrequired | string | |
token_typerequired | string |
4XXRefused: `code` says why5XXFailed: `code` says why
Error bodies: ErrorBody. See Errors.
/api/v1/internal/users/{user_id}/passwordSet Password
Give the account a password to sign in with, beside its codes.
Authentication
X-Internal-Api-Key header.
Parameters
| Name | In | Type | Description |
|---|---|---|---|
user_idrequired | path | string (uuid) |
Request bodyrequired
application/jsonInternalPasswordRequest| Field | Type | Description |
|---|---|---|
passwordrequired | string | max length 200 |
Responses
204Successful Response4XXRefused: `code` says why5XXFailed: `code` says why
Error bodies: ErrorBody. See Errors.
/api/v1/internal/users/lookupLookup Users
Authentication
X-Internal-Api-Key header.
Request bodyrequired
application/jsonInternalUserLookupRequest| Field | Type | Description |
|---|---|---|
user_ids | string (uuid)[] | default []string (uuid)[] fields |
emails | string (email)[] | default []string (email)[] fields |
Responses
200Successful Responseapplication/jsonInternalUserLookupResponse| Field | Type | Description |
|---|---|---|
usersrequired | InternalUserRecord[] | InternalUserRecord[] fieldsInternalUserRecord, expanded above. |
4XXRefused: `code` says why5XXFailed: `code` says why
Error bodies: ErrorBody. See Errors.
/api/v1/internal/users/provisionProvision User
Authentication
X-Internal-Api-Key header.
Request bodyrequired
application/jsonInternalProvisionUserRequest| Field | Type | Description |
|---|---|---|
emailrequired | string (email) | |
first_namerequired | string | |
last_namerequired | string | |
phone | string | null | |
role_id | integer | default 400 |
send_password_reset | boolean | default true |
Responses
200User updated successfullyapplication/jsonInternalProvisionUserResponse| Field | Type | Description |
|---|---|---|
user_idrequired | string (uuid) | |
emailrequired | string (email) | |
first_name | string | null | |
last_name | string | null | |
phone | string | null | |
role_idrequired | integer | |
createdrequired | boolean | |
password_reset_sentrequired | boolean |
201Successful Responseapplication/jsonInternalProvisionUserResponseInternalProvisionUserResponse, expanded above.
4XXRefused: `code` says why5XXFailed: `code` says why
Error bodies: ErrorBody. See Errors.