Appearance
Campaigns
APIs for managing email campaigns (drafts) in your Lindris account.
As a reminder, all requests must be authenticated and use the base URL: https://api.lindris.com
List campaigns
GETapi/campaignsRetrieve a paginated list of campaigns. Defaults to draft campaigns when no status filter is provided.
Query Parameters
statusstring optional - A single campaign status to filter by, orallfor every status. Defaults todraftwhen omitted. Filtering bysendingincludes campaigns in thepreparingsub-state. Example:sent- Must be one of:
draftsentscheduledsendingpausedfailedall
- Must be one of:
pageinteger optional - Page number for pagination. Defaults to 1. Example:2perPageinteger optional - Number of items per page. Defaults to 10, maximum 100. Example:25sortstring optional - Field to sort by. Defaults to the backend's per-status order. Example:createdAt- Must be one of:
namestatuscreatedAt
- Must be one of:
orderstring optional - Sort direction (requiressort). Defaults todesc. Example:desc- Must be one of:
ascdesc
- Must be one of:
Request
bash
curl --request GET \
--get "https://api.lindris.com/api/campaigns?status=sent&page=2&perPage=25&sort=createdAt&order=desc" \
--header "Authorization: Bearer {YOUR_API_KEY}" \
--header "Content-Type: application/json"php
$client = new \GuzzleHttp\Client();
$url = 'https://api.lindris.com/api/campaigns';
$response = $client->get(
$url,
[
'headers' => [
'Authorization' => 'Bearer {YOUR_API_KEY}',
'Content-Type' => 'application/json',
],
'query' => [
'status' => 'sent',
'page' => '2',
'perPage' => '25',
'sort' => 'createdAt',
'order' => 'desc',
],
]
);
$body = $response->getBody();
print_r(json_decode((string) $body));javascript
const url = new URL(
"https://api.lindris.com/api/campaigns"
);
const params = {
"status": "sent",
"page": "2",
"perPage": "25",
"sort": "createdAt",
"order": "desc",
};
Object.keys(params)
.forEach(key => url.searchParams.append(key, params[key]));
const headers = {
"Authorization": "Bearer {YOUR_API_KEY}",
"Content-Type": "application/json",
"Accept": "application/json",
};
fetch(url, {
method: "GET",
headers,
}).then(response => response.json());Responses
json
{
"data": [
{
"id": 123,
"name": "My Newsletter",
"status": "draft",
"builderReviewed": false,
"createdAt": "2024-01-19T08:30:00+00:00",
"scheduledAt": null,
"sentAt": null,
"links": {
"campaignUrl": "https://app.lindris.com/campaigns/123",
"editorUrl": "https://app.lindris.com/emails/campaigns/123"
}
}
],
"meta": {
"currentPage": 1,
"lastPage": 1,
"from": 1,
"to": 1,
"total": 1,
"perPage": 10,
"path": "/api/campaigns"
},
"links": {
"next": null,
"prev": null,
"first": "/api/campaigns?page=1",
"last": "/api/campaigns?page=1"
}
}json
{
"message": "Unauthenticated"
}Create campaign draft
POSTapi/campaignsCreate a new campaign draft. You may optionally provide a templateId to pre-populate the email content from a saved template. To duplicate an existing campaign, use POST /campaigns/{id}/clone.
Request Body
namestring required - The campaign name. Example:My NewslettertemplateIdstring optional - The ID of an email template to use as the starting content.
Request
bash
curl --request POST \
"https://api.lindris.com/api/campaigns" \
--header "Authorization: Bearer {YOUR_API_KEY}" \
--header "Content-Type: application/json" \
--data "{
\"name\": \"My Newsletter\"
}"php
$client = new \GuzzleHttp\Client();
$url = 'https://api.lindris.com/api/campaigns';
$response = $client->post(
$url,
[
'headers' => [
'Authorization' => 'Bearer {YOUR_API_KEY}',
'Content-Type' => 'application/json',
],
'json' => [
'name' => 'My Newsletter',
],
]
);
$body = $response->getBody();
print_r(json_decode((string) $body));javascript
const url = new URL(
"https://api.lindris.com/api/campaigns"
);
const headers = {
"Authorization": "Bearer {YOUR_API_KEY}",
"Content-Type": "application/json",
"Accept": "application/json",
};
let body = {
"name": "My Newsletter"
};
fetch(url, {
method: "POST",
headers,
body: JSON.stringify(body),
}).then(response => response.json());Responses
json
{
"data": {
"id": 123,
"name": "My Newsletter",
"status": "draft",
"subject": "Welcome to our newsletter",
"previewText": "Read our latest updates inside",
"sender": {
"name": "Acme Corp",
"email": "[email protected]"
},
"replyTo": {
"name": "Acme Support",
"email": "[email protected]"
},
"builderReviewed": false,
"createdAt": "2024-01-19T08:30:00+00:00",
"scheduledAt": null,
"sentAt": null,
"links": {
"campaignUrl": "https://app.lindris.com/campaigns/123",
"editorUrl": "https://app.lindris.com/emails/campaigns/123"
}
}
}json
{
"message": "The name field is required.",
"errors": {
"name": [
"The name field is required."
]
}
}json
{
"message": "The selected template does not exist.",
"errors": {
"templateId": [
"The selected template does not exist."
]
}
}Clone campaign
POSTapi/campaigns/{id}/cloneDuplicate an existing campaign into a new draft, copying its content and targeting.
URL Parameters
idinteger required - The ID of the campaign to duplicate. Example:123
Request Body
namestring optional - Name for the new campaign. Defaults to a "Copy of …" name when omitted. Example:My Newsletter (copy)
Request
bash
curl --request POST \
"https://api.lindris.com/api/campaigns/123/clone" \
--header "Authorization: Bearer {YOUR_API_KEY}" \
--header "Content-Type: application/json" \
--data "{
\"name\": \"My Newsletter (copy)\"
}"php
$client = new \GuzzleHttp\Client();
$url = 'https://api.lindris.com/api/campaigns/123/clone';
$response = $client->post(
$url,
[
'headers' => [
'Authorization' => 'Bearer {YOUR_API_KEY}',
'Content-Type' => 'application/json',
],
'json' => [
'name' => 'My Newsletter (copy)',
],
]
);
$body = $response->getBody();
print_r(json_decode((string) $body));javascript
const url = new URL(
"https://api.lindris.com/api/campaigns/123/clone"
);
const headers = {
"Authorization": "Bearer {YOUR_API_KEY}",
"Content-Type": "application/json",
"Accept": "application/json",
};
let body = {
"name": "My Newsletter (copy)"
};
fetch(url, {
method: "POST",
headers,
body: JSON.stringify(body),
}).then(response => response.json());Responses
json
{
"data": {
"id": 123,
"name": "My Newsletter",
"status": "draft",
"subject": "Welcome to our newsletter",
"previewText": "Read our latest updates inside",
"sender": {
"name": "Acme Corp",
"email": "[email protected]"
},
"replyTo": {
"name": "Acme Support",
"email": "[email protected]"
},
"builderReviewed": false,
"createdAt": "2024-01-19T08:30:00+00:00",
"scheduledAt": null,
"sentAt": null,
"links": {
"campaignUrl": "https://app.lindris.com/campaigns/123",
"editorUrl": "https://app.lindris.com/emails/campaigns/123"
}
}
}json
{
"message": "Campaign not found"
}Get campaign details
GETapi/campaigns/{id}Retrieve a single campaign by its ID, including its builder-reviewed status and current campaign status.
URL Parameters
idinteger required - The campaign ID. Example:123
Response Fields
dataarrayidinteger optional - The unique identifier for the campaign. Example: 123namestring optional - The campaign name. Example: My Newsletterstatusstring optional - The current campaign status. Enum: draft,sent,scheduled,sending,preparing,paused,failed Example: draftsubjectstring optional - The email subject line. Example: Welcome to our newsletterpreviewTextstring optional - The email preview text shown in inbox previews. Example: Read our latest updates
senderobject optional - Sender details.namestring optional - The sender display name. Example: Acme Corpemailstring optional - The sender email address. No-example
replyToobject optional - Reply-to details.namestring optional - The reply-to display name. Example: Acme Supportemailstring optional - The reply-to email address. No-examplebuilderReviewedboolean optional - Whether the email content has been reviewed in the email builder. Example: falsecreatedAtstring optional - ISO 8601 datetime when the campaign was created. Example: 2024-01-19T08:30:00+00:00scheduledAtstring optional - ISO 8601 datetime when the campaign is scheduled to send (null if not scheduled). Example: 2024-02-01T10:00:00+00:00sentAtstring optional - ISO 8601 datetime when the campaign finished sending (null if not sent). Example: 2024-01-25T14:32:00+00:00
linksobject optional - UI handoff links for this campaign.campaignUrlstring optional - URL to the campaign management page. Example: https://app.lindris.com/campaigns/123editorUrlstring optional - URL to the email editor for this campaign. Example: https://app.lindris.com/emails/campaigns/123
Request
bash
curl --request GET \
--get "https://api.lindris.com/api/campaigns/123" \
--header "Authorization: Bearer {YOUR_API_KEY}" \
--header "Content-Type: application/json"php
$client = new \GuzzleHttp\Client();
$url = 'https://api.lindris.com/api/campaigns/123';
$response = $client->get(
$url,
[
'headers' => [
'Authorization' => 'Bearer {YOUR_API_KEY}',
'Content-Type' => 'application/json',
],
]
);
$body = $response->getBody();
print_r(json_decode((string) $body));javascript
const url = new URL(
"https://api.lindris.com/api/campaigns/123"
);
const headers = {
"Authorization": "Bearer {YOUR_API_KEY}",
"Content-Type": "application/json",
"Accept": "application/json",
};
fetch(url, {
method: "GET",
headers,
}).then(response => response.json());Responses
json
{
"data": {
"id": 123,
"name": "My Newsletter",
"status": "draft",
"subject": "Welcome to our newsletter",
"previewText": "Read our latest updates inside",
"sender": {
"name": "Acme Corp",
"email": "[email protected]"
},
"replyTo": {
"name": "Acme Support",
"email": "[email protected]"
},
"builderReviewed": false,
"createdAt": "2024-01-19T08:30:00+00:00",
"scheduledAt": null,
"sentAt": null,
"links": {
"campaignUrl": "https://app.lindris.com/campaigns/123",
"editorUrl": "https://app.lindris.com/emails/campaigns/123"
}
}
}json
{
"message": "Campaign not found"
}Update campaign
PUTapi/campaigns/{id}Update one or more fields of an existing campaign. All fields are optional, but at least one must be provided.
URL Parameters
idinteger required - The campaign ID. Example:123
Request Body
namestring optional - The campaign name.- Example:
My Updated Newsletter
- Example:
subjectstring optional - The email subject line.- Example:
Big sale — don't miss out!
- Example:
previewTextstring optional - The email preview text.- Example:
Up to 50% off this weekend only
- Example:
senderobject optional - Sender configuration.
Example: []
* `name` <small class="prop-details"> string _optional_</small> - The sender display name.
Example: `Acme Marketing`
* `email` <small class="prop-details"> string _optional_</small> - The sender email address.
replyToobject optional - Reply-to configuration.
Example: []
* `name` <small class="prop-details"> string _optional_</small> - The reply-to display name.
Example: `Acme Support`
* `email` <small class="prop-details"> string _optional_</small> - The reply-to email address.
Request
bash
curl --request PUT \
"https://api.lindris.com/api/campaigns/123" \
--header "Authorization: Bearer {YOUR_API_KEY}" \
--header "Content-Type: application/json" \
--data "{
\"name\": \"My Updated Newsletter\",
\"subject\": \"Big sale — don\'t miss out!\",
\"previewText\": \"Up to 50% off this weekend only\",
\"sender\": {
\"name\": \"Acme Marketing\"
},
\"replyTo\": {
\"name\": \"Acme Support\"
}
}"php
$client = new \GuzzleHttp\Client();
$url = 'https://api.lindris.com/api/campaigns/123';
$response = $client->put(
$url,
[
'headers' => [
'Authorization' => 'Bearer {YOUR_API_KEY}',
'Content-Type' => 'application/json',
],
'json' => [
'name' => 'My Updated Newsletter',
'subject' => 'Big sale — don\'t miss out!',
'previewText' => 'Up to 50% off this weekend only',
'sender' => [
'name' => 'Acme Marketing',
],
'replyTo' => [
'name' => 'Acme Support',
],
],
]
);
$body = $response->getBody();
print_r(json_decode((string) $body));javascript
const url = new URL(
"https://api.lindris.com/api/campaigns/123"
);
const headers = {
"Authorization": "Bearer {YOUR_API_KEY}",
"Content-Type": "application/json",
"Accept": "application/json",
};
let body = {
"name": "My Updated Newsletter",
"subject": "Big sale — don't miss out!",
"previewText": "Up to 50% off this weekend only",
"sender": {
"name": "Acme Marketing"
},
"replyTo": {
"name": "Acme Support"
}
};
fetch(url, {
method: "PUT",
headers,
body: JSON.stringify(body),
}).then(response => response.json());Responses
json
{
"data": {
"id": 123,
"name": "My Newsletter",
"status": "draft",
"subject": "Welcome to our newsletter",
"previewText": "Read our latest updates inside",
"sender": {
"name": "Acme Corp",
"email": "[email protected]"
},
"replyTo": {
"name": "Acme Support",
"email": "[email protected]"
},
"builderReviewed": false,
"createdAt": "2024-01-19T08:30:00+00:00",
"scheduledAt": null,
"sentAt": null,
"links": {
"campaignUrl": "https://app.lindris.com/campaigns/123",
"editorUrl": "https://app.lindris.com/emails/campaigns/123"
}
}
}json
{
"message": "Campaign not found"
}json
{
"message": "At least one field must be provided for update.",
"errors": {
"_body": [
"At least one field must be provided for update."
]
}
}json
{
"message": "Only draft campaigns can be updated.",
"errors": {
"status": [
"Only draft campaigns can be updated."
]
}
}Delete campaign
DELETEapi/campaigns/{id}Permanently delete a campaign by its ID. Campaigns of any status can be deleted (draft, scheduled, paused, sent, failed) except one that is actively sending, which is rejected to avoid disrupting an in-progress send.
URL Parameters
idinteger required - The campaign ID. Example:123
Request
bash
curl --request DELETE \
"https://api.lindris.com/api/campaigns/123" \
--header "Authorization: Bearer {YOUR_API_KEY}" \
--header "Content-Type: application/json"php
$client = new \GuzzleHttp\Client();
$url = 'https://api.lindris.com/api/campaigns/123';
$response = $client->delete(
$url,
[
'headers' => [
'Authorization' => 'Bearer {YOUR_API_KEY}',
'Content-Type' => 'application/json',
],
]
);
$body = $response->getBody();
print_r(json_decode((string) $body));javascript
const url = new URL(
"https://api.lindris.com/api/campaigns/123"
);
const headers = {
"Authorization": "Bearer {YOUR_API_KEY}",
"Content-Type": "application/json",
"Accept": "application/json",
};
fetch(url, {
method: "DELETE",
headers,
}).then(response => response.json());Responses
text
(No response body)json
{
"message": "Campaign not found"
}json
{
"message": "Campaigns that are currently sending cannot be deleted.",
"errors": {
"status": [
"Campaigns that are currently sending cannot be deleted."
]
}
}