Skip to main content
POST
/
instance
/
create
Create WhatsApp Instance
curl --request POST \
  --url https://app.wachat.net/api/v1/instance/create \
  --header 'Authorization: Bearer <token>' \
  --header 'Content-Type: application/json' \
  --data '
{
  "instanceName": "jakarta_store",
  "number": "628123456789",
  "integration": "WHATSAPP-BAILEYS"
}
'
"<string>"
Create a new WhatsApp instance from an external application using your Wachat API key. The instance is automatically saved to your account and will appear in Settings > Instance inside the dashboard. For WhatsApp Baileys instances, the response also includes a QR code immediately, so you do not need to call the QR endpoint after creating the instance.
instance.instanceName is the display name shown in Wachat. Use instance.apiInstanceName for future API calls such as sending messages, checking state, logout, and delete.

Displaying the QR Code

Use the qrcode.base64 value as an image source in your application.
The Mintlify API playground shows the QR code value as JSON. It does not automatically render qrcode.base64 as an image preview.
<img src="data:image/png;base64,..." alt="WhatsApp QR Code" />
You can also use qrcode.imageUrl to render the QR code through an image endpoint:
<img src="https://app.wachat.net/api/v1/instance/qr/image?instanceName=t1_mq9r2jov_store-jakarta&apiKey=YOUR_API_KEY" alt="WhatsApp QR Code" />
For an auto-updating QR display that changes to a success message after the user scans it, use qrcode.liveUrl:
<iframe
  src="https://app.wachat.net/api/v1/instance/qr/live?instanceName=t1_mq9r2jov_store-jakarta&apiKey=YOUR_API_KEY"
  width="420"
  height="460"
></iframe>
If the QR code expires, request a fresh QR code using GET /instance/qr.

Return QR Image Directly

If you want the create request to return the QR code as an image instead of JSON, add response=image to the URL:
curl -X POST "https://app.wachat.net/api/v1/instance/create?response=image" \
  -H "Authorization: Bearer YOUR_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "instanceName": "store-jakarta",
    "number": "628123456789",
    "integration": "WHATSAPP-BAILEYS"
  }' \
  --output qr.png
The instance display name is returned in X-Instance-Name. Use X-Api-Instance-Name for future API calls.

Authorizations

Authorization
string
header
required

Authenticate your integration payloads by injecting your premium secure Wachat Account API Private Secret Key inside standard Authorization Bearer header vectors.

Query Parameters

response
enum<string>
default:json

Set to image to return the QR code directly as image/png instead of JSON.

Available options:
json,
image

Body

application/json
instanceName
string
required

Friendly instance name. Wachat will add a unique prefix before saving the final instance name.

Example:

"jakarta_store"

number
string

Optional WhatsApp phone number with country code.

Example:

"628123456789"

integration
enum<string>
default:WHATSAPP-BAILEYS

Instance integration type.

Available options:
WHATSAPP-BAILEYS,
WHATSAPP-BUSINESS
Example:

"WHATSAPP-BAILEYS"

rejectCalls
boolean

Reject incoming WhatsApp calls automatically.

Example:

false

ignoreGroups
boolean

Ignore group messages for this instance.

Example:

false

alwaysOnline
boolean

Keep the instance online when possible.

Example:

true

readMessages
boolean

Mark incoming messages as read.

Example:

false

readStatus
boolean

Read status updates.

Example:

false

metaToken
string

Required only for WHATSAPP-BUSINESS integrations.

metaBusinessId
string

Required only for WHATSAPP-BUSINESS integrations.

metaPhoneNumberId
string

Required only for WHATSAPP-BUSINESS integrations.

Response

Instance created successfully. For WhatsApp Baileys, the QR code is returned immediately.

The response is of type file.