Skip to content

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

Select language

HTTPPHP SDKJavaScript SDKAndroid SDKiOS SDKcURL


GET /v25.0/{pixel-id}/shared_accounts?business=%7Bbusiness-id%7D HTTP/1.1
Host: graph.facebook.com

Try it in Graph API Explorer

If you want to learn how to use the Graph API, read our Using Graph API guide

Parameters

ParameterDescription
business numeric string or integerID 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 CodeDescription
100Invalid parameter
190Invalid 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

Select language

HTTPPHP SDKJavaScript SDKAndroid SDKiOS SDKcURL


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

account_id=%7Bad-account-id%7D&business=%7Bbusiness-id%7D

Try it in Graph API Explorer

If you want to learn how to use the Graph API, read our Using Graph API guide

Parameters

ParameterDescription
account_id numeric stringSELF_EXPLANATORY required
business numeric string or integerSELF_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 CodeDescription
100Invalid parameter
200Permissions error
190Invalid 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

ParameterDescription
account_id numeric stringSELF_EXPLANATORY required
business numeric string or integerSELF_EXPLANATORY required

Return Type

Struct  {
success: bool,
}

Error Codes

Error CodeDescription
100Invalid parameter

Unofficial mirror for reference/search purposes. All content originates from developers.facebook.com — see the source link at the top of each page. Machine-readable indexes: llms.txt · llms-full.txt · About