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 |
409 | Wait, then retry the same Idempotency-Key. A create with that key is already in progress |
422 | No — this Idempotency-Key was already used with a different body |
429 / 503 | Yes — with exponential backoff. Reuse Idempotency-Key when you sent one |
5xx | Yes — with backoff. On POST /customers, reuse the same Idempotency-Key |
POST /customers accepts an optional Idempotency-Key header. A retry with the same key and body returns the original jobID for 72 hours and does not create a second customer. See Onboarding a customer.
A slow 5xx can still mean the signup was accepted and the response never arrived. Look for a job or customer before treating that retry as a brand new create. Poll GET /jobs/{jobID} once you have a job ID, instead of sending another create.
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 21 days ago
