Auth
Mail a new verification link to the signed-in account
Section titled “Mail a new verification link to the signed-in account”POST /api/v1/auth/email/resend
Authentication: BearerAuth.
Responses
Section titled “Responses”| Status | Description | Body |
|---|---|---|
202 | Accepted | None |
401 | Unauthorized | ErrorResponse |
429 | Too Many Requests | ErrorResponse |
500 | Internal Server Error | ErrorResponse |
Confirm an email address from a mailed link
Section titled “Confirm an email address from a mailed link”POST /api/v1/auth/email/verify
Request body
Section titled “Request body”application/json, required: EmailTokenRequest
Token from the link
| Field | Type | Required | Description |
|---|---|---|---|
token | string | Yes | At most 128 characters. |
Responses
Section titled “Responses”| Status | Description | Body |
|---|---|---|
204 | No Content | None |
400 | Bad Request | ErrorResponse |
429 | Too Many Requests | ErrorResponse |
500 | Internal Server Error | ErrorResponse |
Begin a GitHub OAuth sign-in
Section titled “Begin a GitHub OAuth sign-in”GET /api/v1/auth/github
Responses
Section titled “Responses”| Status | Description | Body |
|---|---|---|
302 | Found | None |
503 | Service Unavailable | ErrorResponse (text/plain) |
GitHub OAuth redirect target
Section titled “GitHub OAuth redirect target”GET /api/v1/auth/github/callback
Parameters
Section titled “Parameters”| Name | In | Type | Required | Description |
|---|---|---|---|---|
code | query | string | Yes | Authorization code from GitHub |
state | query | string | Yes | CSRF state echoed from BeginGitHub |
Responses
Section titled “Responses”| Status | Description | Body |
|---|---|---|
302 | Found | None |
400 | Bad Request | ErrorResponse (text/plain) |
403 | Forbidden | ErrorResponse (text/plain) |
409 | Conflict | ErrorResponse (text/plain) |
Begin a Google OAuth sign-in
Section titled “Begin a Google OAuth sign-in”GET /api/v1/auth/google
Responses
Section titled “Responses”| Status | Description | Body |
|---|---|---|
302 | Found | None |
503 | Service Unavailable | ErrorResponse (text/plain) |
Google OAuth redirect target
Section titled “Google OAuth redirect target”GET /api/v1/auth/google/callback
Parameters
Section titled “Parameters”| Name | In | Type | Required | Description |
|---|---|---|---|---|
code | query | string | Yes | Authorization code from Google |
state | query | string | Yes | CSRF state echoed from BeginGoogle |
Responses
Section titled “Responses”| Status | Description | Body |
|---|---|---|
302 | Found | None |
400 | Bad Request | ErrorResponse (text/plain) |
403 | Forbidden | ErrorResponse (text/plain) |
409 | Conflict | ErrorResponse (text/plain) |
Authenticate a user and return tokens
Section titled “Authenticate a user and return tokens”POST /api/v1/auth/login
Request body
Section titled “Request body”application/json, required: LoginRequest
Email and password
| Field | Type | Required | Description |
|---|---|---|---|
email | string | Yes | |
password | string | Yes |
Responses
Section titled “Responses”| Status | Description | Body |
|---|---|---|
200 | OK | AuthResponse |
202 | Password checked out; finish with POST /auth/mfa/verify | MFAChallengeResponse |
400 | Bad Request | ErrorResponse |
401 | Unauthorized | ErrorResponse |
403 | Forbidden | ErrorResponse |
429 | Too Many Requests | ErrorResponse |
500 | Internal Server Error | ErrorResponse |
End the session
Section titled “End the session”POST /api/v1/auth/logout
Revokes the session in the httpOnly cookie and clears it. Requires the session’s CSRF token in X-CSRF-Token and an allowed console origin.
Parameters
Section titled “Parameters”| Name | In | Type | Required | Description |
|---|---|---|---|---|
X-CSRF-Token | header | string | Yes | The csrf_token issued with the session |
Responses
Section titled “Responses”| Status | Description | Body |
|---|---|---|
204 | No Content | None |
403 | Forbidden | ErrorResponse |
500 | Internal Server Error | ErrorResponse |
Finish a sign-in with a second factor
Section titled “Finish a sign-in with a second factor”POST /api/v1/auth/mfa/verify
Takes the ticket from a sign-in that answered mfa_required and a one-time or recovery code, and starts the session. The request must come from an allowed console origin.
Request body
Section titled “Request body”application/json, required: MFAVerifyRequest
Ticket and code
| Field | Type | Required | Description |
|---|---|---|---|
code | string | Yes | Code is a six-digit one-time code or a recovery code. At most 32 characters. |
ticket | string | Yes | At most 256 characters. |
Responses
Section titled “Responses”| Status | Description | Body |
|---|---|---|
200 | OK | AuthResponse |
400 | Bad Request | ErrorResponse |
401 | Unauthorized | ErrorResponse |
403 | Forbidden | ErrorResponse |
429 | Too Many Requests | ErrorResponse |
500 | Internal Server Error | ErrorResponse |
Trade a one-time OAuth code for tokens
Section titled “Trade a one-time OAuth code for tokens”POST /api/v1/auth/oauth/exchange
Request body
Section titled “Request body”application/json, required: OAuthExchangeRequest
One-time code from the OAuth callback redirect
| Field | Type | Required | Description |
|---|---|---|---|
code | string | Yes |
Responses
Section titled “Responses”| Status | Description | Body |
|---|---|---|
200 | OK | AuthResponse |
202 | Finish with POST /auth/mfa/verify | MFAChallengeResponse |
400 | Bad Request | ErrorResponse |
401 | Unauthorized | ErrorResponse |
403 | Forbidden | ErrorResponse |
429 | Too Many Requests | ErrorResponse |
Mail a password reset link
Section titled “Mail a password reset link”POST /api/v1/auth/password/forgot
Always answers 202, whether or not the email belongs to an account.
Request body
Section titled “Request body”application/json, required: ForgotPasswordRequest
Account email
| Field | Type | Required | Description |
|---|---|---|---|
email | string | Yes | At most 255 characters. |
Responses
Section titled “Responses”| Status | Description | Body |
|---|---|---|
202 | Accepted | None |
400 | Bad Request | ErrorResponse |
429 | Too Many Requests | ErrorResponse |
500 | Internal Server Error | ErrorResponse |
Set a new password from a mailed link
Section titled “Set a new password from a mailed link”POST /api/v1/auth/password/reset
Signs the account out of every session.
Request body
Section titled “Request body”application/json, required: ResetPasswordRequest
Token and new password
| Field | Type | Required | Description |
|---|---|---|---|
password | string | Yes | At least 8 characters. At most 72 characters. |
token | string | Yes | At most 128 characters. |
Responses
Section titled “Responses”| Status | Description | Body |
|---|---|---|
204 | No Content | None |
400 | Bad Request | ErrorResponse |
429 | Too Many Requests | ErrorResponse |
500 | Internal Server Error | ErrorResponse |
Rotate the session and get a new access token
Section titled “Rotate the session and get a new access token”POST /api/v1/auth/refresh
Reads the httpOnly session cookie, rotates it and returns new access and CSRF tokens. The request must come from an allowed console origin. A refresh token used before revokes the whole session.
Responses
Section titled “Responses”| Status | Description | Body |
|---|---|---|
200 | OK | AuthResponse |
401 | Unauthorized | ErrorResponse |
403 | Forbidden | ErrorResponse |
429 | Too Many Requests | ErrorResponse |
500 | Internal Server Error | ErrorResponse |
Create a new user account
Section titled “Create a new user account”POST /api/v1/auth/signup
Request body
Section titled “Request body”application/json, required: SignUpRequest
Credentials and profile fields
| Field | Type | Required | Description |
|---|---|---|---|
email | string | Yes | At most 255 characters. |
first_name | string | Yes | At most 50 characters. |
last_name | string | Yes | At most 50 characters. |
password | string | Yes | Bcrypt silently truncates passwords over 72 bytes, so we cap at 72. At least 8 characters. At most 72 characters. |
Responses
Section titled “Responses”| Status | Description | Body |
|---|---|---|
201 | Created | AuthResponse |
400 | Bad Request | ErrorResponse |
403 | Forbidden | 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.