Creates a custom audience by uploading a file of hashed identifiers. The request is multipart/form-data, not JSON, because the file is uploaded in the same call.
End Point POST https://business.newsbreak.com/business-api/v1/audience/create
Header
| Field | Required | Data Type | Description |
|---|---|---|---|
| Access-Token | Y | string | Authorized access token. For details, see Authentication. |
| Content-Type | Y | string | multipart/form-data |
Request Parameters
| Field | Required | Data Type | Description |
|---|---|---|---|
| file | Y | binary | CSV of SHA-256 hashed identifiers, one per line, no header. Max 100 MB. |
| adAccountId | Y | string | ID of the ad account that will own the audience. |
| name | Y | string | Audience name. 3–256 characters. |
| fileType | Y | enumerate | What was hashed. Available values: EMAIL, DEVICE_ID. |
Example
curl -X 'POST' \
'https://business.newsbreak.com/business-api/v1/audience/create' \
-H 'Access-Token: {{Access-Token}}' \
-F 'file=@/Users/tom/Documents/customers.csv' \
-F 'adAccountId=1234567' \
-F 'name=Spring campaign customers' \
-F 'fileType=EMAIL'Response Parameters
| Field | Data Type | Description |
|---|---|---|
| code | int | Status code, see Return Codes |
| errMsg | string | Error message when code!=0 |
| data | object | Response object. |
| .id | string | Audience ID. |
| .name | string | Audience name. |
| .adAccountId | string | ID of the owning ad account. |
| .type | string | Always FILE for audiences created through this API. |
| .status | string | QUEUED on creation. AVAILABLE once the daily job has processed the file. |
| .size | int | Number of matched NewsBreak users. Absent until processing completes. |
| .fileType | string | EMAIL or DEVICE_ID, as supplied. |
| .createTime | string | Creation time, Unix seconds. |
| .updateTime | string | Last update time, Unix seconds. |
Example
{
"code": 0,
"data": {
"id": "1234567890123456789",
"name": "Spring campaign customers",
"adAccountId": "1234567",
"type": "FILE",
"status": "QUEUED",
"fileType": "EMAIL",
"createTime": "1755500000",
"updateTime": "1755500000"
}
}size is absent while status is QUEUED — the audience holds no matched users yet.
Errors
| Code | Meaning |
|---|---|
| 48026 | The file is missing, empty, not a .csv, or contains no identifiers. |
| 48027 | The file is larger than 100 MB. |
| 48028 | A line is not a single 64-character SHA-256 hash. The message names the line number. |
| 48029 | The file holds too many rows. |
| 403 | The access token's user cannot manage ads on adAccountId. |