p_user_id
)?
p_user_id
) to X IDs (tw_id
). This will be done on a 2-3 month basis regularly to ensure proper upkeep. Once the match is completed, X will share a baseline match rate from this file with Company via e-mail.
The format of this file should be:
Name Convention: FullDataMatch.[CompanyName].txt
Hashing Algorithm: HMAC_SHA-256
Format:
Column 1: HMAC hashed value of common identifiers
Column 2: Partner User ID (unique per user, non-unique in file)
Column Delimiter (CSV): Commas will be used to delimit the hashed common user identifier from the Partner ID
Line separated values
common user identifier 1 | p_user_1 |
common user identifier 2 | p_user_1 |
common user identifier 3 | p_user_1 |
p_user_id
to create custom audiences for customers for targeting on X.
p_user_id
@
It92I6Ev2B.
Com
After normalization: testemail_organisational_baseball+884@
it92i6ev2b.
com
Hashed value: 74d9584eded0ad1e5572a1c1849f3716751d371d6117a6155dad5363f4b4fbec
Note: The specific number of characters for both the encoded hmac and key could vary based on the input and the encoding so the specific number of characters.
@
username, but User IDs do not require normalization. @usernames should be lowercased for normalization. And the @ symbol should not be included as part of the username.
The raw ID format will be:
p_id
must undergo an ID Sync process to generate a mapping of the advertiser or partner’s user ids to X user ids. This allows advertisers to directly target their own user segments on X. Partners must also set the value of the param user_identifier_type
to either TALIST_PARTNER_USER_ID
or TAWEB_PARTNER_USER_ID
while sending their membership updates.
Base URL |
https://analytics.x.com/i/adsct |
Parameter | Description |
p_id | Your X-assigned partner id |
p_user_id | The user’s id in the partner system |
p_user_id
of abc, the constructed pixel would be the following:
Column Number | Column Name | Column Type | Description |
1 | Partner ID | string | The “partner id” is the ID that X provides to the Partner in order to uniquely identify each Partner. |
2 | The user’s id in the partner system | string | The p_user_id is the unique ID that is used to identify the user by the Partner. The file containing these opt-out users should be uploaded using the TON upload endpoint and the path of uploaded data should be sent to the Global Opt Out endpoint here:PUT accounts/:account_id/custom_audiences/global_opt_out. |
p_id
must set the user_identifier_type
to TALIST_PARTNER_USER_ID
or TAWEB_PARTNER_USER_ID
.
All other steps will remain the same as those listed in the Real-Time Audience API Integration Guide
4b61639e-47cc-4056-a16a-c8217e029462
2f5f5391-3e45-4d02-b645-4575a08f86e
af3802a465767e36
support@x.com
jack
143567
SHA256
, without a salt. Additionally, the final output hash must be in lower case. E.g., 49e0be2aeccfb51a8dee4c945c8a70a9ac500cf6f5cb08112575f74db9b1470d and **not **49E0BE2AECCFB51A8DEE4C945C8A70A9AC500CF6F5CB08112575F74DB9B1470D
p_user_ids
) to target on behalf of an advertiser. This is accomplished through an ID Sync process that builds a mapping between the p_user_ids
and X user ID. This mapping is then used to produce lists of X User IDs that can be used for Targeting. These custom audiences will be made available on the advertiser’s specific @handle specified by the label on ads.x.com Custom Audiences Web campaign setup.
X will provide the secure pixel that can be dropped on partner tags and sites in order to match the IDs (p_user_ids
) to X user IDs. Once the ID Sync process is complete, the targeting files will be created by the partner and will be made available to X through a HTTPS endpoint. These targeting files are ingested on a regular basis by X and are then made available in the X UI.
X Secure Pixel
The X secure pixel will look as follows:
https://analytics.x.com/i/adsct?p\_user\_id=xyz&p_id=123
p_user_id
- xyz represents the partner user ID that is provided by the Partner
p_id
- 123 represents the unique ID for the Partner (provided by X)
Partner HTTPS Endpoint & Targeting User File
Partner will need to provide X with a HTTPS endpoint and credentials (username/password) that can be used to ingest the targeting file on a regular basis. A sample HTTPS endpoint will look as follows:
Column Number | Column Name | Column Type | Description |
---|---|---|---|
1 | partner id | string | The “partner id” is the ID that X provides to the Partner in order to uniquely identify each Partner. |
2 | advertiser id | string | The “advertiser id” is the @handle for the advertiser. |
3 | p_user_id | string | The “p_user_id” is the unique ID that is used to identify the user by the Partner. |
3 | confidence score | integer | The “confidence score” is optional. Our recommendation for confidence score is to use 0-100. If the use case is for retargeting, then a confidence score of “100” is a user who has been directly retargeted. Any score from 0-99 would correspond to the level of confidence of the look-alike. |
4 | segment label | string | The “segment label” is optional. Partners can use “segment label” to specify product categories, for example. Our recommendation is to use this “segment label” as this is the human readable name for Custom Audiences in the ads.x.com UI. |
list_type
parameter will be removed from the request and response on all Custom Audience endpoints. This parameter was previously used to identify the user identifier type of the Audience (i.e., email, X User ID, etc.) however Audiences now have the ability to accept multiple user identifiers for the same Audience thereby making this value irrelevant.Step in Process | Audience API | (Deprecated) TON Upload |
---|---|---|
Create a shell Audience | Can be created via the [POST custom_audience endpoint]/x-ads-api/audiences | Can be created via the [POST custom_audience endpoint]/x-ads-api/audiences |
Add a new user | Use the operation_type Update with the Audience endpoint | Use the operation ADD with the POST custom_audience_changes endpoint |
Remove a user | Use the operation_type Delete with the Audience endpoint | Use the operation REMOVE with the POST custom_audience_changes endpoint |
Opting-Out Users | Use the operation_type Delete with the Audience endpoint and the corresponding custom_audience_id s that the user is a part of | Use the Global opt-out endpoint |
id
. This step is required if creating an Audience from scratch. If updating an existing Audience, skip to the next section
id
and a sample payload like so:
POST https://ads-api.x.com/11/accounts/18ce54d4x5t/custom_audiences/1nmth/users
operation_type
Update
. The new Audience interface enables the ability to pass in multiple user keys for a single user. Each object in the array of JSON objects corresponds to a single user. Using the example payload above, the request will add two users to an Audience, one with an email
and handle
and another with an email
and twitter_id
.
operation_type
must be set to Delete
and users will be matched on any keys that were present when adding users to the audience. For example, if a user was added to an audience using an email
and twitter_id
, then the same user can be removed using any one of these keys, i.e., either email
or twitter_id
or both.
Additionally, it is possible to add and remove users from an Audience within the same request. The endpoint supports multiple operation_type
per request.
Delete
any users that have opted-out of any Audiences. There are a few ways to achieve this:
success_count
and total_count
corresponding to the number of user
objects that have been received in the request.end_time
- start_time
) of 7 days is allowed.
Please note that results are scoped by a single geo (country).
Resource URL
https://ads-api.x.com/12/insights/keywords/search
Parameters
Name | Description |
---|---|
granularity required | Specifies the granularity of the data returned for the time range denoted by start_time and end_time . For instance, when set to HOUR , you will be presented with a datapoint for each hour between start_time and end_time . request.Type: enum Possible values: DAY , HOUR |
keywords required | A comma-separated string of keywords to narrow search by. All keywords are OR’ed with one another. Note: A maximum of 10 keywords ( keywords and negative_keywords combined) may be used.Type: string Example: developers |
start_time required | Scopes the retrieved data to data collected in the window of time between start_time and end_time . Expressed in ISO 8601.Type: string Example: 2017-07-10T00:00:00Z |
end_time optional | Scopes the retrieved data to data collected in the window of time between start_time and end_time . Expressed in ISO 8601.Note: Defaults to the current time. Type: string Example: 2017-07-11T00:00:00Z |
location optional | A targeting value you would get from the GET targeting_criteria/locations endpoint to narrow results in terms of where the user of the account is located. Note that at present only country level locations are supported. Type: string Example: 0ce8b9a7b2742f7e |
negative_keywords optional | A comma-separated string of keywords to exclude. All negative keywords are OR’ed with one another. Note: A maximum of 10 keywords ( keywords and negative_keywords combined) may be used.Type: string Example: rain |
https://ads-api.x.com/5/accounts/:account_id/tailored_audiences/:tailored_audience_id/permissions
Parameters
Name | Description |
---|---|
account_id required | The identifier for the leveraged account. Appears within the resource’s path and is generally a required parameter for all Advertiser API requests excluding GET accounts. The specified account must be associated with the authenticated user. Type: string Example: 18ce54d4x5t |
tailored_audience_id required | A reference to the tailored audience you are operating with in the request. Type: string Example: 1nmth |
count optional | Specifies the number of records to try and retrieve per distinct request. Type: int Default: 200 Min, Max: 1 , 1000 |
cursor optional | Specifies a cursor to get the next page of results. See Pagination for more information. Type: string Example: 8x7v00oow |
granted_account_ids optional | Scope the response to just the desired accounts by specifying a comma-separated list of identifiers. Up to 200 IDs may be provided. Type: string Example: 18ce54aymz3 |
sort_by optional | Sorts by supported attribute in ascending or descending order. See Sorting for more information. Type: string Example: created_at-asc |
tailored_audience_permission_ids optional | Scope the response to just the desired tailored audience permissions by specifying a comma-separated list of identifiers. Up to 200 IDs may be provided. Type: string Example: ri |
with_total_count optional | Include the total_count response attribute.Note: This parameter and cursor are exclusive.Note: Requests which include total_count will have lower rate limits, currently set at 200 per 15 minutes.Type: boolean Default: false Possible values: true , false |
GET https://ads-api.x.com/5/accounts/18ce54d4x5t/tailored_audiences/1nmth/permissions
Example Response
is_owner
response attribute in the response for a given audience.
Note: Audiences can only be shared between ads accounts under the same business or if the ads account that owns the audience has the SHARE_AUDIENCE_OUTSIDE_BUSINESS
account feature.
Resource URL
https://ads-api.x.com/5/accounts/:account_id/tailored_audiences/:tailored_audience_id/permissions
Parameters
Name | Description |
---|---|
account_id required | The identifier for the leveraged account. Appears within the resource’s path and is generally a required parameter for all Advertiser API requests excluding GET accounts. The specified account must be associated with the authenticated user. Type: string Example: 18ce54d4x5t |
granted_account_id required | The account you wish to grant the tailored audience permissions for. Type: string Example: 18ce54aymz3 |
permission_level required | The type of access to the tailored audience that the granted_account_id should have.Type: enum Possible values: READ_ONLY , READ_WRITE |
tailored_audience_id required | A reference to the tailored audience you are operating with in the request. Type: string Example: 2906h |
POST https://ads-api.x.com/5/accounts/18ce54d4x5t/tailored_audiences/2906h/permissions?granted_account_id=18ce54aymz3&permission_level=READ_ONLY
Example Response
is_owner
response attribute in the response for a given audience.
When revoked, we guarantee that the granted account (granted_account_id
) will not be able to target the audience in future campaigns. Existing campaigns will continue to run with the shared audiences; campaigns do not stop and the audience does not get removed from the campaign. It is not possible to copy this campaign after the audience sharing permission has been revoked.
Resource URL
https://ads-api.x.com/5/accounts/:account_id/tailored_audiences/:tailored_audience_id/permissions/:tailored_audience_permission_id
Parameters
Name | Description |
---|---|
account_id required | The identifier for the leveraged account. Appears within the resource’s path and is generally a required parameter for all Advertiser API requests excluding GET accounts. The specified account must be associated with the authenticated user. Type: string Example: 18ce54d4x5t |
tailored_audience_id required | A reference to the tailored audience you are operating with in the request. Type: string Example: 1nmth |
tailored_audience_permission_id required | A reference to the tailored audience permission you are operating with in the request. Type: string Example: ri |
DELETE https://ads-api.x.com/5/accounts/18ce54d4x5t/tailored_audiences/1nmth/permissions/ri
Example Response
custom_audience_id
Name | Description |
---|---|
account_id required | The identifier for the leveraged account. Appears within the resource’s path and is generally a required parameter for all Advertiser API requests excluding GET accounts. The specified account must be associated with the authenticated user. Type: string Example: 18ce54d4x5t |
custom_audience_id required | A reference to the custom audience you are operating with in the request. Type: string Example: 2906h |
with_active optional | When false , includes line items that have servable=false statusType: boolean Default: true Possible values: true , false |
cursor optional | Specifies a cursor to get the next page of results. See Pagination for more information. Type: string Example: 8x7v00oow |
GET https://ads-api.x.com/12/accounts/18ce54d4x5t/custom_audiences/2906h/targeted
Example Response
custom_audience_id
. The endpoint will also accept multiple user identifier types per user as well.
All data being provided in the users
field of the request except partner_user_id
must be hashed using SHA256
and normalized.
Batch Requests
2500
for this endpoint. The batch size is determined by the number of operations (Update
/Delete
) per request. For example, over 2500 operation objects ({"operation_type": "Update/Delete", [..] }
) in one array result in an error.5,000,000
bytes.Content-Type
of application/json
is required.success_count
and a total_count
. These values must always be equal, and they are a count of the number of records in the request that have been processed by the backend. A situation where the number of records sent in the request body is not equal the success_count
and total_count
should be treated as an error condition, requiring a retry.
Batch Errors
errors
object.operation_errors
object.operation_errors
refers to the index in the input item, with the corresponding error messagehttps://ads-api.x.com/12/accounts/:account_id/custom_audiences/:custom_audience_id/users
Name | Description |
---|---|
operation_type required | The per users group operation type being performed.Type: enum Possible values: Update , Delete |
params required | A JSON object containing the users array, the effective_at and expires_at timestamps.Type: JSON |
users required | An array of JSON objects containing all params for an individual user. Type: JSON |
effective_at optional | The UTC time at which the custom audience association(s) should take effect. Expressed in ISO 8601. Defaults to the current date and time. Type: string Example: 2017-07-05T07:00:00Z |
expires_at optional | The UTC time at which the custom audience association(s) should expire. The specified time must be later than the value of effective_at . Expressed in ISO 8601. Defaults to 13 months from the request timestamp.Type: string Example: 2017-07-05T07:00:00Z |
users
object, each element of this object is documented below:
Name | Description |
---|---|
email optional | Email address(es) for the user. Type: Array[String] |
device_id optional | IDFA/AdID/Android ID Type: Array[String] |
handle optional | The @handle(s) belonging to the user Type: Array[String] |
twitter_id optional | The X ID belonging to the user Type: Array[String] |
phone_number optional | Phone number(s) for the user Type: Array[String] |
partner_user_id optional | The user’s ID in the partners’ system. Type: Array[String] |
POST https://ads-api.x.com/12/accounts/18ce54d4x5t/custom_audiences/1nmth/users
https://ads-api.x.com/12/accounts/:account_id/custom_audiences/:custom_audience_id/permissions
Parameters
Name | Description |
---|---|
account_id required | The identifier for the leveraged account. Appears within the resource’s path and is generally a required parameter for all Advertiser API requests excluding GET accounts. The specified account must be associated with the authenticated user. Type: string Example: 18ce54d4x5t |
custom_audience_id required | A reference to the custom audience you are operating with in the request. Type: string Example: 1nmth |
count optional | Specifies the number of records to try and retrieve per distinct request. Type: int Default: 200 Min, Max: 1 , 1000 |
cursor optional | Specifies a cursor to get the next page of results. See Pagination for more information. Type: string Example: 8x7v00oow |
granted_account_ids optional | Scope the response to just the desired accounts by specifying a comma-separated list of identifiers. Up to 200 IDs may be provided. Type: string Example: 18ce54aymz3 |
sort_by optional | Sorts by supported attribute in ascending or descending order. See Sorting for more information. Type: string Example: created_at-asc |
custom_audience_permission_ids optional | Scope the response to just the desired custom audience permissions by specifying a comma-separated list of identifiers. Up to 200 IDs may be provided. Type: string Example: ri |
with_total_count optional | Include the total_count response attribute.Note: This parameter and cursor are exclusive.Note: Requests which include total_count will have lower rate limits, currently set at 200 per 15 minutes.Type: boolean Default: false Possible values: true , false |
GET https://ads-api.x.com/12/accounts/18ce54d4x5t/custom_audiences/1nmth/permissions
Example Response
is_owner
response attribute in the response for a given audience.
Note: Audiences can only be shared between ads accounts under the same business or if the ads account that owns the audience has the SHARE_AUDIENCE_OUTSIDE_BUSINESS
account feature.
Resource URL
https://ads-api.x.com/12/accounts/:account_id/custom_audiences/:custom_audience_id/permissions
Parameters
Name | Description |
---|---|
account_id required | The identifier for the leveraged account. Appears within the resource’s path and is generally a required parameter for all Advertiser API requests excluding GET accounts. The specified account must be associated with the authenticated user. Type: string Example: 18ce54d4x5t |
granted_account_id required | The account you wish to grant the custom audience permissions for. Type: string Example: 18ce54aymz3 |
permission_level required | The type of access to the custom audience that the granted_account_id should have.Type: enum Possible values: READ_ONLY , READ_WRITE |
custom_audience_id required | A reference to the custom audience you are operating with in the request. Type: string Example: 2906h |
is_owner
response attribute in the response for a given audience.
When revoked, we guarantee that the granted account (granted_account_id
) will not be able to target the audience in future campaigns. Existing campaigns will continue to run with the shared audiences; campaigns do not stop and the audience does not get removed from the campaign. It is not possible to copy this campaign after the audience sharing permission has been revoked.
Resource URL
https://ads-api.x.com/12/accounts/:account_id/custom_audiences/:custom_audience_id/permissions/:custom_audience_permission_id
Parameters
Name | Description |
---|---|
account_id required | The identifier for the leveraged account. Appears within the resource’s path and is generally a required parameter for all Advertiser API requests excluding GET accounts. The specified account must be associated with the authenticated user. Type: string Example: 18ce54d4x5t |
custom_audience_id required | A reference to the custom audience you are operating with in the request. Type: string Example: 1nmth |
custom_audience_permission_id required | A reference to the custom audience permission you are operating with in the request. Type: string Example: ri |
DELETE https://ads-api.x.com/12/accounts/18ce54d4x5t/custom_audiences/1nmth/permissions/ri
Example Response
https://ads-api.x.com/12/accounts/:account_id/custom_audiences
Parameters
Name | Description |
---|---|
account_id required | The identifier for the leveraged account. Appears within the resource’s path and is generally a required parameter for all Advertiser API requests excluding GET accounts. The specified account must be associated with the authenticated user. Type: string Example: 18ce54d4x5t |
count optional | Specifies the number of records to try and retrieve per distinct request. Type: int Default: 200 Min, Max: 1 , 1000 |
cursor optional | Specifies a cursor to get the next page of results. See Pagination for more information. Type: string Example: 8x7v00oow |
permission_scope optional | Allows filtering the response to lists you own or lists that have been shared with you. By default, without specifying this parameter you will only see audiences you own. Type: enum Default: OWNER Possible values: OWNER , SHARED |
q optional | An optional query to scope resource by name .Note: This performs case-insensitive prefix matching. Type: string Min, Max length: 1 , 255 |
sort_by optional | Sorts by supported attribute in ascending or descending order. See Sorting for more information. Type: string Example: created_at-asc |
custom_audience_ids optional | Scope the response to just the desired custom audiences by specifying a comma-separated list of identifiers. Up to 200 IDs may be provided. Type: string Example: 1nmth |
with_deleted optional | Include deleted results in your request. Type: boolean Default: false Possible values: true , false |
with_total_count optional | Include the total_count response attribute.Note: This parameter and cursor are exclusive.Note: Requests which include total_count will have lower rate limits, currently set at 200 per 15 minutes.Type: boolean Default: false Possible values: true , false |
GET https://ads-api.x.com/12/accounts/18ce54d4x5t/custom_audiences?custom_audience_ids=1nmth
Example Response
https://ads-api.x.com/12/accounts/:account_id/custom_audiences/:custom_audience_id
Parameters
Name | Description |
---|---|
account_id required | The identifier for the leveraged account. Appears within the resource’s path and is generally a required parameter for all Advertiser API requests excluding GET accounts. The specified account must be associated with the authenticated user. Type: string Example: 18ce54d4x5t |
custom_audience_id required | A reference to the custom audience you are operating with in the request. Type: string Example: 2906h |
with_deleted optional | Include deleted results in your request. Type: boolean Default: false Possible values: true , false |
GET https://ads-api.x.com/12/accounts/18ce54d4x5t/custom_audiences/2906h
Example Response
https://ads-api.x.com/12/accounts/:account_id/custom_audiences
Parameters
Name | Description |
---|---|
account_id required | The identifier for the leveraged account. Appears within the resource’s path and is generally a required parameter for all Advertiser API requests excluding GET accounts. The specified account must be associated with the authenticated user. Type: string Example: 18ce54d4x5t |
name required | The display name for this audience. Unique name value must be used. Failure to do so will result in an error. Type: string Example: ads api users |
description optional | A description for this audience. Type: string Example: Collection of all users of the Ads API |
POST https://ads-api.x.com/12/accounts/18ce54d4x5t/custom_audiences?name=developers
Example Response
https://ads-api.x.com/12/accounts/:account_id/custom_audiences/:custom_audience_id
Parameters
Name | Description |
---|---|
account_id required | The identifier for the leveraged account. Appears within the resource’s path and is generally a required parameter for all Advertiser API requests excluding GET accounts. The specified account must be associated with the authenticated user. Type: string Example: 18ce54d4x5t |
custom_audience_id required | A reference to the Custom Audience you are operating with in the request Type: string Example: 2906h |
name optional | The display name for this audience. Unique name value must be used. Failure to do so will result in an error. Type: string Example: ads api users |
description optional | A description for this audience. Type: string Example: Collection of all users of the Ads API |
PUT https://ads-api.x.com/12/accounts/18ce54d4x5t/custom_audiences/2906h?name=developers_changed
Example Response
Content-Type
of application/json
is required.errors
object.operation_errors
object.https://ads-api.x.com/12/batch/accounts/:account_id/custom_audiences
Parameters
Name | Description |
---|---|
account_id required | The identifier for the leveraged account. Appears within the resource’s path and is generally a required parameter for all Advertiser API requests excluding GET accounts. The specified account must be associated with the authenticated user. Type: string Example: 18ce54d4x5t |
audience_type required | The type of audience to create. Type: enum Possible values: FLEXIBLE , MOBILE_AUDIENCE |
child_segments required | An array containing objects which define the subset of a Custom Audience’s members that you would like to target. Each object should contain a custom_audience_id , frequency , frequency_comparator , lookback_window , negate , and, in some cases, additional child_segments .Type: array |
name required | The display name for the audience. Unique name value must be used. Failure to do so will result in an error. Type: string Example: my_flexible_audience_name |
operation_type required | The per item operation type being performed. Type: enum Possible values: Create , Update , Delete |
boolean_operator sometimes required | The logical relationship between the child segments in its parent (containing) object. Required if child_segments is non-empty for the parent object. Type: enum Possible values: AND , OR |
lookback_window sometimes required | An integer value specifying the range of days within which the user has taken the specific action and qualified for the given custom audience. Type: int Possible values: 1 , 7 , 14 , 30 |
segments sometimes required | An object containing a boolean_operator and child_segments which define the subset of a Custom Audience’s members that you would like to target.Type: object |
custom_audience_id sometimes required | The id of the custom audience to use as a child segment. Type: string Example: tyfo |
frequency optional | An integer value specifying the frequency within the lookback window that the user has taken the specific action and qualified for the given custom audience. Type: int Default value: 1 |
frequency_comparator optional | The comparator to the frequency passed in the request.Note: In the values below, GTE refers to greater than or equal, LT to less than, and so on.Type: string Possible values: NUM_GTE , NUM_GT , NUM_EQ , NUM_LTE , NUM_LT Default value: NUM_GTE |
negate optional | Negates the segment and thus is excluded in the combination. Type: boolean Default value: true Possible values: true , false |
POST https://ads-api.x.com/12/batch/accounts/18ce54d4x5t/custom_audiences
https://ads-api.x.com/12/accounts/:account_id/custom_audiences/:custom_audience_id
Parameters
Name | Description |
---|---|
account_id required | The identifier for the leveraged account. Appears within the resource’s path and is generally a required parameter for all Advertiser API requests excluding GET accounts. The specified account must be associated with the authenticated user. Type: string Example: 18ce54d4x5t |
custom_audience_id required | A reference to the custom audience you are operating with in the request. Type: string Example: 2906h |
DELETE https://ads-api.x.com/12/accounts/18ce54d4x5t/custom_audiences/2906h
Example Response
account_id
can only have at most one Do Not Reach List
Resource URL
https://ads-api.x.com/12/accounts/:account_id/do_not_reach_lists
Parameters
Name | Description |
---|---|
account_id required | The identifier for the leveraged account. Appears within the resource’s path and is generally a required parameter for all Advertiser API requests excluding GET accounts. The specified account must be associated with the authenticated user. Type: string Example: 18ce54d4x5t |
with_deleted optional | Include deleted results in your request. Type: boolean Default: false Possible values: true , false |
GET https://ads-api.x.com/12/accounts/18ce54bgxky/do_not_reach_lists
Example Response
account_id
can only have at most one Do Not Reach List
Resource URL
https://ads-api.x.com/12/accounts/:account_id/do_not_reach_lists
Parameters
Name | Description |
---|---|
account_id required | The identifier for the leveraged account. Appears within the resource’s path and is generally a required parameter for all Advertiser API requests excluding GET accounts. The specified account must be associated with the authenticated user. Type: string Example: 18ce54d4x5t |
description optional | A description for this audience. Type: string Example: A list of users to exclude |
POST https://ads-api.x.com/12/accounts/18ce54bgxky/do_not_reach_lists?description=A list of users to exclude
Example Response
do_not_reach_list_id
. This endpoint only accepts emails as the valid user identifier type.
All data being provided in the emails
field of the request must be hashed using SHA256
and normalized.
Notes
account_id
can only have at most one Do Not Reach Listexpires_at
timestamp set to less than 13 months from the current timestampeffective_at
timestamp and defaults to the current timestamp2500
for this endpoint. The batch size is determined by the number of operations (Update
/Delete
) per request. For example, over 2500 operation objects ({"operation_type": "Update/Delete", [..] }
) in one array result in an error.5,000,000
bytes.Content-Type
of application/json
is required.success_count
and a total_count
. These values must always be equal, and they are a count of the number of records in the request that have been processed by the backend. A situation where the number of records sent in the request body is not equal the success_count
and total_count
should be treated as an error condition, requiring a retry.
Batch Errors
errors
object.operation_errors
object.operation_errors
refers to the index in the input item, with the corresponding error messagehttps://ads-api.x.com/12/batch/accounts/:account_id/do_not_reach_lists/:do_not_reach_list_id/users
Parameters
Name | Description |
---|---|
account_id required | The identifier for the leveraged account. Appears within the resource’s path and is generally a required parameter for all Advertiser API requests excluding GET accounts. The specified account must be associated with the authenticated user. Type: string Example: 18ce54d4x5t |
do_not_reach_list_id required | A reference to the Do Not Reach List you are operating with in the request Type: string Example: 2906h |
operation_type required | The per users group operation type being performed.Type: enum Possible values: Update , Delete |
params required | A JSON object containing the emails array and expires_at timestamp.Type: JSON |
users required | An array of JSON objects containing all params for an individual user. Type: JSON |
expires_at optional | The UTC time at which the user association(s) should expire. The specified time must be later than the value of the current timestamp. Expressed in ISO 8601. Defaults to 13 months from current timestamp. Type: string Example: 2017-07-05T07:00:00Z |
users
object, each element of this object is documented below:
Name | Description |
---|---|
email optional | Email address(es) for the user. Type: Array[String] |
phone_number optional | Phone number(s) for the user Type: Array[String] |
https://ads-api.x.com/12/accounts/:account_id/do_not_reach_lists/:do_not_reach_list_id
Parameters
None
Example Request
DELETE https://ads-api.x.com/12/accounts/18ce54bgxky/do_not_reach_lists/4ofrp
Example Response