Skip to main content

Base URL

All API requests are made to:
For local development:

API Versioning

The API is versioned through the URL path. The current version is v1. All endpoints are prefixed with /api/v1.

Authentication

BunShip supports two authentication methods:

Bearer Token (JWT)

Used for user-facing requests. Obtain a token pair by calling the login endpoint, then include the access token in the Authorization header:
Access tokens expire after 15 minutes. Use the refresh endpoint to obtain a new token pair before expiry.

API Key

Used for server-to-server integrations. Include the key in the X-API-Key header:
API keys are scoped to an organization and can have granular permission scopes. See API Key Management for details.

Request Format

All request bodies must be JSON with the Content-Type: application/json header.

Response Format

All responses return JSON. Successful responses vary by endpoint. Error responses follow a consistent structure:

Status Codes

Rate Limiting

Authentication endpoints are limited to 20 requests per minute per IP address. When exceeded, the API returns a 429 status code. Rate limit headers are included in every response: API key requests can have per-key rate limits configured at creation time.

Pagination

List endpoints return paginated results:
Use page and pageSize query parameters to navigate results. The default page size is 20, and the maximum is 100.

OpenAPI / Swagger

Auto-generated interactive documentation is available at:
  • Production: https://api.bunship.com/docs
  • Local: http://localhost:3000/docs