Kraiter
API Reference

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/campaigns

Creates a new campaign.

Request body

FieldTypeRequiredDescription
namestringYesName of the campaign.
descriptionstringNoDescription 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

CodeDescription
VALIDATION_ERRORMissing 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/campaigns

Returns a paginated list of campaigns.

Query parameters

ParameterTypeDefaultDescription
cursorstringPagination cursor.
limitnumber20Number 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/:id

Returns a single campaign with its associated sequences and templates.

Path parameters

ParameterTypeDescription
idstringThe 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

CodeDescription
NOT_FOUNDNo 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/:id

Updates a campaign's name, description, or status.

Path parameters

ParameterTypeDescription
idstringThe campaign ID.

Request body

FieldTypeRequiredDescription
namestringNoNew campaign name.
descriptionstringNoNew description.
statusstringNoNew status: draft, active, or completed.

Campaign statuses

StatusDescription
draftThe campaign is being prepared.
activeThe campaign is live.
completedThe 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/:id

Permanently 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

CodeDescription
NOT_FOUNDNo 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/:seqId

Associates a sequence with the campaign.

Path parameters

ParameterTypeDescription
idstringThe campaign ID.
seqIdstringThe sequence ID to add.

Response

Returns the updated campaign.

Errors

CodeDescription
NOT_FOUNDCampaign or sequence not found.
CONFLICTThe 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/:seqId

Removes a sequence from the campaign. The sequence itself is not deleted.

Path parameters

ParameterTypeDescription
idstringThe campaign ID.
seqIdstringThe 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/:tplId

Associates a template with the campaign.

Path parameters

ParameterTypeDescription
idstringThe campaign ID.
tplIdstringThe template ID to add.

Response

Returns the updated campaign.

Errors

CodeDescription
NOT_FOUNDCampaign or template not found.
CONFLICTThe 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/:tplId

Removes a template from the campaign. The template itself is not deleted.

Path parameters

ParameterTypeDescription
idstringThe campaign ID.
tplIdstringThe 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");