Sessions API

Manage WhatsApp sessions — create accounts, connect via QR, check status, and disconnect.

WhatsApp sessions are managed under `https://api.actiwapi.com/api/v1/whatsapp`. After creating a session, call connect and scan the QR code from the dashboard or Socket.io events.

GET/api/v1/whatsapp

List sessions

List all WhatsApp sessions for your tenant.

URL: https://api.actiwapi.com/api/v1/whatsapp

Auth: JWT Bearer

Headers

HeaderValueRequired
AuthorizationBearer {accessToken}Yes
Content-Typeapplication/jsonYes*

Query parameters

  • pagePage number (default 1)
  • limitItems per page (default 20)

Code examples

curl -X GET "https://api.actiwapi.com/api/v1/whatsapp" \
  -H "Content-Type: application/json" \
  -H "Authorization: Bearer {accessToken}"

Response example200

{
  "success": true,
  "data": [
    {
      "id": "uuid",
      "name": "Sales Line 1",
      "status": "connected",
      "phoneNumber": "919876543210",
      "connected": true
    }
  ],
  "pagination": { "page": 1, "limit": 20, "total": 1, "totalPages": 1 }
}

Try in Swagger UI

POST/api/v1/whatsapp

Create session

Create a new WhatsApp session slot. Connect separately to obtain a QR code.

URL: https://api.actiwapi.com/api/v1/whatsapp

Auth: JWT Bearer

Headers

HeaderValueRequired
AuthorizationBearer {accessToken}Yes
Content-Typeapplication/jsonYes*

Request example

{ "name": "Support Line" }

Code examples

curl -X POST "https://api.actiwapi.com/api/v1/whatsapp" \
  -H "Content-Type: application/json" \
  -H "Authorization: Bearer {accessToken}"
  -d '{ "name": "Support Line" }'

Response example201

{
  "success": true,
  "data": {
    "id": "uuid",
    "name": "Support Line",
    "status": "disconnected",
    "phoneNumber": null
  }
}

Try in Swagger UI

POST/api/v1/whatsapp/{id}/connect

Connect session

Initiate QR code pairing for the session.

URL: https://api.actiwapi.com/api/v1/whatsapp/{id}/connect

Auth: JWT Bearer

Headers

HeaderValueRequired
AuthorizationBearer {accessToken}Yes
Content-Typeapplication/jsonYes*

Path parameters

  • idSession UUID

Code examples

curl -X POST "https://api.actiwapi.com/api/v1/whatsapp/{id}/connect" \
  -H "Content-Type: application/json" \
  -H "Authorization: Bearer {accessToken}"

Response example200

{
  "success": true,
  "data": { "status": "qr_pending", "message": "Scan QR code in dashboard" }
}

Try in Swagger UI

GET/api/v1/whatsapp/{id}/status

Session status

Get real-time connection status for a session.

URL: https://api.actiwapi.com/api/v1/whatsapp/{id}/status

Auth: JWT Bearer

Headers

HeaderValueRequired
AuthorizationBearer {accessToken}Yes
Content-Typeapplication/jsonYes*

Path parameters

  • idSession UUID

Code examples

curl -X GET "https://api.actiwapi.com/api/v1/whatsapp/{id}/status" \
  -H "Content-Type: application/json" \
  -H "Authorization: Bearer {accessToken}"

Response example200

{
  "success": true,
  "data": {
    "id": "uuid",
    "status": "connected",
    "phoneNumber": "919876543210",
    "connected": true
  }
}

Try in Swagger UI

POST/api/v1/whatsapp/{id}/disconnect

Disconnect session

Disconnect the WhatsApp session without deleting it.

URL: https://api.actiwapi.com/api/v1/whatsapp/{id}/disconnect

Auth: JWT Bearer

Headers

HeaderValueRequired
AuthorizationBearer {accessToken}Yes
Content-Typeapplication/jsonYes*

Path parameters

  • idSession UUID

Code examples

curl -X POST "https://api.actiwapi.com/api/v1/whatsapp/{id}/disconnect" \
  -H "Content-Type: application/json" \
  -H "Authorization: Bearer {accessToken}"

Response example200

{ "success": true, "message": "Session disconnected" }

Try in Swagger UI

GET/api/external/sessions

List sessions (API key)

List sessions using API key authentication.

URL: https://api.actiwapi.com/api/external/sessions

Auth: API Key

Headers

HeaderValueRequired
X-API-Key{apiKey}Yes
Content-Typeapplication/jsonYes*

Code examples

curl -X GET "https://api.actiwapi.com/api/external/sessions" \
  -H "Content-Type: application/json" \
  -H "X-API-Key: {apiKey}"

Response example200

{ "success": true, "data": [{ "id": "uuid", "status": "connected" }] }

Try in Swagger UI

Error codes

Failed requests return a JSON envelope with success: false and a human-readable message.

{
  "success": false,
  "message": "Validation failed",
  "errors": {
    "phone": "Valid phone number is required"
  }
}
HTTPCodeDescription
400VALIDATION_ERRORRequest body or query failed validation.
401UNAUTHORIZEDMissing or invalid JWT / API key.
403FORBIDDENAuthenticated but lacking permission or entitlement.
403SUBSCRIPTION_INACTIVETrial expired or subscription not active.
403LIMIT_EXCEEDEDPlan limit reached (sessions, messages, API requests, etc.).
404NOT_FOUNDResource does not exist or is not in your tenant.
409CONFLICTDuplicate resource or invalid state transition.
429RATE_LIMITEDToo many requests; retry after backoff.
500INTERNAL_ERRORUnexpected server error.
502WHATSAPP_UNAVAILABLEWhatsApp session disconnected or provider error.

← Back to Getting Started