Skip to main content
The ColdSend API uses standard HTTP status codes and returns structured error responses.
Always check the HTTP status code first, then parse the detail field for specific error information.

HTTP Status Codes

Error Response Format

All errors return a detail field: Simple error:
Validation error:
Multiple fields:
The detail field contains either a simple string or an array of validation failures with loc (field path), msg (human-readable), and type (error category).

Authentication Errors

Missing API Key

Status: 401 Unauthorized
Fix: Include X-API-Key: cs_live_your_key in every request.

Invalid or Revoked Key

Status: 401 Unauthorized
Fix: Generate a new API key in the dashboard. Revoked keys cannot be restored.

Insufficient Permissions

Status: 403 Forbidden
Fix: Create a new API key with the required scopes. See API Key Scopes.

Validation Errors

Field Required

Status: 422 Unprocessable Entity (via FastAPI) or 400 Bad Request

Value Constraint Violated

Common constraints:
  • Campaign name: 8-255 characters
  • Daily limit per inbox: 1-100
  • Variant distribution: must sum to 100%

Invalid Format

Campaign Errors

Campaign Not Found

Status: 404 Not Found
Check:
  • Campaign ID is a valid UUID
  • Campaign belongs to your team
  • Campaign hasn’t been deleted

Campaign Not Modifiable

Status: 400 Bad Request
Fix: Pause the campaign first via POST /api/public/v1/campaigns/{id}/pause, then make updates.

Missing Launch Requirements

When you set launch: true, the API validates and may return:
Fix the missing items and retry. See Campaigns Overview.

Variant Distribution Mismatch

All distribution_percent values must sum to exactly 100.

Sender Account Errors

Inbox Already Exists

Status: 409 Conflict
Fix: Use a different email address, or delete the existing inbox first.

Connection Failed

Status: 400 Bad Request
Fix:
  • Verify SMTP/IMAP hostnames and ports match your provider’s config
  • Check credentials — use app-specific passwords, not main passwords
  • See Provider Configuration for recommended settings

Inbox In Use

Status: 400 Bad Request
Fix: Remove the inbox from all campaigns it’s assigned to, then retry deletion.

Rate Limit Error

Status: 429 Too Many Requests
Fix: Implement exponential backoff. See Rate Limits.

Best Practices

  1. Check status codes — Differentiate 4xx (client errors, fix the request) from 5xx (server errors, retry with backoff).
  2. Implement retry logic — Retry on 429 and 5xx with exponential backoff. Don’t retry 4xx errors (except 409/422 with fixes).
  3. Log errors — Include timestamps, request IDs, and context in your logs.
  4. Display user-friendly messages — Convert technical errors into actionable guidance.
  5. Use separate keys per integration — Makes debugging scope issues easier.

Next Steps

Authentication

API keys and security.

Rate Limits

Learn about rate limiting and retry strategies.