# Create a New Adgroup

<details>

<summary>Body JSON</summary>

```shell
{
    "adgroup_name" : "adgroup 9"
}
```

</details>

<mark style="color:green;">`POST`</mark> `https://us-central1-appgregator.cloudfunctions.net/googleads/adgroups/`

#### Query Parameters

| Name                                               | Type   | Description |
| -------------------------------------------------- | ------ | ----------- |
| name<mark style="color:red;">\*</mark>             | String | ft-4        |
| connection\_name<mark style="color:red;">\*</mark> | String | ga-06       |
| customer\_id<mark style="color:red;">\*</mark>     | String | 8171576147  |
| campaign\_id<mark style="color:red;">\*</mark>     | String | 19557665715 |

#### Headers

| Name                                                | Type   | Description                          |
| --------------------------------------------------- | ------ | ------------------------------------ |
| login-customer-id<mark style="color:red;">\*</mark> | String | 1894250756                           |
| client\_id<mark style="color:red;">\*</mark>        | String | XXXX-XXXX.apps.googleusercontent.com |
| client\_secret<mark style="color:red;">\*</mark>    | String | XXXX-XXXX                            |
| developer\_token<mark style="color:red;">\*</mark>  | String | XXXX                                 |
| x-api-key<mark style="color:red;">\*</mark>         | String | U2FsdG...                            |

{% tabs %}
{% tab title="201: Created Success" %}

```javascript
{
    "status": true,
    "count": 1
}
```

{% endtab %}
{% endtabs %}

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

```javascript
var axios = require('axios');
var data = JSON.stringify({
  "adgroup_name": "adgroup 10"
});

var config = {
  method: 'post',
  url: 'https://us-central1-appgregator.cloudfunctions.net/googleads/adgroups?name=ft-4&connection_name=ga-06&customer_id=8171576147&campaign_id=19557665715',
  headers: { 
    'login-customer-id': '1894250756', 
    'client_id': 'XXXX-XXXX.apps.googleusercontent.com', 
    'client_secret': 'XXXX-XXXX', 
    'developer_token': 'XXX', 
    '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="cURL" %}

```shell
curl --location --request POST 'https://us-central1-appgregator.cloudfunctions.net/googleads/adgroups?name=ft-4&connection_name=ga-06&customer_id=8171576147&campaign_id=19557665715' \
--header 'login-customer-id: 1894250756' \
--header 'client_id: XXXX-XXXX.apps.googleusercontent.com' \
--header 'client_secret: XXXX-XXXX' \
--header 'developer_token: XXX' \
--header 'x-api-key: U2Fsd...' \
--header 'Content-Type: application/json' \
--data-raw '{
    "adgroup_name" : "adgroup 10"
}'
```

{% endtab %}

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

```php
<?php

$curl = curl_init();

curl_setopt_array($curl, array(
  CURLOPT_URL => 'https://us-central1-appgregator.cloudfunctions.net/googleads/adgroups?name=ft-4&connection_name=ga-06&customer_id=8171576147&campaign_id=19557665715',
  CURLOPT_RETURNTRANSFER => true,
  CURLOPT_ENCODING => '',
  CURLOPT_MAXREDIRS => 10,
  CURLOPT_TIMEOUT => 0,
  CURLOPT_FOLLOWLOCATION => true,
  CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
  CURLOPT_CUSTOMREQUEST => 'POST',
  CURLOPT_POSTFIELDS =>'{
    "adgroup_name" : "adgroup 10"
}',
  CURLOPT_HTTPHEADER => array(
    'login-customer-id: 1894250756',
    'client_id: XXXX-XXXX.apps.googleusercontent.com',
    'client_secret: XXXX-XXXX',
    'developer_token: XXX',
    'x-api-key: U2Fsd...',
    'Content-Type: application/json'
  ),
));

$response = curl_exec($curl);

curl_close($curl);
echo $response;

```

{% endtab %}
{% endtabs %}
