Instances

Instances are the primary way to manage WhatsApp connections in Omdaa API. Each instance represents a single WhatsApp connection, and you can create multiple instances to manage multiple phone numbers.

Create a New Instance

To create a new instance, use the create instance endpoint. You'll receive a unique instanceName that you can use in all subsequent requests.

"function">curl "keyword">-X POST https://omdaa.com/api/v1/instances/create \
  "keyword">-H "Authorization: Bearer YOUR_JWT_TOKEN" \
  "keyword">-H "Content"keyword">-Type: application/json" \
  "keyword">-d '{
  "instanceName": "my"keyword">-instance",
  "deviceName": "My Device"
}'

Required Parameters

ParameterTypeDescription
instanceNamestringUnique name for the instance
deviceNamestringDevice name (optional)

Get QR Code

After creating an instance, you'll need to scan a QR code to link your WhatsApp number. You can get the QR code using the following endpoint:

"function">curl "keyword">-X GET "https://omdaa.com/api/v1/instances/my class="keyword">-instance/qrcode" \
  "keyword">-H "Authorization: Bearer YOUR_JWT_TOKEN"

Important Notes:

  • QR code is valid for 60 seconds only
  • If QR code expires, you can request a new one
  • After successfully scanning the QR code, the instance will be connected automatically

Check Connection State

You can check the connection state of an instance at any time:

"function">curl "keyword">-X GET "https://omdaa.com/api/v1/instances/my class="keyword">-instance/connectionState" \
  "keyword">-H "Authorization: Bearer YOUR_JWT_TOKEN"

Connection States

open
Instance is connected and ready
close
Instance is disconnected
connecting
Instance is connecting

Get All Instances

To get a list of all your instances:

"function">curl "keyword">-X GET "https://omdaa.com/api/v1/instances" \
  "keyword">-H "Authorization: Bearer YOUR_JWT_TOKEN"

💡 Tip

You can create multiple instances to manage multiple WhatsApp numbers. Each instance is completely independent and can be used to send and receive messages separately.