API Reference
The full API reference is generated from the same source-of-truth contract used by the worker. Use it for exact parameters, schemas, and operation ids.
6 min read
OpenAPI contract
Download the exact schema document that powers this reference and the public worker.
Platform
Version metadata, discovery URLs, capability discovery, and the machine-readable OpenAPI document.
/v1 Get API metadata
Returns the current public API version and discovery links for docs, llms files, the OpenAPI contract, webhook subscriptions, and the authenticated capability endpoint.
Responses
{
"$ref": "#/components/schemas/ApiMetadata"
} /v1/capabilities Get authenticated API capabilities
Returns the current workspace context, discovery URLs, shared request conventions, supported webhook events, and the public resource operations available to the authenticated bearer credential.
Responses
{
"type": "object",
"required": [
"data"
],
"properties": {
"data": {
"$ref": "#/components/schemas/Capabilities"
}
}
} {
"$ref": "#/components/schemas/Error"
} /v1/openapi.json Get the OpenAPI document
Returns the machine-readable OpenAPI 3.1 contract for the current public API surface.
Responses
{
"type": "object"
} Workspace
Read the current authenticated workspace profile and execution context.
/v1/workspace Get the current workspace
Returns the authenticated workspace profile and mailing context used by broadcasts, sequences, automations, forms, and magic links.
Responses
{
"type": "object",
"required": [
"data"
],
"properties": {
"data": {
"$ref": "#/components/schemas/Workspace"
}
}
} {
"$ref": "#/components/schemas/Error"
} Subscribers
Create or upsert subscribers and list audience records in a workspace.
/v1/subscribers List subscribers
Returns subscribers in the authenticated workspace, ordered from newest to oldest.
Parameters
search query Filter by name, email, or status.
status query Filter by subscriber status.
cold_only query When `true`, limit results to cold subscribers.
limit query Maximum number of items to return. Defaults to 25 and is capped at 100.
starting_after query Opaque cursor returned by the previous page.
Responses
{
"type": "object",
"required": [
"data",
"pagination"
],
"properties": {
"data": {
"type": "array",
"items": {
"$ref": "#/components/schemas/Subscriber"
}
},
"pagination": {
"$ref": "#/components/schemas/Pagination"
}
}
} {
"$ref": "#/components/schemas/Error"
} /v1/subscribers Create or upsert a subscriber
Creates a new subscriber when the email does not exist in the workspace. If the email already exists, the existing subscriber is updated instead.
Request Body
{
"$ref": "#/components/schemas/SubscriberUpsertRequest"
} Responses
{
"type": "object",
"required": [
"data"
],
"properties": {
"data": {
"$ref": "#/components/schemas/Subscriber"
}
}
} {
"type": "object",
"required": [
"data"
],
"properties": {
"data": {
"$ref": "#/components/schemas/Subscriber"
}
}
} {
"$ref": "#/components/schemas/Error"
} {
"$ref": "#/components/schemas/Error"
} Custom Fields
Read the typed custom-field schema available to the authenticated workspace.
/v1/custom-fields List custom fields
Returns custom fields available to the authenticated workspace.
Parameters
limit query Maximum number of items to return.
starting_after query Opaque cursor returned by the previous page.
Responses
{
"type": "object",
"required": [
"data",
"pagination"
],
"properties": {
"data": {
"type": "array",
"items": {
"$ref": "#/components/schemas/CustomField"
}
},
"pagination": {
"$ref": "#/components/schemas/Pagination"
}
}
} {
"$ref": "#/components/schemas/Error"
} Email Templates
Create and manage reusable email templates for the authenticated workspace.
/v1/email-templates List email templates
Returns reusable email templates linked to the authenticated workspace.
Parameters
limit query Maximum number of items to return.
starting_after query Opaque cursor returned by the previous page.
Responses
{
"type": "object",
"required": [
"data",
"pagination"
],
"properties": {
"data": {
"type": "array",
"items": {
"$ref": "#/components/schemas/EmailTemplate"
}
},
"pagination": {
"$ref": "#/components/schemas/Pagination"
}
}
} {
"$ref": "#/components/schemas/Error"
} /v1/email-templates Create an email template
Creates a reusable email template scoped to the authenticated workspace.
Parameters
Idempotency-Key header Optional idempotency key for safe retries.
Request Body
{
"$ref": "#/components/schemas/EmailTemplateUpsertRequest"
} Responses
{
"type": "object",
"required": [
"data"
],
"properties": {
"data": {
"$ref": "#/components/schemas/EmailTemplate"
}
}
} {
"$ref": "#/components/schemas/Error"
} /v1/email-templates/{template_id} Get an email template
Returns a reusable email template linked to the authenticated workspace.
Parameters
template_id path
required
The email template identifier.
Responses
{
"type": "object",
"required": [
"data"
],
"properties": {
"data": {
"$ref": "#/components/schemas/EmailTemplate"
}
}
} {
"$ref": "#/components/schemas/Error"
} /v1/email-templates/{template_id} Update an email template
Updates the content or enabled state of an existing email template.
Parameters
template_id path
required
The email template identifier.
Request Body
{
"$ref": "#/components/schemas/EmailTemplateUpsertRequest"
} Responses
{
"type": "object",
"required": [
"data"
],
"properties": {
"data": {
"$ref": "#/components/schemas/EmailTemplate"
}
}
} {
"$ref": "#/components/schemas/Error"
} {
"$ref": "#/components/schemas/Error"
} /v1/email-templates/{template_id} Delete an email template
Deletes an existing email template linked to the authenticated workspace.
Parameters
template_id path
required
The email template identifier.
Responses
{
"$ref": "#/components/schemas/Error"
} Forms
Read and manage embeddable form definitions and presentation settings.
/v1/forms List forms
Returns forms in the authenticated workspace.
Parameters
limit query Maximum number of items to return.
starting_after query Opaque cursor returned by the previous page.
Responses
{
"type": "object",
"required": [
"data",
"pagination"
],
"properties": {
"data": {
"type": "array",
"items": {
"$ref": "#/components/schemas/Form"
}
},
"pagination": {
"$ref": "#/components/schemas/Pagination"
}
}
} {
"$ref": "#/components/schemas/Error"
} /v1/forms Create a form
Creates a form in the authenticated workspace.
Parameters
Idempotency-Key header Optional idempotency key for safe retries.
Request Body
{
"$ref": "#/components/schemas/FormUpsertRequest"
} Responses
{
"type": "object",
"required": [
"data"
],
"properties": {
"data": {
"$ref": "#/components/schemas/Form"
}
}
} {
"$ref": "#/components/schemas/Error"
} /v1/forms/{form_id} Get a form
Returns a form in the authenticated workspace.
Parameters
form_id path
required
The form identifier.
Responses
{
"type": "object",
"required": [
"data"
],
"properties": {
"data": {
"$ref": "#/components/schemas/Form"
}
}
} {
"$ref": "#/components/schemas/Error"
} /v1/forms/{form_id} Update a form
Updates an existing form in place.
Parameters
form_id path
required
The form identifier.
Request Body
{
"$ref": "#/components/schemas/FormUpsertRequest"
} Responses
{
"type": "object",
"required": [
"data"
],
"properties": {
"data": {
"$ref": "#/components/schemas/Form"
}
}
} {
"$ref": "#/components/schemas/Error"
} {
"$ref": "#/components/schemas/Error"
} /v1/forms/{form_id} Delete a form
Deletes a form from the authenticated workspace.
Parameters
form_id path
required
The form identifier.
Responses
{
"$ref": "#/components/schemas/Error"
} Sequences
Create and manage email sequences, their status, and delivery configuration.
/v1/sequences List sequences
Returns sequences available in the authenticated workspace.
Parameters
limit query Maximum number of items to return.
starting_after query Opaque cursor returned by the previous page.
Responses
{
"type": "object",
"required": [
"data",
"pagination"
],
"properties": {
"data": {
"type": "array",
"items": {
"$ref": "#/components/schemas/Sequence"
}
},
"pagination": {
"$ref": "#/components/schemas/Pagination"
}
}
} {
"$ref": "#/components/schemas/Error"
} /v1/sequences Create a sequence
Creates a sequence in the authenticated workspace.
Parameters
Idempotency-Key header Optional idempotency key for safe retries.
Request Body
{
"$ref": "#/components/schemas/SequenceUpsertRequest"
} Responses
{
"type": "object",
"required": [
"data"
],
"properties": {
"data": {
"$ref": "#/components/schemas/Sequence"
}
}
} {
"$ref": "#/components/schemas/Error"
} /v1/sequences/{sequence_id} Get a sequence
Returns a sequence in the authenticated workspace.
Parameters
sequence_id path
required
The sequence identifier.
Responses
{
"type": "object",
"required": [
"data"
],
"properties": {
"data": {
"$ref": "#/components/schemas/Sequence"
}
}
} {
"$ref": "#/components/schemas/Error"
} /v1/sequences/{sequence_id} Update a sequence
Updates an existing sequence in place.
Parameters
sequence_id path
required
The sequence identifier.
Request Body
{
"$ref": "#/components/schemas/SequenceUpsertRequest"
} Responses
{
"type": "object",
"required": [
"data"
],
"properties": {
"data": {
"$ref": "#/components/schemas/Sequence"
}
}
} {
"$ref": "#/components/schemas/Error"
} {
"$ref": "#/components/schemas/Error"
} /v1/sequences/{sequence_id} Delete a sequence
Deletes an existing sequence from the authenticated workspace.
Parameters
sequence_id path
required
The sequence identifier.
Responses
{
"$ref": "#/components/schemas/Error"
} Automations
Create and manage automation definitions and lifecycle state.
/v1/automations List automations
Returns automations available in the authenticated workspace.
Parameters
limit query Maximum number of items to return.
starting_after query Opaque cursor returned by the previous page.
Responses
{
"type": "object",
"required": [
"data",
"pagination"
],
"properties": {
"data": {
"type": "array",
"items": {
"$ref": "#/components/schemas/Automation"
}
},
"pagination": {
"$ref": "#/components/schemas/Pagination"
}
}
} {
"$ref": "#/components/schemas/Error"
} /v1/automations Create an automation
Creates an automation in the authenticated workspace.
Parameters
Idempotency-Key header Optional idempotency key for safe retries.
Request Body
{
"$ref": "#/components/schemas/AutomationUpsertRequest"
} Responses
{
"type": "object",
"required": [
"data"
],
"properties": {
"data": {
"$ref": "#/components/schemas/Automation"
}
}
} {
"$ref": "#/components/schemas/Error"
} /v1/automations/{automation_id} Get an automation
Returns an automation in the authenticated workspace.
Parameters
automation_id path
required
The automation identifier.
Responses
{
"type": "object",
"required": [
"data"
],
"properties": {
"data": {
"$ref": "#/components/schemas/Automation"
}
}
} {
"$ref": "#/components/schemas/Error"
} /v1/automations/{automation_id} Update an automation
Updates an existing automation in place.
Parameters
automation_id path
required
The automation identifier.
Request Body
{
"$ref": "#/components/schemas/AutomationUpsertRequest"
} Responses
{
"type": "object",
"required": [
"data"
],
"properties": {
"data": {
"$ref": "#/components/schemas/Automation"
}
}
} {
"$ref": "#/components/schemas/Error"
} {
"$ref": "#/components/schemas/Error"
} /v1/automations/{automation_id} Delete an automation
Deletes an automation from the authenticated workspace.
Parameters
automation_id path
required
The automation identifier.
Responses
{
"$ref": "#/components/schemas/Error"
} Magic Links
Create and manage magic links used in broadcasts, sequences, and automations.
/v1/magic-links List magic links
Returns magic links available in the authenticated workspace.
Parameters
limit query Maximum number of items to return.
starting_after query Opaque cursor returned by the previous page.
Responses
{
"type": "object",
"required": [
"data",
"pagination"
],
"properties": {
"data": {
"type": "array",
"items": {
"$ref": "#/components/schemas/MagicLink"
}
},
"pagination": {
"$ref": "#/components/schemas/Pagination"
}
}
} {
"$ref": "#/components/schemas/Error"
} /v1/magic-links Create a magic link
Creates a magic link in the authenticated workspace.
Parameters
Idempotency-Key header Optional idempotency key for safe retries.
Request Body
{
"$ref": "#/components/schemas/MagicLinkUpsertRequest"
} Responses
{
"type": "object",
"required": [
"data"
],
"properties": {
"data": {
"$ref": "#/components/schemas/MagicLink"
}
}
} {
"$ref": "#/components/schemas/Error"
} {
"$ref": "#/components/schemas/Error"
} /v1/magic-links/{magic_link_id} Get a magic link
Returns a magic link in the authenticated workspace.
Parameters
magic_link_id path
required
The magic link identifier.
Responses
{
"type": "object",
"required": [
"data"
],
"properties": {
"data": {
"$ref": "#/components/schemas/MagicLink"
}
}
} {
"$ref": "#/components/schemas/Error"
} /v1/magic-links/{magic_link_id} Update a magic link
Updates an existing magic link in place.
Parameters
magic_link_id path
required
The magic link identifier.
Request Body
{
"$ref": "#/components/schemas/MagicLinkUpsertRequest"
} Responses
{
"type": "object",
"required": [
"data"
],
"properties": {
"data": {
"$ref": "#/components/schemas/MagicLink"
}
}
} {
"$ref": "#/components/schemas/Error"
} {
"$ref": "#/components/schemas/Error"
} {
"$ref": "#/components/schemas/Error"
} /v1/magic-links/{magic_link_id} Delete a magic link
Deletes a magic link from the authenticated workspace.
Parameters
magic_link_id path
required
The magic link identifier.
Responses
{
"$ref": "#/components/schemas/Error"
} Broadcasts
Create, schedule, test, send, and inspect one-off broadcasts.
/v1/broadcasts List broadcasts
Returns broadcast drafts, scheduled sends, active sends, and completed sends.
Parameters
limit query Maximum number of items to return.
starting_after query Opaque cursor returned by the previous page.
Responses
{
"type": "object",
"required": [
"data",
"pagination"
],
"properties": {
"data": {
"type": "array",
"items": {
"$ref": "#/components/schemas/Broadcast"
}
},
"pagination": {
"$ref": "#/components/schemas/Pagination"
}
}
} {
"$ref": "#/components/schemas/Error"
} /v1/broadcasts Create a broadcast
Creates a broadcast draft or scheduled broadcast in the authenticated workspace.
Parameters
Idempotency-Key header Optional idempotency key for safe retries.
Request Body
{
"$ref": "#/components/schemas/BroadcastUpsertRequest"
} Responses
{
"type": "object",
"required": [
"data"
],
"properties": {
"data": {
"$ref": "#/components/schemas/Broadcast"
}
}
} {
"$ref": "#/components/schemas/Error"
} /v1/broadcasts/{broadcast_id} Get a broadcast
Returns a broadcast draft, scheduled send, active send, or completed send.
Parameters
broadcast_id path
required
The broadcast identifier.
Responses
{
"type": "object",
"required": [
"data"
],
"properties": {
"data": {
"$ref": "#/components/schemas/Broadcast"
}
}
} {
"$ref": "#/components/schemas/Error"
} /v1/broadcasts/{broadcast_id} Update a broadcast
Updates a broadcast draft or scheduled send in place.
Parameters
broadcast_id path
required
The broadcast identifier.
Request Body
{
"$ref": "#/components/schemas/BroadcastUpsertRequest"
} Responses
{
"type": "object",
"required": [
"data"
],
"properties": {
"data": {
"$ref": "#/components/schemas/Broadcast"
}
}
} {
"$ref": "#/components/schemas/Error"
} {
"$ref": "#/components/schemas/Error"
} /v1/broadcasts/{broadcast_id} Delete a broadcast
Deletes an existing broadcast from the authenticated workspace.
Parameters
broadcast_id path
required
The broadcast identifier.
Responses
{
"$ref": "#/components/schemas/Error"
} /v1/broadcasts/{broadcast_id}/send Send a broadcast now
Launches immediate delivery for a broadcast draft or scheduled send.
Parameters
broadcast_id path
required
The broadcast identifier.
Idempotency-Key header Optional idempotency key for safe retries.
Responses
{
"type": "object",
"required": [
"data"
],
"properties": {
"data": {
"type": "object",
"required": [
"status",
"resource"
],
"properties": {
"status": {
"type": "string",
"enum": [
"completed"
]
},
"resource": {
"$ref": "#/components/schemas/Broadcast"
}
}
}
}
} {
"$ref": "#/components/schemas/Error"
} {
"$ref": "#/components/schemas/Error"
} {
"$ref": "#/components/schemas/Error"
} /v1/broadcasts/{broadcast_id}/test Send a broadcast test email
Sends a test message for an existing broadcast to a single recipient.
Parameters
broadcast_id path
required
The broadcast identifier.
Idempotency-Key header Optional idempotency key for safe retries.
Request Body
{
"$ref": "#/components/schemas/BroadcastTestRequest"
} Responses
{
"type": "object",
"required": [
"data"
],
"properties": {
"data": {
"$ref": "#/components/schemas/ActionResult"
}
}
} {
"$ref": "#/components/schemas/Error"
} {
"$ref": "#/components/schemas/Error"
} Segments
Read saved segments and preview dynamic audience definitions.
/v1/segments List segments
Returns saved segments in the authenticated workspace.
Parameters
limit query Maximum number of items to return.
starting_after query Opaque cursor returned by the previous page.
Responses
{
"type": "object",
"required": [
"data",
"pagination"
],
"properties": {
"data": {
"type": "array",
"items": {
"$ref": "#/components/schemas/Segment"
}
},
"pagination": {
"$ref": "#/components/schemas/Pagination"
}
}
} {
"$ref": "#/components/schemas/Error"
} /v1/segments/preview Preview a segment definition
Returns subscriber counts for an unsaved audience definition.
Request Body
{
"$ref": "#/components/schemas/SegmentPreviewRequest"
} Responses
{
"type": "object",
"required": [
"data"
],
"properties": {
"data": {
"$ref": "#/components/schemas/SegmentPreview"
}
}
} {
"$ref": "#/components/schemas/Error"
} Jobs
Create and inspect asynchronous subscriber import and export jobs.
/v1/jobs/subscriber-exports Create a subscriber export job
Queues an asynchronous subscriber export for the authenticated workspace.
Parameters
Idempotency-Key header Optional idempotency key for safe retries.
Request Body
{
"$ref": "#/components/schemas/SubscriberExportJobCreateRequest"
} Responses
{
"type": "object",
"required": [
"data"
],
"properties": {
"data": {
"$ref": "#/components/schemas/SubscriberExportJob"
}
}
} {
"$ref": "#/components/schemas/Error"
} /v1/jobs/subscriber-exports/{job_id} Get a subscriber export job
Returns the current state of a previously created export job.
Parameters
job_id path
required
The export job identifier.
Responses
{
"type": "object",
"required": [
"data"
],
"properties": {
"data": {
"$ref": "#/components/schemas/SubscriberExportJob"
}
}
} {
"$ref": "#/components/schemas/Error"
} /v1/jobs/subscriber-imports Create a subscriber import job
Queues an asynchronous subscriber import from CSV text.
Parameters
Idempotency-Key header Optional idempotency key for safe retries.
Request Body
{
"$ref": "#/components/schemas/SubscriberImportJobCreateRequest"
} Responses
{
"type": "object",
"required": [
"data"
],
"properties": {
"data": {
"$ref": "#/components/schemas/SubscriberImportJob"
}
}
} {
"$ref": "#/components/schemas/Error"
} /v1/jobs/subscriber-imports/{job_id} Get a subscriber import job
Returns the current state of a previously created import job.
Parameters
job_id path
required
The import job identifier.
Responses
{
"type": "object",
"required": [
"data"
],
"properties": {
"data": {
"$ref": "#/components/schemas/SubscriberImportJob"
}
}
} {
"$ref": "#/components/schemas/Error"
} Webhooks
Create and manage outbound webhook subscriptions for Mailrith events and signed event delivery.
/v1/webhook-subscriptions List webhook subscriptions
Returns the outbound webhook subscriptions configured for the authenticated workspace.
Responses
{
"type": "object",
"required": [
"data",
"pagination"
],
"properties": {
"data": {
"type": "array",
"items": {
"$ref": "#/components/schemas/WebhookSubscription"
}
},
"pagination": {
"$ref": "#/components/schemas/Pagination"
}
}
} {
"$ref": "#/components/schemas/Error"
} /v1/webhook-subscriptions Create a webhook subscription
Creates a signed outbound webhook subscription and returns the signing secret once.
Request Body
{
"$ref": "#/components/schemas/WebhookSubscriptionCreateRequest"
} Responses
{
"type": "object",
"required": [
"data"
],
"properties": {
"data": {
"$ref": "#/components/schemas/WebhookSubscriptionCreateResult"
}
}
} {
"$ref": "#/components/schemas/Error"
} {
"$ref": "#/components/schemas/Error"
} /v1/webhook-subscriptions/{webhook_subscription_id} Get a webhook subscription
Returns a single outbound webhook subscription configured for the authenticated workspace.
Parameters
webhook_subscription_id path
required
The webhook subscription identifier.
Responses
{
"type": "object",
"required": [
"data"
],
"properties": {
"data": {
"$ref": "#/components/schemas/WebhookSubscription"
}
}
} {
"$ref": "#/components/schemas/Error"
} /v1/webhook-subscriptions/{webhook_subscription_id} Update a webhook subscription
Updates the destination URL, status, or event pattern set for an existing webhook subscription.
Parameters
webhook_subscription_id path
required
The webhook subscription identifier.
Request Body
{
"$ref": "#/components/schemas/WebhookSubscriptionUpdateRequest"
} Responses
{
"type": "object",
"required": [
"data"
],
"properties": {
"data": {
"$ref": "#/components/schemas/WebhookSubscription"
}
}
} {
"$ref": "#/components/schemas/Error"
} {
"$ref": "#/components/schemas/Error"
} {
"$ref": "#/components/schemas/Error"
} /v1/webhook-subscriptions/{webhook_subscription_id} Delete a webhook subscription
Deletes an existing outbound webhook subscription from the authenticated workspace.
Parameters
webhook_subscription_id path
required
The webhook subscription identifier.
Responses
{
"type": "object",
"required": [
"data"
],
"properties": {
"data": {
"type": "object",
"required": [
"id",
"deleted"
],
"properties": {
"id": {
"type": "string"
},
"deleted": {
"type": "boolean",
"enum": [
true
]
}
}
}
}
} {
"$ref": "#/components/schemas/Error"
} Need help shipping an integration?
Reach the Mailrith team if you need help planning a sync, validating a webhook flow, or troubleshooting a request.
Related guides
Create a workspace key and make the first authenticated request against Mailrith's public API.
Use workspace-scoped Bearer keys and understand how protected requests are authorized.
Run the local worker, generate a workspace key, exercise the endpoints, and execute automated integration coverage.