Skip to main content

Base URL

https://relay.bayse.markets
Our sandbox environment is currently a work in progress. For now, please use the production URL and sign in with your production credentials.

Authentication

Authentication requirements vary by endpoint. See the Authentication guide for full details.

Public

No authentication required.

Session

Requires x-auth-token + x-device-id (from login).

Read

Requires X-Public-Key header.

Write

Requires X-Public-Key + X-Timestamp + X-Signature.

Error responses

All errors return a consistent JSON body:
{
  "error": "error_code",
  "message": "Human-readable description",
  "statusCode": 400
}
Common status codes:
CodeMeaning
400Bad request — invalid parameters.
401Unauthorized — missing or invalid credentials.
404Not found — resource does not exist.
422Unprocessable entity — validation failed.
500Internal server error.

Pagination

List endpoints use page and size query parameters:
GET /v1/pm/events?page=1&size=20
Paginated responses include a pagination object:
{
  "pagination": {
    "page": 1,
    "size": 20,
    "lastPage": 5,
    "totalCount": 98
  }
}

Request tracing

You can provide a custom trace ID for debugging:
curl -H "x-trace-id: my-trace-123" https://relay.bayse.markets/v1/pm/events
The trace ID is echoed back in response headers.

Endpoints

System

Health check

GET /health

Version

GET /version

User

Login

POST /v1/user/login

Create API key

POST /v1/user/me/api-keys

List API keys

GET /v1/user/me/api-keys

Revoke API key

DELETE /v1/user/me/api-keys/{keyId}

Rotate API key

POST /v1/user/me/api-keys/{keyId}/rotate

Trading

List events

GET /v1/pm/events

Get event

GET /v1/pm/events/{eventId}

Get quote

POST /v1/pm/events/{eventId}/markets/{marketId}/quote

Place order

POST /v1/pm/events/{eventId}/markets/{marketId}/orders

Get portfolio

GET /v1/pm/portfolio

List orders

GET /v1/pm/orders

Get order

GET /v1/pm/orders/{orderId}

Cancel order

DELETE /v1/pm/orders/{orderId}

Mint shares

POST /v1/pm/markets/{marketId}/mint

Burn shares

POST /v1/pm/markets/{marketId}/burn

Activities

GET /v1/pm/activities

Wallet

Get assets

GET /v1/wallet/assets

Market data

Price history

GET /v1/pm/events/{eventId}/price-history

Order book

GET /v1/pm/books

Ticker

GET /v1/pm/markets/{marketId}/ticker

Trades

GET /v1/pm/trades