# Ad Account Ads



Ads belonging to this ad account.

## Reading

Ads belonging to this ad account

```html
curl GET \
https://graph.facebook.com/v25.0/act_&lt;AD_ACCOUNT_ID&gt;/ads
```

#### Parameters

| Parameter | Description |
| --- | --- |
| `date_preset`&lt;br&gt;&lt;br&gt;*enum&#123;today, yesterday, this_month, last_month, this_quarter, maximum, data_maximum, last_3d, last_7d, last_14d, last_28d, last_30d, last_90d, last_week_mon_sun, last_week_sun_sat, last_quarter, last_year, this_week_mon_today, this_week_sun_today, this_year&#125;* | Predefine date range used to aggregate insights metrics&lt;br&gt; |
| `effective_status`&lt;br&gt;&lt;br&gt;*list&lt;string&gt;* | Filter ads by effective status&lt;br&gt; |
| `time_range`&lt;br&gt;&lt;br&gt;*&#123;&#039;since&#039;:YYYY-MM-DD,&#039;until&#039;:YYYY-MM-DD&#125;* | Date range used to aggregate insights metrics&lt;br&gt;&lt;br&gt;&lt;br&gt;`since` *datetime*&lt;br&gt;A date in the format of &quot;YYYY-MM-DD&quot;, which means from the beginning midnight of that day.&lt;br&gt;&lt;br&gt;&lt;br&gt;`until` *datetime*&lt;br&gt;A date in the format of &quot;YYYY-MM-DD&quot;, which means to the beginning midnight of the following day.&lt;br&gt; |
| `updated_since`&lt;br&gt;&lt;br&gt;*integer* | Time since the Ad has been updated.&lt;br&gt; |

#### Fields

Reading from this edge will return a JSON formatted result:

```
&#123;
&quot;data&quot;: [],
&quot;paging&quot;: &#123;&#125;,
&quot;summary&quot;: &#123;&#125;
&#125;
```

##### data

A list of [Ad](https://developers.facebook.com/docs/graph-api/reference/adgroup) nodes.

##### paging

For more details about pagination, see the [Graph API guide](https://developers.facebook.com/docs/graph-api/using-graph-api#paging).

##### summary

Aggregated information about the edge, such as counts. Specify the fields to fetch in the summary param (like summary=__type__).

| Field | Description |
| --- | --- |
| `insights`&lt;br&gt;&lt;br&gt;*Edge&lt;AdsInsights&gt;* | Analytics summary for all objects&lt;br&gt; |
| `total_count`&lt;br&gt;&lt;br&gt;*unsigned int32* | Total number of Ads returned by the query&lt;br&gt;&lt;br&gt;&lt;br&gt;**[default]**&lt;br&gt; |

#### Error Codes

| Error Code | Description |
| --- | --- |
| 200 | Permissions error |
| 613 | Calls to this api have exceeded the rate limit. |
| 100 | Invalid parameter |
| 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. |
| 190 | Invalid OAuth 2.0 Access Token |
| 2500 | Error parsing graph query |
| 3018 | The start date of the time range cannot be beyond 37 months from the current date |
| 2635 | You are calling a deprecated version of the Ads API. Please update to the latest version. |
| 368 | The action attempted has been deemed abusive or is otherwise disallowed |

## Creating

### /act_&#123;ad_account_id&#125;/ads
You can make a POST request to *ads* edge from the following paths:

- [/act_&#123;ad_account_id&#125;/ads](https://developers.facebook.com/documentation/ads-commerce/marketing-api/reference/ad-account/ads)

When posting to this edge, an [Ad](https://developers.facebook.com/docs/graph-api/reference/adgroup) will be created.

#### Example

### HTTP
```
POST /v25.0/act_&lt;AD_ACCOUNT_ID&gt;/ads HTTP/1.1
Host: graph.facebook.com

name=My+Ad&amp;adset_id=%3CAD_SET_ID%3E&amp;creative=%7B%22creative_id%22%3A%22%3CCREATIVE_ID%3E%22%7D&amp;status=PAUSED
```

### PHP SDK
```
/* PHP SDK v5.0.0 */
/* make the API call */
try &#123;
  // Returns a `Facebook\FacebookResponse` object
  $response = $fb-&gt;post(
    &#039;/act_&lt;AD_ACCOUNT_ID&gt;/ads&#039;,
    array (
      &#039;name&#039; =&gt; &#039;My Ad&#039;,
      &#039;adset_id&#039; =&gt; &#039;&lt;AD_SET_ID&gt;&#039;,
      &#039;creative&#039; =&gt; &#039;&#123;&quot;creative_id&quot;:&quot;&lt;CREATIVE_ID&gt;&quot;&#125;&#039;,
      &#039;status&#039; =&gt; &#039;PAUSED&#039;,
    ),
    &#039;&#123;access-token&#125;&#039;
  );
&#125; catch(Facebook\Exceptions\FacebookResponseException $e) &#123;
  echo &#039;Graph returned an error: &#039; . $e-&gt;getMessage();
  exit;
&#125; catch(Facebook\Exceptions\FacebookSDKException $e) &#123;
  echo &#039;Facebook SDK returned an error: &#039; . $e-&gt;getMessage();
  exit;
&#125;
$graphNode = $response-&gt;getGraphNode();
/* handle the result */
```

### JavaScript SDK
```
/* make the API call */
FB.api(
    &quot;/act_&lt;AD_ACCOUNT_ID&gt;/ads&quot;,
    &quot;POST&quot;,
    &#123;
        &quot;name&quot;: &quot;My Ad&quot;,
        &quot;adset_id&quot;: &quot;&lt;AD_SET_ID&gt;&quot;,
        &quot;creative&quot;: &quot;&#123;\&quot;creative_id\&quot;:\&quot;&lt;CREATIVE_ID&gt;\&quot;&#125;&quot;,
        &quot;status&quot;: &quot;PAUSED&quot;
    &#125;,
    function (response) &#123;
      if (response &amp;&amp; !response.error) &#123;
        /* handle the result */
      &#125;
    &#125;
);
```

### Android SDK
```
Bundle params = new Bundle();
params.putString(&quot;name&quot;, &quot;My Ad&quot;);
params.putString(&quot;adset_id&quot;, &quot;&lt;AD_SET_ID&gt;&quot;);
params.putString(&quot;creative&quot;, &quot;&#123;\&quot;creative_id\&quot;:\&quot;&lt;CREATIVE_ID&gt;\&quot;&#125;&quot;);
params.putString(&quot;status&quot;, &quot;PAUSED&quot;);
/* make the API call */
new GraphRequest(
    AccessToken.getCurrentAccessToken(),
    &quot;/act_&lt;AD_ACCOUNT_ID&gt;/ads&quot;,
    params,
    HttpMethod.POST,
    new GraphRequest.Callback() &#123;
        public void onCompleted(GraphResponse response) &#123;
            /* handle the result */
        &#125;
    &#125;
).executeAsync();
```

### iOS SDK
```
NSDictionary *params = &#064;&#123;
  &#064;&quot;name&quot;: &#064;&quot;My Ad&quot;,
  &#064;&quot;adset_id&quot;: &#064;&quot;&lt;AD_SET_ID&gt;&quot;,
  &#064;&quot;creative&quot;: &#064;&quot;&#123;\&quot;creative_id\&quot;:\&quot;&lt;CREATIVE_ID&gt;\&quot;&#125;&quot;,
  &#064;&quot;status&quot;: &#064;&quot;PAUSED&quot;,
&#125;;
/* make the API call */
FBSDKGraphRequest *request = [[FBSDKGraphRequest alloc]
                               initWithGraphPath:&#064;&quot;/act_&lt;AD_ACCOUNT_ID&gt;/ads&quot;
                                      parameters:params
                                      HTTPMethod:&#064;&quot;POST&quot;];
[request startWithCompletionHandler:^(FBSDKGraphRequestConnection *connection,
                                      id result,
                                      NSError *error) &#123;
    // Handle the result
&#125;];
```

### cURL
```
curl -X POST \
  -F &#039;name=&quot;My Ad&quot;&#039; \
  -F &#039;adset_id=&quot;&lt;AD_SET_ID&gt;&quot;&#039; \
  -F &#039;creative=&#123;
       &quot;creative_id&quot;: &quot;&lt;CREATIVE_ID&gt;&quot;
     &#125;&#039; \
  -F &#039;status=&quot;PAUSED&quot;&#039; \
  -F &#039;access_token=&lt;ACCESS_TOKEN&gt;&#039; \
  https://graph.facebook.com/v25.0/act_&lt;AD_ACCOUNT_ID&gt;/ads
```

Try it in [Graph API Explorer](https://developers.facebook.com/tools/explorer/?method=POST&amp;path=act_%3CAD_ACCOUNT_ID%3E%2Fads%3Fname%3DMy%2BAd%26adset_id%3D%253CAD_SET_ID%253E%26creative%3D%257B%2522creative_id%2522%253A%2522%253CCREATIVE_ID%253E%2522%257D%26status%3DPAUSED&amp;version=v25.0)

If you want to learn how to use the Graph API, read our [Using Graph API guide](https://developers.facebook.com/docs/graph-api/using-graph-api)

#### Parameters

| Parameter | Description |
| --- | --- |
| `ad_schedule_end_time`&lt;br&gt;&lt;br&gt;*datetime* | An optional parameter that defines the end time of an individual ad. If no end time is defined, the ad will run on the campaign’s schedule.&lt;br&gt;&lt;br&gt;&lt;br&gt;This parameter is only available for sales and app promotion campaigns.&lt;br&gt; |
| `ad_schedule_start_time`&lt;br&gt;&lt;br&gt;*datetime* | An optional parameter that defines the start time of an individual ad. If no start time is defined, the ad will run on the campaign’s schedule.&lt;br&gt;&lt;br&gt;&lt;br&gt;This parameter is only available for sales and app promotion campaigns.&lt;br&gt; |
| `adlabels`&lt;br&gt;&lt;br&gt;*list&lt;Object&gt;* | Ad labels associated with this ad&lt;br&gt; |
| `adset_id`&lt;br&gt;&lt;br&gt;*int64* | The ID of the ad set, required on creation.&lt;br&gt; |
| `adset_spec`&lt;br&gt;&lt;br&gt;*Ad set spec* | The ad set spec for this ad. When the spec is provided, adset_id field is not required.&lt;br&gt; |
| `audience_id`&lt;br&gt;&lt;br&gt;*string* | The ID of the audience.&lt;br&gt; |
| `bid_amount`&lt;br&gt;&lt;br&gt;*integer* | **Deprecated.** We no longer allow setting the `bid_amount` value on an ad. Please set `bid_amount` for the ad set.&lt;br&gt; |
| `conversion_domain`&lt;br&gt;&lt;br&gt;*string* | The domain where conversions happen. Required to create or update an ad in a campaign that shares data with a pixel. This field will be auto-populated for existing ads by inferring from destination URLs . Note that this field should contain only the first and second level domains, and not the full URL. For example `facebook.com`.&lt;br&gt; |
| `creative`&lt;br&gt;&lt;br&gt;*AdCreative* | This field is required for create. The ID or creative spec of the ad creative to be used by this ad. You can read more about creatives [here](https://developers.facebook.com/docs/marketing-api/adcreative). You may supply the ID within an object as follows:&lt;br&gt;&lt;br&gt;`&#123;&quot;creative_id&quot;: &lt;CREATIVE_ID&gt;&#125;`&lt;br&gt;or creative spec as follow:&lt;br&gt;&lt;br&gt; `&#123;&quot;creative&quot;: &#123;\&quot;name\&quot;: \&quot;&lt;NAME&gt;\&quot;, \&quot;object_story_spec\&quot;: &lt;SPEC&gt;&#125;&#125;`&lt;br&gt;&lt;br&gt;**[required]**&lt;br&gt;&lt;br&gt;**[supports emoji]**&lt;br&gt; |
| `creative_asset_groups_spec`&lt;br&gt;&lt;br&gt;*string (CreativeAssetGroupsSpec)* | creative_asset_groups_spec&lt;br&gt;&lt;br&gt;**[supports emoji]**&lt;br&gt; |
| `date_format`&lt;br&gt;&lt;br&gt;*string* | The format of the date.&lt;br&gt; |
| `display_sequence`&lt;br&gt;&lt;br&gt;*int64* | The sequence of the ad within the same campaign&lt;br&gt; |
| `engagement_audience`&lt;br&gt;&lt;br&gt;*boolean* | Flag to create a new audience based on users who engage with this ad&lt;br&gt; |
| `execution_options`&lt;br&gt;&lt;br&gt;*list&lt;enum&#123;validate_only, synchronous_ad_review, include_recommendations&#125;&gt;* | **Default value: **`Set`&lt;br&gt;An execution setting&lt;br&gt; `validate_only`: when this option is specified, the API call will not perform the mutation but will run through the validation rules against values of each field. &lt;br&gt;`include_recommendations`: this option cannot be used by itself. When this option is used, recommendations  for ad object&#039;s configuration will be included. A separate section [recommendations](https://developers.facebook.com/docs/marketing-api/reference/ad-recommendation) will be included in the response, but only if recommendations for this specification exist.&lt;br&gt;`synchronous_ad_review`: this option should not be used by itself. It should always be specified with `validate_only`. When these options are specified, the API call will perform Ads Integrity validations, which include message language checking, image 20% text rule, and so on, as well as the validation logics.&lt;br&gt;If the call passes validation or review, response will be `&#123;&quot;success&quot;: true&#125;`. If the call does not pass, an error will be returned with more details. These options can be used to improve any UI to display errors to the user much sooner, e.g. as soon as a new value is typed into any field corresponding to this ad object, rather than at the upload/save stage, or after review.&lt;br&gt; |
| `include_demolink_hashes`&lt;br&gt;&lt;br&gt;*boolean* | Include the demolink hashes.&lt;br&gt; |
| `name`&lt;br&gt;&lt;br&gt;*string* | Name of the ad.&lt;br&gt;&lt;br&gt;**[required]**&lt;br&gt;&lt;br&gt;**[supports emoji]**&lt;br&gt; |
| `priority`&lt;br&gt;&lt;br&gt;*int64* | Priority&lt;br&gt; |
| `source_ad_id`&lt;br&gt;&lt;br&gt;*numeric string or integer* | ID of the source Ad, if applicable.&lt;br&gt; |
| `status`&lt;br&gt;&lt;br&gt;*enum&#123;ACTIVE, PAUSED, DELETED, ARCHIVED&#125;* | Only `ACTIVE` and `PAUSED` are valid during creation. Other statuses&lt;br&gt;can be used for update. When an ad is created, it will first go through&lt;br&gt;ad review, and will have the ad status `PENDING_REVIEW` before it&lt;br&gt;finishes review and reverts back to your selected status of `ACTIVE`&lt;br&gt;or `PAUSED`. During testing, it is recommended to set ads to a `PAUSED`&lt;br&gt;status so as to not incur accidental spend.&lt;br&gt; |
| `tracking_specs`&lt;br&gt;&lt;br&gt;*Object* | With Tracking Specs, you log actions taken by people on your ad. See [Tracking and Conversion Specs](https://developers.facebook.com/documentation/ads-commerce/marketing-api/tracking-specs).&lt;br&gt; |

#### Return Type

This endpoint supports [read-after-write](https://developers.facebook.com/docs/graph-api/overview#read-after-write) and will read the node represented by *id* in the return type.

```
Struct  &#123;
id: numeric string,
success: bool,
&#125;
```

#### Error Codes

| Error Code | Description |
| --- | --- |
| 100 | Invalid parameter |
| 200 | Permissions error |
| 613 | Calls to this api have exceeded the rate limit. |
| 368 | The action attempted has been deemed abusive or is otherwise disallowed |
| 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. |
| 194 | Missing at least one required parameter |
| 500 | Message contains banned content |
| 2635 | You are calling a deprecated version of the Ads API. Please update to the latest version. |
| 190 | Invalid OAuth 2.0 Access Token |
| 105 | The number of parameters exceeded the maximum for this operation |

## Updating

You can&#039;t perform this operation on this endpoint.

## Deleting

You can&#039;t perform this operation on this endpoint.

