Errors
HTTP status codes and error response handling
Common status codes
| Status | Meaning |
|---|---|
400 | Validation error (malformed body, invalid query, or business rule on request body) |
401 | Missing or invalid Bearer JWT |
403 | Authenticated but not permitted (upstream) |
404 | Resource not found |
409 | Conflict (upstream) |
422 | Semantic validation (upstream) |
5xx | Server or upstream failure |
Validation errors (400)
Request bodies and query parameters are validated before your request reaches backend provisioning logic.
Examples that return 400:
- Invalid UUID format for
customerID - Invalid email or enum values
PATCH .../contractwith bothtermandplan—Cannot update both term and plan at the same timePATCH .../contractwith neithertermnorplan—No contract updates providedPOST /customerswithoutadminUser.emailon non–hardware-only plans
Validation responses follow NestJS / Zod validation format (typically an array of messages in the response body).
Upstream errors
When the API calls internal PhoneLine+ or billing services, failures are mapped where possible:
- HTTP status from the upstream service is often passed through.
- Message body may include a
messagefield from the upstream response.
Always log the HTTP status, response body, and your correlation ID for support requests.
Authentication errors
| Situation | Status |
|---|---|
No Authorization header | 401 |
| Non-Bearer scheme | 401 |
| Expired or invalid JWT | 401 |
Refresh the JWT via POST /auth before retrying.
Client retry guidance
| Status | Retry? |
|---|---|
400 | No — fix the request |
401 | Yes — after refreshing JWT |
429 / 503 | Yes — with exponential backoff |
5xx | Limited retry with backoff |
For async operations, prefer polling GET /jobs/{jobID} rather than repeating POST /customers without idempotency.
Support
Include in tickets:
- Timestamp (UTC)
- Request ID / correlation ID from your logs
- HTTP method and path (no secrets)
- Response status and body (redact tokens)
Updated 3 months ago
Did this page help you?
