Skip to main content
POST
/
v1
/
user
/
login
Login
curl --request POST \
  --url https://relay.bayse.markets/v1/user/login \
  --header 'Content-Type: application/json' \
  --data '
{
  "email": "<string>",
  "password": "<string>"
}
'
{
  "token": "eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9...",
  "deviceId": "d_abc123",
  "userId": "usr_456def"
}

Overview

Log in with your Bayse account credentials to obtain a session token and device ID. These are required to manage API keys (create, list, revoke, rotate).
This endpoint is rate-limited to 1 request per 2 minutes per email address. See Rate limits for details.

Request body

email
string
required
Your Bayse account email address.
password
string
required
Your Bayse account password (max 128 characters).

Example request

curl -X POST https://relay.bayse.markets/v1/user/login \
  -H "Content-Type: application/json" \
  -d '{
    "email": "you@example.com",
    "password": "your-password"
  }'

Response

token
string
Session token. Pass this as the x-auth-token header when managing API keys.
deviceId
string
Device identifier. Pass this as the x-device-id header when managing API keys.
userId
string
Your Bayse user ID.
{
  "token": "eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9...",
  "deviceId": "d_abc123",
  "userId": "usr_456def"
}

Errors

StatusDescription
400Invalid request body (missing or malformed email/password).
401Invalid credentials.
429Rate limited. Retry after the number of seconds in retryAfter.
429 Too Many Requests
{
  "message": "Too many login attempts. Please try again later.",
  "retryAfter": 120
}

Next steps

Use the token and deviceId from the response to create an API key:
curl -X POST https://relay.bayse.markets/v1/user/me/api-keys \
  -H "x-auth-token: YOUR_TOKEN" \
  -H "x-device-id: YOUR_DEVICE_ID" \
  -H "Content-Type: application/json" \
  -d '{"name": "My API Key"}'