User
Get the authenticated user
Section titled “Get the authenticated user”GET /api/v1/user/me
Authentication: BearerAuth.
Responses
Section titled “Responses”| Status | Description | Body |
|---|---|---|
200 | OK | MeResponse |
401 | Unauthorized | ErrorResponse |
404 | Not Found | ErrorResponse |
500 | Internal Server Error | ErrorResponse |
Update the authenticated user
Section titled “Update the authenticated user”PATCH /api/v1/user/me
Authentication: BearerAuth.
Request body
Section titled “Request body”application/json, required: UpdateMeRequest
Fields to update
| Field | Type | Required | Description |
|---|---|---|---|
avatar_url | string | No | |
first_name | string | No | At least 1 character. At most 50 characters. |
last_name | string | No | At least 1 character. At most 50 characters. |
Responses
Section titled “Responses”| Status | Description | Body |
|---|---|---|
200 | OK | User |
400 | Bad Request | ErrorResponse |
401 | Unauthorized | ErrorResponse |
404 | Not Found | ErrorResponse |
500 | Internal Server Error | ErrorResponse |
Upload the authenticated user’s avatar
Section titled “Upload the authenticated user’s avatar”POST /api/v1/user/me/avatar
Accepts a multipart form with a single “file” field (JPEG, PNG, or WebP). The image is re-encoded to a 512px JPEG (stripping metadata), stored in object storage, and the user’s avatar_url is updated. A previous avatar is deleted.
Authentication: BearerAuth.
Request body
Section titled “Request body”multipart/form-data, required: object
Image file to upload
| Field | Type | Required | Description |
|---|---|---|---|
file | string | Yes | Image file to upload |
Responses
Section titled “Responses”| Status | Description | Body |
|---|---|---|
200 | OK | User |
400 | Bad Request | ErrorResponse |
401 | Unauthorized | ErrorResponse |
404 | Not Found | ErrorResponse |
413 | Request Entity Too Large | ErrorResponse |
415 | Unsupported Media Type | ErrorResponse |
500 | Internal Server Error | ErrorResponse |
Delete the authenticated user’s avatar
Section titled “Delete the authenticated user’s avatar”DELETE /api/v1/user/me/avatar
Clears the user’s avatar_url and deletes the stored object.
Authentication: BearerAuth.
Responses
Section titled “Responses”| Status | Description | Body |
|---|---|---|
200 | OK | User |
401 | Unauthorized | ErrorResponse |
404 | Not Found | ErrorResponse |
500 | Internal Server Error | ErrorResponse |
Start setting up an authenticator app
Section titled “Start setting up an authenticator app”POST /api/v1/user/me/mfa/totp
Returns a new TOTP secret, shown once. TOTP is on only after POST /user/me/mfa/totp/confirm proves the app has it.
Authentication: BearerAuth.
Responses
Section titled “Responses”| Status | Description | Body |
|---|---|---|
200 | OK | TOTPEnrollmentResponse |
401 | Unauthorized | ErrorResponse |
409 | Conflict | ErrorResponse |
500 | Internal Server Error | ErrorResponse |
Turn TOTP on with a code from the app
Section titled “Turn TOTP on with a code from the app”POST /api/v1/user/me/mfa/totp/confirm
Returns ten recovery codes, shown once; each signs in once in place of a code.
Authentication: BearerAuth.
Request body
Section titled “Request body”application/json, required: MFACodeRequest
Current code from the app
| Field | Type | Required | Description |
|---|---|---|---|
code | string | Yes | At most 32 characters. |
Responses
Section titled “Responses”| Status | Description | Body |
|---|---|---|
200 | OK | RecoveryCodesResponse |
400 | Bad Request | ErrorResponse |
401 | Unauthorized | ErrorResponse |
409 | Conflict | ErrorResponse |
429 | Too Many Requests | ErrorResponse |
500 | Internal Server Error | ErrorResponse |
Turn TOTP off
Section titled “Turn TOTP off”POST /api/v1/user/me/mfa/totp/disable
Takes a current code or a recovery code, so an access token alone cannot remove the second factor.
Authentication: BearerAuth.
Request body
Section titled “Request body”application/json, required: MFACodeRequest
Current or recovery code
| Field | Type | Required | Description |
|---|---|---|---|
code | string | Yes | At most 32 characters. |
Responses
Section titled “Responses”| Status | Description | Body |
|---|---|---|
204 | No Content | None |
400 | Bad Request | ErrorResponse |
401 | Unauthorized | ErrorResponse |
409 | Conflict | ErrorResponse |
429 | Too Many Requests | ErrorResponse |
500 | Internal Server Error | ErrorResponse |
Part of Crewlet. Generated from the OpenAPI document of the API, version 0.1.0.