Mailmus

Campaigns

GET
/projects/{projectId}/campaigns
AuthorizationBearer <token>

In: header

Path Parameters

projectId*string

Response Body

application/json

curl -X GET "https://example.com/projects/string/campaigns"
[  {    "id": "string",    "name": "string",    "subject": "string",    "fromEmail": "contact@mail.exemple.com",    "fromName": "string",    "previewText": "string",    "status": "DRAFT",    "scheduledAt": "2019-08-24T14:15:22Z",    "sentAt": "2019-08-24T14:15:22Z",    "templateId": "string",    "domainId": "string",    "audienceId": "string",    "appId": "string",    "abTestEnabled": true,    "abTestSamplePercent": 0,    "abTestMetric": "OPEN_RATE",    "abTestDurationMinutes": 0,    "abTestStartedAt": "2019-08-24T14:15:22Z",    "createdAt": "2019-08-24T14:15:22Z",    "updatedAt": "2019-08-24T14:15:22Z"  }]
POST
/projects/{projectId}/campaigns
AuthorizationBearer <token>

In: header

Path Parameters

projectId*string

Request Body

application/json

TypeScript Definitions

Use the request body type in TypeScript.

Response Body

application/json

curl -X POST "https://example.com/projects/string/campaigns" \  -H "Content-Type: application/json" \  -d '{    "name": "Summer Newsletter",    "subject": "Our summer deals are here 🌞",    "fromEmail": "hello@yourdomain.com",    "templateId": "tpl_abc123",    "domainId": "dom_abc123",    "audienceId": "aud_abc123"  }'
{  "id": "string",  "name": "string",  "subject": "string",  "fromEmail": "contact@mail.exemple.com",  "fromName": "string",  "previewText": "string",  "status": "DRAFT",  "scheduledAt": "2019-08-24T14:15:22Z",  "sentAt": "2019-08-24T14:15:22Z",  "templateId": "string",  "domainId": "string",  "audienceId": "string",  "appId": "string",  "abTestEnabled": true,  "abTestSamplePercent": 0,  "abTestMetric": "OPEN_RATE",  "abTestDurationMinutes": 0,  "abTestStartedAt": "2019-08-24T14:15:22Z",  "createdAt": "2019-08-24T14:15:22Z",  "updatedAt": "2019-08-24T14:15:22Z"}
GET
/projects/{projectId}/campaigns/{id}
AuthorizationBearer <token>

In: header

Path Parameters

id*string
projectId*string

Response Body

application/json

curl -X GET "https://example.com/projects/string/campaigns/string"
{  "id": "string",  "name": "string",  "subject": "string",  "fromEmail": "contact@mail.exemple.com",  "fromName": "string",  "previewText": "string",  "status": "DRAFT",  "scheduledAt": "2019-08-24T14:15:22Z",  "sentAt": "2019-08-24T14:15:22Z",  "templateId": "string",  "domainId": "string",  "audienceId": "string",  "appId": "string",  "abTestEnabled": true,  "abTestSamplePercent": 0,  "abTestMetric": "OPEN_RATE",  "abTestDurationMinutes": 0,  "abTestStartedAt": "2019-08-24T14:15:22Z",  "createdAt": "2019-08-24T14:15:22Z",  "updatedAt": "2019-08-24T14:15:22Z",  "variants": [    {      "id": "string",      "campaignId": "string",      "name": "string",      "subject": "string",      "templateId": "string",      "weight": 0,      "isWinner": true,      "createdAt": "2019-08-24T14:15:22Z",      "stats": {        "sent": 0,        "opened": 0,        "clicked": 0,        "openRate": 0,        "clickRate": 0      }    }  ],  "stats": {    "total": 0,    "delivered": 0,    "opened": 0,    "clicked": 0,    "bounced": 0  }}
PATCH
/projects/{projectId}/campaigns/{id}
AuthorizationBearer <token>

In: header

Path Parameters

id*string
projectId*string

Request Body

application/json

TypeScript Definitions

Use the request body type in TypeScript.

Response Body

application/json

curl -X PATCH "https://example.com/projects/string/campaigns/string" \  -H "Content-Type: application/json" \  -d '{}'
{  "id": "string",  "name": "string",  "subject": "string",  "fromEmail": "contact@mail.exemple.com",  "fromName": "string",  "previewText": "string",  "status": "DRAFT",  "scheduledAt": "2019-08-24T14:15:22Z",  "sentAt": "2019-08-24T14:15:22Z",  "templateId": "string",  "domainId": "string",  "audienceId": "string",  "appId": "string",  "abTestEnabled": true,  "abTestSamplePercent": 0,  "abTestMetric": "OPEN_RATE",  "abTestDurationMinutes": 0,  "abTestStartedAt": "2019-08-24T14:15:22Z",  "createdAt": "2019-08-24T14:15:22Z",  "updatedAt": "2019-08-24T14:15:22Z"}
DELETE
/projects/{projectId}/campaigns/{id}
AuthorizationBearer <token>

In: header

Path Parameters

id*string
projectId*string

Response Body

application/json

curl -X DELETE "https://example.com/projects/string/campaigns/string"
{  "deleted": true}
POST
/projects/{projectId}/campaigns/{id}/cancel
AuthorizationBearer <token>

In: header

Path Parameters

id*string
projectId*string

Response Body

application/json

curl -X POST "https://example.com/projects/string/campaigns/string/cancel"
{  "id": "string",  "name": "string",  "subject": "string",  "fromEmail": "contact@mail.exemple.com",  "fromName": "string",  "previewText": "string",  "status": "DRAFT",  "scheduledAt": "2019-08-24T14:15:22Z",  "sentAt": "2019-08-24T14:15:22Z",  "templateId": "string",  "domainId": "string",  "audienceId": "string",  "appId": "string",  "abTestEnabled": true,  "abTestSamplePercent": 0,  "abTestMetric": "OPEN_RATE",  "abTestDurationMinutes": 0,  "abTestStartedAt": "2019-08-24T14:15:22Z",  "createdAt": "2019-08-24T14:15:22Z",  "updatedAt": "2019-08-24T14:15:22Z"}
POST
/projects/{projectId}/campaigns/{id}/ab-test/cancel
AuthorizationBearer <token>

In: header

Path Parameters

id*string
projectId*string

Response Body

application/json

curl -X POST "https://example.com/projects/string/campaigns/string/ab-test/cancel"
{  "id": "string",  "name": "string",  "subject": "string",  "fromEmail": "contact@mail.exemple.com",  "fromName": "string",  "previewText": "string",  "status": "DRAFT",  "scheduledAt": "2019-08-24T14:15:22Z",  "sentAt": "2019-08-24T14:15:22Z",  "templateId": "string",  "domainId": "string",  "audienceId": "string",  "appId": "string",  "abTestEnabled": true,  "abTestSamplePercent": 0,  "abTestMetric": "OPEN_RATE",  "abTestDurationMinutes": 0,  "abTestStartedAt": "2019-08-24T14:15:22Z",  "createdAt": "2019-08-24T14:15:22Z",  "updatedAt": "2019-08-24T14:15:22Z"}
POST
/projects/{projectId}/campaigns/{id}/ab-test/select-winner
AuthorizationBearer <token>

In: header

Path Parameters

id*string
projectId*string

Request Body

application/json

TypeScript Definitions

Use the request body type in TypeScript.

Response Body

application/json

curl -X POST "https://example.com/projects/string/campaigns/string/ab-test/select-winner" \  -H "Content-Type: application/json" \  -d '{    "variantId": "clx1234567890"  }'
{  "id": "string",  "name": "string",  "subject": "string",  "fromEmail": "contact@mail.exemple.com",  "fromName": "string",  "previewText": "string",  "status": "DRAFT",  "scheduledAt": "2019-08-24T14:15:22Z",  "sentAt": "2019-08-24T14:15:22Z",  "templateId": "string",  "domainId": "string",  "audienceId": "string",  "appId": "string",  "abTestEnabled": true,  "abTestSamplePercent": 0,  "abTestMetric": "OPEN_RATE",  "abTestDurationMinutes": 0,  "abTestStartedAt": "2019-08-24T14:15:22Z",  "createdAt": "2019-08-24T14:15:22Z",  "updatedAt": "2019-08-24T14:15:22Z"}
POST
/projects/{projectId}/campaigns/{id}/send
AuthorizationBearer <token>

In: header

Path Parameters

id*string
projectId*string

Response Body

application/json

curl -X POST "https://example.com/projects/string/campaigns/string/send"
{  "success": true}
POST
/projects/{projectId}/campaigns/{id}/test
AuthorizationBearer <token>

In: header

Path Parameters

id*string
projectId*string

Request Body

application/json

TypeScript Definitions

Use the request body type in TypeScript.

Response Body

application/json

curl -X POST "https://example.com/projects/string/campaigns/string/test" \  -H "Content-Type: application/json" \  -d '{    "to": "test@exemple.com"  }'
{  "success": true,  "sent": 0}
POST
/projects/{projectId}/campaigns/{id}/test-seed-list
AuthorizationBearer <token>

In: header

Path Parameters

id*string
projectId*string

Response Body

application/json

curl -X POST "https://example.com/projects/string/campaigns/string/test-seed-list"
{  "success": true,  "sent": 0}
POST
/projects/{projectId}/campaigns/{id}/duplicate
AuthorizationBearer <token>

In: header

Path Parameters

id*string
projectId*string

Response Body

application/json

curl -X POST "https://example.com/projects/string/campaigns/string/duplicate"
{  "id": "string",  "name": "string",  "subject": "string",  "fromEmail": "contact@mail.exemple.com",  "fromName": "string",  "previewText": "string",  "status": "DRAFT",  "scheduledAt": "2019-08-24T14:15:22Z",  "sentAt": "2019-08-24T14:15:22Z",  "templateId": "string",  "domainId": "string",  "audienceId": "string",  "appId": "string",  "abTestEnabled": true,  "abTestSamplePercent": 0,  "abTestMetric": "OPEN_RATE",  "abTestDurationMinutes": 0,  "abTestStartedAt": "2019-08-24T14:15:22Z",  "createdAt": "2019-08-24T14:15:22Z",  "updatedAt": "2019-08-24T14:15:22Z"}
GET
/projects/{projectId}/campaigns/{id}/sends/export
AuthorizationBearer <token>

In: header

Path Parameters

id*string
projectId*string

Response Body

text/csv

curl -X GET "https://example.com/projects/string/campaigns/string/sends/export"
"string"
GET
/projects/{projectId}/campaigns/{id}/sends
AuthorizationBearer <token>

In: header

Path Parameters

id*string
projectId*string

Query Parameters

status*string

Response Body

application/json

curl -X GET "https://example.com/projects/string/campaigns/string/sends?status=string"
{  "data": [    {      "id": "string",      "status": "QUEUED",      "messageId": "string",      "subject": "string",      "from": "string",      "deliveredAt": "2019-08-24T14:15:22Z",      "openedAt": "2019-08-24T14:15:22Z",      "clickedAt": "2019-08-24T14:15:22Z",      "bouncedAt": "2019-08-24T14:15:22Z",      "complainedAt": "2019-08-24T14:15:22Z",      "createdAt": "2019-08-24T14:15:22Z",      "contact": {        "id": "string",        "email": "string"      }    }  ],  "total": 0,  "page": 0,  "pages": 0}