Skip to main content
Use sessions for pairing, status checks, and WhatsApp session disconnect. For instances and billing, see Instances and billing. For chats, see Chats.

Session

client.Sessions.StatusAsync<TResponse>(instanceId, options?)

await client.Sessions.StatusAsync<object>("VZ...", new InstanceRequestOptions { InstanceToken = "instance-token" });
Returns SessionStatusResponse. The Data object uses this field order:
  1. Connected — always first
  2. Phone
  3. WhatsappJid
  4. PushName
  5. BusinessName
  6. BusinessProfile — subfields: BusinessHoursTimezone, Categories, ProfileOptions, Address, Email
  7. ProfilePictureId
  8. ProfilePictureUrl
  9. ProfileUrl
  10. VerifiedNameabout, website (when applicable)
When disconnected, Data only has Connected = false. Empty fields are omitted.

client.Sessions.QrAsync<TResponse>(instanceId, options?)

await client.Sessions.QrAsync<object>("VZ...", new InstanceRequestOptions { InstanceToken = "instance-token" });
Return: envelope { Code, Success, Data }. When not connected yet, Data.QrCode (PNG data URL). When already connected, Data.Status and Data.Phone.

client.Sessions.PairCodeAsync<TResponse>(instanceId, phone, options?)

await client.Sessions.PairCodeAsync<object>("VZ...", "5511999999999", new InstanceRequestOptions { InstanceToken = "instance-token" });
Return: envelope { Code, Success, Data } with Data.LinkingCode (pairing code).

client.Sessions.DisconnectAsync<TResponse>(instanceId, options?)

await client.Sessions.DisconnectAsync<object>("VZ...", new InstanceRequestOptions { InstanceToken = "instance-token" });
Return: InstanceActionResponseInstanceId, Status, Details.