Errors

HTTP status codes and error response handling

Common status codes

StatusMeaning
400Validation error (malformed body, invalid query, or business rule on request body)
401Missing or invalid Bearer JWT
403Authenticated but not permitted (upstream)
404Resource not found
409Conflict (upstream)
422Semantic validation (upstream)
5xxServer 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 .../contract with both term and plan — Cannot update both term and plan at the same time
  • PATCH .../contract with neither term nor plan — No contract updates provided
  • POST /customers without adminUser.email on 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 message field from the upstream response.

Always log the HTTP status, response body, and your correlation ID for support requests.

Authentication errors

SituationStatus
No Authorization header401
Non-Bearer scheme401
Expired or invalid JWT401

Refresh the JWT via POST /auth before retrying.

Client retry guidance

StatusRetry?
400No — fix the request
401Yes — after refreshing JWT
409Wait, then retry the same Idempotency-Key. A create with that key is already in progress
422No — this Idempotency-Key was already used with a different body
429 / 503Yes — with exponential backoff. Reuse Idempotency-Key when you sent one
5xxYes — 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)

Did this page help you?