> For the complete documentation index, see [llms.txt](https://leadexporter.gitbook.io/custom-integrations/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://leadexporter.gitbook.io/custom-integrations/contact-search.md).

# Contact

## Create Contact

<mark style="color:green;">`POST`</mark> `https://api.yourdomain.com/v1/contact/create`

Create a new contact

#### Request Body

| Name    | Type   | Description                                           |
| ------- | ------ | ----------------------------------------------------- |
| userId  | string | Id of the user creating the contact record            |
| contact | object | JSON object with the field names and the field values |

{% tabs %}
{% tab title="200 Contact created successfully" %}

```
{
    "success": true,
    "contact": {
                "id": "contact001",
                "firstName": "John",
                "lastName": "Doe",
    }
    link: "https://app.yourdomain.com/contacts/contact001"
}
```

{% endtab %}
{% endtabs %}

{% hint style="info" %}
The **contact** property in the response should contain the id, first name and last name of the newly created contact.
{% endhint %}

{% hint style="info" %}
The **link** property in the response should contain a link to the newly created record in your backend / CRM application, if applicable.
{% endhint %}

## Update Contact

<mark style="color:green;">`POST`</mark> `htpps://api.yourdomain.com/v1/contact/update`

Update a contact

#### Request Body

| Name    | Type   | Description                                           |
| ------- | ------ | ----------------------------------------------------- |
| userId  | string | Id of the user updating the contact record            |
| id      | string | Id of the contact to update                           |
| contact | object | JSON object with the field names and the field values |

{% tabs %}
{% tab title="200 Contact updated successfully" %}

```
{
    "success": true,
    "contact": {
                "id": "contact001",
                "firstName": "John",
                "lastName": "Doe",
                }
}
```

{% endtab %}
{% endtabs %}

{% hint style="info" %}
The **contact** property in the response should contain the id, first name and last name of the newly created contact.
{% endhint %}

{% hint style="info" %}
The **link** property in the response should contain a link to the newly created record in your backend / CRM application, if applicable.
{% endhint %}

## Search Contact

<mark style="color:green;">`POST`</mark> `https://api.yourdomain.com/v1/contact/search`

Search for a contact

#### Query Parameters

| Name     | Type   | Description                                         |
| -------- | ------ | --------------------------------------------------- |
| linkedIn | string | LinkedIn profile URL of the contact we're searching |
| name     | string | Full name of the contact we're searching            |

{% tabs %}
{% tab title="200 Search completed successfully" %}

```javascript
{
    "success": true,
    "contacts": [{
                "id": "contact001",
                "firstName": "John",
                "lastName": "Doe",
              }]
}
```

{% endtab %}
{% endtabs %}

{% hint style="info" %}
In the request, the **linkedIn** parameter or the **name** parameter will always be passed (always 1 of the 2).
{% endhint %}

{% hint style="info" %}
The **contacts** property in the response should be an array of results, also if there is only one result. Each result should contain all available fields.
{% endhint %}
