Ranla Emails API
The Emails API from Ranla — 5 operation(s) for emails.
The Emails API from Ranla — 5 operation(s) for emails.
Every API here is available over the APIs.io API and to AI agents over MCP.
One button, every client — Claude, Cursor, VS Code and the rest.
https://apis.io/mcp
find_apisBrowse and filter every API in the catalog.get_api_artifactsOne API's artifacts, grouped by type.get_openapiThe primary OpenAPI for this API.find_similar_apisAPIs that look like this one.apis_io_searchSTART HERE — APIs, providers and tags for one query, each with its total.resolveTurn a domain, URL or GitHub org into the provider it belongs to.find_cohortsEvery scored population of providers in the catalog.curl "https://apis.io/api/v1/apis/ranla-ai:ranla-ai-emails-api"
curl "https://apis.io/api/v1/apis?limit=25"
Calls without X-API-Key need no key. Calls with it need a paid plan — get a key.
Free tier, no form to fill in. Signing in shares your email address with us — we store it to create your key and to recognise you if you sign in with another provider. By signing up you are subscribing to the APIs.io and API Evangelist newsletters — you can unsubscribe from any issue. See our Privacy Policy and Terms.
A second provider on the same verified email joins the account you already have.
openapi: 3.2.0
info:
title: Ranla Emails API
version: 0.12.0
description: 'Transactional email API for developers.
Auth: `Authorization: Bearer rnl_…` or `stx_…` (or dashboard session cookie for integrations).
Production base URL: https://api.ranla.ai'
servers:
- url: https://api.ranla.ai
description: Production
tags:
- name: Emails
paths:
/emails:
get:
operationId: listEmails
summary: List recent sent emails
tags:
- Emails
security:
- bearerAuth: []
parameters:
- name: limit
in: query
schema:
type: integer
minimum: 1
maximum: 100
default: 25
description: Maximum number of emails to return (1–100)
- name: cursor
in: query
schema:
type: string
description: Opaque cursor for the next page
responses:
'200':
description: Email list
content:
application/json:
schema:
$ref: '#/components/schemas/ListEmailsResponse'
'401':
description: Missing or invalid API key
content:
application/json:
schema:
$ref: '#/components/schemas/ErrorResponse'
post:
operationId: sendEmail
summary: Send a transactional email
tags:
- Emails
security:
- bearerAuth: []
parameters:
- name: Idempotency-Key
in: header
required: false
schema:
type: string
maxLength: 256
description: 'Optional idempotency key (max 256 chars). Retries with the same key
and identical body return the original response. Same key with a
different body, or a concurrent in-flight request, returns 409.
A 502 or 503 where the mail server did not take the message releases
the key, so a retry with it sends the email. A 504 keeps the key,
because the email may still be delivered.
'
requestBody:
required: true
content:
application/json:
schema:
$ref: '#/components/schemas/SendEmailRequest'
examples:
basic:
value:
from: you@yourdomain.com
to: user@example.com
subject: Hello from Ranla
html: <p>It works.</p>
responses:
'200':
description: Email accepted for delivery
headers:
ratelimit-limit:
description: Request quota for the current window
schema:
type: integer
ratelimit-remaining:
description: Remaining requests in the current window
schema:
type: integer
ratelimit-reset:
description: Unix timestamp when the current window resets
schema:
type: integer
content:
application/json:
schema:
$ref: '#/components/schemas/SendEmailResponse'
'400':
description: Invalid request
content:
application/json:
schema:
$ref: '#/components/schemas/ErrorResponse'
'401':
description: Missing or invalid API key
content:
application/json:
schema:
$ref: '#/components/schemas/ErrorResponse'
'403':
description: From domain not verified, sandbox/verified-domain sender used for non-account recipients, or send to other recipients without a paid plan
content:
application/json:
schema:
$ref: '#/components/schemas/ErrorResponse'
'404':
description: '`template.id` does not match a template id or alias on this account'
content:
application/json:
schema:
$ref: '#/components/schemas/ErrorResponse'
example:
error:
message: Template not found
code: not_found
'409':
description: Idempotency key conflict (payload mismatch or concurrent request)
content:
application/json:
schema:
$ref: '#/components/schemas/ErrorResponse'
example:
error:
message: Idempotency key was already used with a different request body.
code: idempotency_conflict
'422':
description: Recipient is suppressed or opted out of the email category, or the mail server refused the message (`upstream_error`)
content:
application/json:
schema:
$ref: '#/components/schemas/ErrorResponse'
examples:
category_unsubscribed:
summary: Category opt-out
value:
error:
message: One or more recipients opted out of this email category
code: validation_error
details:
category_unsubscribed:
- user@example.com
category: product
email_id: msg_…
suppressed:
summary: Global suppression
value:
error:
message: One or more recipients are suppressed
code: validation_error
details:
suppressed:
- user@example.com
email_id: msg_…
'429':
description: 'Send rate limit exceeded (`rate_limited` — too many sends this minute or hour; retry after `Retry-After` seconds), or Free plan send limit reached (`plan_limit` — daily or monthly; paid plans meter overage instead)
'
headers:
Retry-After:
description: Seconds until sending is allowed again. Present on `rate_limited` responses.
schema:
type: integer
ratelimit-limit:
description: Request quota for the current window. Present on `plan_limit` responses.
schema:
type: integer
ratelimit-remaining:
description: Remaining requests in the current window. Present on `plan_limit` responses.
schema:
type: integer
ratelimit-reset:
description: Unix timestamp when the current window resets. Present on `plan_limit` responses.
schema:
type: integer
content:
application/json:
schema:
$ref: '#/components/schemas/ErrorResponse'
examples:
rate_limited:
summary: Per-minute or per-hour send rate limit
value:
error:
message: Rate limit exceeded. Try again later.
code: rate_limited
plan_limit:
summary: Free plan send limit
value:
error:
message: Monthly send limit reached (3000/month on the free plan). Upgrade at /settings/billing.
code: plan_limit
upgrade_url: /settings/billing
'502':
description: Upstream mail server error
content:
application/json:
schema:
$ref: '#/components/schemas/ErrorResponse'
'503':
description: Mail delivery temporarily unavailable
content:
application/json:
schema:
$ref: '#/components/schemas/ErrorResponse'
'504':
description: The mail server could not confirm the send (timeout, dropped connection, or unreadable reply). The email may still be delivered.
content:
application/json:
schema:
$ref: '#/components/schemas/ErrorResponse'
/emails/batch:
post:
operationId: sendEmailBatch
summary: Send a batch of transactional emails
tags:
- Emails
security:
- bearerAuth: []
requestBody:
required: true
content:
application/json:
schema:
$ref: '#/components/schemas/BatchSendEmailRequest'
responses:
'200':
description: Index-aligned per-message results
content:
application/json:
schema:
$ref: '#/components/schemas/BatchSendEmailResponse'
'400':
description: Invalid batch wrapper
content:
application/json:
schema:
$ref: '#/components/schemas/ErrorResponse'
'401':
description: Missing or invalid API key
content:
application/json:
schema:
$ref: '#/components/schemas/ErrorResponse'
'503':
description: Mail server not configured
content:
application/json:
schema:
$ref: '#/components/schemas/ErrorResponse'
/emails/{id}:
get:
operationId: getEmail
summary: Retrieve a sent email
tags:
- Emails
security:
- bearerAuth: []
parameters:
- name: id
in: path
required: true
description: Public message ID (`msg_…`)
schema:
type: string
responses:
'200':
description: Email detail
content:
application/json:
schema:
type: object
required:
- email
properties:
email:
$ref: '#/components/schemas/EmailListItem'
'401':
description: Missing or invalid API key
content:
application/json:
schema:
$ref: '#/components/schemas/ErrorResponse'
'404':
description: Email not found
content:
application/json:
schema:
$ref: '#/components/schemas/ErrorResponse'
patch:
operationId: updateScheduledEmail
summary: Reschedule or cancel a scheduled email
tags:
- Emails
security:
- bearerAuth: []
parameters:
- name: id
in: path
required: true
description: Public message ID (`msg_…`)
schema:
type: string
requestBody:
required: true
content:
application/json:
schema:
$ref: '#/components/schemas/UpdateScheduledEmailRequest'
examples:
reschedule:
value:
scheduled_at: '2026-08-01T12:00:00.000Z'
cancel:
value:
cancel: true
responses:
'200':
description: Scheduled email updated
content:
application/json:
schema:
$ref: '#/components/schemas/SendEmailResponse'
'400':
description: Email is not scheduled, or request is invalid
content:
application/json:
schema:
$ref: '#/components/schemas/ErrorResponse'
'401':
description: Missing or invalid API key
content:
application/json:
schema:
$ref: '#/components/schemas/ErrorResponse'
'404':
description: Email not found
content:
application/json:
schema:
$ref: '#/components/schemas/ErrorResponse'
/emails/{id}/resend:
post:
operationId: resendEmail
summary: Resend a previously stored email
description: 'Creates a **new** send using the stored from/to/subject/body (and tags/headers)
from an existing message. Returns a new `msg_…` id. Attachment bytes are not
stored, so attachments are omitted on resend.'
tags:
- Emails
security:
- bearerAuth: []
parameters:
- name: id
in: path
required: true
description: Public message ID of the source email (`msg_…`)
schema:
type: string
responses:
'200':
description: New email accepted for delivery
content:
application/json:
schema:
$ref: '#/components/schemas/SendEmailResponse'
'400':
description: Source email has no stored body, or request is invalid
content:
application/json:
schema:
$ref: '#/components/schemas/ErrorResponse'
'401':
description: Missing or invalid credentials
content:
application/json:
schema:
$ref: '#/components/schemas/ErrorResponse'
'403':
description: From domain is not verified
content:
application/json:
schema:
$ref: '#/components/schemas/ErrorResponse'
'404':
description: Source email not found
content:
application/json:
schema:
$ref: '#/components/schemas/ErrorResponse'
'503':
description: Mail server not configured
content:
application/json:
schema:
$ref: '#/components/schemas/ErrorResponse'
/emails/test:
post:
operationId: testEmailWebhookEvent
summary: Simulate a webhook event (test sink for CI)
description: 'Builds the payload for an outbound email event and, by default, delivers it to your
webhook endpoints. `email.received` is inbound-only and cannot be simulated here.'
tags:
- Emails
security:
- bearerAuth: []
requestBody:
required: true
content:
application/json:
schema:
type: object
required:
- event
properties:
event:
$ref: '#/components/schemas/TestWebhookEventType'
email_id:
type: string
description: Optional existing email public id (`msg_…`). Without it, the payload describes a sample email.
webhook_id:
type: string
format: uuid
description: Optional webhook endpoint id (the `id` returned by `POST /webhooks`) for a single-endpoint test delivery
sync:
type: boolean
default: false
description: When true, deliver synchronously and return per-endpoint HTTP results (defaults to true when `webhook_id` is set)
deliver:
type: boolean
default: true
description: When true, deliver the payload to your webhook endpoints subscribed to the event (in the background unless `sync` is true)
responses:
'200':
description: Payload built (and optionally delivered)
content:
application/json:
schema:
type: object
required:
- ok
- payload
- delivered
- deliveries
properties:
ok:
type: boolean
payload:
$ref: '#/components/schemas/EmailWebhookEventPayload'
delivered:
type: boolean
deliveries:
type: array
items:
type: object
required:
- endpoint_id
- url
- success
properties:
endpoint_id:
type: string
url:
type: string
success:
type: boolean
status:
type: integer
error:
type: string
'400':
description: '`event` is missing or is not an outbound email event (`email.received` is not accepted)'
content:
application/json:
schema:
$ref: '#/components/schemas/ErrorResponse'
'401':
description: Missing or invalid API key
content:
application/json:
schema:
$ref: '#/components/schemas/ErrorResponse'
'404':
description: '`webhook_id` or `email_id` does not match a webhook endpoint or email on this account'
content:
application/json:
schema:
$ref: '#/components/schemas/ErrorResponse'
examples:
webhook_not_found:
summary: Unknown webhook_id
value:
error:
message: Webhook endpoint not found
code: not_found
email_not_found:
summary: Unknown email_id
value:
error:
message: Email not found
code: not_found
components:
schemas:
SendEmailResponse:
type: object
required:
- id
- status
properties:
id:
type: string
description: Public message ID (`msg_…`)
status:
type: string
example: sent
ErrorResponse:
type: object
required:
- error
properties:
error:
type: object
required:
- message
properties:
message:
type: string
code:
$ref: '#/components/schemas/ErrorCode'
upgrade_url:
type: string
description: Dashboard path to upgrade when code is plan_limit or domain_limit
details:
description: 'Optional structured details. For send blocks this may include `suppressed` (global suppression list) or `category_unsubscribed` plus `category` and `email_id` (category opt-out).
'
EmailTag:
type: object
required:
- name
- value
properties:
name:
type: string
value:
type: string
ReceivedEmailAttachmentMeta:
type: object
required:
- filename
- content_type
- size
properties:
filename:
type: string
content_type:
type: string
size:
type: integer
content_id:
type: string
nullable: true
TestWebhookEventType:
type: string
description: 'Outbound email events that `POST /emails/test` can simulate. `email.received` is
inbound-only, so it is not accepted there.
'
enum:
- email.sent
- email.delivered
- email.delivery_delayed
- email.bounced
- email.complained
- email.opened
- email.clicked
- email.failed
- email.suppressed
- email.scheduled
SendTemplateRef:
type: object
required:
- id
description: Reference a published template by UUID or alias. Mutually exclusive with html/text.
properties:
id:
type: string
description: Template UUID or alias
variables:
type: object
additionalProperties:
oneOf:
- type: string
- type: number
- type: boolean
description: Values for `{{variable}}` placeholders (HTML-escaped in html body)
ErrorCode:
type: string
description: Machine-readable error code
enum:
- validation_error
- unauthorized
- forbidden
- not_found
- conflict
- plan_limit
- domain_limit
- idempotency_conflict
- rate_limited
- upstream_error
- not_configured
- internal_error
EmailWebhookEventPayload:
type: object
required:
- type
- created_at
- data
properties:
type:
$ref: '#/components/schemas/EmailWebhookEventType'
created_at:
type: string
format: date-time
data:
type: object
required:
- email_id
- to
- from
- subject
- status
properties:
email_id:
type: string
to:
type: array
items:
type: string
format: email
from:
type: string
subject:
type: string
status:
type: string
bounce_reason:
type: string
nullable: true
rcpt_to:
type: string
format: email
cc:
type: array
items:
type: string
format: email
message_id:
type: string
nullable: true
in_reply_to:
type: string
nullable: true
references:
type: array
items:
type: string
spam_status:
type: string
nullable: true
attachment_count:
type: integer
attachments:
type: array
items:
$ref: '#/components/schemas/ReceivedEmailAttachmentMeta'
received_at:
type: string
format: date-time
BatchSendEmailRequest:
type: object
required:
- emails
properties:
emails:
type: array
maxItems: 100
items:
$ref: '#/components/schemas/SendEmailRequest'
description: Attachments are rejected for batch sends in v1.
EmailAttachment:
type: object
required:
- name
- content_type
- data
properties:
name:
type: string
description: Filename sent to the recipient.
filename:
type: string
description: Alias for name.
content_type:
type: string
example: application/pdf
contentType:
type: string
description: Alias for content_type.
data:
type: string
format: byte
description: Base64-encoded attachment content (10MB decoded max).
content:
type: string
format: byte
description: Alias for data (base64 string expected over HTTP).
content_id:
type: string
description: Optional Content-ID for inline attachments.
contentId:
type: string
description: Alias for content_id.
BatchSendEmailResponse:
type: object
required:
- data
properties:
data:
type: array
items:
type: object
required:
- index
properties:
index:
type: integer
id:
type: string
status:
type: string
error:
type: object
properties:
message:
type: string
code:
type: string
status_code:
type: integer
details: {}
ListEmailsResponse:
type: object
required:
- emails
- has_more
- next_cursor
properties:
emails:
type: array
items:
$ref: '#/components/schemas/EmailListItem'
has_more:
type: boolean
next_cursor:
type: string
nullable: true
UpdateScheduledEmailRequest:
type: object
properties:
scheduled_at:
type: string
format: date-time
scheduledAt:
type: string
format: date-time
description: Alias for scheduled_at.
cancel:
type: boolean
EmailWebhookEventType:
type: string
enum:
- email.received
- email.sent
- email.delivered
- email.delivery_delayed
- email.bounced
- email.complained
- email.opened
- email.clicked
- email.failed
- email.suppressed
- email.scheduled
SendEmailRequest:
type: object
required:
- from
- to
description: '`subject` is required unless `template` is provided (subject comes from the published template).
Provide `html` and/or `text`, or `template` (mutually exclusive). React Email is compiled
client-side by the Node SDK (`react` option) — do not send `react` to the HTTP API.
'
properties:
from:
oneOf:
- type: string
format: email
- type: object
required:
- email
properties:
email:
type: string
format: email
name:
type: string
to:
oneOf:
- type: string
format: email
- type: array
items:
type: string
format: email
subject:
type: string
description: Required unless using `template` (optional override when sending with a template).
html:
type: string
htmlBody:
type: string
description: Alias for html
html_body:
type: string
description: Alias for html
text:
type: string
textBody:
type: string
description: Alias for text
text_body:
type: string
description: Alias for text
plain_body:
type: string
description: Alias for text
template:
$ref: '#/components/schemas/SendTemplateRef'
reply_to:
oneOf:
- type: string
format: email
- type: array
items:
type: string
format: email
replyTo:
oneOf:
- type: string
format: email
- type: array
items:
type: string
format: email
description: Alias for reply_to
cc:
oneOf:
- type: string
- type: array
items:
type: string
bcc:
oneOf:
- type: string
- type: array
items:
type: string
tags:
oneOf:
- type: array
maxItems: 10
items:
$ref: '#/components/schemas/EmailTag'
- type: object
additionalProperties:
type: string
description: Key/value tags stored with the email. Ranla derives a single tag for delivery metadata.
tag:
type: string
description: Optional delivery tag override.
headers:
type: object
additionalProperties:
type: string
description: Custom headers after server-side safety filtering.
attachments:
type: array
maxItems: 10
description: Not supported for batch sends or scheduled sends in v1.
items:
$ref: '#/components/schemas/EmailAttachment'
scheduled_at:
type: string
format: date-time
description: Schedule delivery for a future ISO 8601 timestamp. Returns status `scheduled`.
scheduledAt:
type: string
format: date-time
description: Alias for scheduled_at.
unsubscribe:
type: boolean
description: 'Opt in to managed unsubscribe for this send. Injects RFC 8058 `List-Unsubscribe`
headers and replaces `{{unsubscribe_url}}` in subject/html/text. When sending with
a template, inherits the template''s `unsubscribe_enabled` setting unless overridden here.
'
category:
type: string
enum:
- transactional
- product
- newsletter
description: 'Optional send-level category override. Defaults to the template''s category when sending
with a template, otherwise `transactional`. Product and newsletter categories support
category-scoped opt-out and auto-enable managed unsubscribe.
'
EmailListItem:
type: object
required:
- id
- from
- to
- subject
- status
- created_at
properties:
id:
type: string
from:
type: string
to:
type: array
items:
type: string
format: email
cc:
type: array
items:
type: string
format: email
bcc:
type: array
items:
type: string
format: email
reply_to:
type: array
items:
type: string
format: email
subject:
type: string
status:
type: string
enum:
- queued
- scheduled
- sent
- delivered
- delayed
- opened
- clicked
- bounced
- complained
- failed
- suppressed
- cancelled
description: 'Latest delivery state. `delayed` means delivery was deferred and has not completed
yet. `opened` and `clicked` are set when tracking records engagement; they never
replace `bounced`, `complained`, `failed`, or `suppressed`. `suppressed` means nothing
was sent because a recipient is suppressed or opted out of the email''s category.
'
last_event:
type: string
nullable: true
enum:
- queued
- scheduled
- sent
- delivered
- delayed
- opened
- clicked
- bounced
- complained
- failed
- suppressed
- cancelled
- send_failed
- account_sending_blocked
- plan_limit
description: 'Most recent delivery event recorded for this email. `send_failed` means the mail
server did not accept the message, `account_sending_blocked` and `plan_limit` mean
the account could not send it. Unlike `status`, opens and clicks can appear here
after a bounce.
'
bounce_reason:
type: string
nullable: true
description: 'Why delivery failed, as reported by the recipient''s mail server. Set for bounces,
complaints, and failed sends.
'
tags:
oneOf:
- type: array
items:
$ref: '#/components/schemas/EmailTag'
- type: object
nullable: true
scheduled_at:
type: string
format: date-time
nullable: true
cancelled_at:
type: string
format: date-time
nullable: true
created_at:
type: string
format: date-time
sent_at:
type: string
format: date-time
nullable: true
delivered_at:
type: string
format: date-time
nullable: true
bounced_at:
type: string
format: date-time
nullable: true
securitySchemes:
bearerAuth:
type: http
scheme: bearer
description: Ranla API key prefixed with `rnl_` or `stx_`