API Reference7 min read•Audience: Developers
REST API Reference
Exhaustive documentation for all PostBrix v1 endpoints: render, projects, templates, and health check.
Key Takeaways
- Base URL: https://api.postbrix.com/api/v1
- All endpoints require Bearer API key authentication.
- Standard JSON error schemas with actionable root causes.
- Headers include rate limit status and Redis cache indicators.
Core Endpoints#
POST /api/v1/templates/:id/render#
Request Headers:
Authorization:Bearer pb_live_...Content-Type:application/json
Request Body:
code
json
Response (200 OK):
code
json
HTTP Status Codes#
- 200 OK: Request succeeded and HTML was generated.
- 400 Bad Request: Malformed JSON body or invalid variable types.
- 401 Unauthorized: Missing, expired, or invalid API key.
- 404 Not Found: Specified template ID does not exist or was deleted.
- 429 Too Many Requests: Rate limit exceeded (check
Retry-Afterheader). - 500 Internal Error: MJML compilation timeout or internal server exception.
Frequently Asked Questions
Does the render API return raw MJML if requested?
Yes. Set "format": "mjml" in the request body to receive the dynamic Handlebars-infused MJML markup instead of compiled HTML.
Are API responses gzipped?
Yes. The API automatically returns gzip-compressed responses if your client sends the Accept-Encoding: gzip header.