Ad Account Adrules Library
Updated: Apr 2, 2024
Reading
AdAccountAdRulesLibrary
Example
GET /v25.0/{ad-account-id}/adrules_library 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
This endpoint doesn't have any parameters.
Fields
Reading from this edge will return a JSON formatted result:
{
"data": [],
"paging": {}
}
data
A list of AdRule nodes.
paging
For more details about pagination, see the Graph API guide.
Error Codes
| Error Code | Description |
|---|---|
200 | Permissions error |
100 | Invalid parameter |
190 | Invalid OAuth 2.0 Access Token |
80004 | There have been too many calls to this ad-account. Wait a bit and try again. For more info, please refer to /docs/graph-api/overview/rate-limiting#ads-management. |
Creating
/act_{ad_account_id}/adrules_library
You can make a POST request to adrules_library edge from the following paths:
When posting to this edge, an AdRule will be created.
Parameters
| Parameter | Description |
|---|---|
account_idnumeric string |
Ad Account ID. This is inferred from the path.
|
evaluation_specObject |
Defines the evaluation spec upon which a rule will be executed
required evaluation_type enum{SCHEDULE, TRIGGER}required filters list<Object>required field stringrequired value numeric, string, boolean, list<>, or object-like arraysrequired operator enum{GREATER_THAN, LESS_THAN, EQUAL, NOT_EQUAL, IN_RANGE, NOT_IN_RANGE, IN, NOT_IN, CONTAIN, NOT_CONTAIN, ANY, ALL, NONE}required Show child parameters trigger Objecttype enum{METADATA_CREATION, METADATA_UPDATE, STATS_MILESTONE, STATS_CHANGE, DELIVERY_INSIGHTS_CHANGE}required field stringvalue numeric, string, boolean, list<>, or object-like arraysoperator enum{GREATER_THAN, LESS_THAN, EQUAL, NOT_EQUAL, IN_RANGE, NOT_IN_RANGE, IN, NOT_IN, CONTAIN, NOT_CONTAIN, ANY, ALL, NONE}Show child parameters Show child parameters |
execution_specObject |
Defines the execution spec upon which a rule will be executed
required execution_type enum{DCO, PING_ENDPOINT, NOTIFICATION, PAUSE, REBALANCE_BUDGET, CHANGE_BUDGET, CHANGE_BID, ROTATE, UNPAUSE, CHANGE_CAMPAIGN_BUDGET, ADD_INTEREST_RELAXATION, ADD_QUESTIONNAIRE_INTERESTS, INCREASE_RADIUS, UPDATE_CREATIVE, UPDATE_LAX_BUDGET, UPDATE_LAX_DURATION, AUDIENCE_CONSOLIDATION, AUDIENCE_CONSOLIDATION_ASK_FIRST, AD_RECOMMENDATION_APPLY}required is_once_off booleanexecution_options list<Object>field stringrequired value numeric, string, boolean, list<>, or object-like arraysrequired operator enum{EQUAL, IN}required Show child parameters Show child parameters |
namestring |
The friendly name of a rule, optional for inline rules
required |
schedule_specObject |
Specifies the schedule with which a rule will be evaluated
schedule_type enum{DAILY, HOURLY, SEMI_HOURLY, CUSTOM}required schedule list<Object>start_minute int64end_minute int64days list<int64>Show child parameters Show child parameters |
statusenum {ENABLED, DISABLED, DELETED, HAS_ISSUES} |
The status of a rule
|
Return Type
This endpoint supports read-after-write and will read the node represented by id in the return type.
Struct {
id: numeric string,
}
Error Codes
| Error Code | Description |
|---|---|
200 | Permissions error |
100 | Invalid parameter |
368 | The action attempted has been deemed abusive or is otherwise disallowed |
2703 | Rules that turn off ads can’t have cost conditions. You need to change the rule’s conditions or action. |
190 | Invalid OAuth 2.0 Access Token |
Updating
You can't perform this operation on this endpoint.
Deleting
You can't perform this operation on this endpoint.