API Overview
Base URLs
The Primebrick API is served by the central backend. In development:
Code
In production, the base URL is configurable — typically a custom domain or API gateway. All environments expose the API under the same path prefix.
API versioning
All endpoints are served under /api/v1/:
Code
The version prefix allows breaking changes to be introduced in future major versions (/api/v2/) without disrupting existing clients.
OpenAPI specification
Primebrick is OpenAPI-first. The backend exposes an aggregated OpenAPI document that merges:
- The backend's own endpoints (auth, RBAC, registry, etc.)
- All currently online microservice endpoints (prefixed with
/ws/:serviceCode)
Aggregated spec endpoint
Code
This endpoint is public — no authentication required. It is mounted before the auth guard so that the API Explorer and any external tooling can fetch the spec without credentials.
If some microservices are offline, the aggregated spec simply omits them. The spec always reflects the services that are currently registered and healthy.
Using the spec
You can import the aggregated spec into any OpenAPI-compatible tool:
Code
API Explorer
Primebrick includes an interactive API Explorer powered by Zudoku. It lets you:
- Browse all endpoints from the aggregated spec
- Configure the backend host (localhost, staging, production)
- Authenticate with bearer tokens, API keys, or OAuth2 client credentials
- Send live requests and inspect responses
The explorer fetches the spec client-side, so it always reflects the backend you point it at.
Error format
All errors follow RFC 7807 Problem Details for HTTP APIs. Every error response has a consistent JSON structure:
Code
See Error Handling for the full specification and common error codes.
Next steps
- Authentication — how to get tokens and call the API.
- RBAC — the permission system.
- Error Handling — the error response format.
- API Explorer — try the API live.