POST /newsletters

Create a new newsletter/channel

application/json

Body Required

  • name string Required
  • description string

Responses

  • 200 application/json

    Newsletter 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
      • subscriber_count integer
      • picture_url string
  • 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 /newsletters
curl \
 --request POST 'http://localhost:7001/newsletters' \
 --header "Authorization: $API_KEY" \
 --header "Content-Type: application/json" \
 --data '{"name":"My Channel","description":"Channel description"}'
Request examples
{
  "name": "My Channel",
  "description": "Channel description"
}
Response examples (200)
{
  "code": 200,
  "data": {
    "jid": "120363123456789012@newsletter",
    "name": "My Channel",
    "description": "Channel description",
    "picture_url": null,
    "subscriber_count": 1
  },
  "status": true,
  "message": "Newsletter created successfully"
}
Response examples (200)
{
  "status": true,
  "code": 200,
  "message": "Newsletter info retrieved successfully",
  "data": {
    "jid": "120363123456789012@newsletter",
    "name": "My Channel",
    "description": "Channel description",
    "subscriber_count": 1500,
    "picture_url": "https://pps.whatsapp.net/v/..."
  }
}
Response examples (400)
{
  "code": 400,
  "error": "Channel 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 newsletter",
  "status": false,
  "message": "Internal server error"
}
Response examples (500)
{
  "status": false,
  "code": 400,
  "message": "Bad request",
  "error": "Bad request"
}