Adhub API
  1. Adverts
Adhub API
  • User
    • Get user information
      GET
    • Update user
      PATCH
    • Reset API key
      POST
    • Get user balance
      GET
  • Campaigns
    • List campaigns
      GET
    • Create campaign
      POST
    • Get campaign
      GET
    • Update campaign
      PATCH
    • Delete campaign
      DELETE
    • Toggle campaign status
      POST
  • Adverts
    • List adverts
      GET
    • Create advert
      POST
    • Get advert
      GET
    • Update advert
      PATCH
    • Delete advert
      DELETE
  1. Adverts

Create advert

POST
/adverts
Create a new advertisement

Request

Authorization
API Key
Add parameter in header
Authorization
Example:
Authorization: ********************
or
Body Params application/jsonRequired

Examples

Responses

🟢201Created
application/json
Advert created successfully
Body

🟠401Unauthorized
🟠422Unprocessable Entity
Request Request Example
Shell
JavaScript
Java
Swift
curl --location --request POST 'adhub.plus/api/v1/adverts' \
--header 'Authorization: <api-key>' \
--header 'Content-Type: application/json' \
--data-raw '{
    "advert": {
        "name": "Sample Advertisement",
        "text": "This is a sample advertisement text",
        "pic_url": "https://example.com/image.jpg",
        "button_caption": "Click Me",
        "button_url": "https://example.com",
        "parse_mode": "HTML"
    }
}'
Response Response Example
201 - Example 1
{
    "success": true,
    "data": {
        "id": 1,
        "name": "Sample Advertisement",
        "text": "This is a sample advertisement text",
        "pic_url": "https://example.com/image.jpg",
        "button_caption": "Click Me",
        "button_url": "https://example.com",
        "parse_mode": "HTML",
        "admitted": true,
        "created_at": "2024-01-01T00:00:00Z",
        "updated_at": "2024-01-15T10:30:00Z"
    }
}
Modified at 2025-11-11 09:40:41
Previous
List adverts
Next
Get advert
Built with