application/json

Body

  • name string Required
  • participants array[string]

Responses

  • 200 application/json

    Group created successfully

    Hide response attributes Show response attributes object
    • status boolean
    • code integer
    • message string
    • data object
      Hide data attributes Show data attributes object
      • jid string
      • name string
      • description string
      • owner string
      • created_at integer
      • participant_count integer
      • participants array[object]
        Hide participants attributes Show participants attributes object
        • jid string
        • is_admin boolean
        • is_super_admin boolean
  • 400 application/json

    Bad request

    Hide response attributes Show response attributes object
    • status boolean
    • code integer
    • message string
    • error string
  • 401 application/json

    Unauthorized

    Hide response attributes Show response attributes object
    • status boolean
    • code integer
    • message string
    • error string
  • 500 application/json

    Internal server error

    Hide response attributes Show response attributes object
    • status boolean
    • code integer
    • message string
    • error string
POST /groups
curl \
 --request POST 'http://localhost:7001/groups' \
 --header "Authorization: $API_KEY" \
 --header "Content-Type: application/json" \
 --data '{"name":"My Group","participants":["6281234567890@s.whatsapp.net"]}'
Request examples
{
  "name": "My Group",
  "participants": [
    "6281234567890@s.whatsapp.net"
  ]
}
Response examples (200)
{
  "code": 200,
  "data": {
    "jid": "120363123456789012@g.us",
    "name": "My Group",
    "owner": "6281234567890@s.whatsapp.net",
    "created_at": 1702129024,
    "description": "",
    "participants": [
      {
        "jid": "6281234567890@s.whatsapp.net",
        "is_admin": true,
        "is_super_admin": true
      },
      {
        "jid": "6289876543210@s.whatsapp.net",
        "is_admin": false,
        "is_super_admin": false
      }
    ],
    "participant_count": 2
  },
  "status": true,
  "message": "Group created successfully"
}
Response examples (200)
{
  "status": true,
  "code": 200,
  "message": "Group info retrieved successfully",
  "data": {
    "jid": "120363123456789012@g.us",
    "name": "My Group",
    "description": "Group description",
    "owner": "6281234567890@s.whatsapp.net",
    "created_at": 1702129024,
    "participant_count": 25,
    "participants": [
      {
        "jid": "6281234567890@s.whatsapp.net",
        "is_admin": true,
        "is_super_admin": false
      }
    ]
  }
}
Response examples (400)
{
  "code": 400,
  "error": "Group name is required",
  "status": false,
  "message": "Bad request"
}
Response examples (400)
{
  "status": false,
  "code": 400,
  "message": "Bad request",
  "error": "Bad request"
}
Response examples (401)
{
  "code": 401,
  "error": "Invalid or expired JWT token",
  "status": false,
  "message": "Unauthorized"
}
Response examples (401)
{
  "status": false,
  "code": 401,
  "message": "Unauthorized",
  "error": "Invalid or missing authentication"
}
Response examples (500)
{
  "code": 500,
  "error": "Failed to create group",
  "status": false,
  "message": "Internal server error"
}
Response examples (500)
{
  "status": false,
  "code": 400,
  "message": "Bad request",
  "error": "Bad request"
}