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

# adjar import

`adjar import` is the starting point for every Adjar project. It connects to your live ad account via the API and writes a complete snapshot of your campaigns, ad groups, creatives, and conversions — plus keywords and assets on Google Ads — to a TOML config. Once imported, your account lives in plain text — human-readable, diffable, and ready to be managed by you or an AI agent.

## Syntax

```bash theme={null}
adjar import --account <id> [--platform <google|openai>] [-o <output-file>]
```

With no `-o`, the config is written to stdout.

## Flags

<ParamField query="--account <id>" type="string" required>
  The account ID to import.

  * **Google Ads** — the numeric customer ID shown top-right in the Google Ads UI, with no hyphens (e.g. `4821937650`, not `482-193-7650`).
  * **OpenAI Ads** — the `adacct_…` account ID. Since the API key already scopes to one account, this is mainly a label; Adjar reads the real ID from the account endpoint.
</ParamField>

<ParamField query="--platform <platform>" type="string" default="google">
  The ad platform to import from — `google` or `openai`.
</ParamField>

<ParamField query="-o, --out <file>" type="string">
  Path to the TOML file to write (e.g., `config/google.toml`). The parent directory is created automatically if it does not exist. Omit to print the config to stdout instead.
</ParamField>

<ParamField query="--credentials <path>" type="string">
  Path to the platform credentials JSON file (`google.json` or `openai.json`). Alternatively set `ADJAR_CREDENTIALS`. See [Authentication](/docs/cli/overview#authentication).
</ParamField>

## Examples

```bash theme={null}
# Google Ads → file
adjar import --account 4821937650 -o config/google.toml

# OpenAI Ads → file
adjar import --platform openai --account adacct_6a44ee8e025c819fbd6057719ccb8545 -o config/openai.toml

# Preview the config without writing it
adjar import --account 4821937650
```

## Output

`adjar import` writes a single self-contained TOML file containing the account's metadata and its full campaign tree — every campaign, ad group, ad, and account-level conversion (plus keywords and assets on Google Ads). For a large account you can split this into multiple files with a top-level `imports` directive after the fact — see the config reference for [Google Ads](/docs/config/google/account) or [OpenAI Ads](/docs/config/openai/account).

## After import: commit to version control

Once the import completes, commit the entire config directory to your repository. This snapshot becomes the baseline that `adjar plan` diffs against:

```bash theme={null}
git add config/
git commit -m "chore: initial import of Google Ads account 4821937650"
```

From this point forward, all changes flow through the `plan` → `apply` cycle rather than through `import`.

## Re-running import

Re-run `adjar import` to refresh your local config from the live account state at any time — for example, after making changes directly in the Google Ads UI, or to onboard a new team member against the latest live state:

```bash theme={null}
adjar import --account 4821937650 -o config/google.toml
```

<Warning>
  Re-running `adjar import` overwrites the output file with the live account state. Commit or stash any uncommitted local changes first — they will be lost.
</Warning>

## Next steps

After importing, edit your TOML files and use [`adjar plan`](/docs/cli/plan) to preview what will change before pushing anything back to the platform.
