Campaigns
Organise sequences and templates into campaigns for coordinated email marketing.
Campaigns group related sequences and templates together for coordinated email marketing efforts. Use campaigns to organise product launches, seasonal promotions, or onboarding flows that span multiple sequences and templates.
Create campaign
POST /api/campaignsCreates a new campaign.
Request body
| Field | Type | Required | Description |
|---|---|---|---|
name | string | Yes | Name of the campaign. |
description | string | No | Description of the campaign's purpose. |
Response
Returns the created campaign.
{
"id": "cmp_01H9...",
"name": "Q4 Product Launch",
"description": "Announcement and onboarding for the new analytics feature.",
"status": "draft",
"sequences": [],
"templates": [],
"createdAt": "2025-09-15T10:00:00.000Z",
"updatedAt": "2025-09-15T10:00:00.000Z"
}Errors
| Code | Description |
|---|---|
VALIDATION_ERROR | Missing campaign name. |
Examples
curl -X POST https://api.kraiter.com/api/campaigns \
-H "Authorization: Bearer YOUR_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"name": "Q4 Product Launch",
"description": "Announcement and onboarding for the new analytics feature."
}'const campaign = await kraiter.campaigns.create({
name: "Q4 Product Launch",
description: "Announcement and onboarding for the new analytics feature.",
});List campaigns
GET /api/campaignsReturns a paginated list of campaigns.
Query parameters
| Parameter | Type | Default | Description |
|---|---|---|---|
cursor | string | — | Pagination cursor. |
limit | number | 20 | Number of campaigns to return (max 100). |
Examples
curl "https://api.kraiter.com/api/campaigns?limit=10" \
-H "Authorization: Bearer YOUR_API_KEY"const campaigns = await kraiter.campaigns.list({ limit: 10 });Get campaign
GET /api/campaigns/:idReturns a single campaign with its associated sequences and templates.
Path parameters
| Parameter | Type | Description |
|---|---|---|
id | string | The campaign ID. |
Response
{
"id": "cmp_01H9...",
"name": "Q4 Product Launch",
"description": "Announcement and onboarding for the new analytics feature.",
"status": "active",
"sequences": [
{ "id": "onboarding", "name": "Onboarding Sequence" }
],
"templates": [
{ "id": "launch-announcement", "name": "Launch Announcement" }
],
"createdAt": "2025-09-15T10:00:00.000Z",
"updatedAt": "2025-09-16T12:00:00.000Z"
}Errors
| Code | Description |
|---|---|
NOT_FOUND | No campaign with this ID exists. |
Examples
curl https://api.kraiter.com/api/campaigns/cmp_01H9... \
-H "Authorization: Bearer YOUR_API_KEY"const campaign = await kraiter.campaigns.get("cmp_01H9...");Update campaign
PATCH /api/campaigns/:idUpdates a campaign's name, description, or status.
Path parameters
| Parameter | Type | Description |
|---|---|---|
id | string | The campaign ID. |
Request body
| Field | Type | Required | Description |
|---|---|---|---|
name | string | No | New campaign name. |
description | string | No | New description. |
status | string | No | New status: draft, active, or completed. |
Campaign statuses
| Status | Description |
|---|---|
draft | The campaign is being prepared. |
active | The campaign is live. |
completed | The campaign has finished. |
Examples
curl -X PATCH https://api.kraiter.com/api/campaigns/cmp_01H9... \
-H "Authorization: Bearer YOUR_API_KEY" \
-H "Content-Type: application/json" \
-d '{ "status": "active" }'const campaign = await kraiter.campaigns.update("cmp_01H9...", {
status: "active",
});Delete campaign
DELETE /api/campaigns/:idPermanently deletes a campaign. The sequences and templates associated with the campaign are not deleted — only the campaign grouping is removed.
Response
Returns 204 No Content on success.
Errors
| Code | Description |
|---|---|
NOT_FOUND | No campaign with this ID exists. |
Examples
curl -X DELETE https://api.kraiter.com/api/campaigns/cmp_01H9... \
-H "Authorization: Bearer YOUR_API_KEY"await kraiter.campaigns.delete("cmp_01H9...");Add sequence to campaign
POST /api/campaigns/:id/sequences/:seqIdAssociates a sequence with the campaign.
Path parameters
| Parameter | Type | Description |
|---|---|---|
id | string | The campaign ID. |
seqId | string | The sequence ID to add. |
Response
Returns the updated campaign.
Errors
| Code | Description |
|---|---|
NOT_FOUND | Campaign or sequence not found. |
CONFLICT | The sequence is already part of this campaign. |
Examples
curl -X POST https://api.kraiter.com/api/campaigns/cmp_01H9.../sequences/onboarding \
-H "Authorization: Bearer YOUR_API_KEY"await kraiter.campaigns.addSequence("cmp_01H9...", "onboarding");Remove sequence from campaign
DELETE /api/campaigns/:id/sequences/:seqIdRemoves a sequence from the campaign. The sequence itself is not deleted.
Path parameters
| Parameter | Type | Description |
|---|---|---|
id | string | The campaign ID. |
seqId | string | The sequence ID to remove. |
Response
Returns 204 No Content on success.
Examples
curl -X DELETE https://api.kraiter.com/api/campaigns/cmp_01H9.../sequences/onboarding \
-H "Authorization: Bearer YOUR_API_KEY"await kraiter.campaigns.removeSequence("cmp_01H9...", "onboarding");Add template to campaign
POST /api/campaigns/:id/templates/:tplIdAssociates a template with the campaign.
Path parameters
| Parameter | Type | Description |
|---|---|---|
id | string | The campaign ID. |
tplId | string | The template ID to add. |
Response
Returns the updated campaign.
Errors
| Code | Description |
|---|---|
NOT_FOUND | Campaign or template not found. |
CONFLICT | The template is already part of this campaign. |
Examples
curl -X POST https://api.kraiter.com/api/campaigns/cmp_01H9.../templates/launch-announcement \
-H "Authorization: Bearer YOUR_API_KEY"await kraiter.campaigns.addTemplate("cmp_01H9...", "launch-announcement");Remove template from campaign
DELETE /api/campaigns/:id/templates/:tplIdRemoves a template from the campaign. The template itself is not deleted.
Path parameters
| Parameter | Type | Description |
|---|---|---|
id | string | The campaign ID. |
tplId | string | The template ID to remove. |
Response
Returns 204 No Content on success.
Examples
curl -X DELETE https://api.kraiter.com/api/campaigns/cmp_01H9.../templates/launch-announcement \
-H "Authorization: Bearer YOUR_API_KEY"await kraiter.campaigns.removeTemplate("cmp_01H9...", "launch-announcement");