Contact APIs
Create Contact
API
- Introduction
- Authorization
- SDK
- Objects
Chat APIs
Group Settings APIs
Message APIs
Contact APIs
Phone APIs
Contact APIs
Create Contact
This endpoint creates a new contact.
import { PeriskopeApi } from '@periskope/periskope-client';
const client = new PeriskopeApi({
authToken: 'YOUR_API_KEY',
phone: 'YOUR_PHONE_NUMBER', // e.g., '919876543210'
});
async function createContact() {
const response = await client.contact.create({
contact_name: 'BK Local1',
contact_id: '919537851844'
});
console.log(response);
}
createContact();
{
"chat_ids": [
"120363231636311517@g.us",
"120363298090795525@g.us",
"120363300395249001@g.us",
"120363329861739657@g.us",
"120363331984403446@g.us",
"120363346994879209@g.us",
"120363348209472631@g.us",
"120363352652386702@g.us",
"120363363215130488@g.us",
"120363367240230358@g.us",
"120363370646127343@g.us",
"120363371655584481@g.us",
"120363372525172897@g.us",
"120363373761356282@g.us",
"120363378751945209@g.us",
"120363387379991154@g.us",
"120363387670530253@g.us",
"120363388696354849@g.us",
"120363389171465741@g.us",
"120363391093262494@g.us",
"120363392706769636@g.us",
"919537851844@c.us"
],
"contact_color": "#FA6533",
"contact_id": "919537851844@c.us",
"contact_image": "https://storage.googleapis.com/periskope-images/2997dd64-89bf-48d3-9a22-b314fca017e5%2F919537851844%40c.us.jpg?timestamp=1737445692504",
"contact_name": "BK Local1",
"contact_type": "user",
"is_imported": null,
"is_internal": false,
"is_my_contact": null,
"is_wa_contact": false,
"label_ids": {
"label-ukjqhqngnakncalm": true,
"label-wwfrdqogccexahnv": true
},
"labels": [
"label1",
"label2"
],
"org_id": "2997dd64-89bf-48d3-9a22-b314fca017e5",
"updated_at": "2025-01-22T05:41:15.303874+00:00"
}
Authorizations
Bearer authentication header of the form Bearer <token>
, where <token>
is your auth token.
Headers
Please provide the number of the phone you want to call with this API in the header. The number must be in country code + number format without any characters or spaces, e.g. 919876543210; Alternatively, provide the phone_id (phone-xxxxxxxxxxxx) in the header
Example:
"{{orgPhone}}"
Body
application/json
Response
200 - application/json
200 OK
The response is a contact object. Refer to the contact object here
Was this page helpful?
import { PeriskopeApi } from '@periskope/periskope-client';
const client = new PeriskopeApi({
authToken: 'YOUR_API_KEY',
phone: 'YOUR_PHONE_NUMBER', // e.g., '919876543210'
});
async function createContact() {
const response = await client.contact.create({
contact_name: 'BK Local1',
contact_id: '919537851844'
});
console.log(response);
}
createContact();
{
"chat_ids": [
"120363231636311517@g.us",
"120363298090795525@g.us",
"120363300395249001@g.us",
"120363329861739657@g.us",
"120363331984403446@g.us",
"120363346994879209@g.us",
"120363348209472631@g.us",
"120363352652386702@g.us",
"120363363215130488@g.us",
"120363367240230358@g.us",
"120363370646127343@g.us",
"120363371655584481@g.us",
"120363372525172897@g.us",
"120363373761356282@g.us",
"120363378751945209@g.us",
"120363387379991154@g.us",
"120363387670530253@g.us",
"120363388696354849@g.us",
"120363389171465741@g.us",
"120363391093262494@g.us",
"120363392706769636@g.us",
"919537851844@c.us"
],
"contact_color": "#FA6533",
"contact_id": "919537851844@c.us",
"contact_image": "https://storage.googleapis.com/periskope-images/2997dd64-89bf-48d3-9a22-b314fca017e5%2F919537851844%40c.us.jpg?timestamp=1737445692504",
"contact_name": "BK Local1",
"contact_type": "user",
"is_imported": null,
"is_internal": false,
"is_my_contact": null,
"is_wa_contact": false,
"label_ids": {
"label-ukjqhqngnakncalm": true,
"label-wwfrdqogccexahnv": true
},
"labels": [
"label1",
"label2"
],
"org_id": "2997dd64-89bf-48d3-9a22-b314fca017e5",
"updated_at": "2025-01-22T05:41:15.303874+00:00"
}