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
Was this page helpful?