# Create and share digital business cards

Give someone a link to your current contact details, offer a wallet pass after an event, or build a directory of shareable team cards. A **digital card** is the profile you share with others. To read the people you’ve collected in a contact list, use [Contact items](/contacts/contact-items/).

## List your own digital cards

Call the Digital Card service with a [personal API token](/authentication/) for the user who owns the card. Call `GET /digital-card/` to list the token holder’s active cards in the current organization, oldest first. The response contains a `digitalCards` array. Keep the `digitalCardId` for API requests and use the returned `publicLink`, when present, as the destination for a QR code, email signature, or share button.

```bash
CARDS=https://backend.snapaddy.com/digital-card

curl --fail-with-body "$CARDS/" -H "x-api-key: $SNAPADDY_API_KEY" |
  jq '.digitalCards[] | {cardName, digitalCardId, publicLink}'
```

```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/digital-card/", {
  headers: { "x-api-key": apiKey },
});
if (!response.ok) throw new Error(`Request failed (${response.status})`);
const { digitalCards } = await response.json();
for (const { cardName, digitalCardId, publicLink } of digitalCards) {
  console.log({ cardName, digitalCardId, publicLink });
}
```

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

request = Request(
    "https://backend.snapaddy.com/digital-card/",
    headers={"x-api-key": os.environ["SNAPADDY_API_KEY"]},
)
with urlopen(request, timeout=20) as response:
    for card in json.load(response)["digitalCards"]:
        print({key: card.get(key) for key in ("cardName", "digitalCardId", "publicLink")})
```

## List cards across your organization

For a BusinessCards inventory, use the management search with a BusinessCards Manager or organization administrator account that has paid BusinessCards access. The response contains a page of `digitalCards` and the matching `total`. Use each item’s `userId` to identify the owner. The `email` here is the owner’s sign-in email.

```bash
curl --fail-with-body 'https://backend.snapaddy.com/digital-card/digital-card-management/find?limit=20&offset=0' \
  -H "x-api-key: $SNAPADDY_API_KEY" | jq '{total, cards: [.digitalCards[] | {digitalCardId, userId}]}'
```

```typescript
const url = "https://backend.snapaddy.com/digital-card/digital-card-management/find?limit=20&offset=0";
const response = await fetch(url, { headers: { "x-api-key": process.env.SNAPADDY_API_KEY! } });
if (!response.ok) throw new Error(`Card search failed (${response.status})`);
const { total, digitalCards } = await response.json();
console.log(total, digitalCards);
```

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

url = "https://backend.snapaddy.com/digital-card/digital-card-management/find?limit=20&offset=0"
request = Request(url, headers={"x-api-key": os.environ["SNAPADDY_API_KEY"]})
with urlopen(request, timeout=20) as response:
    page = json.load(response)
print(page["total"], page["digitalCards"])
```

Increase `offset` by the number of cards received to read the next page. To let colleagues browse cards intended for sharing, use the team directory below.

## Create a digital card

Send contact fields for the token holder and a hexadecimal `primaryColor`. The example uses a fictional contact. See [Create a digital card](/reference/businesscards/#POST/) in the API reference for the full request body. The API checks organization membership, additional-card eligibility, and access to advanced styling. Creating another card can return `409` when the user has reached their limit.

```bash
CARDS=https://backend.snapaddy.com/digital-card

curl --fail-with-body "$CARDS/" \
  -H "x-api-key: $SNAPADDY_API_KEY" \
  -H 'Content-Type: application/json' \
  --data '{
    "firstName": "Alex",
    "lastName": "Morgan",
    "email": "alex@example.com",
    "primaryColor": "#19624B"
  }'
```

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

const payload = {
  firstName: "Alex",
  lastName: "Morgan",
  email: "alex@example.com",
  primaryColor: "#19624B"
};
const response = await fetch("https://backend.snapaddy.com/digital-card/", {
  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 = {
    "firstName": "Alex",
    "lastName": "Morgan",
    "email": "alex@example.com",
    "primaryColor": "#19624B"
}
request = Request(
    "https://backend.snapaddy.com/digital-card/",
    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))
```

A successful creation returns `201` with the card. Save its `digitalCardId` and use its `publicLink` for sharing. Each successful POST creates a card, so reuse a card you found in the list if you already have one.

## Share a colleague’s card

Organizations with team sharing enabled can expose selected cards to colleagues. Searching the team directory requires access to paid digital card features.

1. Call `GET /digital-card-sharing/list?searchText=Morgan&limit=20&offset=0` with your API key. Read the `shareableCards` array and use `total` to page through results.
2. Select a `digitalCardId`, then call `GET /digital-card-sharing/card/{cardId}` with that ID and the same key.
3. Show the returned `publicLink` to the recipient when available. The service checks that the card is shareable in your organization.

## Offer wallet passes and contact files

Use the card UUID from the API as `CARD_ID`. The recipient can use these links without a snapAddy API token. For Google Wallet, give the recipient the full redirect URL to open in their browser.

| Recipient action | Request under the Digital Card service | Result |
| --- | --- | --- |
| Add to Apple Wallet | `GET /{id}/downloads/apple-wallet` | Binary Apple Wallet pass, served as `application/vnd.apple.pkpass` |
| Add to Google Wallet | `GET /{id}/redirects/google-wallet` | Redirects the recipient to Google Wallet |
| Save to contacts | `GET /{id}/downloads/vcard` | Contact file, served as `text/vcard` |

```bash
CARDS=https://backend.snapaddy.com/digital-card

# Replace the sample UUID with the digitalCardId you received.
CARD_ID=11111111-1111-4111-8111-111111111111

curl --fail "$CARDS/$CARD_ID/downloads/apple-wallet" --output contact.pkpass
printf '%s\n' "$CARDS/$CARD_ID/redirects/google-wallet"
curl --fail "$CARDS/$CARD_ID/downloads/vcard" --output contact.vcf
```

```typescript
import { writeFile } from "node:fs/promises";

const cardId = "11111111-1111-4111-8111-111111111111";
const card = `https://backend.snapaddy.com/digital-card/${cardId}`;
async function download(kind: string): Promise<Response> {
  const response = await fetch(`${card}/downloads/${kind}`);
  if (!response.ok) throw new Error(`Download failed (${response.status})`);
  return response;
}

await writeFile("contact.pkpass", new Uint8Array(await (await download("apple-wallet")).arrayBuffer()));
console.log(`${card}/redirects/google-wallet`);
await writeFile("contact.vcf", await (await download("vcard")).text());
```

```python
from pathlib import Path
from urllib.request import urlopen

card_id = "11111111-1111-4111-8111-111111111111"
card = f"https://backend.snapaddy.com/digital-card/{card_id}"

with urlopen(f"{card}/downloads/apple-wallet", timeout=20) as response:
    Path("contact.pkpass").write_bytes(response.read())
print(f"{card}/redirects/google-wallet")
with urlopen(f"{card}/downloads/vcard", timeout=20) as response:
    Path("contact.vcf").write_bytes(response.read())
```

[BusinessCards API reference](/reference/businesscards/)
