Skip to main content

Error Handling

The Cover Whale API uses standard HTTP status codes and returns structured error responses to help you diagnose and resolve issues.

HTTP Status Codes

Error Response Formats

Validation Errors (422)

Returned when field-level validation fails. The errors object maps field names to arrays of error messages:

Business Rule Errors (400 / 404)

Returned when a request is structurally valid but violates a business rule:

Cancellation Notice Holds (422)

Cancellation request or approval can return 422 when enabled notice rules cannot safely finalize the dates. Distinguish this from field validation using reason_code: cancellation_notice_manual_review:
The decision may contain further rule, date-change, and measurement fields. Resolve the hold with Cover Whale before retrying; the API does not shorten the notice minimum to fit expiration. A held proposal in advisory metadata on a successful response is different from this 422 refusal. See cancellation dates and rollout.

Saved Cancellation Approval Needs Notice Review (500 / 409)

A notice-continuation failure differs from a precommit notice-date hold. cancel-approve returns 500 when an intent-backed approval is already saved but its notice handoff needs review or safe recovery. cancel returns 409 when that saved approval’s notice readiness blocks finalization. Inspect approval_saved and the continuation receipt:
There is no status: success in this refusal. Keep the receipt and reconcile with Cover Whale; do not blindly repeat cancel-approve or an uncertain filing or queue publication. A generic error-only 500 does not establish that approval was saved. Required physical-print chain handoff must also be confirmed before finalization; PDF readiness alone is insufficient. Queue handoff, filing acceptance, and provider delivery remain separate facts; readiness does not promise exactly-once delivery.

Authentication Errors (400 / 401)

Returned when credentials are invalid or a token has expired:

Common Issues and Solutions

”Incorrect username or password”

Cause: Invalid credentials or account not yet provisioned. Fix: Verify your username (email) and password. If you haven’t received credentials, contact api-support@coverwhale.com.

Token expired (401 on API calls)

Cause: The AccessToken expires after 3600 seconds (1 hour). Fix: Use the refresh token to obtain a new access token:

“The given data was invalid” (422)

Cause: One or more fields failed validation. Fix: Check the errors object in the response. Each key is the field path (e.g., insuredInformation.legalName) and the values describe what’s wrong.

Submission not found (404)

Cause: The displayId doesn’t exist, or you don’t have access to this submission. Fix: Verify the display ID. Submissions are scoped to your agency — you can only access submissions created by your account.

Submission not in required status (404)

Cause: You’re trying to perform an operation that requires a specific status. For example, binding requires Quoted status. Fix: Check the current submission status with GET /submission/{displayId} and ensure it matches the required status for your operation. See the submission lifecycle for status flow.

Best Practices

  • Always check the status code first — branch your error handling on the HTTP status before parsing the body
  • Log the full response — include headers and body for debugging
  • Handle 401 proactively — refresh your token before it expires rather than waiting for a failure
  • Implement retry with backoff for 429 responses — start with 1 second and double on each retry
  • Validate locally first — check required fields before sending requests to reduce round trips