# Find or create by channel identity

Get the Subiz customer for a Facebook, Zalo, or other channel profile.

API 4.1

Use this endpoint when you know a customer's identity on a channel, such as their Facebook profile on your page, but not their Subiz user ID. It returns the existing customer, or creates one if none exists.

## Channel identity

A channel identity has three parts, all in the URL path:

| Parameter | Type | Description |
| --- | --- | --- |
| `accid` (path) | string | Your account ID. |
| `channel` (path) | string | Channel, such as `facebook` or `zalo`. |
| `source` (path) | string | Connected page or account on that channel, such as a Facebook page ID. |
| `id` (path) | string | Customer's profile ID on that channel. |

Use values from your connected integration. Do not put a Subiz user ID in `id`. There is no request body.

## Find without creating

Use `GET` on the same path to look up a customer without creating one:

```http
GET https://api.subiz.com.vn/4.1/accounts/YOUR_ACCID/contact-profiles/YOUR_CHANNEL/sources/YOUR_SOURCE/YOUR_ID
Authorization: Bearer YOUR_ACCESS_TOKEN
```

Use `POST`, shown at the end of this page, to find the customer or create them.

## Response

Both methods return HTTP `200` with the customer. Selected fields:

```json
{
  "id": "user_example",
  "account_id": "account_example",
  "channel": "facebook",
  "channel_source": "page_example",
  "profile_id": "profile_example",
  "attributes": [
    {
      "key": "fullname",
      "text": "Alex Example"
    }
  ]
}
```

Store the Subiz `id` together with the channel identity. Use the `id` to [get](/developers/api-reference/users/retrieve) or [update](/developers/api-reference/users/update) the customer.

Subiz may normalize or merge customer identities. If a lookup fails temporarily, retry it rather than creating a separate customer with [Create a customer](/developers/api-reference/users/create).

## Send without resolving first

To message a customer by channel identity, you can skip this step. [Send to a customer](/developers/api-reference/messages/send-to-user#identify-the-customer) accepts `channel`, `channel_source`, and `profile_id` directly.

## HTTP request

Replace `YOUR_ACCID`, `YOUR_CHANNEL`, `YOUR_SOURCE`, `YOUR_ID`, and `YOUR_ACCESS_TOKEN` with your values.

```http
POST https://api.subiz.com.vn/4.1/accounts/YOUR_ACCID/contact-profiles/YOUR_CHANNEL/sources/YOUR_SOURCE/YOUR_ID
Authorization: Bearer YOUR_ACCESS_TOKEN
Content-Type: application/json

{}
```