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 planCannot update both term and plan at the same time
  • PATCH .../contract with neither term nor planNo 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
429 / 503Yes — with exponential backoff
5xxLimited 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)


Did this page help you?