Auth
Authenticate users and obtain access tokens.
Start email login
/auth/email/startInitiates an email-based login flow by sending a verification code to the provided email address.
The response includes a nonce that must be used when verifying the login, along with timing information for the verification code.
This endpoint always returns 202 Accepted to prevent email enumeration attacks.
BodyStartEmailLoginRequestrequiredapplication/json
Request to initiate an email-based login flow. A verification code will be sent to the provided email address.
emailstringemailrequiredThe email address to send the verification code to.
Responses
202Login flow initiated. A verification code has been sent to the email address if it exists in the system.
application/json
Login flow initiated. A verification code has been sent to the email address if it exists in the system.
Login flow initiated. A verification code has been sent to the email address if it exists in the system.
objectStartEmailLoginResponse
Response from initiating an email login. Contains the nonce needed for verification and timing information.
noncestringrequiredToken to reference this authentication request during verification.
expires InintegerrequiredNumber of seconds until the verification code expires.
created Atstringdate-timerequiredWhen the authentication request was created.
expires Atstringdate-timerequiredWhen the verification code will expire.
400The request was malformed or invalid.
application/json
The request was malformed or invalid.
The request was malformed or invalid.
objectError
The error body returned by every endpoint when a request fails. Use internalCode for programmatic
handling, show message to a human, and check details for field-level problems when the request
was invalid.
messagestringrequiredA human-readable message providing more details about the error.
codestringrequiredA machine-readable code for the error. It is the code the failing system answered with — one of
ours where the endpoint publishes one, an operator's own code where the failure came from an
operator, and otherwise the request status. Prefer internalCode for branching.
internal CodestringNames the condition that failed, from our own registry, independently of which system reported it and of the HTTP status. Stable across releases and the code to branch on in client code.
detailsarray of objectAdditional details about the error, typically one entry per invalid field on validation failures.
Show child attributes
messagestringrequiredA human-readable message providing more details about the error.
codestringrequiredA machine-readable code for the specific detail.
propertystringThe property or field related to the error. May be nested using dot notation (e.g., "billing.email").
suggestionone ofA suggested value for the particular property.
For example, this may be set when validating an address with an alias, suggesting the expected value by the operator.
A string, number, boolean, object, or array value. The concrete type depends on the field the value is returned for.
Show child attributes
hintstringA hint to help resolve the error.
trace IdstringIdentifies the trace this request produced. Quote it when reporting a failure — it is what lets us find the request among everything else the platform served.
span IdstringThe span within the trace that failed.
429Too many requests have been sent in a given amount of time.
application/json
Too many requests have been sent in a given amount of time.
Too many requests have been sent in a given amount of time.
objectError
The error body returned by every endpoint when a request fails. Use internalCode for programmatic
handling, show message to a human, and check details for field-level problems when the request
was invalid.
messagestringrequiredA human-readable message providing more details about the error.
codestringrequiredA machine-readable code for the error. It is the code the failing system answered with — one of
ours where the endpoint publishes one, an operator's own code where the failure came from an
operator, and otherwise the request status. Prefer internalCode for branching.
internal CodestringNames the condition that failed, from our own registry, independently of which system reported it and of the HTTP status. Stable across releases and the code to branch on in client code.
detailsarray of objectAdditional details about the error, typically one entry per invalid field on validation failures.
Show child attributes
messagestringrequiredA human-readable message providing more details about the error.
codestringrequiredA machine-readable code for the specific detail.
propertystringThe property or field related to the error. May be nested using dot notation (e.g., "billing.email").
suggestionone ofA suggested value for the particular property.
For example, this may be set when validating an address with an alias, suggesting the expected value by the operator.
A string, number, boolean, object, or array value. The concrete type depends on the field the value is returned for.
Show child attributes
hintstringA hint to help resolve the error.
trace IdstringIdentifies the trace this request produced. Quote it when reporting a failure — it is what lets us find the request among everything else the platform served.
span IdstringThe span within the trace that failed.
500An unexpected error occurred on the server.
application/json
An unexpected error occurred on the server.
An unexpected error occurred on the server.
objectError
The error body returned by every endpoint when a request fails. Use internalCode for programmatic
handling, show message to a human, and check details for field-level problems when the request
was invalid.
messagestringrequiredA human-readable message providing more details about the error.
codestringrequiredA machine-readable code for the error. It is the code the failing system answered with — one of
ours where the endpoint publishes one, an operator's own code where the failure came from an
operator, and otherwise the request status. Prefer internalCode for branching.
internal CodestringNames the condition that failed, from our own registry, independently of which system reported it and of the HTTP status. Stable across releases and the code to branch on in client code.
detailsarray of objectAdditional details about the error, typically one entry per invalid field on validation failures.
Show child attributes
messagestringrequiredA human-readable message providing more details about the error.
codestringrequiredA machine-readable code for the specific detail.
propertystringThe property or field related to the error. May be nested using dot notation (e.g., "billing.email").
suggestionone ofA suggested value for the particular property.
For example, this may be set when validating an address with an alias, suggesting the expected value by the operator.
A string, number, boolean, object, or array value. The concrete type depends on the field the value is returned for.
Show child attributes
hintstringA hint to help resolve the error.
trace IdstringIdentifies the trace this request produced. Quote it when reporting a failure — it is what lets us find the request among everything else the platform served.
span IdstringThe span within the trace that failed.
No auth required
curl https://apiv2.example.com/api/v2/auth/email/start \
--request POST \
--header 'Content-Type: application/json' \
--data '{
"email": "john.doe@example.com"
}'fetch('https://apiv2.example.com/api/v2/auth/email/start', {
method: 'POST',
headers: {
'Content-Type': 'application/json'
},
body: JSON.stringify({
email: 'john.doe@example.com'
})
})requests.post(
"https://apiv2.example.com/api/v2/auth/email/start",
headers={
"Content-Type": "application/json"
},
json={
"email": "john.doe@example.com"
}
)package main
import (
"fmt"
"io"
"net/http"
"strings"
)
func main() {
requestUrl := "https://apiv2.example.com/api/v2/auth/email/start"
payload := strings.NewReader(`{
"email": "john.doe@example.com"
}`)
req, _ := http.NewRequest("POST", requestUrl, payload)
req.Header.Add("Content-Type", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(res)
fmt.Println(string(body))
}{
"nonce": "a1b2c3d4-e5f6-7890-abcd-ef1234567890",
"expiresIn": 300,
"createdAt": "2024-01-15T10:30:00Z",
"expiresAt": "2024-01-15T10:35:00Z"
}{
"message": "The request body is invalid.",
"code": "bad_request",
"details": [
{
"message": "Email format is invalid.",
"code": "invalid_email",
"property": "contact.email"
}
],
"hint": "Check the request payload and correct the highlighted fields."
}{
"message": "Too many requests. Please slow down.",
"code": "too_many_requests",
"hint": "Retry after the number of seconds indicated in the Retry-After header."
}{
"message": "An unexpected error occurred on the server.",
"code": "internal_server_error",
"hint": "Retry the request later. If the problem persists, contact support."
}Verify email login
/auth/email/verifyVerifies an email login by validating the verification code sent to the email address.
On success, returns an OAuth2-compatible token response with:
accessToken: JWT token for authenticating subsequent API requeststokenType: Always "Bearer"expiresIn: Token lifetime in secondsuserId: The authenticated user's identifier
Use the access token in the Authorization header: Authorization: Bearer {accessToken}
BodyVerifyEmailLoginRequestrequiredapplication/json
Request to verify an email login by providing the verification code sent to the email address.
emailstringemailrequiredThe email address used to initiate the login.
noncestringrequiredThe nonce returned from the start login request.
codestringpattern ^[0-9]{6}$requiredThe 6-digit verification code sent to the email address.
Responses
200Login verified successfully. Returns access token for API authentication.
application/json
Login verified successfully. Returns access token for API authentication.
Login verified successfully. Returns access token for API authentication.
objectTokenResponse
OAuth2-compatible token response containing the access token for authenticating API requests.
access TokenstringrequiredJWT access token for authenticating API requests. Include in the Authorization header as "Bearer {accessToken}".
token Typeenum<string>requiredThe type of token issued. Always "Bearer" for JWT tokens.
values
Bearer
expires InintegerrequiredNumber of seconds until the access token expires.
user IdstringThe unique identifier of the authenticated user.
400The request was malformed or invalid.
application/json
The request was malformed or invalid.
The request was malformed or invalid.
objectError
The error body returned by every endpoint when a request fails. Use internalCode for programmatic
handling, show message to a human, and check details for field-level problems when the request
was invalid.
messagestringrequiredA human-readable message providing more details about the error.
codestringrequiredA machine-readable code for the error. It is the code the failing system answered with — one of
ours where the endpoint publishes one, an operator's own code where the failure came from an
operator, and otherwise the request status. Prefer internalCode for branching.
internal CodestringNames the condition that failed, from our own registry, independently of which system reported it and of the HTTP status. Stable across releases and the code to branch on in client code.
detailsarray of objectAdditional details about the error, typically one entry per invalid field on validation failures.
Show child attributes
messagestringrequiredA human-readable message providing more details about the error.
codestringrequiredA machine-readable code for the specific detail.
propertystringThe property or field related to the error. May be nested using dot notation (e.g., "billing.email").
suggestionone ofA suggested value for the particular property.
For example, this may be set when validating an address with an alias, suggesting the expected value by the operator.
A string, number, boolean, object, or array value. The concrete type depends on the field the value is returned for.
Show child attributes
hintstringA hint to help resolve the error.
trace IdstringIdentifies the trace this request produced. Quote it when reporting a failure — it is what lets us find the request among everything else the platform served.
span IdstringThe span within the trace that failed.
401Authentication is required to access this resource.
application/json
Authentication is required to access this resource.
Authentication is required to access this resource.
objectError
The error body returned by every endpoint when a request fails. Use internalCode for programmatic
handling, show message to a human, and check details for field-level problems when the request
was invalid.
messagestringrequiredA human-readable message providing more details about the error.
codestringrequiredA machine-readable code for the error. It is the code the failing system answered with — one of
ours where the endpoint publishes one, an operator's own code where the failure came from an
operator, and otherwise the request status. Prefer internalCode for branching.
internal CodestringNames the condition that failed, from our own registry, independently of which system reported it and of the HTTP status. Stable across releases and the code to branch on in client code.
detailsarray of objectAdditional details about the error, typically one entry per invalid field on validation failures.
Show child attributes
messagestringrequiredA human-readable message providing more details about the error.
codestringrequiredA machine-readable code for the specific detail.
propertystringThe property or field related to the error. May be nested using dot notation (e.g., "billing.email").
suggestionone ofA suggested value for the particular property.
For example, this may be set when validating an address with an alias, suggesting the expected value by the operator.
A string, number, boolean, object, or array value. The concrete type depends on the field the value is returned for.
Show child attributes
hintstringA hint to help resolve the error.
trace IdstringIdentifies the trace this request produced. Quote it when reporting a failure — it is what lets us find the request among everything else the platform served.
span IdstringThe span within the trace that failed.
429Too many requests have been sent in a given amount of time.
application/json
Too many requests have been sent in a given amount of time.
Too many requests have been sent in a given amount of time.
objectError
The error body returned by every endpoint when a request fails. Use internalCode for programmatic
handling, show message to a human, and check details for field-level problems when the request
was invalid.
messagestringrequiredA human-readable message providing more details about the error.
codestringrequiredA machine-readable code for the error. It is the code the failing system answered with — one of
ours where the endpoint publishes one, an operator's own code where the failure came from an
operator, and otherwise the request status. Prefer internalCode for branching.
internal CodestringNames the condition that failed, from our own registry, independently of which system reported it and of the HTTP status. Stable across releases and the code to branch on in client code.
detailsarray of objectAdditional details about the error, typically one entry per invalid field on validation failures.
Show child attributes
messagestringrequiredA human-readable message providing more details about the error.
codestringrequiredA machine-readable code for the specific detail.
propertystringThe property or field related to the error. May be nested using dot notation (e.g., "billing.email").
suggestionone ofA suggested value for the particular property.
For example, this may be set when validating an address with an alias, suggesting the expected value by the operator.
A string, number, boolean, object, or array value. The concrete type depends on the field the value is returned for.
Show child attributes
hintstringA hint to help resolve the error.
trace IdstringIdentifies the trace this request produced. Quote it when reporting a failure — it is what lets us find the request among everything else the platform served.
span IdstringThe span within the trace that failed.
500An unexpected error occurred on the server.
application/json
An unexpected error occurred on the server.
An unexpected error occurred on the server.
objectError
The error body returned by every endpoint when a request fails. Use internalCode for programmatic
handling, show message to a human, and check details for field-level problems when the request
was invalid.
messagestringrequiredA human-readable message providing more details about the error.
codestringrequiredA machine-readable code for the error. It is the code the failing system answered with — one of
ours where the endpoint publishes one, an operator's own code where the failure came from an
operator, and otherwise the request status. Prefer internalCode for branching.
internal CodestringNames the condition that failed, from our own registry, independently of which system reported it and of the HTTP status. Stable across releases and the code to branch on in client code.
detailsarray of objectAdditional details about the error, typically one entry per invalid field on validation failures.
Show child attributes
messagestringrequiredA human-readable message providing more details about the error.
codestringrequiredA machine-readable code for the specific detail.
propertystringThe property or field related to the error. May be nested using dot notation (e.g., "billing.email").
suggestionone ofA suggested value for the particular property.
For example, this may be set when validating an address with an alias, suggesting the expected value by the operator.
A string, number, boolean, object, or array value. The concrete type depends on the field the value is returned for.
Show child attributes
hintstringA hint to help resolve the error.
trace IdstringIdentifies the trace this request produced. Quote it when reporting a failure — it is what lets us find the request among everything else the platform served.
span IdstringThe span within the trace that failed.
No auth required
curl https://apiv2.example.com/api/v2/auth/email/verify \
--request POST \
--header 'Content-Type: application/json' \
--data '{
"email": "john.doe@example.com",
"nonce": "a1b2c3d4-e5f6-7890-abcd-ef1234567890",
"code": "123456"
}'fetch('https://apiv2.example.com/api/v2/auth/email/verify', {
method: 'POST',
headers: {
'Content-Type': 'application/json'
},
body: JSON.stringify({
email: 'john.doe@example.com',
nonce: 'a1b2c3d4-e5f6-7890-abcd-ef1234567890',
code: '123456'
})
})requests.post(
"https://apiv2.example.com/api/v2/auth/email/verify",
headers={
"Content-Type": "application/json"
},
json={
"email": "john.doe@example.com",
"nonce": "a1b2c3d4-e5f6-7890-abcd-ef1234567890",
"code": "123456"
}
)package main
import (
"fmt"
"io"
"net/http"
"strings"
)
func main() {
requestUrl := "https://apiv2.example.com/api/v2/auth/email/verify"
payload := strings.NewReader(`{
"email": "john.doe@example.com",
"nonce": "a1b2c3d4-e5f6-7890-abcd-ef1234567890",
"code": "123456"
}`)
req, _ := http.NewRequest("POST", requestUrl, payload)
req.Header.Add("Content-Type", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(res)
fmt.Println(string(body))
}{
"accessToken": "<access-token>",
"tokenType": "Bearer",
"expiresIn": 604800,
"userId": "b2c3d4e5-f6a7-5b6c-9d0e-1f2a3b4c5d6e"
}{
"message": "The request body is invalid.",
"code": "bad_request",
"details": [
{
"message": "Email format is invalid.",
"code": "invalid_email",
"property": "contact.email"
}
],
"hint": "Check the request payload and correct the highlighted fields."
}{
"message": "Authentication is required to access this resource.",
"code": "unauthorized",
"hint": "Provide a valid API key in the X-Api-Key header."
}{
"message": "Too many requests. Please slow down.",
"code": "too_many_requests",
"hint": "Retry after the number of seconds indicated in the Retry-After header."
}{
"message": "An unexpected error occurred on the server.",
"code": "internal_server_error",
"hint": "Retry the request later. If the problem persists, contact support."
}