TypeScript
import { PeriskopeApi } from '@periskope/periskope-client';
const client = new PeriskopeApi({
authToken: 'YOUR_API_KEY',
phone: '919876543210', // the phone to act with (x-phone)
});
async function main() {
const response = await client.chats.leaveGroup({
chat_id: '120363000000000000@g.us',
});
console.log(response);
}
main();curl -X POST 'https://api.periskope.app/v1/chats/120363000000000000@g.us/leave' \
-H 'Authorization: Bearer YOUR_API_KEY' \
-H 'x-phone: 919876543210'{}Group Settings APIs
Leave Group
Makes the phone in the x-phone header leave the group. Group chats only.
TypeScript
import { PeriskopeApi } from '@periskope/periskope-client';
const client = new PeriskopeApi({
authToken: 'YOUR_API_KEY',
phone: '919876543210', // the phone to act with (x-phone)
});
async function main() {
const response = await client.chats.leaveGroup({
chat_id: '120363000000000000@g.us',
});
console.log(response);
}
main();curl -X POST 'https://api.periskope.app/v1/chats/120363000000000000@g.us/leave' \
-H 'Authorization: Bearer YOUR_API_KEY' \
-H 'x-phone: 919876543210'{}Authorizations
Headers
Path Parameters
Response
Result of the leave operation
Result of the leave operation as returned by the phone instance. Usually an empty object or a per-participant status map.
Was this page helpful?