Contacts

Ensure Contact

Ensure a contact exists or create a new one

post
/v1/contact/ensure

Description

Ensure a contact with the given parameters exists or create a new one.

Authorization

ChatBotKit API Secret * Required

HTTP Authorization Scheme: bearer

Request Body * Required

Request Body Schema: application/json

namestring

The associated name

descriptionstring

The associated description

metaobject

Meta data information

fingerprintstring

The fingerprint of the contact

emailstring

The email address of the contact

phonestring

The phone number of the contact

nickstring

The nickname of the contact

verifiedAtnumber

The timestamp (ms) when the contact was verified

import { ChatBotKit } from '@chatbotkit/sdk'

const cbk = new ChatBotKit({

secret: process.env.CHATBOTKIT_API_KEY!

})

const response = await cbk.contact.ensure(

{
"name":"string",
"description":"string",
"meta":"object",
"fingerprint":"string",
"email":"string",
"phone":"string",
"nick":"string",
"verifiedAt":"number"
}
)
{
"id":"string"
}
The contact was ensured successfully