API Documentation

Base URL

http://api.mybid.io/gateway/v1/api/

API Keys

You can create and manage API Keys via https://dashboard.mybid.io/key-gateways

Authorization

For authorization, you need to include the API key in the Header of each request in the field X-Auth-Token.

Response Structure

Each request returns a response in the format:

{
  "code": int,
  "message": text,
  "data": json
}

Status Codes

Dictionary values and filters

The following rules apply to data from /gateway/v1/api/application/* and to request fields that reference those dictionaries (campaign updates, change-task creation, and similar).

value vs label

Do not use label as an identifier. A dictionary row may look like this:

{
  "value": "mobile",
  "label": "Mobile devices"
}

Use only value (here: "mobile") in API requests and targeting.

Usage types

From GET /gateway/v1/api/application/usage-types, each item may include several fields. When you send usage_type or usage_type_black, pass only the string from type:

{
  "type": "mainstream",
  "label": "Mainstream"
}

Example in a request: "usage_type": ["mainstream"] — not the label text.

Browser versions

Versions may be any values you need; each version must be a JSON string (for example a decimal like "120.5"). Example whitelist shape:

{
  "browser_families_versions_whitelist": {
    "chrome": ["120.5", "131", "142.25"]
  }
}

Skins (inpage creatives)

Each skin row from GET /gateway/v1/api/application/skins looks like:

{
  "id": 1,
  "name": "skin-a"
}

In creatives[].skins when creating an inpage campaign, pass only the name string (here: "skin-a"), not id.

Get Balance GET /gateway/v1/api/current-balance

Request

Only the API key needs to be passed in the request.

Response

{
  "code": int,
  "message": text,
  "data": {
    "current_balance": float
  }
}

current_balance - current balance

Examples

Invalid token
curl --location 'http://api.mybid.io/gateway/v1/api/current-balance' \
--header 'X-Auth-Token: {{api_key}}'
{
  "code": 401,
  "message": "api key is not valid",
  "data": null
}
Successful balance retrieval
curl --location 'http://api.mybid.io/gateway/v1/api/current-balance' \
--header 'X-Auth-Token: *****MRCP'
{
  "code": 200,
  "message": "",
  "data": {
    "current_balance": 6849.651174751568
  }
}

Get Campaigns GET /gateway/v1/api/campaigns

Request

Only the API key needs to be passed in the request.

Response

{
  "code": int,
  "message": text,
  "data": [{
    "id": int,
    "name": text,
    "adtype": text,
    "budget": float,
    "status": text,
    "tracking_url": text,
    "daily_budget": float,
    "Total_spend": float,
    "daily_spend": float,
    "bid": float,
    "traffic_stop_reason": text
  }]
}

Examples

curl --location 'http://api.mybid.io/gateway/v1/api/campaigns' \
--header 'X-Auth-Token: *****MRCP'
{
  "code": 200,
  "message": "",
  "data": [{
    "id": 502,
    "name": "test_inpage_adv_direct",
    "adtype": "inpage",
    "budget": 0,
    "status": "active",
    "tracking_url": "https://mybid.io/campaigns/new",
    "daily_budget": 0,
    "total_spend": 86.03763403306333,
    "daily_spend": 0,
    "bid": 0.00015,
    "traffic_stop_reason": "total_budget_exceeded"
  },
  {
    "id": 509,
    "name": "test_c_mng_dir",
    "adtype": "push",
    "budget": 0,
    "status": "paused",
    "tracking_url": "https://mybid.io/campaigns/new",
    "daily_budget": 0,
    "total_spend": 111.12182032043002,
    "daily_spend": 0,
    "bid": 0.001,
    "traffic_stop_reason": "daily_budget_exceeded"
  },
  {
    "id": 510,
    "name": "test_inpage_adv_direct1",
    "adtype": "inpage",
    "budget": 0,
    "status": "paused",
    "tracking_url": "https://mybid.io/campaigns/new",
    "daily_budget": 0,
    "total_spend": 185.07603906435966,
    "daily_spend": 0,
    "bid": 0.001,
    "traffic_stop_reason": "no_stop_condition"
  }]
}

Get Campaign Status GET /gateway/v1/api/campaign/status/:id

Request

You need to pass the API key and specify the campaign ID in the request parameters to get the campaign status.

Response

{
  "code": int,
  "message": text,
  "data": {
    "id": int,
    "status": text
  }
}

Examples

Get campaign status
curl --location 'http://api.mybid.io/gateway/v1/api/campaign/status/382' \
--header 'X-Auth-Token: *****MRCP'
{
  "code": 200,
  "message": "",
  "data": {
    "id": 382,
    "status": "active"
  }
}
Get non-existent campaign status
curl --location 'http://api.mybid.io/gateway/v1/api/campaign/status/3820000' \
--header 'X-Auth-Token: *****MRCP'
{
  "code": 204,
  "message": "content not found",
  "data": null
}

Get Campaign Data GET /gateway/v1/api/campaign/:id

Request

You need to pass the API key and specify the campaign ID in the request parameters to get the campaign data.

Response

{
  "code": int,
  "message": text,
  "data": {
    "id": int,
    "name": text,
    "adtype": text,
    "budget": float,
    "status": text,
    "tracking_url": text,
    "os_type_familie_version_whitelist": {"os_type": {"family": [1,2,3 ("version")]}},
    "os_type_familie_version_blacklist": {"os_type": {"family": [1,2,3 ("version")]}},
    "capping_settings": [text],
    "capping_unique_settings": string,
    "daily_budget": float,
    "bid": float,
    "bid_by_source": {text: float, text: float},
    "black_list": [text],
    "white_list": [text],
    "smart_purchase": boolean
  }
}

Examples

Get specific Campaign Data
curl --location 'http://api.mybid.io/gateway/v1/api/campaign/15964' \
--header 'X-Auth-Token: *****MRCP'
{
  "code": 200,
  "message": "",
  "data": {
    "id": 15964,
    "name": "test_push",
    "adtype": "push",
    "budget": 0,
    "status": "paused",
    "tracking_url": "https://mybid.io/campaigns",
    "os_type_familie_version_whitelist": {
      "mobile": {
        "android": [3, 5, 7]
      }
    },
    "os_type_familie_version_blacklist": {},
    "capping_settings": [
      {
        "type": "impression",
        "limit": 1,
        "duration": 2
      },
      {
        "type": "click",
        "limit": 1,
        "duration": 2
      }
    ],
    "capping_unique_settings": "ip+ua",
    "daily_budget": 95.07,
    "bid": 0.4,
    "bid_by_source": {
      "123": 0.1,
      "124": 0.1
    },
    "black_list": ["11", "12", "14", "15", "16"],
    "white_list": ["1", "2"],
    "smart_purchase": false
  }
}
Get non-existent campaign
curl --location 'http://api.mybid.io/gateway/v1/api/campaign/15964000' \
--header 'X-Auth-Token: *****MRCP'
{
  "code": 204,
  "message": "content not found",
  "data": null
}

Get Statistic POST /gateway/v1/api/statistic

Request

Pass the required fields in the request body:

{
  "campaigns": [int],
  "ad_types": [text],
  "countries": [text],
  "os_types": [text],
  "os_families": [text],
  "date_from": "YYYY-MM-DD",
  "date_to": "YYYY-MM-DD",
  "group_by": text
}

Response

{
  "code": 200,
  "message": "ok",
  "data": {
    "goals": [],
    "stats": [
      {
        "campaign_id": int, // if you choose group by campaign
        "creative_id": int, // if you choose group by creative
        "source_id": text, // if you choose group by source
        "spot_id": text, // if you choose group by spot
        "date": text, // if you choose group by day
        "country": text, // if you choose group by country
        "platform": text, // if you choose group by os
        "clicks": int,
        "conversions": int,
        "cr": float,
        "ctr": float,
        "impressions": int,
        "platform": text,
        "revenue": float,
        "spent": float,
        "cv": float,
        "roi": float,
        "ecpa": float,
        "goals": [
          {
            "id": int,
            "conversions": float,
            "ecpa": float,
            "cr": float,
            "cv": float,
            "revenue": float,
            "roi": float
          }
        ]
      }
    ],
    "summary": {
      "clicks": int,
      "conversions": int,
      "cr": float,
      "ctr": float,
      "cpl": float, // deprecated
      "impressions": int,
      "revenue": float,
      "spent": float,
      "cv": float,
      "roi": float,
      "ecpa": float
    }
  }
}

Example

Get statistic on campaigns X, Y + params
curl --location --request POST 'http://api.mybid.io/gateway/v1/api/statistic' \
--header 'X-Auth-Token: *****MRCP' \
--header 'Content-Type: application/json' \
--data '{
  "campaigns": [480],
  "ad_types": ["push", "inpage"],
  "countries": ["LK", "US"],
  "os_types": ["mobile", "computer"],
  "os_families": ["android", "ios"],
  "date_from": "2024-09-01",
  "date_to": "2024-09-20",
  "group_by": "country"
}'
Response
{
  "code": 200,
  "message": "ok",
  "data": {
    "goals": [],
    "stats": [
      {
        "country": "US",
        "clicks": 1508488,
        "conversions": 2494,
        "cr": 0.165,
        "ctr": 4.42,
        "cpl": 0.028,
        "impressions": 34125286,
        "platform": "ios",
        "revenue": 0,
        "spent": 3207.648458369033,
        "cv": 0,
        "roi": -100,
        "goals": [
          {
            "id": 1,
            "conversions": 0.02,
            "ecpa": 0.3,
            "cr": 0.001,
            "cv": 0.01,
            "revenue": 0.001,
            "roi": 0.5
          }
        ]
      }
    ],
    "summary": {
      "clicks": 1508488,
      "conversions": 2494,
      "cr": 0.165,
      "ctr": 4.42,
      "cpl": 0.028,
      "impressions": 34125286,
      "revenue": 0,
      "spent": 3207.648458369033,
      "cv": 1,
      "roi": -99
    }
  }
}
Get statistic on X, Y via CSV
curl --location --request POST 'http://api.mybid.io/gateway/v1/api/statistic' \
--header 'X-Auth-Token: *****MRCP' \
--header 'Content-Type: application/json' \
--data '{
  "campaigns": [480, 490],
  "ad_types": ["push", "inpage"],
  "countries": ["LK", "US"],
  "os_types": ["mobile" , "computer"],
  "os_families": ["android", "ios"],
  "date_from": "2024-09-01",
  "date_to": "2024-09-20",
  "output_format": "csv",
  "group_by": "country"
}'
Response
{
  "code": 200,
  "message": "ok",
  "data": {
    "filename": "assets/uploads/by_country_from_2024-09-01_to_2024-09-19_report_time_2024-09-23T07:37:38Z.csv"
  }
}

Update Campaign Status PUT /gateway/v1/api/campaign/status

Request

You need to pass the API key and:

{
  "id": int,
  "status": text
}

Response

{
  "code": int,
  "message": text,
  "data": null
}

Examples

Update specific campaign status
curl --location --request PUT 'http://api.mybid.io/gateway/v1/api/campaign/status' \
--header 'X-Auth-Token: *****MRCP' \
--header 'Content-Type: application/json' \
--data '{
  "id": 382,
  "status": "active"
}'
{
  "code": 200,
  "message": "Ok",
  "data": null
}
Update campaign status with invalid status
curl --location --request PUT 'http://api.mybid.io/gateway/v1/api/campaign/status' \
--header 'X-Auth-Token: *****MRCP' \
--header 'Content-Type: application/json' \
--data '{
  "id": 382,
  "status": "blabla"
}'
{
  "code": 400,
  "message": "status is not valid",
  "data": null
}
Internal error
curl --location --request PUT 'http://api.mybid.io/gateway/v1/api/campaign/status' \
--header 'X-Auth-Token: *****MRCP' \
--header 'Content-Type: application/json' \
--data '{
  "id": 382,
  "status": "blabla"
}'
{
  "code": 500,
  "message": "try again later",
  "data": null
}

Update Campaign PUT /gateway/v1/api/campaign/:id

Request

You need to pass the API key, specify the campaign ID in the request parameters, and pass in the Body:

{
  "bid": float,
  "black_list": [text],
  "white_list": [text],
  "bid_by_source": {text: float, text: float},
  "smart_purchase": boolean
}

Response

{
  "code": int,
  "message": text,
  "data": null
}

Examples

Change Bid
curl --location --request PUT 'http://api.mybid.io/gateway/v1/api/campaign/382' \
--header 'X-Auth-Token: *****MRCP' \
--header 'Content-Type: application/json' \
--data '{
  "bid": 0.1,
  "smart_purchase": boolean
}'
{
  "code": 200,
  "message": "Ok",
  "data": null
}
Add/Change BidBySource
curl --location --request PUT 'http://api.mybid.io/gateway/v1/api/campaign/15964' \
--header 'X-Auth-Token: *****MRCP' \
--header 'Content-Type: application/json' \
--data '{
  "bid_by_source": {
    "2": 0.1,
    "3": 0.2,
    "smart_purchase": true
  }
}'
{
  "code": 200,
  "message": "Ok",
  "data": null
}
Change only lists
curl --location --request PUT 'http://api.mybid.io/gateway/v1/api/campaign/382' \
--header 'X-Auth-Token: *****MRCP' \
--header 'Content-Type: application/json' \
--data '{
  "black_list": [
    "1-11",
    "111",
    "222"
  ],
  "white_list": [
    "6-66",
    "666",
    "777"
  ],
  "smart_purchase": true
}'
{
  "code": 200,
  "message": "Ok",
  "data": null
}

List Change Tasks GET /gateway/v1/api/change-task

Request

Pass the API key. Optional query parameters are passed through unchanged (filters, pagination, sorting, etc.). Common parameters include:

Response

JSON with code, message, and data. Example when tasks exist:

{
  "code": 200,
  "message": "OK",
  "data": {
    "data": [
      { "id": 1, "type": "create_campaign", "status": "open", ... },
      ...
    ],
    "meta": { "total": 1, "total_pages": 1 }
  }
}

The status field on each item in data.data is one of: open, rejected, approved.

If there is nothing to return, the HTTP status may be 404.

Example: filter by status

curl --location 'http://api.mybid.io/gateway/v1/api/change-task?status=open' \
--header 'X-Auth-Token: *****MRCP'

Example: status and pagination

curl --location 'http://api.mybid.io/gateway/v1/api/change-task?status=open&pagination[page]=2&pagination[per_page]=10' \
--header 'X-Auth-Token: *****MRCP'

Get Change Task GET /gateway/v1/api/change-task/:id

Request

Pass the API key and the numeric change-task id in the path.

Response

Example:

{
  "code": 200,
  "message": "OK",
  "data": {
    "change_task": {
      "id": 42,
      "type": "create_campaign",
      "status": "open",
      ...
    }
  }
}

change_task.status is one of: open, rejected, approved.

Example

curl --location 'http://api.mybid.io/gateway/v1/api/change-task/42' \
--header 'X-Auth-Token: *****MRCP'

Reject Change Task PUT /gateway/v1/api/change-task/reject/:id

Request

Pass the API key, the numeric change-task id in the path, and a JSON body:

{
  "status": "rejected",
  "reject_reason": text (optional)
}

Response

Returns HTTP 200 with this JSON body:

{
  "code": 204,
  "message": "OK",
  "data": {}
}

Example

curl --location --request PUT 'http://api.mybid.io/gateway/v1/api/change-task/reject/42' \
--header 'X-Auth-Token: *****MRCP' \
--header 'Content-Type: application/json' \
--data '{
  "status": "rejected",
  "reject_reason": "does not meet guidelines"
}'

Create Campaign POST /gateway/v1/api/change-task

Creates a change task of type create_campaign.

Request

Pass the API key and a JSON body. The gateway validates the fields below and submits the task.

{
  "name": text,
  "tracking_url": text,
  "bid": float,
  "budget": float (optional),
  "daily_budget": float (optional),
  "ad_type": text,
  "smart_purchase": bool (optional),
  "category": [text],
  "traffic_qualities": [text],
  "price_type": text,
  "countries": [text] (optional),
  "countries_black": [text] (optional),
  "black_list": [text] (optional),
  "white_list": [text] (optional),
  "usage_type": [text] (optional),
  "usage_type_black": [text] (optional),
  "os_type_familie_version_whitelist": object (optional),
  "os_type_familie_version_blacklist": object (optional),
  "browser_families_versions_whitelist": object (optional),
  "browser_families_versions_blacklist": object (optional),
  "capping_settings": json (optional),
  "work_schedule": json (optional),
  "work_schedule_black": json (optional),
  "capping_unique_settings": text (optional),
  "creatives": [object] (required for inpage)
}

Required and simple fields

Creatives (required for ad_type = "inpage", forbidden for "popunder")

The creatives array defines creatives for the campaign. Each object:

{
  "title": text (required),
  "description": text (optional),
  "is_active": bool (required),
  "image_url": text (optional),
  "icon_url": text (optional),
  "skins": [text] (optional),
  "is_mandatory_skins": bool (optional)
}

File requirements (validated on the server):

FieldAllowed formatsMax size
imagejpg, jpeg, png, gif, webp720 KB
iconjpg, jpeg, png, gif, webp200 KB

Fields whose values come from dictionaries

List fields not from application dictionaries

Examples of complex JSON values

os_type_familie_version_whitelist (illustrative):

{
  "mobile": {
    "android": [10, 11, 12]
  },
  "computer": {
    "windows": [10, 11]
  },
  "tablet": {
    "xbox": []
  },
  "smartTv": {}
}

browser_families_versions_whitelist (family keys must match value from the browser dictionary):

{
  "chrome": ["120.5", "131"],
  "firefox": ["115.0"],
  "qq": []
}

capping_settings (array of rules; same idea as campaign capping):

[
  { "type": "impression", "limit": 1, "duration": 24 },
  { "type": "click", "limit": 2, "duration": 48 }
]

work_schedule - per weekday, list of [start, end] time ranges (HH:MM strings). Days: MondaySunday. Example fragment:

{
  "Monday": [["09:00", "12:00"], ["13:00", "18:00"]],
  "Tuesday": [["09:00", "18:00"]]
}

work_schedule_black - same shape as work_schedule; ranges listed here are excluded. Empty day arrays mean nothing blocked for that day:

{
  "Monday": [],
  "Saturday": [["00:00", "23:59"]]
}

capping_unique_settings - optional string: ip or ip+ua (user uniqueness for capping).

Fuller request body example (popunder)

{
  "name": "My popunder campaign",
  "tracking_url": "https://example.com/click",
  "bid": 0.05,
  "budget": 1000,
  "daily_budget": 100,
  "ad_type": "popunder",
  "smart_purchase": true,
  "category": ["AD"],
  "traffic_qualities": ["premium"],
  "price_type": "cpc",
  "countries": ["US", "DE"],
  "countries_black": ["RU"],
  "black_list": ["100-200"],
  "white_list": ["300"],
  "usage_type": ["mainstream"],
  "usage_type_black": ["incentive"],
  "os_type_familie_version_whitelist": {
    "mobile": { "android": [11, 12, 13] }
  },
  "browser_families_versions_whitelist": {
    "chrome": ["120.5", "131"]
  },
  "capping_settings": [
    { "type": "impression", "limit": 1, "duration": 24 }
  ],
  "capping_unique_settings": "ip+ua"
}

Fuller request body example (inpage with creatives)

{
  "name": "My inpage campaign",
  "tracking_url": "https://example.com/click",
  "bid": 0.02,
  "budget": 500,
  "daily_budget": 50,
  "ad_type": "inpage",
  "category": ["MS"],
  "traffic_qualities": ["premium", "optimum"],
  "price_type": "cpc",
  "countries": ["US"],
  "creatives": [
    {
      "title": "Special offer",
      "description": "Limited time deal",
      "is_active": true,
      "image_url": "https://advertiser.example/banner.png",
      "icon_url": "https://advertiser.example/icon.png",
      "skins": ["skin-a"],
      "is_mandatory_skins": false
    },
    {
      "title": "New product",
      "is_active": true,
      "image_url": "https://advertiser.example/banner2.png",
      "skins": ["skin-b", "skin-c"],
      "is_mandatory_skins": true
    }
  ]
}

Response

Example:

{
  "code": 201,
  "message": "OK",
  "data": {
    "change_task": { "id": 99, "type": "create_campaign", "status": "open", ... }
  }
}

Example: minimal popunder (curl)

curl --location --request POST 'http://api.mybid.io/gateway/v1/api/change-task' \
--header 'X-Auth-Token: *****MRCP' \
--header 'Content-Type: application/json' \
--data '{
  "name": "My popunder campaign",
  "tracking_url": "https://example.com/click",
  "bid": 0.05,
  "ad_type": "popunder",
  "category": ["MS"],
  "traffic_qualities": ["premium"],
  "price_type": "cpc",
  "countries": ["US", "DE"]
}'

Example: inpage with creatives (curl)

curl --location --request POST 'http://api.mybid.io/gateway/v1/api/change-task' \
--header 'X-Auth-Token: *****MRCP' \
--header 'Content-Type: application/json' \
--data '{
  "name": "My inpage campaign",
  "tracking_url": "https://example.com/click",
  "bid": 0.02,
  "ad_type": "inpage",
  "category": ["MS"],
  "traffic_qualities": ["premium"],
  "price_type": "cpc",
  "countries": ["US"],
  "creatives": [
    {
      "title": "Best deal",
      "is_active": true,
      "image_url": "https://advertiser.example/banner.png",
      "icon_url": "https://advertiser.example/icon.png",
      "skins": ["skin-a"],
      "is_mandatory_skins": false
    }
  ]
}'

Get skins dictionary GET /gateway/v1/api/application/skins

Request

Pass the API key. Required query parameter:

Response

Example (structure illustrative):

{
  "code": 200,
  "message": "OK",
  "data": [
    { "id": 1, "name": "skin-a" },
    { "id": 2, "name": "skin-b" },
    ...
  ]
}

Use only name in skins, not id.

Example

curl --location 'http://api.mybid.io/gateway/v1/api/application/skins?ad_type=inpage' \
--header 'X-Auth-Token: *****MRCP'

Get OS / platform dictionary GET /gateway/v1/api/application/os-platform

Request

Pass the API key.

Response

Example (structure illustrative):

{
  "code": 200,
  "message": "OK",
  "data": [
    { "value": "mobile", "label": "Mobile" },
    { "value": "computer", "label": "Desktop" },
    ...
  ]
}

Use only value in later requests, not label.

Example

curl --location 'http://api.mybid.io/gateway/v1/api/application/os-platform' \
--header 'X-Auth-Token: *****MRCP'

Get browser dictionary GET /gateway/v1/api/application/browser

Request

Pass the API key.

Response

Example (structure illustrative):

{
  "code": 200,
  "message": "OK",
  "data": [
    { "value": "chrome", "label": "Google Chrome" },
    { "value": "firefox", "label": "Mozilla Firefox" },
    ...
  ]
}

Use only value for browser family keys in targeting, not label. Version arrays use strings, for example ["120.5", "131"].

Example

curl --location 'http://api.mybid.io/gateway/v1/api/application/browser' \
--header 'X-Auth-Token: *****MRCP'

Get countries dictionary GET /gateway/v1/api/application/countries

Request

Pass the API key.

Response

Example:

{
  "code": 200,
  "message": "OK",
  "data": {
    "countries": ["AD", "AE", "AF", "US", ...]
  }
}

countries is a sorted list of ISO 3166-1 alpha-2 codes for use in API requests.

Example

curl --location 'http://api.mybid.io/gateway/v1/api/application/countries' \
--header 'X-Auth-Token: *****MRCP'

Get usage types GET /gateway/v1/api/application/usage-types

Request

Pass the API key. The list is returned for the authenticated account.

Response

Example (structure illustrative):

{
  "code": 200,
  "message": "OK",
  "data": [
    { "type": "mainstream", "label": "Mainstream" },
    { "type": "incentive", "label": "Incentive" },
    ...
  ]
}

When you send usage_type or usage_type_black elsewhere, use only the type field of each object, for example "usage_type": ["mainstream"].

Example

curl --location 'http://api.mybid.io/gateway/v1/api/application/usage-types' \
--header 'X-Auth-Token: *****MRCP'