# Update ad rule

<mark style="color:orange;">`PUT`</mark> `https://us-central1-appgregator.cloudfunctions.net/facebook/adrules/`

#### Query Parameters

| Name                                               | Type   | Description       |
| -------------------------------------------------- | ------ | ----------------- |
| name<mark style="color:red;">\*</mark>             | String | ft-4              |
| connection\_name<mark style="color:red;">\*</mark> | String | fbads-01          |
| rule\_id<mark style="color:red;">\*</mark>         | String | 23852206730700549 |

#### Headers

| Name                                        | Type   | Description |
| ------------------------------------------- | ------ | ----------- |
| x-api-key<mark style="color:red;">\*</mark> | String | U2Fsd...    |

{% tabs %}
{% tab title="200: OK Success" %}

```javascript
{
    "success": true
}
```

{% endtab %}
{% endtabs %}

<details>

<summary>Body JSON</summary>

```shell
{
  "status": "ENABLED"
}
```

</details>

{% tabs %}
{% tab title="cURL" %}

```shell
curl --location --request PUT 'https://us-central1-appgregator.cloudfunctions.net/facebook/adrules?name=ft-4&connection_name=fbads-01&rule_id=23852206730700549' \
--header 'x-api-key: U2Fsd...' \
--header 'Content-Type: application/json' \
--data-raw '{
  "status": "ENABLED"
}'
```

{% endtab %}

{% tab title="NodeJs - Axios" %}

```javascript
var axios = require('axios');
var data = JSON.stringify({
  "status": "ENABLED"
});

var config = {
  method: 'put',
  url: 'https://us-central1-appgregator.cloudfunctions.net/facebook/adrules?name=ft-4&connection_name=fbads-01&rule_id=23852206730700549',
  headers: { 
    'x-api-key': 'U2Fsd...', 
    'Content-Type': 'application/json'
  },
  data : data
};

axios(config)
.then(function (response) {
  console.log(JSON.stringify(response.data));
})
.catch(function (error) {
  console.log(error);
});

```

{% endtab %}

{% tab title="PHP - cURL" %}

```php
<?php

$curl = curl_init();

curl_setopt_array($curl, array(
  CURLOPT_URL => 'https://us-central1-appgregator.cloudfunctions.net/facebook/adrules?name=ft-4&connection_name=fbads-01&rule_id=23852206730700549',
  CURLOPT_RETURNTRANSFER => true,
  CURLOPT_ENCODING => '',
  CURLOPT_MAXREDIRS => 10,
  CURLOPT_TIMEOUT => 0,
  CURLOPT_FOLLOWLOCATION => true,
  CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
  CURLOPT_CUSTOMREQUEST => 'PUT',
  CURLOPT_POSTFIELDS =>'{
  "status": "ENABLED"
}',
  CURLOPT_HTTPHEADER => array(
    'x-api-key: U2Fsd...',
    'Content-Type: application/json'
  ),
));

$response = curl_exec($curl);

curl_close($curl);
echo $response;

```

{% endtab %}
{% endtabs %}
