API Overview
The REST API backs both the SDK and the CLI. Most integrations should use the SDK Reference instead of calling routes directly — this page covers the pieces every request shares.
Base URL
The hosted API is at https://develemail.com/api. Self-hosted instances
listen on http://localhost:3001 in development; use the URL of your deployed
API in production.
Authentication
Send your API key as a bearer token on every request:
Authorization: Bearer <your-api-key>Create a key with devel key create --project <id> --name <name> (see
the CLI Reference) or from a project's page in the dashboard.
Requests without a valid Authorization header return
401 Unauthorized.
Errors
Failed requests return a JSON body shaped like:
{
"statusCode": 401,
"error": "Unauthorized",
"message": "Missing or invalid Authorization header"
}Generic failures (validation, authentication, not found) put the HTTP
reason phrase in error, such as Unauthorized or Not Found, and the
detail in message. Failures your code may want to branch on carry a
machine-readable value in one of two fields.
Codes in the error field
| Status | error | Meaning |
|---|---|---|
| 400 | reserved_recipient_domain | A recipient is on a reserved domain |
| 400 | mixed_sandbox_recipients | One send mixes sandbox and real recipients |
| 403 | domain_not_verified | The sender domain isn't verified yet |
| 403 | sending_restricted | Sending is restricted for this account |
| 403 | organization_suspended | The organization is suspended |
| 413 | attachment_too_large | An attachment exceeds the size limit |
| 429 | quota_exceeded | Monthly quota used up; Retry-After is set |
| 429 | daily_limit_exceeded | Daily tier limit reached; Retry-After is set |
| 422 | idempotency_key_reuse | The idempotency key was already used with a different request body |
| 409 | idempotency_conflict | A request with this idempotency key is still running; Retry-After |
| 403 | plan_limit | The plan's member or domain limit is reached; see the code table |
| 403 | sms_not_enabled | SMS isn't enabled for this organization |
| 403 | sms_from_number_admin_assigned | SMS from-numbers are assigned by the platform |
| 403 | sms_from_number_not_owned | The SMS from-number doesn't belong to this organization |
| 422 | sms_destination_not_allowed | The SMS destination isn't allowed |
| 429 | daily_sms_limit_exceeded | Daily SMS limit reached |
| 429 | sms_quota_exceeded | Monthly SMS segment quota reached; Retry-After is set |
| 409 | project_has_data | The project still has data; the body's counts says what |
| 409 | domain_has_data | The domain still has data; the body's counts says what |
| 409 | domain_verified_elsewhere | Another organization has already verified this domain name |
When billing is enabled on the instance, a quota_exceeded response also
includes upgrade_url, a link to the dashboard billing page where an org
admin can pick a larger plan.
Codes in the code field
These responses keep the HTTP reason phrase in error and put the
machine-readable value in code.
| Status | code | Meaning |
|---|---|---|
| 429 | recipient_cooldown | The recipient was emailed too recently; Retry-After is set |
| 403 | EMAIL_NOT_VERIFIED | The account email must be verified before sending |
| 403 | ADMIN_REQUIRED | The operation needs the admin role |
| 409 | LAST_ADMIN | The change would leave the organization without an admin |
| 409 | DUPLICATE_INVITATION | That address already has a pending invitation |
| 403 | MEMBER_LIMIT | The plan's member limit is reached (error is plan_limit) |
| 403 | DOMAIN_LIMIT | The plan's domain limit is reached (error is plan_limit) |
The SDK parses the body automatically and throws DevelEmailError with
status, message, and code (from the error field). A value from the
code field above is not in err.code; read it from err.details.code.
See the "Error handling" section of the SDK Reference.
Batch item codes
POST /v1/emails/batch answers 207 when any item failed (201 otherwise) and reports each failed item as
{ index, error, code }. code is one of:
code | Meaning |
|---|---|
domain_not_verified | The sender domain isn't verified yet |
reserved_recipient_domain | A recipient is on a reserved domain |
mixed_sandbox_recipients | The item mixes sandbox and real recipients |
recipient_cooldown | The recipient was emailed too recently |
attachment_too_large | An attachment exceeds the size limit |
invalid_sender_domain | The sender domain isn't allowed for this project |
template_not_found | The referenced template doesn't exist |
missing_subject | The item has no subject |
attachment_type_blocked | An attachment's file type isn't allowed |
invalid_attachment | An attachment is invalid |
daily_limit_reached | The daily limit ran out before this item |
send_failed | Anything else |
SMS batch items use their own codes, listed in the SMS reference.
Retries
The API returns 429 when you're rate-limited and 5xx for transient
failures. Both are safe to retry; the SDK does this automatically with
exponential backoff, respecting Retry-After when present.
Idempotency
POST /v1/emails, POST /v1/emails/batch, POST /v1/sms and
POST /v1/sms/batch accept an Idempotency-Key header. Retrying the same
key returns the original result instead of sending a duplicate. The SDK
generates one for you unless you pass options.idempotencyKey explicitly.
Email and SMS keys live in separate namespaces, so the same key on
/v1/emails and /v1/sms doesn't collide.
List queries
| Resource | limit max | Notes |
|---|---|---|
| Emails | 200 | recipient up to 320 chars, subject up to 200 |
| Contacts | 200 | search up to 200 chars |
| Lists | 200 | |
| SMS | 200 | cursor-paginated |
| Campaigns | 100 | default 50 |
A limit above the cap, or an email status filter that isn't one of the
email statuses, returns 400.
In search strings, % and _ match literally rather than as wildcards.