# Investigate accounts and segments

> Connect customers to companies or workspaces and watch important account groups.

Canonical page: https://anectico.com/docs/investigate/accounts-and-segments/


Accounts are built from SDK `group()` calls. They let a B2B team see customer activity, errors, and
impact at a company, workspace, tenant, or other group boundary.

## Create account identity in the SDK

After identifying a customer, call `group` with a stable group type and key:

<div data-language-tabs="account-group" data-language-tabs-label="Choose an SDK"></div>

**JavaScript / TypeScript**

```typescript
anectico.group('company', 'acme', { name: 'Acme Inc', plan: 'enterprise' });
```

**Python**

```python
client.group('company', 'acme', {'name': 'Acme Inc', 'plan': 'enterprise'})
```

**Go**

```go
if err := client.Group(ctx, "company", "acme", map[string]any{
	"name": "Acme Inc",
	"plan": "enterprise",
}); err != nil {
	return err
}
```

**Swift (iOS)**

```swift
Anectico.group(type: "company", key: "acme", set: ["name": "Acme Inc", "plan": "enterprise"])
```

**Kotlin (Android)**

```kotlin
Anectico.group("company", "acme", mapOf("name" to "Acme Inc", "plan" to "enterprise"))
```

**React Native**

```typescript
await Anectico.group('company', 'acme', { name: 'Acme Inc', plan: 'enterprise' });
```

**Flutter**

```dart
await Anectico.group('company', 'acme', set: {
  'name': 'Acme Inc',
  'plan': 'enterprise',
});
```

<div data-language-tabs-end="account-group"></div>

Use one meaning per group type. Do not alternate between `company`, `account`, and `workspace` for
the same domain object. Group properties should be small, current facts—not secrets or event history.

## Investigate an account

Open **Customers → Accounts**, choose the group type, and search by key. An account page brings its
member customers and connected activity together. Start with the account symptom, then open an
affected customer or Issue for the detailed causal path.

If an account is empty, verify `group()` runs after `identify()` and before the relevant events. A
group assertion records membership even when no optional properties are supplied.

## Create an account segment

Open **Customers → Account Segments** to save a reusable filter for important accounts. Segments can be
used by watched-account alerting, so validate the current membership before relying on escalation.

Choose **Preview** on a saved segment to see a count and list of up to 200 current matching accounts.
Each result links to the account detail page, making it easy to check several matching and non-matching
accounts after an edit.

Before deleting a segment, update any alert routing that uses it. Anectico refuses to delete a segment
while an active alert rule still references it and explains that dependency in the confirmation
dialog; disable or retarget the rule, then retry.

- [Identify customers](/docs/instrument/identity)
- [Create alerts](/docs/respond/alerts)
