> ## Documentation Index
> Fetch the complete documentation index at: https://developers.leadwaycrm.com/llms.txt
> Use this file to discover all available pages before exploring further.

# Delete ad account

> Remove a Google Ads account connection from a account

Remove a Google Ads account connection from a account

```http theme={null}
DELETE https://services.leadconnectorhq.com/ad-publishing/google/ad-accounts/{adAccountId}
```

## Autorización

<ParamField header="Authorization" type="string" required>
  Bearer token generado desde el portal Leadway. Ver [Autenticación](/authentication).
</ParamField>

<ParamField header="Version" type="string" required default="2021-07-28">
  Versión de la API.
</ParamField>

## Path parameters

<ParamField path="adAccountId" type="string" required default="act_abc123">
  Ad account identifier
</ParamField>

## Body

<ParamField body="locationId" type="string" required default="HChooFuiyPpVYzeJ4HMe">
  Account identifier
</ParamField>

## Respuestas

<Accordion title="200 - Response" />

<Accordion title="400 - Bad Request">
  ```json theme={null}
  {}
  ```
</Accordion>

<Accordion title="401 - Unauthorized">
  ```json theme={null}
  {}
  ```
</Accordion>

<Accordion title="422 - Unprocessable Entity">
  ```json theme={null}
  {}
  ```
</Accordion>

## Ejemplo

<CodeGroup>
  ```bash cURL theme={null}
  curl -X DELETE 'https://services.leadconnectorhq.com/ad-publishing/google/ad-accounts/YOUR_adAccountId' \
    -H 'Authorization: Bearer YOUR_TOKEN' \
    -H 'Version: 2021-07-28' \
    -H 'Content-Type: application/json' \
    -d '{
    "locationId": "HChooFuiyPpVYzeJ4HMe"
  }'
  ```

  ```javascript Node.js theme={null}
  const response = await fetch('https://services.leadconnectorhq.com/ad-publishing/google/ad-accounts/YOUR_adAccountId', {
    method: 'DELETE',
    headers: {
      Authorization: `Bearer ${process.env.LEADWAY_TOKEN}`,
      Version: '2021-07-28',
      'Content-Type': 'application/json',
    },
    body: JSON.stringify({"locationId": "HChooFuiyPpVYzeJ4HMe"}),
  });
  const data = await response.json();
  ```

  ```python Python theme={null}
  import os, requests
  response = requests.request(
      'DELETE',
      'https://services.leadconnectorhq.com/ad-publishing/google/ad-accounts/YOUR_adAccountId',
      headers={
          'Authorization': f"Bearer {os.environ['LEADWAY_TOKEN']}",
          'Version': '2021-07-28',
          'Content-Type': 'application/json',
      },
      json={"locationId": "HChooFuiyPpVYzeJ4HMe"},
  )
  data = response.json()
  ```

  ```php PHP theme={null}
  <?php
  $ch = curl_init('https://services.leadconnectorhq.com/ad-publishing/google/ad-accounts/YOUR_adAccountId');
  curl_setopt_array($ch, [
      CURLOPT_RETURNTRANSFER => true,
      CURLOPT_CUSTOMREQUEST => 'DELETE',
      CURLOPT_HTTPHEADER => [
          'Authorization: Bearer ' . getenv('LEADWAY_TOKEN'),
          'Version: 2021-07-28',
          'Content-Type: application/json',
      ],
      CURLOPT_POSTFIELDS => json_encode({'locationId': 'HChooFuiyPpVYzeJ4HMe'}),
  ]);
  $data = json_decode(curl_exec($ch), true);
  ```
</CodeGroup>
