Skip to main content

POST /instance/create

Create a new WhatsApp instance with support for multiple integrations including Baileys, WhatsApp Business API, webhooks, event systems, and chatbot platforms.

Authentication

This endpoint requires authentication via the apikey header.

Request Body

string
required
Unique name for your instance. This identifier is used across all API calls.
string
Custom authentication token for this instance. If not provided, a token will be auto-generated.
string
WhatsApp number in international format (e.g., 5511999999999). Required for WhatsApp Business API integration.
string
WhatsApp Business Account ID. Required for WhatsApp Business API integration.
boolean
default:"false"
Generate QR code immediately after instance creation for Baileys integration.
string
WhatsApp integration type. Available options:
  • WHATSAPP-BAILEYS - WhatsApp Web integration
  • WHATSAPP-BUSINESS - Official WhatsApp Business API

Settings

boolean
default:"false"
Automatically reject incoming calls.
string
Message to send when rejecting a call. Requires rejectCall to be enabled.
boolean
default:"false"
Ignore messages from groups.
boolean
default:"false"
Keep WhatsApp status always online.
boolean
default:"false"
Automatically mark messages as read.
boolean
default:"false"
Automatically read status updates.
boolean
default:"false"
Sync full message history when connecting.

Webhook Configuration

string
URL to receive webhook events.
boolean
default:"false"
Send webhooks grouped by event type.
boolean
default:"true"
Include media files as base64 in webhook payload.
array
Array of event types to receive. Available events:
  • QRCODE_UPDATED
  • MESSAGES_UPSERT
  • MESSAGES_UPDATE
  • MESSAGES_DELETE
  • SEND_MESSAGE
  • CONNECTION_UPDATE
  • CALL And more…

Proxy Configuration

string
Proxy server hostname or IP address.
string
Proxy server port.
string
Proxy protocol: http or https.
string
Proxy authentication username (optional).
string
Proxy authentication password (optional).

Event System Integration

boolean
default:"false"
Enable RabbitMQ event publishing.
array
Array of events to publish to RabbitMQ.
boolean
default:"false"
Enable AWS SQS event publishing.
array
Array of events to publish to SQS.
boolean
default:"false"
Enable NATS event publishing.
array
Array of events to publish to NATS.

Chatwoot Integration

string
Chatwoot account ID.
string
Chatwoot access token.
string
Chatwoot instance URL.
boolean
Sign messages with agent name in Chatwoot.
boolean
Automatically reopen conversations.
boolean
Set new conversations as pending.
boolean
default:"true"
Import contacts to Chatwoot.
boolean
default:"true"
Import message history to Chatwoot.
number
default:"60"
Number of days to import messages from history.
boolean
default:"false"
Merge Brazilian contacts (removes 9th digit).
string
Custom inbox name in Chatwoot. Defaults to instance name.

Response

object
Instance information
string
Name of the created instance
string
Unique instance identifier (UUID)
string
Integration type used
string
Connection status: open, close, connecting
string
Webhook URL for WhatsApp Business (if applicable)
string
Access token for WhatsApp Business webhook (if applicable)
string
Authentication token for this instance. Use this in the apikey header for instance-specific operations.
object
Webhook configuration
string
Configured webhook URL
boolean
Events grouped by type
boolean
Media included as base64
object
WebSocket configuration
boolean
WebSocket events enabled
object
RabbitMQ configuration
boolean
RabbitMQ events enabled
object
SQS configuration
boolean
SQS events enabled
object
NATS configuration
boolean
NATS events enabled
object
Instance settings
boolean
Reject calls setting
string
Call rejection message
boolean
Ignore groups setting
boolean
Always online setting
boolean
Auto-read messages setting
boolean
Auto-read status setting
object
QR code for Baileys connection (if qrcode: true and integration is Baileys)
string
QR code string
string
QR code as base64 image
object
Chatwoot configuration (if Chatwoot credentials provided)
boolean
Chatwoot integration enabled
string
Chatwoot account ID
string
Chatwoot webhook URL

Examples

Response Example

Success Response
Error Response
Important: Save the hash value from the response. You’ll need it as your apikey for all subsequent API calls related to this instance.
If you provide Chatwoot credentials (chatwootAccountId, chatwootToken, chatwootUrl), all three fields are required along with chatwootSignMsg, chatwootReopenConversation, and chatwootConversationPending.

Error Handling

The API returns standard HTTP status codes:
  • 201 - Instance created successfully
  • 400 - Bad request (validation error)
  • 401 - Unauthorized (invalid API key)
  • 500 - Internal server error
Common error scenarios:
  1. Missing instanceName: The instanceName field is required
  2. Invalid integration: Unknown integration type specified
  3. Invalid proxy: Proxy configuration test failed
  4. Chatwoot validation: Missing required Chatwoot fields when partial config provided
  5. Business API requirements: Missing number field for WhatsApp Business integration