Delete Audience

v4

Deletes an audience or superaudience.

Request

Request syntax:

DELETE /audiences/{Audience ID}

Define the following variable when submitting the above request:

VariableDescription
Audience IDRequired. Identifies an audience by its system-defined or external ID. Use the Get Multiple Audiences endpoint to retrieve a list of audiences/superaudience and their IDs.

Response

A successful request returns a 200 OK response that contains the following properties:

NameData TypeDescription
@idStringIndicates the relative path to the requested endpoint.
@typeStringReturns Audience.
messageStringReturns Deleted.

Sample Request/Response

The code below (Python 3) shows how to delete an audience or superaudience.

This code imports names from the api_auth module for V4 APIs (see below).

import json, requests
from api_auth import APICredentials, APIParams
audience_id = 'Hak3zjnPLSW5o0j8GMpzRMsa' # Replace with the ID for the desired audience.

class DeleteAudience:
    def __init__(self):
        self.host = "https://services.uplynk.com"

    def run(self):
        """
        Deletes an audience.
        """
        self._delete_audience()

    def _delete_audience(self):
        url = "{}{}{}".format(self.host, "/api/v4/audiences/", audience_id)

        response = requests.delete(
            url, params=APIParams(APICredentials()).get_params({})
        )

        print(response.json())

DeleteAudience().run()

Response:

{
	"@id": "/api/v4/audiences/Hak3zjnPLSW5o0j8GMpzRMsa",
	"@type": "Audience",
	"message": "Deleted"
}