The Audience API helps LiveIntent partners to programmatically exchange data for creating and managing audiences. The API enables a high level of automation, which helps LiveIntent partners increase efficiency, reduce labor requirements, and improve audience delivery time.
As a LiveIntent partner, you can leverage the Audience API to create and manage Custom Audience. This API supports the HTTP GET, POST, and PATCH methods. The following sections describe how to call the endpoints.
The LiveIntent Audience API utilizes access tokens for request authentication. These access tokens grant you the necessary privileges to access the Audience API endpoints, allowing LiveIntent to identify the sender of a request and verify their access rights.
To get an access token, contact your account team at LiveIntent. Then use the provided access token as a bearer token in the Authorization header when sending request to any of the endpoints.
The Audience API currently supports creation and management of Custom Audiences. A Custom Audience lets you upload first-party data (either emails or mobile identifiers) that you wish to target or suppress across LiveIntent’s ad exchange. Email identifiers can be hashed or unhashed. For more information on Custom Audiences, please visit our Knowledge Base.
The Audience API offers a collection of endpoints for accessing and maintaining your Custom Audiences. The API reference section of this document describes the elements of each endpoint.
A Custom Audience may contain three different types of identifiers which are as follows.
Id type | Description |
---|---|
EMAIL_HASH | Use when uploading MD5, SHA-1, SHA-2, and unhashed emails |
AAID | Google advertising identifier for Android devices |
IDFA | Apple identifier for advertisers |
To set up a functional Custom Audience, perform the steps below.
Typically, you will create your Custom Audience and then add a list of customers that you wish to target or suppress. Use this guide when preparing the audience file. The information here can also be helpful for troubleshooting issues with audience files.
Consider the following guidelines when preparing your audience file for upload.
The following file excerpt is an example of correctly formatted email hashes:
D5f0726215cdf6d9dbf7f5fa43c47850
A1568e8c0d8faff3fc0ec7d612531189
F0754457d38013a31be0766eb1d97e0c
J5e1043d20ce435f9c54b6a202ed299c
The following file excerpt is an example of incorrectly formatted email hashes that include spaces and more than one hash on a line:
D5f0726215cdf6d9dbf7f5fa43c47850 A1568e8c0d8faff3fc0ec7d612531189
F0754457d38013a31be0766eb1d97e0c
J5e1043 d20ce435f9 c54b6a202ed299c
If you upload email hashes, please make sure each hash conform to the following standard character length:
There are no limits to the number of identifiers that you can send in a single file upload. However, we recommend that you keep your upload file moderately large.
If you are unable to successfully upload your audience files, and have confirmed the file follows the formatting guidelines,, please reach out to your LiveIntent team.
The information in this section will help you successfully initiate an audience file upload.
Follow the steps in this guide to successfully upload your audience file.
Start by getting your audience file ready. See Preparing audience upload file.
The supported file formats are text/csv
, text/plain
, application/zip
.
Before you upload a file, get a signed URL. The signed URL is a string granted as time-limited permission for making a request. The signed URL contains authenticated information in its query string and gives you the right access to perform specific upload actions. To obtain the right access for the operation you are trying to perform, specify the appropriate value for the action parameter when generating a signed URL.
The following table describes the supported file upload actions.
Action | Description |
---|---|
ADD | Adds identifiers to a specified audienceId. |
REMOVE | Removes identifiers from a specified audienceId. |
REPLACE | Replaces all identifiers of a specified audienceId with the content of an upload file. |
The following is an example cURL request showing the pre-signed URL with data in the request’s body:
curl --request PUT --url "https://raw-audience-uploads.s3.amazonaws.com/upload/2021-01-13/123456/add/96c483ba6b1234549f9b6854606c4d9d/353cee92-172d-44b6-ac56-2f4cab34371a?x-amz-meta-type=email-hash&x-amz-meta-segment-id=166997&x-amz-meta-unique-segment-id=166997&x-amz-meta-action=add&X-Amz-Security-Token=IQoJb3JpZ2luX2VjEN%2F%2F%2F%2F%2F%2F%2F%2F%2F%2F%2FwEaCXVzLWVhc6QtMSJHMEUCIDFy8qyHu0V8%2BazVtqaW1GtWHt9C9VJa%2B5By1ZTKTLz7AiEAjpDiimeHkIh67bUFLMw34JfrtiSPXEzo6Iye6hMzL2Mq%2BgMIFxAAGgw0MjU5Mz756RHlkCBqZci49QZ77eri9Rw2lPpmZgFz5VGWkrydBDBujet2%2Bg1B16w75hO9DCFsQOw%3D%3D&X-Amz-Algorithm=AWS4-HMAC-SHA256&X-Amz-Date=20210113T142421Z&X-Amz-SignedHeaders=host&X-Amz-Expires=3599&X-Amz-Credential=ASIAWGK5HWMJGBBHLOWB%2F20210823%2Fus-east-1%2Fs3%2Faws4_request&X-Amz-Signature=d07c43827c5599625dd13ad45ebed3b264f4447cf14ab3711ab0c4ac607cca07"
--data "d8e8fca2dc0f896fd7cb4cb0031ba249" -H "Content-Type: text/csv"
The following is an example cURL request showing the pre-signed URL with file upload:
curl --request PUT --url "https://raw-audience-uploads-staging.s3.amazonaws.com/upload/2021-12-20/167192/add/84a72f3a33014f39a39a079ae9bffea1/test_signed2?x-amz-meta-type=email-hash&x-amz-meta-segment-id=167192&x-amz-meta-unique-segment-id=167192&x-amz-meta-action=add&X-Amz-Security-Token=FwoGZXIvYXdzEBcaDFXeN%2BOHzkbW1fYg3SKtAeqASMxIILTzy9SFP5bNQcUyc0WPBg%2FEetiwdR6nZRLa9IyiTvSTmk2VNReNjdpR2EYap5gIuIgnoCLSxEFpbQv7MDFGvE6oYLiJWFoSHvcOeNWg6L3zLhgk1NTHtRbsMtlHud7BqUNvCw5ybBirRnNALKnb0hUAl5r3B3uz%2FjrB6IENx9S1AVJTY%2BNoAZak%2B1dScw8XCgh9GFkFPKUtO0yDcUyxziq2HZTWGGGyKOmZgo4GMi02j4Noc3o2iuWWz6x4n3CjgURoJqW3bw7JdAQHAN6ngmZtjDTAPWuT%2FkdthAc%3D&X-Amz-Algorithm=AWS4-HMAC-SHA256&X-Amz-Date=20211220T143929Z&X-Amz-SignedHeaders=host&X-Amz-Expires=3600&X-Amz-Credential=ASIAWGK5HWMJJQPTEGWW%2F20211220%2Fus-east-1%2Fs3%2Faws4_request&X-Amz-Signature=895ea80bcf5399e7e492df64177102e4bb321f6df75f8495f238681318677f39" \
-T identifiers.zip -H "Content-Type: application/zip"
This endpoint lets you create an audience for a specified accountId. The operation returns an identifier of a newly created audience.
This resource lets you create a Custom Audience. It takes in only the request body in JSON format (no query parameters).
dataProviderId required | integer <int64> Enum: 84 101 |
name required | string |
accountId required | integer <int64> Specify your LiveIntent account identifier. |
object |
{- "dataProviderId": 84,
- "name": "string",
- "accountId": 0,
- "metadata": {
- "property1": {
- "data": null
}, - "property2": {
- "data": null
}
}
}
{- "id": 0,
- "name": "string",
- "accountId": 0,
- "dataProviderId": 0,
- "createdAt": "2019-08-24T14:15:22Z",
- "updatedAt": "2019-08-24T14:15:22Z",
- "status": "ACTIVE",
- "metadata": {
- "updatedAt": "2019-08-24T14:15:22Z",
- "data": null
}
}
Use this resource to update an audience name.
audienceId required | integer <int64> (AudienceId) Specify an audience you would like to modify its name. |
name | string Assign a new name to the specified audienceId. |
{- "name": "string"
}
{- "id": 0,
- "name": "string",
- "accountId": 0,
- "dataProviderId": 0,
- "createdAt": "2019-08-24T14:15:22Z",
- "updatedAt": "2019-08-24T14:15:22Z",
- "status": "ACTIVE",
- "metadata": {
- "updatedAt": "2019-08-24T14:15:22Z",
- "data": null
}
}
This endpoint lets you generate a signed URL that provides permission for modifying the members of an audience by uploading a file containing common types of user identifiers. See the Using a pre-signed URL guide for details of how to proceed after obtaining a signed URL. The operation returns an optional processing report to the notificationEmail address you provide.
audienceId required | integer <int64> (AudienceId) The identifier of the audience to which you are uploading the user identifiers. |
uploadName | string Name of the file you want to send to a signed URL. The file name will be used as a key when the content is stored. If not specified, a random name will be generated. |
notificationEmail | string Assign an email address for receiving the processing report once the file processing has completed. |
identifierType required | string Enum: "EMAIL_HASH" "AAID" "IDFA" The type of user identifier. Specify the type of user identifier you would like to upload. |
action required | string Enum: "ADD" "REMOVE" "REPLACE" Specify the action type to be performed on a given audienceId, in terms of whether the identifiers in the file be added or removed from an audience or entirely replace the audience. |
{- "uploadName": "string",
- "notificationEmail": "string",
- "identifierType": "EMAIL_HASH",
- "action": "ADD"
}
{- "signedUrl": "string"
}
This resource lets you query the endpoint for all the audiences in an account. The operation returns descriptive information about each audience.
pageSize | integer >= 0 Default: 30 The number of records per page. Use if you expect large response data. |
page required | integer >= 1 Specify the maximum number of page to be returned. |
updatedAfter | string <date-time> Only return audiences that were updated after this point in time. This should be an ISO 8601 date string in UTC (Zulu) time zone. |
{- "entries": [
- {
- "id": 0,
- "name": "string",
- "accountId": 0,
- "dataProviderId": 0,
- "createdAt": "2019-08-24T14:15:22Z",
- "updatedAt": "2019-08-24T14:15:22Z",
- "status": "ACTIVE",
- "metadata": {
- "updatedAt": "2019-08-24T14:15:22Z",
- "data": null
}
}
], - "page": 0,
- "pageSize": 0,
- "totalCount": 0
}
This resource lets you query the endpoint for information about a specific audience in an account.
audienceId required | integer <int64> (AudienceId) Specify the audience identifier for which you are requesting information. |
{- "id": 0,
- "name": "string",
- "accountId": 0,
- "dataProviderId": 0,
- "createdAt": "2019-08-24T14:15:22Z",
- "updatedAt": "2019-08-24T14:15:22Z",
- "status": "ACTIVE",
- "metadata": {
- "updatedAt": "2019-08-24T14:15:22Z",
- "data": null
}
}
Use this resource to obtain the number of active identifiers (match
) and the total number of identifiers (total
) that belong to the specified audienceId.
audienceId required | integer <int64> (AudienceId) Specify the audience identifier for which you are requesting count information. |
{- "entries": [
- {
- "date": "2019-08-24",
- "total": 0,
- "match": 0
}
]
}
Use this endpoint to get file upload information by passing in the corresponding audienceId. The endpoint returns a history of the file upload that has been previously uploaded to the specified audienceId.
audienceId required | integer <int64> (AudienceId) Specify the audience identifier for which you are requesting file upload history. |
pageSize | integer >= 0 Default: 30 The number of records per page. Use if you expect large response data. |
page required | integer >= 1 Specify the maximum number of page to be returned. |
{- "entries": [
- {
- "status": "string",
- "action": "ADD",
- "uploadType": "EMAIL_HASH",
- "notificationEmail": "string",
- "lastUpdate": "2019-08-24T14:15:22Z",
- "scheduledAt": "2019-08-24T14:15:22Z",
- "estimatedDuplicateCount": 0,
- "uploadedHashesCount": 0,
- "invalidHashesCount": 0
}
], - "page": 0,
- "pageSize": 0,
- "totalCount": 0
}
Use this endpoint to retrieve audiences using a more sophisticated filter.
accountId | integer <int64> (AccountId) The LiveIntent account identifier. |
pageSize | integer >= 0 Default: 30 The number of records per page. Use if you expect large response data. |
page | integer >= 1 The page that should be returned. |
includeInternal | boolean Whether to inlude internal audiences. |
object or object or object or object or object or object or object Which audiences to include in the response. |
Search for audiences that have a DataProvider with id 95 and metadata with the key bar. Show the second page with 15 elements.
{- "page": 2,
- "pageSize": 15,
- "matches": {
- "and": [
- {
- "dataProviderIdMatches": {
- "eq": 95
}
}, - {
- "hasMetadata": {
- "nameMatches": {
- "eq": "bar"
}
}
}
]
}
}
{- "entries": [
- {
- "id": 0,
- "name": "string",
- "accountId": 0,
- "dataProviderId": 0,
- "createdAt": "2019-08-24T14:15:22Z",
- "updatedAt": "2019-08-24T14:15:22Z",
- "status": "ACTIVE",
- "metadata": {
- "updatedAt": "2019-08-24T14:15:22Z",
- "data": null
}
}
], - "page": 0,
- "pageSize": 0,
- "totalCount": 0
}