Auth API
Users
9 endpoints.
/api/v1/users/{user_id}/roleUpdate User Role
Update another user's role. Restricted to Admin User.
Authentication
Authorization: Bearer <token>.
Parameters
| Name | In | Type | Description |
|---|---|---|---|
user_idrequired | path | string (uuid) |
Request bodyrequired
application/jsonUserRoleUpdate| Field | Type | Description |
|---|---|---|
role_idrequired | integer |
Responses
200Successful Responseapplication/jsonUserResponse| Field | Type | Description |
|---|---|---|
emailrequired | string (email) | |
first_name | string | null | |
last_name | string | null | |
is_active | boolean | null | default true |
idrequired | string (uuid) | |
role_idrequired | integer | |
created_atrequired | string (date-time) | |
updated_atrequired | string (date-time) | |
phone | string | null | |
phone_verified_at | string (date-time) | null | |
pending_email | string | null | |
pending_phone | string | null | |
avatar_url | string | null |
4XXRefused: `code` says why5XXFailed: `code` says why
Error bodies: ErrorBody. See Errors.
/api/v1/users/current_userRead Current User
Get current user.
Authentication
Authorization: Bearer <token>.
Responses
200Successful Responseapplication/jsonUserResponseUserResponse, expanded above.
4XXRefused: `code` says why5XXFailed: `code` says why
Error bodies: ErrorBody. See Errors.
/api/v1/users/current_userUpdate Current User
Update own profile. With sign-in by code on, a new email is held as ``pending_email`` and sent a code (``/current_user/email/confirm`` takes it); the current one stands until then.
Authentication
Authorization: Bearer <token>.
Request bodyrequired
application/jsonUserUpdate| Field | Type | Description |
|---|---|---|
first_name | string | null | |
last_name | string | null | |
email | string (email) | null | |
phone | string | null | |
password | string | null | |
old_password | string | null |
Responses
200Successful Responseapplication/jsonUserResponseUserResponse, expanded above.
4XXRefused: `code` says why5XXFailed: `code` says why
Error bodies: ErrorBody. See Errors.
/api/v1/users/current_user/avatarUpload Current User Avatar
Upload own profile avatar (multipart/form-data).
Authentication
Authorization: Bearer <token>.
Request bodyrequired
multipart/form-dataBody_upload_current_user_avatar_api_v1_users_current_user_avatar_post| Field | Type | Description |
|---|---|---|
filerequired | string (binary) |
Responses
200Successful Responseapplication/jsonUserResponseUserResponse, expanded above.
4XXRefused: `code` says why5XXFailed: `code` says why
Error bodies: ErrorBody. See Errors.
/api/v1/users/current_user/avatarDelete Current User Avatar
Remove own profile avatar.
Authentication
Authorization: Bearer <token>.
Responses
200Successful Responseapplication/jsonUserResponseUserResponse, expanded above.
4XXRefused: `code` says why5XXFailed: `code` says why
Error bodies: ErrorBody. See Errors.
/api/v1/users/current_user/email/codeSend Current User Email Code
Take a new email: it is held as ``pending_email`` and sent a code; the current email stands until the code is confirmed. Sent again when asked again. 409 when another account has it; 429 ``cooldown_active`` with ``retry_in_seconds`` too soon, or past the user's or the IP's hourly limit.
Authentication
Authorization: Bearer <token>.
Request bodyrequired
application/jsonEmailCodeRequest| Field | Type | Description |
|---|---|---|
emailrequired | string (email) |
Responses
200Successful Responseapplication/jsonCodeSent| Field | Type | Description |
|---|---|---|
message | string | default "ok" |
resend_in_secondsrequired | integer |
4XXRefused: `code` says why5XXFailed: `code` says why
Error bodies: ErrorBody. See Errors.
/api/v1/users/current_user/email/confirmConfirm Current User Email
The pending email's code is right: it is the account's email from now on. 400 INVALID_OTP otherwise; 404 NO_PENDING_CHANGE when no email waits.
Authentication
Authorization: Bearer <token>.
Request bodyrequired
application/jsonCodeConfirmRequest| Field | Type | Description |
|---|---|---|
coderequired | string | min length 1 · max length 12 |
Responses
200Successful Responseapplication/jsonUserResponseUserResponse, expanded above.
4XXRefused: `code` says why5XXFailed: `code` says why
Error bodies: ErrorBody. See Errors.
/api/v1/users/current_user/phone/codeSend Current User Phone Code
Text a code to the phone to add or confirm as one's own. 409 when another account has proven it; 429 ``cooldown_active`` with ``retry_in_seconds`` too soon after the last, or past the user's or the IP's hourly limit.
Authentication
Authorization: Bearer <token>.
Request bodyrequired
application/jsonPhoneCodeRequest| Field | Type | Description |
|---|---|---|
phonerequired | string | min length 1 · max length 32 |
Responses
/api/v1/users/current_user/phone/confirmConfirm Current User Phone
The phone's code is right: the phone is one's own, to sign in with. 400 INVALID_OTP otherwise.
Authentication
Authorization: Bearer <token>.
Request bodyrequired
application/jsonPhoneConfirmRequest| Field | Type | Description |
|---|---|---|
phonerequired | string | min length 1 · max length 32 |
coderequired | string | min length 1 · max length 12 |
Responses
200Successful Responseapplication/jsonUserResponseUserResponse, expanded above.
4XXRefused: `code` says why5XXFailed: `code` says why
Error bodies: ErrorBody. See Errors.