Campaigns API
These are the Campaigns endpoints of the Keila API.
For Keila Cloud, the base URL is https://app.keila.io.
All endpoints, unless stated differently, require Bearer authentication.
A campaign is an email message sent to many contacts at once The content can be authored as text, Markdown, blocks, MJML, or HTML.
/api/v1/campaigns Index campaigns
Retrieve all campaigns from your project.
Responses
200 Campaign index response
- dataobject[]
- dataobject
Example:
{"books":[{"title":"Space Book","url":"books.books/spacebook"},{"title":"Earth Book","url":"books.books/earthbook"}]} - html_bodystring
Example:
"<!doctype html>\n<html>\n <body>\n <h1>Hello {{ contact.first_name }}!</h1>\n </body>\n</html>\n" - html_contentobject
Map of named HTML content slots.
Example:
{"main":"<p>Hi {{ contact.first_name }}!</p>"} - idstring
Campaign ID
Example:
"mc_12345" - inserted_atstring
Example:
"2026-06-24T16:59:41.530051Z" - json_bodyobject
Example:
{"blocks":[{"data":{"text":"Hello, I am a block campaign!"},"id":"ff0011","type":"paragraph"}]} - mjml_bodystring
Example:
"<mjml>\n <mj-body>\n <mj-section>\n <mj-column>\n <mj-text>Hello I’m an MJML campaign!</mj-text>\n </mj-column>\n </mj-section>\n </mj-body>\n</mjml>\n" - mjml_contentobject
Map of named MJML content slots.
Example:
{"main":"<mj-text>Hi {{ contact.first_name }}!</mj-text>"} - preview_textstring
Example:
"Hello, I am a preview campaign!" - scheduled_forstring
Example:
"2026-06-24T16:59:41.530046Z" - segment_idstring
Example:
"sgm_12345" - sender_idstring
Example:
"ms_12345" - sent_atstring
Example:
"2026-06-24T16:59:41.530020Z" - settingsobject
- subjectstring
Example:
"🚀 Our Space Book is Now Available!" - template_idstring
- text_bodystring
Example:
"Hey {{ contact.first_name }}, are you excited for our Space Book?\n\n[…]\n\n## All Books by Acme Space Corp:\n{% for book in campaign.data.books %}\n - {{ book.title }}: [More info]({{ book.url }})\n{% endfor %}\n" - text_contentobject
Map of named text content slots.
Example:
{"main":"Hi {{ contact.first_name }}!"} - updated_atstring
Example:
"2026-06-24T16:59:41.530055Z"
- metaobject
/api/v1/campaigns Create Campaign
Request body
- dataobject
- dataobject
Example:
{"books":[{"title":"Space Book","url":"books.books/spacebook"},{"title":"Earth Book","url":"books.books/earthbook"}]} - html_bodystring
Example:
"<!doctype html>\n<html>\n <body>\n <h1>Hello {{ contact.first_name }}!</h1>\n </body>\n</html>\n" - html_contentobject
Map of named HTML content slots.
Example:
{"main":"<p>Hi {{ contact.first_name }}!</p>"} - json_bodyobject
Example:
{"blocks":[{"data":{"text":"Hello, I am a block campaign!"},"id":"ff0011","type":"paragraph"}]} - mjml_bodystring
Example:
"<mjml>\n <mj-body>\n <mj-section>\n <mj-column>\n <mj-text>Hello I’m an MJML campaign!</mj-text>\n </mj-column>\n </mj-section>\n </mj-body>\n</mjml>\n" - mjml_contentobject
Map of named MJML content slots.
Example:
{"main":"<mj-text>Hi {{ contact.first_name }}!</mj-text>"} - preview_textstring
Example:
"Hello, I am a preview campaign!" - segment_idstring
Example:
"sgm_12345" - sender_idstring
Example:
"ms_12345" - settingsobject required
- subjectstring required
Example:
"🚀 Our Space Book is Now Available!" - template_idstring
- text_bodystring
Example:
"Hey {{ contact.first_name }}, are you excited for our Space Book?\n\n[…]\n\n## All Books by Acme Space Corp:\n{% for book in campaign.data.books %}\n - {{ book.title }}: [More info]({{ book.url }})\n{% endfor %}\n" - text_contentobject
Map of named text content slots.
Example:
{"main":"Hi {{ contact.first_name }}!"}
Responses
200 Campaign response
- dataobject
- dataobject
Example:
{"books":[{"title":"Space Book","url":"books.books/spacebook"},{"title":"Earth Book","url":"books.books/earthbook"}]} - html_bodystring
Example:
"<!doctype html>\n<html>\n <body>\n <h1>Hello {{ contact.first_name }}!</h1>\n </body>\n</html>\n" - html_contentobject
Map of named HTML content slots.
Example:
{"main":"<p>Hi {{ contact.first_name }}!</p>"} - idstring
Campaign ID
Example:
"mc_12345" - inserted_atstring
Example:
"2026-06-24T16:59:41.530051Z" - json_bodyobject
Example:
{"blocks":[{"data":{"text":"Hello, I am a block campaign!"},"id":"ff0011","type":"paragraph"}]} - mjml_bodystring
Example:
"<mjml>\n <mj-body>\n <mj-section>\n <mj-column>\n <mj-text>Hello I’m an MJML campaign!</mj-text>\n </mj-column>\n </mj-section>\n </mj-body>\n</mjml>\n" - mjml_contentobject
Map of named MJML content slots.
Example:
{"main":"<mj-text>Hi {{ contact.first_name }}!</mj-text>"} - preview_textstring
Example:
"Hello, I am a preview campaign!" - scheduled_forstring
Example:
"2026-06-24T16:59:41.530046Z" - segment_idstring
Example:
"sgm_12345" - sender_idstring
Example:
"ms_12345" - sent_atstring
Example:
"2026-06-24T16:59:41.530020Z" - settingsobject
- subjectstring
Example:
"🚀 Our Space Book is Now Available!" - template_idstring
- text_bodystring
Example:
"Hey {{ contact.first_name }}, are you excited for our Space Book?\n\n[…]\n\n## All Books by Acme Space Corp:\n{% for book in campaign.data.books %}\n - {{ book.title }}: [More info]({{ book.url }})\n{% endfor %}\n" - text_contentobject
Map of named text content slots.
Example:
{"main":"Hi {{ contact.first_name }}!"} - updated_atstring
Example:
"2026-06-24T16:59:41.530055Z"
/api/v1/campaigns/{id} Show Campaign
Parameters
| Name | In | Type | Required | Description |
|---|---|---|---|---|
| id | path | string | yes | Campaign ID |
Responses
200 Campaign response
- dataobject
- dataobject
Example:
{"books":[{"title":"Space Book","url":"books.books/spacebook"},{"title":"Earth Book","url":"books.books/earthbook"}]} - html_bodystring
Example:
"<!doctype html>\n<html>\n <body>\n <h1>Hello {{ contact.first_name }}!</h1>\n </body>\n</html>\n" - html_contentobject
Map of named HTML content slots.
Example:
{"main":"<p>Hi {{ contact.first_name }}!</p>"} - idstring
Campaign ID
Example:
"mc_12345" - inserted_atstring
Example:
"2026-06-24T16:59:41.530051Z" - json_bodyobject
Example:
{"blocks":[{"data":{"text":"Hello, I am a block campaign!"},"id":"ff0011","type":"paragraph"}]} - mjml_bodystring
Example:
"<mjml>\n <mj-body>\n <mj-section>\n <mj-column>\n <mj-text>Hello I’m an MJML campaign!</mj-text>\n </mj-column>\n </mj-section>\n </mj-body>\n</mjml>\n" - mjml_contentobject
Map of named MJML content slots.
Example:
{"main":"<mj-text>Hi {{ contact.first_name }}!</mj-text>"} - preview_textstring
Example:
"Hello, I am a preview campaign!" - scheduled_forstring
Example:
"2026-06-24T16:59:41.530046Z" - segment_idstring
Example:
"sgm_12345" - sender_idstring
Example:
"ms_12345" - sent_atstring
Example:
"2026-06-24T16:59:41.530020Z" - settingsobject
- subjectstring
Example:
"🚀 Our Space Book is Now Available!" - template_idstring
- text_bodystring
Example:
"Hey {{ contact.first_name }}, are you excited for our Space Book?\n\n[…]\n\n## All Books by Acme Space Corp:\n{% for book in campaign.data.books %}\n - {{ book.title }}: [More info]({{ book.url }})\n{% endfor %}\n" - text_contentobject
Map of named text content slots.
Example:
{"main":"Hi {{ contact.first_name }}!"} - updated_atstring
Example:
"2026-06-24T16:59:41.530055Z"
/api/v1/campaigns/{id} Update Campaign
Parameters
| Name | In | Type | Required | Description |
|---|---|---|---|---|
| id | path | string | yes | Campaign ID |
Request body
- dataobject
- dataobject
Example:
{"books":[{"title":"Space Book","url":"books.books/spacebook"},{"title":"Earth Book","url":"books.books/earthbook"}]} - html_bodystring
Example:
"<!doctype html>\n<html>\n <body>\n <h1>Hello {{ contact.first_name }}!</h1>\n </body>\n</html>\n" - html_contentobject
Map of named HTML content slots.
Example:
{"main":"<p>Hi {{ contact.first_name }}!</p>"} - json_bodyobject
Example:
{"blocks":[{"data":{"text":"Hello, I am a block campaign!"},"id":"ff0011","type":"paragraph"}]} - mjml_bodystring
Example:
"<mjml>\n <mj-body>\n <mj-section>\n <mj-column>\n <mj-text>Hello I’m an MJML campaign!</mj-text>\n </mj-column>\n </mj-section>\n </mj-body>\n</mjml>\n" - mjml_contentobject
Map of named MJML content slots.
Example:
{"main":"<mj-text>Hi {{ contact.first_name }}!</mj-text>"} - preview_textstring
Example:
"Hello, I am a preview campaign!" - segment_idstring
Example:
"sgm_12345" - sender_idstring
Example:
"ms_12345" - settingsobject
- subjectstring
Example:
"🚀 Our Space Book is Now Available!" - template_idstring
- text_bodystring
Example:
"Hey {{ contact.first_name }}, are you excited for our Space Book?\n\n[…]\n\n## All Books by Acme Space Corp:\n{% for book in campaign.data.books %}\n - {{ book.title }}: [More info]({{ book.url }})\n{% endfor %}\n" - text_contentobject
Map of named text content slots.
Example:
{"main":"Hi {{ contact.first_name }}!"}
Responses
200 Campaign response
- dataobject
- dataobject
Example:
{"books":[{"title":"Space Book","url":"books.books/spacebook"},{"title":"Earth Book","url":"books.books/earthbook"}]} - html_bodystring
Example:
"<!doctype html>\n<html>\n <body>\n <h1>Hello {{ contact.first_name }}!</h1>\n </body>\n</html>\n" - html_contentobject
Map of named HTML content slots.
Example:
{"main":"<p>Hi {{ contact.first_name }}!</p>"} - idstring
Campaign ID
Example:
"mc_12345" - inserted_atstring
Example:
"2026-06-24T16:59:41.530051Z" - json_bodyobject
Example:
{"blocks":[{"data":{"text":"Hello, I am a block campaign!"},"id":"ff0011","type":"paragraph"}]} - mjml_bodystring
Example:
"<mjml>\n <mj-body>\n <mj-section>\n <mj-column>\n <mj-text>Hello I’m an MJML campaign!</mj-text>\n </mj-column>\n </mj-section>\n </mj-body>\n</mjml>\n" - mjml_contentobject
Map of named MJML content slots.
Example:
{"main":"<mj-text>Hi {{ contact.first_name }}!</mj-text>"} - preview_textstring
Example:
"Hello, I am a preview campaign!" - scheduled_forstring
Example:
"2026-06-24T16:59:41.530046Z" - segment_idstring
Example:
"sgm_12345" - sender_idstring
Example:
"ms_12345" - sent_atstring
Example:
"2026-06-24T16:59:41.530020Z" - settingsobject
- subjectstring
Example:
"🚀 Our Space Book is Now Available!" - template_idstring
- text_bodystring
Example:
"Hey {{ contact.first_name }}, are you excited for our Space Book?\n\n[…]\n\n## All Books by Acme Space Corp:\n{% for book in campaign.data.books %}\n - {{ book.title }}: [More info]({{ book.url }})\n{% endfor %}\n" - text_contentobject
Map of named text content slots.
Example:
{"main":"Hi {{ contact.first_name }}!"} - updated_atstring
Example:
"2026-06-24T16:59:41.530055Z"
/api/v1/campaigns/{id} Update Campaign
Parameters
| Name | In | Type | Required | Description |
|---|---|---|---|---|
| id | path | string | yes | Campaign ID |
Request body
- dataobject
- dataobject
Example:
{"books":[{"title":"Space Book","url":"books.books/spacebook"},{"title":"Earth Book","url":"books.books/earthbook"}]} - html_bodystring
Example:
"<!doctype html>\n<html>\n <body>\n <h1>Hello {{ contact.first_name }}!</h1>\n </body>\n</html>\n" - html_contentobject
Map of named HTML content slots.
Example:
{"main":"<p>Hi {{ contact.first_name }}!</p>"} - json_bodyobject
Example:
{"blocks":[{"data":{"text":"Hello, I am a block campaign!"},"id":"ff0011","type":"paragraph"}]} - mjml_bodystring
Example:
"<mjml>\n <mj-body>\n <mj-section>\n <mj-column>\n <mj-text>Hello I’m an MJML campaign!</mj-text>\n </mj-column>\n </mj-section>\n </mj-body>\n</mjml>\n" - mjml_contentobject
Map of named MJML content slots.
Example:
{"main":"<mj-text>Hi {{ contact.first_name }}!</mj-text>"} - preview_textstring
Example:
"Hello, I am a preview campaign!" - segment_idstring
Example:
"sgm_12345" - sender_idstring
Example:
"ms_12345" - settingsobject
- subjectstring
Example:
"🚀 Our Space Book is Now Available!" - template_idstring
- text_bodystring
Example:
"Hey {{ contact.first_name }}, are you excited for our Space Book?\n\n[…]\n\n## All Books by Acme Space Corp:\n{% for book in campaign.data.books %}\n - {{ book.title }}: [More info]({{ book.url }})\n{% endfor %}\n" - text_contentobject
Map of named text content slots.
Example:
{"main":"Hi {{ contact.first_name }}!"}
Responses
200 Campaign response
- dataobject
- dataobject
Example:
{"books":[{"title":"Space Book","url":"books.books/spacebook"},{"title":"Earth Book","url":"books.books/earthbook"}]} - html_bodystring
Example:
"<!doctype html>\n<html>\n <body>\n <h1>Hello {{ contact.first_name }}!</h1>\n </body>\n</html>\n" - html_contentobject
Map of named HTML content slots.
Example:
{"main":"<p>Hi {{ contact.first_name }}!</p>"} - idstring
Campaign ID
Example:
"mc_12345" - inserted_atstring
Example:
"2026-06-24T16:59:41.530051Z" - json_bodyobject
Example:
{"blocks":[{"data":{"text":"Hello, I am a block campaign!"},"id":"ff0011","type":"paragraph"}]} - mjml_bodystring
Example:
"<mjml>\n <mj-body>\n <mj-section>\n <mj-column>\n <mj-text>Hello I’m an MJML campaign!</mj-text>\n </mj-column>\n </mj-section>\n </mj-body>\n</mjml>\n" - mjml_contentobject
Map of named MJML content slots.
Example:
{"main":"<mj-text>Hi {{ contact.first_name }}!</mj-text>"} - preview_textstring
Example:
"Hello, I am a preview campaign!" - scheduled_forstring
Example:
"2026-06-24T16:59:41.530046Z" - segment_idstring
Example:
"sgm_12345" - sender_idstring
Example:
"ms_12345" - sent_atstring
Example:
"2026-06-24T16:59:41.530020Z" - settingsobject
- subjectstring
Example:
"🚀 Our Space Book is Now Available!" - template_idstring
- text_bodystring
Example:
"Hey {{ contact.first_name }}, are you excited for our Space Book?\n\n[…]\n\n## All Books by Acme Space Corp:\n{% for book in campaign.data.books %}\n - {{ book.title }}: [More info]({{ book.url }})\n{% endfor %}\n" - text_contentobject
Map of named text content slots.
Example:
{"main":"Hi {{ contact.first_name }}!"} - updated_atstring
Example:
"2026-06-24T16:59:41.530055Z"
/api/v1/campaigns/{id} Delete Campaign
Parameters
| Name | In | Type | Required | Description |
|---|---|---|---|---|
| id | path | string | yes | Campaign ID |
Responses
204 Campaign was deleted successfully or didn’t exist.
/api/v1/campaigns/{id}/actions/schedule Schedule Campaign
Parameters
| Name | In | Type | Required | Description |
|---|---|---|---|---|
| id | path | string | yes | Campaign ID |
Request body
- dataobject
- scheduled_forstring
Example:
"2026-06-24T16:59:41.530046Z"
Responses
200 Campaign response
- dataobject
- dataobject
Example:
{"books":[{"title":"Space Book","url":"books.books/spacebook"},{"title":"Earth Book","url":"books.books/earthbook"}]} - html_bodystring
Example:
"<!doctype html>\n<html>\n <body>\n <h1>Hello {{ contact.first_name }}!</h1>\n </body>\n</html>\n" - html_contentobject
Map of named HTML content slots.
Example:
{"main":"<p>Hi {{ contact.first_name }}!</p>"} - idstring
Campaign ID
Example:
"mc_12345" - inserted_atstring
Example:
"2026-06-24T16:59:41.530051Z" - json_bodyobject
Example:
{"blocks":[{"data":{"text":"Hello, I am a block campaign!"},"id":"ff0011","type":"paragraph"}]} - mjml_bodystring
Example:
"<mjml>\n <mj-body>\n <mj-section>\n <mj-column>\n <mj-text>Hello I’m an MJML campaign!</mj-text>\n </mj-column>\n </mj-section>\n </mj-body>\n</mjml>\n" - mjml_contentobject
Map of named MJML content slots.
Example:
{"main":"<mj-text>Hi {{ contact.first_name }}!</mj-text>"} - preview_textstring
Example:
"Hello, I am a preview campaign!" - scheduled_forstring
Example:
"2026-06-24T16:59:41.530046Z" - segment_idstring
Example:
"sgm_12345" - sender_idstring
Example:
"ms_12345" - sent_atstring
Example:
"2026-06-24T16:59:41.530020Z" - settingsobject
- subjectstring
Example:
"🚀 Our Space Book is Now Available!" - template_idstring
- text_bodystring
Example:
"Hey {{ contact.first_name }}, are you excited for our Space Book?\n\n[…]\n\n## All Books by Acme Space Corp:\n{% for book in campaign.data.books %}\n - {{ book.title }}: [More info]({{ book.url }})\n{% endfor %}\n" - text_contentobject
Map of named text content slots.
Example:
{"main":"Hi {{ contact.first_name }}!"} - updated_atstring
Example:
"2026-06-24T16:59:41.530055Z"
/api/v1/campaigns/{id}/actions/send Deliver Campaign
Parameters
| Name | In | Type | Required | Description |
|---|---|---|---|---|
| id | path | string | yes | Campaign ID |
Responses
202 Campaign delivery queued
- dataobject
- campaign_idstring
Campaign ID
Example:
"mc_12345" - delivery_queuedtrue
This indicates that the delivery of the campaign will be processed asynchronously.
Note: If the campaign is invalid (e.g. missing a sender) or if your account has insufficient credits, the campaign will not be delivered regardless of the response from the endpoint.