Mailmus

Audiences

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

In: header

Path Parameters

projectId*string

Response Body

application/json

curl -X GET "https://example.com/projects/string/audiences"
[  {    "id": "string",    "name": "string",    "type": "STATIC",    "rules": {},    "appId": "string",    "createdAt": "2019-08-24T14:15:22Z"  }]
POST
/projects/{projectId}/audiences
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/audiences" \  -H "Content-Type: application/json" \  -d '{    "name": "Newsletter subscribers"  }'
{  "id": "string",  "name": "string",  "type": "STATIC",  "rules": {},  "appId": "string",  "createdAt": "2019-08-24T14:15:22Z"}
GET
/projects/{projectId}/audiences/{id}
AuthorizationBearer <token>

In: header

Path Parameters

id*string
projectId*string

Response Body

application/json

curl -X GET "https://example.com/projects/string/audiences/string"
{  "id": "string",  "name": "string",  "type": "STATIC",  "rules": {},  "appId": "string",  "createdAt": "2019-08-24T14:15:22Z"}
PATCH
/projects/{projectId}/audiences/{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/audiences/string" \  -H "Content-Type: application/json" \  -d '{    "name": "Clients VIP"  }'
{  "id": "string",  "name": "string",  "type": "STATIC",  "rules": {},  "appId": "string",  "createdAt": "2019-08-24T14:15:22Z"}
DELETE
/projects/{projectId}/audiences/{id}
AuthorizationBearer <token>

In: header

Path Parameters

id*string
projectId*string

Response Body

application/json

curl -X DELETE "https://example.com/projects/string/audiences/string"
{  "deleted": true}
PATCH
/projects/{projectId}/audiences/{id}/rules
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/audiences/string/rules" \  -H "Content-Type: application/json" \  -d '{    "match": "all",    "conditions": [      {        "field": "plan",        "operator": "eq",        "value": "pro"      }    ]  }'
{  "added": 0,  "removed": 0}
POST
/projects/{projectId}/audiences/{id}/recompute
AuthorizationBearer <token>

In: header

Path Parameters

id*string
projectId*string

Response Body

application/json

curl -X POST "https://example.com/projects/string/audiences/string/recompute"
{  "added": 0,  "removed": 0}
GET
/projects/{projectId}/audiences/{id}/contacts
AuthorizationBearer <token>

In: header

Path Parameters

id*string
projectId*string

Response Body

application/json

curl -X GET "https://example.com/projects/string/audiences/string/contacts"
{  "data": [    {      "id": "string",      "email": "contact@exemple.com",      "attributes": {},      "unsubscribed": true,      "appId": "string",      "createdAt": "2019-08-24T14:15:22Z",      "updatedAt": "2019-08-24T14:15:22Z"    }  ],  "total": 0,  "page": 0,  "pages": 0}
POST
/projects/{projectId}/audiences/{id}/contacts
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/audiences/string/contacts" \  -H "Content-Type: application/json" \  -d '{    "contactId": "con_abc123"  }'
{  "audienceId": "string",  "contactId": "string"}
POST
/projects/{projectId}/audiences/{id}/contacts/by-email
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/audiences/string/contacts/by-email" \  -H "Content-Type: application/json" \  -d '{    "email": "user@example.com"  }'
{  "audienceId": "string",  "contactId": "string"}
POST
/projects/{projectId}/audiences/{id}/contacts/bulk-email
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/audiences/string/contacts/bulk-email" \  -H "Content-Type: application/json" \  -d '{}'
{  "added": 0,  "skipped": 0}
DELETE
/projects/{projectId}/audiences/{id}/contacts/{contactId}
AuthorizationBearer <token>

In: header

Path Parameters

id*string
contactId*string
projectId*string

Response Body

application/json

curl -X DELETE "https://example.com/projects/string/audiences/string/contacts/string"
{  "audienceId": "string",  "contactId": "string"}