Skip to main content

Authentication

All API requests are authenticated using an API Key provided in the X-Api-Key HTTP header.

API Key Authentication

Include your API key in every request:

curl -H "X-Api-Key: your-api-key" https://polymarket.sandbox.playbatman.com/api/v1/markets

The API key is tied to your operator account. All resources created with this key are scoped to your operator.

Authenticated Routes

PrefixOperations
/api/v1/marketsCreate, update, open, close, resolve, settle markets
/api/v1/categoriesCreate and list categories
/api/v1/ordersPlace, cancel, list orders
/api/v1/positionsQuery positions
/api/v1/tradesQuery trades
/api/v1/settlementsQuery settlements
/api/v1/statsOperator statistics
/wsWebSocket connection (via header or ?apiKey= query param)
caution

Keep your API key secure. If compromised, contact a platform administrator to regenerate it. Regenerating immediately invalidates the previous key.

Public Routes

These routes require no authentication:

MethodPathDescription
GET/healthHealth check
GET/readyReadiness check
GET/api/v1/categories/{id}Get category by ID
GET/api/v1/markets/{id}/orderbook/{outcomeId}Order book
GET/api/v1/markets/{id}/pricesMarket prices
GET/api/v1/markets/{id}/prices/{outcomeId}Outcome price

Error Responses

If the API key is missing or invalid, you receive a 401 Unauthorized response:

{
"success": false,
"error": {
"code": "UNAUTHORIZED",
"message": "Missing or invalid API key"
}
}

If the operator account has been deactivated, requests are also rejected with 401.