Error format
All error responses return a JSON body with anerror field. Some include
a machine-readable code for programmatic handling.
HTTP status codes
| Code | Meaning |
|---|---|
| 200 | Request succeeded |
| 201 | Resource created (e.g. message, lead) |
| 400 | Validation error — check the error field for details |
| 401 | Authentication failed — invalid or missing API key |
| 402 | Workspace is read-only (e.g. subscription past due) |
| 404 | Resource not found (e.g. lead, line, campaign) |
| 429 | Rate limit exceeded — wait and retry |
| 500 | Internal server error — retry or contact support |
Send Message errors (POST /api/messages)
These are the specific errors you may encounter when sending a message.
Pre-send checks like line limits, time windows, device gaps, and contact gaps
never return errors. The message is accepted with
201 and the status
field indicates the outcome (pending, scheduled, etc.).400 — Message and attachments both empty
400 — Message and attachments both empty
Neither Fix: Include at least one of: a non-empty
message nor attachmentUrls was provided (or both were empty).message string, or an attachmentUrls array with up to 2 URLs.400 — Invalid messageType
400 — Invalid messageType
The Fix: Use
messageType value is not one of the accepted values."imessage", "sms", or "email". Or omit it entirely to
default to "imessage".400 — No active lines in workspace
400 — No active lines in workspace
No Fix: Provision at least one line in your workspace, or pass
fromLineId was provided and the workspace has no active lines to
round-robin from.fromLineId
explicitly.400 — Missing recipient
400 — Missing recipient
No Fix: Provide at least one of
recipientPhone, recipientEmail, or leadId was provided, and the
resolved lead (if any) has no contact details.recipientPhone, recipientEmail, or a
leadId that has stored contact details.400 — Fallback not configured
400 — Fallback not configured
sendFallbackSmsOnFailed was set to true but the workspace doesn’t have
Twilio fallback configured.PATCH /api/workspace/fallback-config, or set sendFallbackSmsOnFailed
to false.401 — Unauthorized
401 — Unauthorized
402 — READ_ONLY (subscription past due)
402 — READ_ONLY (subscription past due)
The workspace subscription is past due and write operations are blocked.Fix: Update your billing in the Tuco dashboard.
404 — Lead not found
404 — Lead not found
A Fix: Verify the
leadId was provided but no matching lead exists in the workspace.leadId exists and belongs to the same workspace as
the API key.Status vs error — key distinction
| You received | What it means | Action |
|---|---|---|
201 + "pending" | Message accepted, sending soon | No action needed |
201 + "scheduled" | Message accepted, will send at scheduled time | No action needed |
201 + "sent" | Message sent immediately | No action needed |
201 + "fallback" | Recipient has no iMessage, fallback may fire | Optional: send via another channel |
400 | Validation error | Fix the request and retry |
401 | Auth error | Check API key |
402 | Billing issue | Update payment |
404 | Resource not found | Check IDs |
Rate limits
Tuco applies per-workspace rate limits to protect the platform. When you hit a limit:- You receive a
429response. - The
Retry-Afterheader (when present) tells you how long to wait. - No data is modified.