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

# Create Target Account

> Add target accounts for opportunity prioritization

Two formats supported:

| Format        | Behavior                           |
| ------------- | ---------------------------------- |
| Single object | Adds one account, keeps existing   |
| Batch array   | **Replaces all** existing accounts |

## Body (Single)

<ParamField body="company_name" type="string" required>
  Company name
</ParamField>

<ParamField body="linkedin_url" type="string">
  Company LinkedIn URL
</ParamField>

## Body (Batch)

<ParamField body="target_companies" type="object[]" required>
  **Replaces all existing accounts.**

  <Expandable title="fields">
    <ParamField body="name" type="string" required>Company name</ParamField>
    <ParamField body="linkedin_url" type="string">Company LinkedIn URL</ParamField>
  </Expandable>
</ParamField>

<RequestExample>
  ```json Single Account theme={null}
  {
    "company_name": "Acme Corp",
    "linkedin_url": "https://www.linkedin.com/company/acme-corp"
  }
  ```

  ```json Batch (replaces all) theme={null}
  {
    "target_companies": [
      {
        "name": "Acme Corp",
        "linkedin_url": "https://www.linkedin.com/company/acme-corp"
      },
      {
        "name": "Globex Inc",
        "linkedin_url": "https://www.linkedin.com/company/globex"
      }
    ]
  }
  ```

  ```bash cURL (single) theme={null}
  curl -X POST https://api.clustr-ai.com/api/public/target-accounts \
    -H "Authorization: Bearer YOUR_API_KEY" \
    -H "Content-Type: application/json" \
    -d '{"company_name": "Acme Corp", "linkedin_url": "https://www.linkedin.com/company/acme-corp"}'
  ```

  ```bash cURL (batch) theme={null}
  curl -X POST https://api.clustr-ai.com/api/public/target-accounts \
    -H "Authorization: Bearer YOUR_API_KEY" \
    -H "Content-Type: application/json" \
    -d '{"target_companies": [{"name": "Acme Corp"}, {"name": "Globex Inc"}]}'
  ```

  ```python Python theme={null}
  import requests

  requests.post(
      "https://api.clustr-ai.com/api/public/target-accounts",
      headers={"Authorization": "Bearer YOUR_API_KEY"},
      json={"company_name": "Acme Corp"},
  )
  ```
</RequestExample>

<ResponseExample>
  ```json 201 theme={null}
  {
    "success": true,
    "data": {
      "message": "Target companies created successfully",
      "count": 1
    }
  }
  ```

  ```json 400 theme={null}
  {
    "success": false,
    "error": {
      "message": "No target companies provided",
      "code": "BAD_REQUEST"
    }
  }
  ```

  ```json 401 theme={null}
  {
    "success": false,
    "error": {
      "message": "Invalid or missing API key",
      "code": "UNAUTHORIZED"
    }
  }
  ```
</ResponseExample>
