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

# Meta audiences: List Ad Accounts

> List the Meta ad accounts this connection can upload to, with the workspace default marked. Includes inputs, outputs, SDK V2 examples, and Deepline cost.

List the Meta ad accounts this connection can upload to, with the workspace default marked.

<Info>
  Tool ID: `meta_audiences_list_ad_accounts`
</Info>

## Run this action

Use the TypeScript SDK for a single call. Put `ctx.tools.execute(...)` inside a Play when the call should be durable, scheduled, or run across a CSV.

```ts theme={null}
import { Deepline } from 'deepline';

const deepline = await Deepline.connect();
const result = await deepline.tools.execute(
  'meta_audiences_list_ad_accounts',
  {},
);

console.log(result.toolResponse.raw);
```

### CLI

```bash theme={null}
deepline tools execute meta_audiences_list_ad_accounts --input '{}' --json
```

## Example response

The SDK exposes this shape at `result.toolResponse.raw`. Values below are representative.

```json theme={null}
{
  "data": {
    "ad_accounts": [
      {
        "id": "id_123",
        "account_id": "123456789",
        "name": "Example",
        "account_status": 1,
        "currency": "example",
        "timezone_name": "Example",
        "custom_audience_terms_accepted": false,
        "enabled": true,
        "is_default": true
      }
    ],
    "default_ad_account_id": "123456789",
    "discovery_mode": "user_access_token",
    "client_business_id": "client_business_123"
  }
}
```

Use `deepline tools get meta_audiences_list_ad_accounts --json` for the latest machine-readable contract.

## Input reference

This action does not require input fields.

<details>
  <summary>Show raw input schema</summary>

  ### Input JSON Schema

  ```json theme={null}
  {
    "type": "object",
    "properties": {},
    "additionalProperties": false
  }
  ```
</details>

## Output reference

| Name | Type | Required | Default | Details |
| - | - | - | - | - |
| `result.data` | `object` | Yes | — | — |
| `result.data.ad_accounts` | `array` | Yes | — | — |
| `result.data.ad_accounts[].id` | `string` | Yes | — | Ad account id in act\_\<number> form. |
| `result.data.ad_accounts[].account_id` | `string` | Yes | — | Numeric ad account id. |
| `result.data.ad_accounts[].name` | `string \| null` | Yes | — | — |
| `result.data.ad_accounts[].account_status` | `number \| null` | Yes | — | Meta account\_status code; 1 is ACTIVE. |
| `result.data.ad_accounts[].currency` | `string \| null` | Yes | — | — |
| `result.data.ad_accounts[].timezone_name` | `string \| null` | Yes | — | — |
| `result.data.ad_accounts[].custom_audience_terms_accepted` | `boolean \| null` | Yes | — | — |
| `result.data.ad_accounts[].enabled` | `boolean` | Yes | — | Whether Deepline tools may target this account in this workspace. |
| `result.data.ad_accounts[].is_default` | `boolean` | Yes | — | Whether an omitted ad\_account\_id resolves to this account. |
| `result.data.default_ad_account_id` | `string \| null` | Yes | — | — |
| `result.data.discovery_mode` | `"user_access_token" \| "business_integration_system_user"` | Yes | — | Allowed: `user_access_token`, `business_integration_system_user`. |
| `result.data.client_business_id` | `string \| null` | Yes | — | — |

<details>
  <summary>Show raw output schema</summary>

  ### Output JSON Schema

  ```json theme={null}
  {
    "type": "object",
    "properties": {
      "data": {
        "type": "object",
        "properties": {
          "ad_accounts": {
            "type": "array",
            "items": {
              "type": "object",
              "properties": {
                "id": {
                  "type": "string",
                  "description": "Ad account id in act_<number> form."
                },
                "account_id": {
                  "type": "string",
                  "description": "Numeric ad account id."
                },
                "name": {
                  "type": [
                    "string",
                    "null"
                  ]
                },
                "account_status": {
                  "type": [
                    "number",
                    "null"
                  ],
                  "description": "Meta account_status code; 1 is ACTIVE."
                },
                "currency": {
                  "type": [
                    "string",
                    "null"
                  ]
                },
                "timezone_name": {
                  "type": [
                    "string",
                    "null"
                  ]
                },
                "custom_audience_terms_accepted": {
                  "type": [
                    "boolean",
                    "null"
                  ]
                },
                "enabled": {
                  "type": "boolean",
                  "description": "Whether Deepline tools may target this account in this workspace."
                },
                "is_default": {
                  "type": "boolean",
                  "description": "Whether an omitted ad_account_id resolves to this account."
                }
              },
              "required": [
                "id",
                "account_id",
                "name",
                "account_status",
                "currency",
                "timezone_name",
                "custom_audience_terms_accepted",
                "enabled",
                "is_default"
              ],
              "additionalProperties": false
            }
          },
          "default_ad_account_id": {
            "type": [
              "string",
              "null"
            ]
          },
          "discovery_mode": {
            "type": "string",
            "enum": [
              "user_access_token",
              "business_integration_system_user"
            ]
          },
          "client_business_id": {
            "type": [
              "string",
              "null"
            ]
          }
        },
        "required": [
          "ad_accounts",
          "default_ad_account_id",
          "discovery_mode",
          "client_business_id"
        ],
        "additionalProperties": false
      }
    },
    "required": [
      "data"
    ],
    "additionalProperties": false
  }
  ```
</details>

## Deepline cost

* Pricing model: `fixed` (per call).
* Estimated Deepline credits: `0` per pricing unit.
* Provider-native pricing may still exist outside Deepline credit billing.

## Related documentation

* [SDK V2 quickstart](/docs/sdk-v2/quickstart)
* [SDK reference](/docs/sdk-v2/sdk-reference)
* [Run tools across a CSV](/docs/sdk-v2/batch-csv)


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.