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

# Contacts

> Create, list, retrieve and update contacts via the Zavu Python SDK. Manage profile metadata, channels and merge suggestions from your code.

Contacts are automatically created when you send messages. You can retrieve and update contact information.

## Get Contact

```python theme={null}
result = client.contacts.get(contact_id="con_abc123")

print(result.id)
print(result.phone_number)
print(result.country_code)
print(result.available_channels)
print(result.default_channel)
```

## Get Contact by Phone

```python theme={null}
result = client.contacts.get_by_phone(phone_number="+14155551234")

print(result.id)
print(result.available_channels)  # ["sms", "whatsapp"]
```

## Update Contact

```python theme={null}
result = client.contacts.update(
    contact_id="con_abc123",
    default_channel="whatsapp",
    metadata={
        "name": "John Doe",
        "tier": "premium"
    }
)
```

## List Contacts

```python theme={null}
result = client.contacts.list(limit=50)

for contact in result.items:
    print(contact.id, contact.phone_number)

# Filter by phone number
result = client.contacts.list(phone_number="+1415")

# Pagination
cursor = None
while True:
    result = client.contacts.list(cursor=cursor, limit=50)
    for contact in result.items:
        print(contact.id)
    cursor = result.next_cursor
    if not cursor:
        break
```

## Phone Introspection

Validate a phone number and check available channels:

```python theme={null}
result = client.introspect.phone(phone_number="+14155551234")

print(result.valid_number)       # True
print(result.country_code)       # "US"
print(result.national_format)    # "(415) 555-1234"
print(result.line_type)          # "mobile"
print(result.available_channels) # ["sms", "whatsapp"]
print(result.carrier.name)       # "Verizon Wireless"
```
