Skip to content

API Integration

Each request must be authorized using Header:

http
Authorization: Bearer {apiToken}

{apiToken} you can see on account page

Get list of campaigns

API Endpoint

http
GET https://api.tg-ads.co/api/v1/campaign

Response:

json
[
    {
        "id": 1302,
        "name": "My campaign 19.06.2025",
        "status": {
            "id": 3,
            "name": "On moderation",
            "handle": "ON_MODERATION",
            "color": "info"
        },
        "channel": {
            "id": 2,
            "name": "Telegram Bot",
            "handle": "BOT",
            "color": "success"
        }
    }
]

Start/Stop campaigns

API Endpoint

http
https://api.tg-ads.co/api/v1/campaign/status/{id}/{status}

Available parameters:
{id} - ID of your campaign {status} - ACTIVATE/STOP Valid URL Example:

http
curl --location --request POST 'http://dev.api.tg-ads.co/api/v1/campaign/status/1289/ACTIVATE' \
--header 'Authorization: Bearer 4a07346bda69dbc27df2e0bd50c16abb5f0c33'

Response example:

json
{
  "id": 12345,
  "name": "My campaign 12345",
  "status": {
    "id": 1,
    "name": "Active",
    "handle": "ACTIVE"
  },
  "channel": {
    "id": 1,
    "name": "Telegram Mini App",
    "handle": "TMA",
    "color": "primary"
  }
}

Valid URL Example to STOP campaign:

http
curl --location --request POST 'http://dev.api.tg-ads.co/api/v1/campaign/status/1289/STOP' \
--header 'Authorization: Bearer 4a07346bda69dbc27df2e0bd50c16abb5f0c33'

Response example:

json
{
  "id": 12345,
  "name": "My campaign 12345",
  "status": {
    "id": 2,
    "name": "Stopped",
    "handle": "STOPPED"
  },
  "channel": {
    "id": 1,
    "name": "Telegram Mini App",
    "handle": "TMA",
    "color": "primary"
  }
}