Skip to content
DashboardRequest access

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

StatuserrorMeaning
400reserved_recipient_domainA recipient is on a reserved domain
400mixed_sandbox_recipientsOne send mixes sandbox and real recipients
403domain_not_verifiedThe sender domain isn't verified yet
403sending_restrictedSending is restricted for this account
403organization_suspendedThe organization is suspended
413attachment_too_largeAn attachment exceeds the size limit
429quota_exceededMonthly quota used up; Retry-After is set
429daily_limit_exceededDaily tier limit reached; Retry-After is set
422idempotency_key_reuseThe idempotency key was already used with a different request body
409idempotency_conflictA request with this idempotency key is still running; Retry-After
403plan_limitThe plan's member or domain limit is reached; see the code table
403sms_not_enabledSMS isn't enabled for this organization
403sms_from_number_admin_assignedSMS from-numbers are assigned by the platform
403sms_from_number_not_ownedThe SMS from-number doesn't belong to this organization
422sms_destination_not_allowedThe SMS destination isn't allowed
429daily_sms_limit_exceededDaily SMS limit reached
429sms_quota_exceededMonthly SMS segment quota reached; Retry-After is set
409project_has_dataThe project still has data; the body's counts says what
409domain_has_dataThe domain still has data; the body's counts says what
409domain_verified_elsewhereAnother 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.

StatuscodeMeaning
429recipient_cooldownThe recipient was emailed too recently; Retry-After is set
403EMAIL_NOT_VERIFIEDThe account email must be verified before sending
403ADMIN_REQUIREDThe operation needs the admin role
409LAST_ADMINThe change would leave the organization without an admin
409DUPLICATE_INVITATIONThat address already has a pending invitation
403MEMBER_LIMITThe plan's member limit is reached (error is plan_limit)
403DOMAIN_LIMITThe 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:

codeMeaning
domain_not_verifiedThe sender domain isn't verified yet
reserved_recipient_domainA recipient is on a reserved domain
mixed_sandbox_recipientsThe item mixes sandbox and real recipients
recipient_cooldownThe recipient was emailed too recently
attachment_too_largeAn attachment exceeds the size limit
invalid_sender_domainThe sender domain isn't allowed for this project
template_not_foundThe referenced template doesn't exist
missing_subjectThe item has no subject
attachment_type_blockedAn attachment's file type isn't allowed
invalid_attachmentAn attachment is invalid
daily_limit_reachedThe daily limit ran out before this item
send_failedAnything 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

Resourcelimit maxNotes
Emails200recipient up to 320 chars, subject up to 200
Contacts200search up to 200 chars
Lists200
SMS200cursor-paginated
Campaigns100default 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.