Developers

Platform API

Audiences

Get all audiences

GET /audiences?accountId=1

This request returns an array containing all active single and multiple workspace audiences for an account. Details for each audience include:

  • name / external_name - The names for the audience shown within the mParticle dashboard and to external platforms.
  • id - the unique mParticle identifier for the audience.
  • is_calculated - true if boolean logic is used to build the audience.
  • connected_outputs - A list of each output platform the audience is currently connected to.
  • workspaces - A list of workspace objects that this audience is calculated from.

Example cURL request

curl \
  -X GET \
  -H "Authorization: Bearer YWIxMjdi883GHBBDnjsdKAJQxNjdjYUUJABbg6hdI.8V6HhxW-" \
  "https://api.mparticle.com/v1/audiences?accountId=1"

Response

[
    {
        "name": "Abandoned Cart",
        "external_name": "Abandoned Cart",
        "size": 342,
        "created_by": "jsmith",
        "last_modified_by": "mmann",
        "last_modified_on": "2017-01-12T17:27:34.387",
        "is_calculated": false,
        "added_last_24_hours": 10,
        "dropped_last_24_hours": 7,
        "status": "active",
        "workspaces": [
            {
                "name": "First Workspace",
                "id": 123,
                "data_type": "workspace",
                "created_on": "2016-05-09T18:27:57.337"
            },
            {
                "name": "Second Workspace",
                "id": 456,
                "data_type": "workspace",
                "created_on": "2016-05-09T18:27:57.337"
            }
        ],
        "connected_outputs": [
            {
                "provider_name": "Mixpanel",
                "configurations": [
                {
                    "name": "Prod"
                }
                ],
                "data_type": "audience_output"
            },
            {
                "provider_name": "ActionX",
                "configurations": [
                {
                    "name": "Dev"
                }
                ],
                "data_type": "audience_output"
            }
        ],
        "data_type": "audience",
        "id": 7622
    }
]

Get all audiences for a workspace

GET /workspace/1/audiences?accountId=1

This request returns an array containing all active single workspace audiences for an account.

Example cURL request

curl \
  -X GET \
  -H "Authorization: Bearer YWIxMjdi883GHBBDnjsdKAJQxNjdjYUUJABbg6hdI.8V6HhxW-" \
  "https://api.mparticle.com/v1/workspace/1/audiences?accountId=1"

Response

[
    {
        "name": "Abandoned Cart",
        "external_name": "Abandoned Cart",
        "size": 342,
        "created_by": "jsmith",
        "last_modified_by": "mmann",
        "last_modified_on": "2017-01-12T17:27:34.387",
        "is_calculated": false,
        "added_last_24_hours": 10,
        "dropped_last_24_hours": 7,
        "status": "active",
        "workspaces": [
            {
                "name": "First Workspace",
                "id": 1,
                "data_type": "workspace",
                "created_on": "2016-05-09T18:27:57.337"
            }
        ],
        "connected_outputs": [
            {
                "provider_name": "Mixpanel",
                "configurations": [
                {
                    "name": "Prod"
                }
                ],
                "data_type": "audience_output"
            },
            {
                "provider_name": "ActionX",
                "configurations": [
                {
                    "name": "Dev"
                }
                ],
                "data_type": "audience_output"
            }
        ],
        "data_type": "audience",
        "id": 7622
    }
]

Delete an audience

DELETE /audiences/<audience_id>?accountId=1

Deletes an audience. The Audience ID is a 4-digit number available as the "id" node in the Get All Audiences for an Account response.

Example cURL request

curl \
  -X DELETE \
  -H "Authorization: Bearer YWIxMjdi883GHBBDnjsdKAJQxNjdjYUUJABbg6hdI.8V6HhxW-" \
  "https://api.mparticle.com/v1/audiences/7239?accountId=1"

Was this page helpful?