> For the complete documentation index, see [llms.txt](https://edrus.gitbook.io/appgregator-api-docs/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://edrus.gitbook.io/appgregator-api-docs/appgregators/marketing/facebook-ads/before-starting/api/ad-account/claim-accounts-post.md).

# Claim Accounts -POST

If you manage ad accounts outside of a Business Manager with the "Admin" role, you can claim them for your business. This is a one-time procedure. Once claimed, you can only manage the ad accounts in that Business Manager.

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

#### Query Parameters

| Name                                               | Type   | Description           |
| -------------------------------------------------- | ------ | --------------------- |
| name<mark style="color:red;">\*</mark>             | String | ft-4                  |
| connection\_name<mark style="color:red;">\*</mark> | String | fbads-01              |
| business\_id<mark style="color:red;">\*</mark>     | String | 404745734937629       |
| adaccount\_id<mark style="color:red;">\*</mark>    | String | act\_1514519918873559 |

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

```javascript
{
    "error": {
        "message": "You have exceeded the number of allowed ad accounts for your Business Manager at this time.",
        "type": "OAuthException",
        "code": 3979,
        "error_subcode": 1752140,
        "is_transient": false,
        "error_user_title": "Anda Sudah Mencapai Batas Maksimal Akun Iklan",
        "error_user_msg": "Anda sudah mencapai batas maksimal akun iklan. Anda bisa meningkatkan batas dengan cara melakukan pembayaran di akun bisnis. Lihat batas akun iklan Anda di Pengelola Bisnis (buka Pengaturan Bisnis, lalu Info Bisnis).",
        "fbtrace_id": "AT43Yx2f45NULJyn2lWnDyt"
    }
}
```

{% endtab %}
{% endtabs %}

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

```shell
curl --location --request POST 'https://us-central1-appgregator.cloudfunctions.net/facebook/adaccounts/claim-accounts?name=ft-4&connection_name=fbads-01&adaccount_id=act_1514519918873559&business_id=404745734937629' \
--header 'x-api-key: U2Fsd...'
```

{% endtab %}

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

```javascript
var axios = require('axios');

var config = {
  method: 'post',
  url: 'https://us-central1-appgregator.cloudfunctions.net/facebook/adaccounts/claim-accounts?name=ft-4&connection_name=fbads-01&adaccount_id=act_1514519918873559&business_id=404745734937629',
  headers: { 
    'x-api-key': 'U2Fsd...'
  }
};

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/adaccounts/claim-accounts?name=ft-4&connection_name=fbads-01&adaccount_id=act_1514519918873559&business_id=404745734937629',
  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_HTTPHEADER => array(
    'x-api-key: U2Fsd...'
  ),
));

$response = curl_exec($curl);

curl_close($curl);
echo $response;

```

{% endtab %}
{% endtabs %}


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## Querying This Documentation
If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://edrus.gitbook.io/appgregator-api-docs/appgregators/marketing/facebook-ads/before-starting/api/ad-account/claim-accounts-post.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
