import { PeriskopeApi } from '@periskope/periskope-client';
const client = new PeriskopeApi({
authToken: 'YOUR_API_KEY',
});
async function main() {
const response = await client.contacts.createContact({
contact_id: '911111111111',
contact_name: 'John Doe',
});
console.log(response);
}
main();curl -X POST 'https://api.periskope.app/v1/contacts/create' \
-H 'Authorization: Bearer YOUR_API_KEY' \
-H 'Content-Type: application/json' \
-d '{
"contact_id": "911111111111",
"contact_name": "John Doe"
}'{
"org_id": "00000000-0000-0000-0000-000000000000",
"contact_id": "911111111111@c.us",
"contact_name": "John Doe",
"username": "jane.doe",
"contact_type": "user",
"is_wa_contact": true,
"is_my_contact": true,
"is_internal": false,
"is_imported": true,
"contact_image": "https://example.com/files/image.png",
"contact_color": "#DC2626",
"label_ids": {
"label-aaaaaaaaaaaa": true
},
"labels": [
"lead"
],
"chat_ids": [
"911111111111@c.us",
"120363000000000000@g.us"
],
"updated_at": "2026-01-15T09:30:00.000Z"
}{
"code": "UNAUTHORIZED_ERROR",
"message": "Invalid bearer auth token",
"status": 401
}{
"code": "VALIDATION_ERROR",
"message": "Request validation failed",
"status": 422,
"fields": {
"body.chat_id": {
"message": "chat_id is required"
}
}
}{
"code": "RATE_LIMIT_ERROR",
"message": "You can only make 100 requests per second",
"status": 429
}{
"code": "UNKNOWN_ERROR",
"message": "Internal server error",
"status": 500
}Create Contact
Creates a contact, or updates the existing one with the same contact_id (upsert). contact_id must be a possible phone number.
import { PeriskopeApi } from '@periskope/periskope-client';
const client = new PeriskopeApi({
authToken: 'YOUR_API_KEY',
});
async function main() {
const response = await client.contacts.createContact({
contact_id: '911111111111',
contact_name: 'John Doe',
});
console.log(response);
}
main();curl -X POST 'https://api.periskope.app/v1/contacts/create' \
-H 'Authorization: Bearer YOUR_API_KEY' \
-H 'Content-Type: application/json' \
-d '{
"contact_id": "911111111111",
"contact_name": "John Doe"
}'{
"org_id": "00000000-0000-0000-0000-000000000000",
"contact_id": "911111111111@c.us",
"contact_name": "John Doe",
"username": "jane.doe",
"contact_type": "user",
"is_wa_contact": true,
"is_my_contact": true,
"is_internal": false,
"is_imported": true,
"contact_image": "https://example.com/files/image.png",
"contact_color": "#DC2626",
"label_ids": {
"label-aaaaaaaaaaaa": true
},
"labels": [
"lead"
],
"chat_ids": [
"911111111111@c.us",
"120363000000000000@g.us"
],
"updated_at": "2026-01-15T09:30:00.000Z"
}{
"code": "UNAUTHORIZED_ERROR",
"message": "Invalid bearer auth token",
"status": 401
}{
"code": "VALIDATION_ERROR",
"message": "Request validation failed",
"status": 422,
"fields": {
"body.chat_id": {
"message": "chat_id is required"
}
}
}{
"code": "RATE_LIMIT_ERROR",
"message": "You can only make 100 requests per second",
"status": 429
}{
"code": "UNKNOWN_ERROR",
"message": "Internal server error",
"status": 500
}Authorizations
Body
Comma-separated list of labels to put on the contact (e.g. 'lead, priority'). Labels are matched case-insensitively and labels that do not exist yet are created automatically. This replaces all current labels of the contact — pass the full desired list. Omit, or pass null or an empty string, to apply no labels — the labels of an already existing contact are left unchanged.
"lead, priority"
Response
The created contact
A WhatsApp contact known to the workspace — synced from a connected phone's address book and chats, or created via the API. Contacts belong to the org as a whole, not to a single phone. Labels on a contact are shared with the contact's 1-1 chat.
Was this page helpful?