PlayableLabs Docs
Developers

API Overview

REST API basics, base URL, request format, rate limiting, pagination, and error codes for PlayableLabs

Base URL

All API requests use the following base URL:

https://api.playablelabs.studio/api

Request Format

The API accepts and returns JSON. Include these headers in every request:

Content-Type: application/json
Authorization: Bearer YOUR_TOKEN

Authentication

Every request must include a valid token. PlayableLabs supports two authentication methods:

  • JWT session tokens -- Obtained via the web app login flow (NextAuth v5)
  • API tokens -- Created in Developers > Tokens for programmatic access

See the Authentication guide for details.

Rate Limiting

The API enforces rate limits to ensure fair usage:

TierLimitWindowStrategy
Standard100 requests1 minuteFixed window
Sensitive endpoints20 requests1 minuteSliding window
Export10 requests5 minutesFixed window

When rate-limited, the API returns 429 Too Many Requests with these headers:

X-RateLimit-Limit: 100
X-RateLimit-Remaining: 0
X-RateLimit-Reset: 1700000000
Retry-After: 30

Pagination

List endpoints return paginated results. Use query parameters to control pagination:

curl -H "Authorization: Bearer YOUR_TOKEN" \
  "https://api.playablelabs.studio/api/games?page=1&limit=20&sort=createdAt&order=desc"
ParameterTypeDefaultDescription
pagenumber1Page number (1-based)
limitnumber20Items per page (max 100)
sortstringcreatedAtField to sort by
orderstringdescSort direction: asc or desc

Paginated responses include metadata:

{
  "data": [...],
  "meta": {
    "page": 1,
    "limit": 20,
    "total": 54,
    "totalPages": 3
  }
}

Multi-Tenant Scoping

All data is scoped by organization. Pass the organizationId as a query parameter or in the request body where required. You can only access data belonging to organizations you are a member of.

Error Codes

The API uses standard HTTP status codes and returns structured error responses:

{
  "statusCode": 400,
  "error": "VALIDATION_ERROR",
  "message": "Name is required"
}
StatusError CodeDescription
400VALIDATION_ERRORInvalid request body or parameters
401AUTHENTICATION_REQUIREDMissing or invalid token
403INSUFFICIENT_PERMISSIONSToken lacks required scope
404RESOURCE_NOT_FOUNDRequested resource does not exist
409DUPLICATE_RESOURCEResource already exists
429RATE_LIMIT_EXCEEDEDToo many requests
500INTERNAL_SERVER_ERRORUnexpected server error

Key Endpoints

MethodEndpointDescription
GET/api/gamesList games
POST/api/gamesCreate a game
GET/api/assetsList assets
POST/api/storage/urlsGet upload URLs
POST/api/exportTrigger an export
GET/api/tokensList API tokens

Next Steps

On this page