Close every other session of the person
POST
/v1/auth/sessions/revoke-others
const url = 'https://api.emite.cr/v1/auth/sessions/revoke-others';const options = { method: 'POST', headers: {'Content-Type': 'application/json'}, body: '{"currentPassword":"example"}'};
try { const response = await fetch(url, options); const data = await response.json(); console.log(data);} catch (error) { console.error(error);}curl --request POST \ --url https://api.emite.cr/v1/auth/sessions/revoke-others \ --header 'Content-Type: application/json' \ --data '{ "currentPassword": "example" }'Requires the current password. This session continues under a new token (returned in the X-Session-Token header); a copy of the previous token stops working within 30 seconds. Also unlinks the person’s WhatsApp number.
Request Bodyrequired
Section titled “Request Bodyrequired”Media typeapplication/json
object
currentPassword
required
The current password of the account: whoever copied a session token cannot use it to close the sessions of the person. A wrong one answers 400 INVALID_CURRENT_PASSWORD.
string
Examplegenerated
{ "currentPassword": "example"}Responses
Section titled “Responses”The other sessions are closed; this one goes on under the new token.
Media typeapplication/json
object
revoked
required
How many other sessions were still usable and got closed.
number
whatsappUnlinked
required
true when the person had a WhatsApp number linked and it was unlinked with the sessions; false when none was unlinked.
boolean
Example
{ "revoked": 2, "whatsappUnlinked": false}