Audiences
Deprecated: Use Segments instead. Create and manage Audiences
Retrieve a list of audiences
GET /audiences
Deprecated
This route still works but is deprecated. Use Segments instead.
Deprecated: Use Segments instead. These endpoints still work, but will be removed in the future.
Example
curl -X GET "$SESAMESEND_URL/audiences" \
-H "Authorization: Bearer $OPENSEND_API_KEY"Responses
| Status | Description |
|---|---|
200 | OK |
{
"object": "list",
"data": [
{
"id": "78261eea-8f8b-4381-83c6-79fa7120f1cf",
"name": "Registered Users",
"created_at": "2023-10-06 22:59:55.977+00"
}
]
}Create a list of contacts
POST /audiences
Deprecated
This route still works but is deprecated. Use Segments instead.
Deprecated: Use Segments instead. These endpoints still work, but will be removed in the future.
Body
| Field | Type | Required | Description |
|---|---|---|---|
name | string | yes | The name of the audience you want to create. |
Example
curl -X POST "$SESAMESEND_URL/audiences" \
-H "Authorization: Bearer $OPENSEND_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"name": "string"
}'Responses
| Status | Description |
|---|---|
201 | OK |
{
"id": "78261eea-8f8b-4381-83c6-79fa7120f1cf",
"object": "audience",
"name": "Registered Users"
}Retrieve a single audience
GET /audiences/{id}
Deprecated
This route still works but is deprecated. Use Segments instead.
Not yet exercised
This route exists, but it has not yet returned a 2xx response to a real request on the reference instance (see PARITY.md in the repository). Treat its behavior as unverified.
Deprecated: Use Segments instead. These endpoints still work, but will be removed in the future.
Path parameters
| Name | Type | Required | Description |
|---|---|---|---|
id | string | yes | The Audience ID. |
Example
curl -X GET "$SESAMESEND_URL/audiences/<id>" \
-H "Authorization: Bearer $OPENSEND_API_KEY"Responses
| Status | Description |
|---|---|
200 | OK |
{
"id": "78261eea-8f8b-4381-83c6-79fa7120f1cf",
"object": "audience",
"name": "Registered Users",
"created_at": "2023-10-06 22:59:55.977+00"
}Remove an existing audience
DELETE /audiences/{id}
Deprecated
This route still works but is deprecated. Use Segments instead.
Deprecated: Use Segments instead. These endpoints still work, but will be removed in the future.
Path parameters
| Name | Type | Required | Description |
|---|---|---|---|
id | string | yes | The Audience ID. |
Example
curl -X DELETE "$SESAMESEND_URL/audiences/<id>" \
-H "Authorization: Bearer $OPENSEND_API_KEY"Responses
| Status | Description |
|---|---|
200 | OK |
{
"id": "78261eea-8f8b-4381-83c6-79fa7120f1cf",
"object": "audience",
"deleted": true
}