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

# Contact Methods

> Managing client communication channels

Contact methods represent communication channels for clients, such as email addresses and phone numbers.

## Contact Method Types

| Type    | Description        |
| ------- | ------------------ |
| `email` | Email address      |
| `phone` | Phone number       |
| `fax`   | Fax number         |
| `other` | Other contact type |

## Creating Contact Methods

```typescript theme={null}
// Create an email contact
const email = await sdk.contactMethods.create({
  clientId: "client_abc123",
  type: "email",
  value: "juan@example.com",
  label: "Personal",
  isPrimary: true,
});

// Create a phone contact
const phone = await sdk.contactMethods.create({
  clientId: "client_abc123",
  type: "phone",
  value: "+52 55 1234 5678",
  label: "Mobile",
  isPrimary: false,
});
```

## Retrieving Contact Methods

```typescript theme={null}
// Get a specific contact method
const contact = await sdk.contactMethods.retrieve("contact_xyz789");

console.log(contact.type); // "email"
console.log(contact.value); // "juan@example.com"
console.log(contact.isPrimary); // true
```

Also available: `retrieveByExternalId` and `retrieveByMetadata` for custom identifiers or metadata lookups (see [SDK reference](/sdk/resources)).

## Listing Contact Methods

### List by Client

```typescript theme={null}
// Get all contact methods for a client
const { data: contacts } =
  await sdk.contactMethods.listByClient("client_abc123");

for (const contact of contacts) {
  console.log(`${contact.type}: ${contact.value}`);
}
```

### Filter by Type

```typescript theme={null}
// Get only email contacts for a client
const { data: emails } = await sdk.contactMethods.list({
  filter: {
    clientId: "client_abc123",
    type: "email",
  },
});
```

## Updating Contact Methods

```typescript theme={null}
// Update a contact method
const updated = await sdk.contactMethods.update("contact_xyz789", {
  value: "new.email@example.com",
  isPrimary: true,
});
```

## Deleting Contact Methods

```typescript theme={null}
await sdk.contactMethods.delete("contact_xyz789");
```

## Primary Contact

Each client can have one primary contact method per type:

```typescript theme={null}
// Get the primary email for a client
const primaryEmail = await sdk.contactMethods.getPrimary(
  "client_abc123",
  "email",
);

if (primaryEmail) {
  console.log(`Primary email: ${primaryEmail.value}`);
}

// Set a contact as primary
await sdk.contactMethods.update("contact_xyz789", {
  isPrimary: true,
});
```

<Info>
  Setting a contact method as primary automatically removes the primary flag
  from other contact methods of the same type for that client.
</Info>

## Contact Method Model Properties

| Property     | Type                  | Description             |
| ------------ | --------------------- | ----------------------- |
| `id`         | `string`              | Unique identifier       |
| `clientId`   | `string`              | Parent client ID        |
| `type`       | `ContactMethodType`   | Contact type            |
| `value`      | `string`              | The contact value       |
| `label`      | `string \| undefined` | Optional label          |
| `isPrimary`  | `boolean`             | Whether this is primary |
| `isVerified` | `boolean`             | Whether verified        |
| `createdAt`  | `Date`                | Creation timestamp      |
| `updatedAt`  | `Date`                | Last update timestamp   |

## Batch Operations

```typescript theme={null}
// Create multiple contact methods
const result = await sdk.contactMethods.createMany([
  {
    clientId: "client_abc123",
    type: "email",
    value: "work@company.com",
    label: "Work",
  },
  {
    clientId: "client_abc123",
    type: "phone",
    value: "+52 55 9876 5432",
    label: "Work",
  },
]);
```

<Info>See [Batch Operations](/guides/batch-operations) for more details.</Info>
