Base URL
All API requests are made to:API Versioning
The API is versioned through the URL path. The current version isv1. 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 theAuthorization header:
API Key
Used for server-to-server integrations. Include the key in theX-API-Key header:
Request Format
All request bodies must be JSON with theContent-Type: application/json header.
Response Format
All responses return JSON. Successful responses vary by endpoint. Error responses follow a consistent structure:Status Codes
| Code | Meaning |
|---|---|
200 | Success |
201 | Resource created |
400 | Bad request — invalid parameters or body |
401 | Unauthorized — missing or invalid authentication |
403 | Forbidden — insufficient permissions |
404 | Not found — resource does not exist |
409 | Conflict — resource already exists |
429 | Too many requests — rate limit exceeded |
500 | Internal server error |
Rate Limiting
Authentication endpoints are limited to 20 requests per minute per IP address. When exceeded, the API returns a429 status code. Rate limit headers are included in every response:
| Header | Description |
|---|---|
X-RateLimit-Limit | Maximum requests per window |
X-RateLimit-Remaining | Remaining requests in current window |
X-RateLimit-Reset | Unix timestamp when the window resets |
Pagination
List endpoints return paginated results: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

