import { PeriskopeApi } from '@periskope/periskope-client';
const client = new PeriskopeApi({
authToken: 'YOUR_API_KEY',
});
async function inviteMembers() {
const response = await client.members.invite({
emails: ['[email protected]'],
role: 'member',
labels: ['Sales'],
orgPhones: ['918824248940']
});
console.log(response);
}
inviteMembers();{
"addedMembers": [
{
"created_at": "2025-11-18T05:09:07.481252+00:00",
"email": "[email protected]",
"user_id": null,
"invited_at": "2025-11-18T05:09:07.481252+00:00",
"invited_by": null,
"org_id": "03a52dbe-b8af-47c5-9fd1-e5a622680cad",
"role": "member",
"member_image": null,
"member_name": null,
"is_active": true,
"member_color": "#25D366",
"label_ids": [
"label-uvzfbjfgwjuphhff"
],
"org_phones": [
"[email protected]"
],
"is_owner": null,
"preferences": {
"left_sidebar_open": false,
"right_sidepanel_open": true,
"sync_wa_unread_count": true
},
"is_online": null,
"member_metadata": {}
},
{
"created_at": "2025-11-16T11:38:10.43923+00:00",
"email": "[email protected]",
"user_id": null,
"invited_at": "2025-11-16T11:38:10.43923+00:00",
"invited_by": null,
"org_id": "03a52dbe-b8af-47c5-9fd1-e5a622680cad",
"role": "member",
"member_image": null,
"member_name": null,
"is_active": true,
"member_color": "#FA6533",
"label_ids": [
"label-uvzfbjfgwjuphhff"
],
"org_phones": [
"[email protected]"
],
"is_owner": null,
"preferences": {
"left_sidebar_open": false,
"right_sidepanel_open": true,
"sync_wa_unread_count": true
},
"is_online": null,
"member_metadata": {}
},
{
"created_at": "2025-11-16T11:38:10.43923+00:00",
"email": "[email protected]",
"user_id": null,
"invited_at": "2025-11-16T11:38:10.43923+00:00",
"invited_by": null,
"org_id": "03a52dbe-b8af-47c5-9fd1-e5a622680cad",
"role": "member",
"member_image": null,
"member_name": null,
"is_active": true,
"member_color": "#06CF9C",
"label_ids": [
"label-uvzfbjfgwjuphhff"
],
"org_phones": [
"[email protected]"
],
"is_owner": null,
"preferences": {
"left_sidebar_open": false,
"right_sidepanel_open": true,
"sync_wa_unread_count": true
},
"is_online": null,
"member_metadata": {}
}
],
"errors": []
}Invite one or more members to the organization. Optionally set role and default access (labels and orgPhones).
import { PeriskopeApi } from '@periskope/periskope-client';
const client = new PeriskopeApi({
authToken: 'YOUR_API_KEY',
});
async function inviteMembers() {
const response = await client.members.invite({
emails: ['[email protected]'],
role: 'member',
labels: ['Sales'],
orgPhones: ['918824248940']
});
console.log(response);
}
inviteMembers();{
"addedMembers": [
{
"created_at": "2025-11-18T05:09:07.481252+00:00",
"email": "[email protected]",
"user_id": null,
"invited_at": "2025-11-18T05:09:07.481252+00:00",
"invited_by": null,
"org_id": "03a52dbe-b8af-47c5-9fd1-e5a622680cad",
"role": "member",
"member_image": null,
"member_name": null,
"is_active": true,
"member_color": "#25D366",
"label_ids": [
"label-uvzfbjfgwjuphhff"
],
"org_phones": [
"[email protected]"
],
"is_owner": null,
"preferences": {
"left_sidebar_open": false,
"right_sidepanel_open": true,
"sync_wa_unread_count": true
},
"is_online": null,
"member_metadata": {}
},
{
"created_at": "2025-11-16T11:38:10.43923+00:00",
"email": "[email protected]",
"user_id": null,
"invited_at": "2025-11-16T11:38:10.43923+00:00",
"invited_by": null,
"org_id": "03a52dbe-b8af-47c5-9fd1-e5a622680cad",
"role": "member",
"member_image": null,
"member_name": null,
"is_active": true,
"member_color": "#FA6533",
"label_ids": [
"label-uvzfbjfgwjuphhff"
],
"org_phones": [
"[email protected]"
],
"is_owner": null,
"preferences": {
"left_sidebar_open": false,
"right_sidepanel_open": true,
"sync_wa_unread_count": true
},
"is_online": null,
"member_metadata": {}
},
{
"created_at": "2025-11-16T11:38:10.43923+00:00",
"email": "[email protected]",
"user_id": null,
"invited_at": "2025-11-16T11:38:10.43923+00:00",
"invited_by": null,
"org_id": "03a52dbe-b8af-47c5-9fd1-e5a622680cad",
"role": "member",
"member_image": null,
"member_name": null,
"is_active": true,
"member_color": "#06CF9C",
"label_ids": [
"label-uvzfbjfgwjuphhff"
],
"org_phones": [
"[email protected]"
],
"is_owner": null,
"preferences": {
"left_sidebar_open": false,
"right_sidepanel_open": true,
"sync_wa_unread_count": true
},
"is_online": null,
"member_metadata": {}
}
],
"errors": []
}Bearer authentication header of the form Bearer <token>, where <token> is your auth token.
Role for invited users. Allowed values are admin or member. Defaults to member.
"member"
Label names to grant access to a member(applies to member role). You can provide the value as null if you want to give access to all labels.
["Sales", "Support"]Phone numbers (without @c.us) to grant access to a member(applies to member role). You can provide the value as null if you want to give access to all phone numbers.
["918824248940"]200 OK
The list of added members
Show child attributes
Timestamp when the member record was created
"2025-11-14T07:30:47.873008+00:00"
Email address of the invited member
User ID if the member has accepted the invite
null
Timestamp when the member was invited
"2025-11-14T07:30:47.873008+00:00"
ID of the user who sent the invitation
null
Organization ID that the member belongs to
"03a52dbe-b8af-47c5-9fd1-e5a622680cad"
Role assigned to the member (admin or member)
"member"
Profile image URL of the member
null
Display name of the member
null
Whether the member account is active
true
Color code assigned to the member for UI display
"#DB2777"
Array of label IDs the member has access to
["label-uvzfbjfgwjuphhff"]Whether the member is an organization owner
null
User interface preferences
Show child attributes
Whether left sidebar is open by default
false
Whether right sidepanel is open by default
true
Whether to sync WhatsApp unread count
true
Whether the member is currently online
null
Additional custom metadata for the member
{}Was this page helpful?