# Contact Card

## Get contact cards

**get** `/v3/contact_card`

Returns the contact card for a specific phone number, or all contact cards for the
authenticated partner if no `phone_number` is provided.

### Query Parameters

- `phone_number: optional string`

  E.164 phone number to filter by. If omitted, all my cards for the partner are returned.

### Returns

- `contact_cards: array of object { first_name, is_active, phone_number, 2 more }`

  - `first_name: string`

  - `is_active: boolean`

  - `phone_number: string`

  - `image_url: optional string`

  - `last_name: optional string`

### Example

```http
curl https://api.linqapp.com/api/partner/v3/contact_card \
    -H "Authorization: Bearer $LINQ_API_V3_API_KEY"
```

#### Response

```json
{
  "contact_cards": [
    {
      "phone_number": "+15551234567",
      "first_name": "John",
      "last_name": "Doe",
      "image_url": "https://cdn.linqapp.com/contact-card/example.jpg",
      "is_active": true
    }
  ]
}
```

## Setup contact card

**post** `/v3/contact_card`

Creates a contact card for a phone number. This endpoint is intended for initial, one-time setup only.

The contact card is stored in an inactive state first. Once it's applied successfully,
it is activated and `is_active` is returned as `true`. On failure, `is_active` is `false`.

**Note:** To update an existing contact card after setup, use `PATCH /v3/contact_card` instead.

### Body Parameters

- `first_name: string`

  First name for the contact card. Required.

- `phone_number: string`

  E.164 phone number to associate the contact card with

- `image_url: optional string`

  URL of the profile image to rehost on the CDN. Only re-uploaded when a new value is provided.

- `last_name: optional string`

  Last name for the contact card. Optional.

### Returns

- `SetContactCard object { first_name, is_active, phone_number, 2 more }`

  - `first_name: string`

    First name on the contact card

  - `is_active: boolean`

    Whether the contact card was successfully applied to the device

  - `phone_number: string`

    The phone number the contact card is associated with

  - `image_url: optional string`

    Image URL on the contact card

  - `last_name: optional string`

    Last name on the contact card

### Example

```http
curl https://api.linqapp.com/api/partner/v3/contact_card \
    -H 'Content-Type: application/json' \
    -H "Authorization: Bearer $LINQ_API_V3_API_KEY" \
    -d '{
          "first_name": "Acme",
          "phone_number": "+15551234567",
          "image_url": "https://cdn.linqapp.com/contact-card/example.jpg",
          "last_name": "Support"
        }'
```

#### Response

```json
{
  "phone_number": "+15551234567",
  "first_name": "John",
  "last_name": "Doe",
  "image_url": "https://cdn.linqapp.com/contact-card/example.jpg",
  "is_active": true
}
```

## Update contact card

**patch** `/v3/contact_card`

Partially updates an existing active contact card for a phone number.

Fetches the current active contact card and merges the provided fields.
Only fields present in the request body are updated; omitted fields retain their existing values.

Requires an active contact card to exist for the phone number.

### Query Parameters

- `phone_number: string`

  E.164 phone number of the contact card to update

### Body Parameters

- `first_name: optional string`

  Updated first name. If omitted, the existing value is kept.

- `image_url: optional string`

  Updated profile image URL. If omitted, the existing image is kept.

- `last_name: optional string`

  Updated last name. If omitted, the existing value is kept.

### Returns

- `SetContactCard object { first_name, is_active, phone_number, 2 more }`

  - `first_name: string`

    First name on the contact card

  - `is_active: boolean`

    Whether the contact card was successfully applied to the device

  - `phone_number: string`

    The phone number the contact card is associated with

  - `image_url: optional string`

    Image URL on the contact card

  - `last_name: optional string`

    Last name on the contact card

### Example

```http
curl https://api.linqapp.com/api/partner/v3/contact_card \
    -X PATCH \
    -H 'Content-Type: application/json' \
    -H "Authorization: Bearer $LINQ_API_V3_API_KEY" \
    -d '{
          "first_name": "John",
          "image_url": "https://cdn.linqapp.com/contact-card/example.jpg",
          "last_name": "Doe"
        }'
```

#### Response

```json
{
  "phone_number": "+15551234567",
  "first_name": "John",
  "last_name": "Doe",
  "image_url": "https://cdn.linqapp.com/contact-card/example.jpg",
  "is_active": true
}
```

## Domain Types

### Set Contact Card

- `SetContactCard object { first_name, is_active, phone_number, 2 more }`

  - `first_name: string`

    First name on the contact card

  - `is_active: boolean`

    Whether the contact card was successfully applied to the device

  - `phone_number: string`

    The phone number the contact card is associated with

  - `image_url: optional string`

    Image URL on the contact card

  - `last_name: optional string`

    Last name on the contact card

### Contact Card Retrieve Response

- `ContactCardRetrieveResponse object { contact_cards }`

  - `contact_cards: array of object { first_name, is_active, phone_number, 2 more }`

    - `first_name: string`

    - `is_active: boolean`

    - `phone_number: string`

    - `image_url: optional string`

    - `last_name: optional string`
