API

Templates and campaigns API

Create email content, save a draft, schedule, or send.

Templates

GET/api/v1/templates

Scope

templates:read
POST/api/v1/templates

Scope

templates:write

Fields

nameRequiredemail_typesubjectRequiredpreview_texthtml_bodyRequiredtext_bodyis_active

Returns

id, variables

email_type is any short label you choose, such as welcome, promo, or password_reset. Leave it blank to store general.

text_body is the plain-text version. Leave it out to build one from the HTML. VeloSend adds the unsubscribe link to the end of it, after the line Sent with VeloSend when your project shows the badge.

Saving finds every variable used in the content and returns them. See Template variables for the syntax, types, and defaults.

GET/api/v1/templates/{id}

Scope

templates:read

Returns

the template, including text_body and variables (name, type, default_value, required)

PUT/api/v1/templates/{id}

Scope

templates:write

Fields

nameRequiredemail_typesubjectRequiredpreview_texthtml_bodyRequiredtext_bodyis_active

Returns

id, variables

Variables added to the content are added, and variables removed from the content are removed. Settings on the variables that stay are kept.

PUT/api/v1/templates/{id}/variables

Scope

templates:write

Fields

variables (required)

Sets the type, default, and required switch for variables already in the template.

POST/api/v1/templates/{id}/preview

Scope

templates:read

Fields

emailfirst_namelast_namevariables

Returns

subject, preheader, html, text, warnings

Shows exactly what a send with the same values produces. Nothing is sent.

DELETE/api/v1/templates/{id}

Scope

templates:write

Deletes the template. It can be restored for your plan's retention period. To stop a template being used without deleting it, save it with is_active false.

Campaigns

GET/api/v1/campaigns

Scope

campaigns:read
POST/api/v1/campaigns

Scope

campaigns:write

Fields

nameRequiredtemplate_idsubjectpreview_texthtml_bodylist_idRequiredinclude_riskyscheduled_at

A campaign sends only to list_id, and skips contacts whose address failed the email check. Risky contacts are skipped too unless include_risky is true. Send template_id, or send both subject and html_body. Leave scheduled_at empty to save a draft. Only draft and scheduled campaigns can be edited.

A campaign fills variables from each contact. A variable with no matching contact field uses the default saved on the template, or stays blank and adds a warning to that address in the delivery log.

GET/api/v1/campaigns/{id}

Scope

campaigns:read
PUT/api/v1/campaigns/{id}

Scope

campaigns:write

Fields

nameRequiredsubjectRequiredhtml_bodyRequiredpreview_textlist_idRequiredinclude_riskyscheduled_atclear_schedule
DELETE/api/v1/campaigns/{id}

Scope

campaigns:write

Deletes the campaign and stops it if it was scheduled. It can be restored for your plan's retention period.

Send a list

POST/api/v1/campaigns/{id}/send

Scope

campaigns:send

Starts sending to subscribed contacts on the campaign list who have not already received this campaign, and answers straight away with HTTP 202: status is sending, total is how many people are still waiting for the campaign, and queued is how many get it now. VeloSend sends in the background. If sending stops halfway, it carries on where it stopped. A failed address is tried up to 3 times. Bounced and unsubscribed contacts are skipped. When the project's daily sending limit is reached, the campaign becomes scheduled for the time the limit resets, and the rest are sent automatically. The answer also has warnings: [{ "code": "starter_text", "message": "…" }] when the email still has a starter design's sample text or a link to example.com. The campaign sends either way.

Follow the progress with GET /api/v1/campaigns/{id}, which returns status with sent_count, failed_count and bounced_count. A campaign that cannot start answers at once with the reason: without a connected sending email, the call returns HTTP 409 with the code mailbox_not_connected, and a campaign that is already sending returns HTTP 409 with the code already_sending.

Internal templates

Templates have an `is_internal` field (true or false). Set it to true on `POST /api/v1/templates` or `PUT /api/v1/templates/{id}` for an email to your own team; the email is then sent without the subscriber lines in the footer. Leaving the field out of a `PUT` keeps the saved value. `GET` returns it on every template.