# Organize and share contact lists

Use a private list for one person’s contacts or a shared list for a team. For example, a field team can add scanned business cards to a shared list for sales colleagues to follow up in LeadResearch. Each record in the list is a [contact item](/contacts/contact-items/).

## Find your lists

Use a [personal API token](/authentication/) for the organization you want to work in.

```bash
CONTACTS=https://backend.snapaddy.com/contact

curl --fail-with-body "$CONTACTS/v1/contact-list/user?includeCount=true" \
  -H "x-api-key: $SNAPADDY_API_KEY"
```

```typescript
const apiKey = process.env.SNAPADDY_API_KEY;
if (!apiKey) throw new Error("Set SNAPADDY_API_KEY");

const response = await fetch("https://backend.snapaddy.com/contact/v1/contact-list/user?includeCount=true", {
  headers: { "x-api-key": apiKey },
});
if (!response.ok) throw new Error(`Request failed (${response.status})`);
console.log(await response.json());
```

```python
import json
import os
from urllib.request import Request, urlopen

request = Request(
    "https://backend.snapaddy.com/contact/v1/contact-list/user?includeCount=true",
    headers={"x-api-key": os.environ["SNAPADDY_API_KEY"]},
)
with urlopen(request, timeout=20) as response:
    print(json.load(response))
```

The response is an array of lists you can access, including lists shared directly or through a group. Select a list by its `name`, keep its `contactListId`, and use that ID to [read or create items](/contacts/contact-items/). The optional `includeCount` parameter adds each list’s item count.

## Create a shared list for a team

A private list (`isShared: false`, the default) is assigned to the user who creates it. To create a shared list, use an account with the **DataAgents Manager** role. The example makes the list available in LeadResearch and BusinessCards. Include `is_visible_in_data_agents` if it should also appear in DataAgents.

See the [API reference](/reference/contacts/) for the full request schema.

```bash
CONTACTS=https://backend.snapaddy.com/contact

curl --fail-with-body "$CONTACTS/v1/contact-list" \
  -H "x-api-key: $SNAPADDY_API_KEY" \
  -H 'Content-Type: application/json' \
  --data '{
    "name": "Partner leads",
    "isShared": true,
    "flags": ["is_visible_in_lead_research", "is_visible_in_business_cards"]
  }'
```

```typescript
const apiKey = process.env.SNAPADDY_API_KEY;
if (!apiKey) throw new Error("Set SNAPADDY_API_KEY");

const payload = {
  name: "Partner leads",
  isShared: true,
  flags: [
    "is_visible_in_lead_research",
    "is_visible_in_business_cards"
  ]
};
const response = await fetch("https://backend.snapaddy.com/contact/v1/contact-list", {
  method: "POST",
  headers: { "x-api-key": apiKey, "Content-Type": "application/json" },
  body: JSON.stringify(payload),
});
if (!response.ok) throw new Error(`Request failed (${response.status})`);
console.log(await response.json());
```

```python
import json
import os
from urllib.request import Request, urlopen

payload = {
    "name": "Partner leads",
    "isShared": True,
    "flags": [
        "is_visible_in_lead_research",
        "is_visible_in_business_cards"
    ]
}
request = Request(
    "https://backend.snapaddy.com/contact/v1/contact-list",
    method="POST",
    headers={"x-api-key": os.environ["SNAPADDY_API_KEY"], "Content-Type": "application/json"},
    data=json.dumps(payload).encode(),
)
with urlopen(request, timeout=20) as response:
    print(json.load(response))
```

The API returns `201` and the new list’s `contactListId`. Product visibility controls which app can display the list. Assign users or groups separately to determine who sees the contacts. Include yourself if you need the shared list in your own app.

## Manage access to a shared list

In the dashboard, open **Settings → Shared contact lists**, choose the list and select its users, groups, and product visibility. Members can work with contacts added by other members, including editing and exporting them. Moving a contact into the list makes it visible to those members. [BusinessCards setup](https://portal.snapaddy.com/knowledge/businesscards-shared-contact-list) · [LeadResearch sharing](https://portal.snapaddy.com/knowledge/how-to-create-a-shared-dataquality-contact-list)

For an API integration, use an account with the **DataAgents Manager** role. First read the existing assignments with `GET /v1/contact-list/shared?includeAssignments=true`. Find your list and inspect its `assignedUsers` and `assignedGroups`.

See the [API reference](/reference/contacts/) for the full request schema.

```bash
CONTACTS=https://backend.snapaddy.com/contact

curl --fail-with-body -X PATCH "$CONTACTS/v1/contact-list/$CONTACT_LIST_ID/assign" \
  -H "x-api-key: $SNAPADDY_API_KEY" \
  -H 'Content-Type: application/json' \
  --data '{"userIds":["ExampleUser00001","ExampleUser00002"]}'
```

```typescript
const apiKey = process.env.SNAPADDY_API_KEY;
if (!apiKey) throw new Error("Set SNAPADDY_API_KEY");
const contactListId = process.env.CONTACT_LIST_ID;
if (!contactListId) throw new Error("Set CONTACT_LIST_ID");

const payload = {
  userIds: [
    "ExampleUser00001",
    "ExampleUser00002"
  ]
};
const response = await fetch(`https://backend.snapaddy.com/contact/v1/contact-list/${encodeURIComponent(contactListId)}/assign`, {
  method: "PATCH",
  headers: { "x-api-key": apiKey, "Content-Type": "application/json" },
  body: JSON.stringify(payload),
});
if (!response.ok) throw new Error(`Request failed (${response.status})`);
console.log(response.status);
```

```python
import json
import os
from urllib.parse import quote
from urllib.request import Request, urlopen

payload = {
    "userIds": [
        "ExampleUser00001",
        "ExampleUser00002"
    ]
}
request = Request(
    f"https://backend.snapaddy.com/contact/v1/contact-list/{quote(os.environ['CONTACT_LIST_ID'], safe='')}/assign",
    method="PATCH",
    headers={"x-api-key": os.environ["SNAPADDY_API_KEY"], "Content-Type": "application/json"},
    data=json.dumps(payload).encode(),
)
with urlopen(request, timeout=20) as response:
    print(response.status)
```

**Each supplied array replaces that set of assignments.** This request sets the complete list of directly assigned users and preserves existing group assignments. Send `groupIds` to replace the groups. An empty array clears that assignment type. A user removed from `userIds` can still have access through an assigned group. The endpoint accepts shared lists only.

[Contacts API reference](/reference/contacts/)
