Setup contact card
client.contactCard.create(ContactCardCreateParams { first_name, phone_number, image_url, last_name } body, RequestOptionsoptions?): SetContactCard { first_name, is_active, phone_number, 2 more }
POST/v3/contact_card
Creates a contact card for a phone number. This endpoint is intended for initial, one-time setup only.
If setup does not complete, the response is 500 (2022) — call this endpoint again.
Note: once a card is active, this endpoint returns 409 (2014) so an existing
card is never overwritten by accident. Use PATCH /v3/contact_card to change it.
Setup contact card
import LinqAPIV3 from '@linqapp/sdk';
const client = new LinqAPIV3({
apiKey: process.env['LINQ_API_V3_API_KEY'], // This is the default and can be omitted
});
const setContactCard = await client.contactCard.create({
first_name: 'Acme',
phone_number: '+15551234567',
image_url: 'https://cdn.linqapp.com/contact-card/example.jpg',
last_name: 'Support',
});
console.log(setContactCard.first_name);{
"phone_number": "+15551234567",
"first_name": "John",
"last_name": "Doe",
"image_url": "https://cdn.linqapp.com/contact-card/example.jpg",
"is_active": true
}{
"error": {
"status": 400,
"code": 1002,
"message": "Phone number must be in E.164 format",
"doc_url": "https://docs.linqapp.com/error/codes/1xxx/1002/"
},
"success": false
}{
"error": {
"status": 401,
"code": 2004,
"message": "Unauthorized - missing or invalid authentication token",
"doc_url": "https://docs.linqapp.com/error/codes/2xxx/2004/"
},
"success": false
}{
"error": {
"status": 403,
"code": 2005,
"message": "Access denied - insufficient permissions for this resource",
"doc_url": "https://docs.linqapp.com/error/codes/2xxx/2005/"
},
"success": false
}{
"error": {
"status": 409,
"code": 2013,
"message": "This chat is unavailable",
"doc_url": "https://docs.linqapp.com/error/codes/2xxx/2013/"
},
"success": false
}{
"error": {
"status": 500,
"code": 3006,
"message": "Internal server error",
"doc_url": "https://docs.linqapp.com/error/codes/3xxx/3006/"
},
"success": false
}Returns Examples
{
"phone_number": "+15551234567",
"first_name": "John",
"last_name": "Doe",
"image_url": "https://cdn.linqapp.com/contact-card/example.jpg",
"is_active": true
}{
"error": {
"status": 400,
"code": 1002,
"message": "Phone number must be in E.164 format",
"doc_url": "https://docs.linqapp.com/error/codes/1xxx/1002/"
},
"success": false
}{
"error": {
"status": 401,
"code": 2004,
"message": "Unauthorized - missing or invalid authentication token",
"doc_url": "https://docs.linqapp.com/error/codes/2xxx/2004/"
},
"success": false
}{
"error": {
"status": 403,
"code": 2005,
"message": "Access denied - insufficient permissions for this resource",
"doc_url": "https://docs.linqapp.com/error/codes/2xxx/2005/"
},
"success": false
}{
"error": {
"status": 409,
"code": 2013,
"message": "This chat is unavailable",
"doc_url": "https://docs.linqapp.com/error/codes/2xxx/2013/"
},
"success": false
}{
"error": {
"status": 500,
"code": 3006,
"message": "Internal server error",
"doc_url": "https://docs.linqapp.com/error/codes/3xxx/3006/"
},
"success": false
}