Skip to main content
POST
https://api.enviaai.app
/
v1
/
instances
/
{instanceId}
/
disconnect
Disconnect Instance
curl --request POST \
  --url https://api.enviaai.app/v1/instances/{instanceId}/disconnect \
  --header 'Authorization: Bearer <token>' \
  --header 'Content-Type: application/json' \
  --data '
{
  "reason": "<string>"
}
'
{
  "success": true,
  "message": "Instance disconnected successfully"
}

Overview

Disconnect a WhatsApp instance from your account. This will log out the WhatsApp session and stop all message sending/receiving.
After disconnecting, you’ll need to scan a new QR code or re-authenticate with Meta to reconnect the instance.

Path Parameters

instanceId
string
required
The unique identifier of the instance to disconnect

Request Body

reason
string
Optional reason for disconnecting (for logging purposes)

Examples

const response = await client.instances.disconnect('inst_abc123');

if (response.success) {
  console.log('Instance disconnected successfully');
}

Response

success
boolean
Indicates if the disconnection was successful
message
string
Status message
{
  "success": true,
  "message": "Instance disconnected successfully"
}

Error Codes

CodeDescription
instance_not_foundThe instance ID does not exist
instance_not_connectedThe instance is already disconnected