Errors & Codes
Postject uses standard HTTP status codes and returns structured JSON error responses for all error conditions.
Error Response Format
All error responses follow a consistent JSON structure with the HTTP status code, a human-readable message, and the error type.
{
"statusCode": 400,
"message": "Validation failed: email must be a valid email address",
"error": "Bad Request"
}HTTP Status Codes
| Code | Status | Description |
|---|---|---|
| 200 | OK | Request succeeded |
| 201 | Created | Resource created successfully (new message, server, template, etc.) |
| 400 | Bad Request | Invalid parameters or missing required fields |
| 401 | Unauthorized | Missing or invalid authentication token |
| 403 | Forbidden | Insufficient permissions or plan limit reached |
| 404 | Not Found | The requested resource does not exist |
| 409 | Conflict | Duplicate resource (e.g., domain already registered) |
| 500 | Internal Server Error | An unexpected error occurred on the server |
Common Error Scenarios
Missing Authorization header
Returns 401. Include Authorization: Bearer your_token in all authenticated requests.
Invalid server token
Returns 401. Verify your server token starts with pt_live_ and is copied correctly from the dashboard.
Server limit exceeded for plan
Returns 403. Upgrade your plan to create more servers. See Rate Limits & Quotas.
Template not found
Returns 404. Verify the template ID exists and belongs to the same server as the sending token.
Sending to a suppressed recipient
Returns 201 with status rejected. This is not an error — the message is created but not sent to protect your reputation.
Domain already registered
Returns 409. Each domain or email identity can only be registered once per account.
Missing required fields
Returns 400. The error message will specify which fields are missing or invalid.