Skip to content

Sign in with email and password

POST
/auth/token
curl --request POST \
--url https://api.tradeops.cc/v1/auth/token \
--header 'Content-Type: application/json' \
--data '{ "email": "hello@example.com", "password": "example", "device_name": "example", "code": "example", "recovery_code": "example" }'

Returns a bearer token for the field app. Members who use two-factor sign-in must also send code or recovery_code; without one the response is a 422 with an error on code.

Media typeapplication/json
IssuePasswordTokenRequest
object
email
required
string format: email
password
required
string
device_name
required

A name for this device, shown to the member when they review their signed-in devices. Signing in again from a device with the same name replaces its old token.

string
<= 255 characters
code

Six-digit code from the member’s authenticator app. Required when they use two-factor sign-in, unless recovery_code is sent.

string | null
recovery_code

One of the member’s two-factor recovery codes. Each code works once.

string | null

Example generated

{
"email": "hello@example.com",
"password": "example",
"device_name": "example",
"code": "example",
"recovery_code": "example"
}
Media typeapplication/json
object
token
required

The bearer token. Send it as Authorization: Bearer {token}. It doesn’t expire; revoke it by signing out.

string
token_type
required
string
Allowed value: Bearer

Example

{
"token_type": "Bearer"
}

Validation error

Media typeapplication/json
object
message
required

Errors overview.

string
errors
required

A detailed description of each field that failed validation.

object
key
additional properties
Array<string>

Example generated

{
"message": "example",
"errors": {
"additionalProperty": [
"example"
]
}
}

Too many requests. Wait for Retry-After seconds before trying again.

Media typeapplication/json
object
message
required
string

Example generated

{
"message": "example"
}
Retry-After
integer

Seconds until you can try again.