Ads and Commerce

Ads Pixel Shared Accounts

Updated: Sep 14, 2021

Reading

At the end of September 2024, the POST /{pixel-id}/shared_accounts API (including previous versions) will not support sharing of pixels with an ad account, if a business account does not have access to both pixel and ad account. Refer to the pixel sharing API solution to use POST /{pixel-id}/agencies or use POST {ad_account}/agencies to share into a business account, then use POST /{pixel-id}/shared_accounts to link pixel and ad account

Example

GET /v25.0/{pixel-id}/shared_accounts?business=%7Bbusiness-id%7D HTTP/1.1
Host: graph.facebook.com
If you want to learn how to use the Graph API, read our Using Graph API guide

Parameters

Parameter Description
business
numeric string or integer
ID of the business whose ad accounts the pixel was shared to are fetched
required

Fields

Reading from this edge will return a JSON formatted result:
{
"data": []
}
data
A list of AdAccount nodes.

Error Codes

Error Code Description
100
Invalid parameter
190
Invalid OAuth 2.0 Access Token

Creating

/{ads_pixel_id}/shared_accounts

You can make a POST request to shared_accounts edge from the following paths:
When posting to this edge, no Graph object will be created.

Example

POST /v25.0/{pixel-id}/shared_accounts HTTP/1.1
Host: graph.facebook.com

account_id=%7Bad-account-id%7D&business=%7Bbusiness-id%7D
If you want to learn how to use the Graph API, read our Using Graph API guide

Parameters

Parameter Description
account_id
numeric string
SELF_EXPLANATORY
required
business
numeric string or integer
SELF_EXPLANATORY
required

Return Type

This endpoint supports read-after-write and will read the node to which you POSTed.
Struct  {
success: bool,
}

Error Codes

Error Code Description
100
Invalid parameter
200
Permissions error
190
Invalid OAuth 2.0 Access Token

Updating

You can't perform this operation on this endpoint.

Deleting

/{ads_pixel_id}/shared_accounts

You can dissociate an AdAccount from an AdsPixel by making a DELETE request to /{ads_pixel_id}/shared_accounts.

Parameters

Parameter Description
account_id
numeric string
SELF_EXPLANATORY
required
business
numeric string or integer
SELF_EXPLANATORY
required

Return Type

Struct  {
success: bool,
}

Error Codes

Error Code Description
100
Invalid parameter