{
    "variable": [
        {
            "id": "baseUrl",
            "key": "baseUrl",
            "type": "string",
            "name": "string",
            "value": "https:\/\/api.admailr.com"
        }
    ],
    "info": {
        "name": "Admailr-API API Documentation",
        "_postman_id": "ccf5b35f-a5ad-40dc-aacd-4e986a65b10d",
        "description": "",
        "schema": "https:\/\/schema.getpostman.com\/json\/collection\/v2.1.0\/collection.json"
    },
    "item": [
        {
            "name": "Banners",
            "description": "",
            "item": [
                {
                    "name": "List banner sizes",
                    "request": {
                        "url": {
                            "host": "{{baseUrl}}",
                            "path": "api\/campaigns\/banner-sizes",
                            "query": [],
                            "raw": "{{baseUrl}}\/api\/campaigns\/banner-sizes"
                        },
                        "method": "GET",
                        "header": [
                            {
                                "key": "Content-Type",
                                "value": "application\/json"
                            },
                            {
                                "key": "Accept",
                                "value": "application\/json"
                            }
                        ],
                        "body": null,
                        "description": "Returns the creative dimensions that can be used when uploading banners.\nUse the `name` field from this list for the banner `type` payload."
                    },
                    "response": [
                        {
                            "header": [],
                            "code": 200,
                            "body": "{\n  \"data\": [\n    {\n      \"name\": \"300x250 (Medium Rectangle)\"\n    }\n  ]\n}",
                            "name": ""
                        }
                    ]
                },
                {
                    "name": "List banners for a campaign",
                    "request": {
                        "url": {
                            "host": "{{baseUrl}}",
                            "path": "api\/campaigns\/:campaign_id\/banners",
                            "query": [
                                {
                                    "key": "page",
                                    "value": "1",
                                    "description": "The page to return.",
                                    "disabled": false
                                },
                                {
                                    "key": "per_page",
                                    "value": "50",
                                    "description": "Number of banners per page (defaults to 20).",
                                    "disabled": false
                                }
                            ],
                            "raw": "{{baseUrl}}\/api\/campaigns\/:campaign_id\/banners?page=1&per_page=50",
                            "variable": [
                                {
                                    "id": "campaign_id",
                                    "key": "campaign_id",
                                    "value": "107",
                                    "description": "The ID of the campaign."
                                }
                            ]
                        },
                        "method": "GET",
                        "header": [
                            {
                                "key": "Content-Type",
                                "value": "application\/json"
                            },
                            {
                                "key": "Accept",
                                "value": "application\/json"
                            }
                        ],
                        "body": null,
                        "description": "Returns the paginated set of creative assets attached to a campaign."
                    },
                    "response": [
                        {
                            "header": [],
                            "code": 200,
                            "body": "{\n  \"data\": [\n    {\n      \"id\": 42,\n      \"type\": \"300x250\",\n      \"redirect_link\": \"https:\/\/landing.example.com\",\n      \"status\": 1\n    }\n  ],\n  \"links\": {\n    \"first\": \"https:\/\/api.localhost\/api\/campaigns\/123\/banners?page=1\",\n    \"last\": \"https:\/\/api.localhost\/api\/campaigns\/123\/banners?page=5\",\n    \"prev\": null,\n    \"next\": \"https:\/\/api.localhost\/api\/campaigns\/123\/banners?page=2\"\n  },\n  \"meta\": {\n    \"current_page\": 1,\n    \"per_page\": 20,\n    \"total\": 75\n  }\n}",
                            "name": ""
                        }
                    ]
                },
                {
                    "name": "Upload a new banner",
                    "request": {
                        "url": {
                            "host": "{{baseUrl}}",
                            "path": "api\/campaigns\/:campaign_id\/banners",
                            "query": [],
                            "raw": "{{baseUrl}}\/api\/campaigns\/:campaign_id\/banners",
                            "variable": [
                                {
                                    "id": "campaign_id",
                                    "key": "campaign_id",
                                    "value": "107",
                                    "description": "The ID of the campaign."
                                }
                            ]
                        },
                        "method": "POST",
                        "header": [
                            {
                                "key": "Content-Type",
                                "value": "multipart\/form-data"
                            },
                            {
                                "key": "Accept",
                                "value": "application\/json"
                            }
                        ],
                        "body": {
                            "mode": "formdata",
                            "formdata": [
                                {
                                    "key": "type",
                                    "value": "\"300x250\"",
                                    "type": "text",
                                    "description": "Banner size name as defined in the platform (eg. \"300x250\"). Fetch the allowed list via GET \/api\/campaigns\/banner-sizes."
                                },
                                {
                                    "key": "redirect_link",
                                    "value": "\"https:\/\/landing.example.com\"",
                                    "type": "text",
                                    "description": "HTTPS click-through URL."
                                },
                                {
                                    "key": "image",
                                    "src": [],
                                    "type": "file"
                                }
                            ]
                        },
                        "description": "Creates a creative for the specified campaign. The image must already match one of the allowed banner sizes."
                    },
                    "response": [
                        {
                            "header": [],
                            "code": 200,
                            "body": "{\n  \"data\": {\n    \"id\": 77,\n    \"type\": \"300x250\",\n    \"redirect_link\": \"https:\/\/landing.example.com\",\n    \"status\": 1\n  }\n}",
                            "name": ""
                        }
                    ]
                },
                {
                    "name": "Show a banner",
                    "request": {
                        "url": {
                            "host": "{{baseUrl}}",
                            "path": "api\/campaigns\/:campaign_id\/banners\/:id",
                            "query": [],
                            "raw": "{{baseUrl}}\/api\/campaigns\/:campaign_id\/banners\/:id",
                            "variable": [
                                {
                                    "id": "campaign_id",
                                    "key": "campaign_id",
                                    "value": "107",
                                    "description": "The ID of the campaign."
                                },
                                {
                                    "id": "id",
                                    "key": "id",
                                    "value": "2115067",
                                    "description": "The ID of the banner."
                                }
                            ]
                        },
                        "method": "GET",
                        "header": [
                            {
                                "key": "Content-Type",
                                "value": "application\/json"
                            },
                            {
                                "key": "Accept",
                                "value": "application\/json"
                            }
                        ],
                        "body": null,
                        "description": ""
                    },
                    "response": [
                        {
                            "header": [],
                            "code": 200,
                            "body": "{\n  \"data\": {\n    \"id\": 77,\n    \"type\": \"300x250\",\n    \"redirect_link\": \"https:\/\/landing.example.com\",\n    \"status\": 1\n  }\n}",
                            "name": ""
                        }
                    ]
                },
                {
                    "name": "Update a banner",
                    "request": {
                        "url": {
                            "host": "{{baseUrl}}",
                            "path": "api\/campaigns\/:campaign_id\/banners\/:id",
                            "query": [],
                            "raw": "{{baseUrl}}\/api\/campaigns\/:campaign_id\/banners\/:id",
                            "variable": [
                                {
                                    "id": "campaign_id",
                                    "key": "campaign_id",
                                    "value": "107",
                                    "description": "The ID of the campaign."
                                },
                                {
                                    "id": "id",
                                    "key": "id",
                                    "value": "2115067",
                                    "description": "The ID of the banner."
                                }
                            ]
                        },
                        "method": "POST",
                        "header": [
                            {
                                "key": "Content-Type",
                                "value": "multipart\/form-data"
                            },
                            {
                                "key": "Accept",
                                "value": "application\/json"
                            }
                        ],
                        "body": {
                            "mode": "formdata",
                            "formdata": [
                                {
                                    "key": "type",
                                    "value": "\"728x90\"",
                                    "type": "text",
                                    "description": "Banner size name (must exist in platform, see GET \/api\/campaigns\/banner-sizes)."
                                },
                                {
                                    "key": "redirect_link",
                                    "value": "\"https:\/\/landing.example.com\/new\"",
                                    "type": "text",
                                    "description": "HTTPS click URL."
                                },
                                {
                                    "key": "status",
                                    "value": "1",
                                    "type": "text",
                                    "description": "Enable\/disable flag (1 = active, 0 = disabled)."
                                },
                                {
                                    "key": "image",
                                    "src": [],
                                    "type": "file"
                                },
                                {
                                    "key": "_method",
                                    "value": "PUT",
                                    "type": "text"
                                }
                            ]
                        },
                        "description": "Send a multipart request if you are replacing the image, otherwise JSON is sufficient."
                    },
                    "response": [
                        {
                            "header": [],
                            "code": 200,
                            "body": "{\n  \"data\": {\n    \"id\": 77,\n    \"type\": \"728x90\",\n    \"redirect_link\": \"https:\/\/landing.example.com\/new\",\n    \"status\": 1\n  }\n}",
                            "name": ""
                        }
                    ]
                },
                {
                    "name": "Delete a banner",
                    "request": {
                        "url": {
                            "host": "{{baseUrl}}",
                            "path": "api\/campaigns\/:campaign_id\/banners\/:id",
                            "query": [],
                            "raw": "{{baseUrl}}\/api\/campaigns\/:campaign_id\/banners\/:id",
                            "variable": [
                                {
                                    "id": "campaign_id",
                                    "key": "campaign_id",
                                    "value": "107",
                                    "description": "The ID of the campaign."
                                },
                                {
                                    "id": "id",
                                    "key": "id",
                                    "value": "2115067",
                                    "description": "The ID of the banner."
                                }
                            ]
                        },
                        "method": "DELETE",
                        "header": [
                            {
                                "key": "Content-Type",
                                "value": "application\/json"
                            },
                            {
                                "key": "Accept",
                                "value": "application\/json"
                            }
                        ],
                        "body": null,
                        "description": "Marks the banner as deleted and removes it from the rotation."
                    },
                    "response": [
                        {
                            "header": [],
                            "code": 200,
                            "body": "{\n  \"message\": \"Banner deleted.\"\n}",
                            "name": ""
                        }
                    ]
                }
            ]
        },
        {
            "name": "Campaign categories",
            "description": "",
            "item": [
                {
                    "name": "List available categories",
                    "request": {
                        "url": {
                            "host": "{{baseUrl}}",
                            "path": "api\/campaigns\/categories",
                            "query": [],
                            "raw": "{{baseUrl}}\/api\/campaigns\/categories"
                        },
                        "method": "GET",
                        "header": [
                            {
                                "key": "Content-Type",
                                "value": "application\/json"
                            },
                            {
                                "key": "Accept",
                                "value": "application\/json"
                            }
                        ],
                        "body": null,
                        "description": "Fetches the latest taxonomy directly from the Admailr Behavior API."
                    },
                    "response": [
                        {
                            "header": [],
                            "code": 200,
                            "body": "{\n  \"data\": [\n    {\n      \"code\": 144,\n      \"label\": \"7-12 Education\"\n    }\n  ]\n}",
                            "name": ""
                        }
                    ]
                }
            ]
        },
        {
            "name": "Campaign lifecycle",
            "description": "",
            "item": [
                {
                    "name": "Cancel a campaign",
                    "request": {
                        "url": {
                            "host": "{{baseUrl}}",
                            "path": "api\/campaigns\/:campaign_id\/cancel",
                            "query": [],
                            "raw": "{{baseUrl}}\/api\/campaigns\/:campaign_id\/cancel",
                            "variable": [
                                {
                                    "id": "campaign_id",
                                    "key": "campaign_id",
                                    "value": "107",
                                    "description": "The ID of the campaign."
                                }
                            ]
                        },
                        "method": "PATCH",
                        "header": [
                            {
                                "key": "Content-Type",
                                "value": "application\/json"
                            },
                            {
                                "key": "Accept",
                                "value": "application\/json"
                            }
                        ],
                        "body": null,
                        "description": ""
                    },
                    "response": [
                        {
                            "header": [],
                            "code": 200,
                            "body": "{\n  \"success\": true,\n  \"message\": \"Campaign cancelled.\"\n}",
                            "name": ""
                        }
                    ]
                },
                {
                    "name": "Start a campaign",
                    "request": {
                        "url": {
                            "host": "{{baseUrl}}",
                            "path": "api\/campaigns\/:campaign_id\/start",
                            "query": [],
                            "raw": "{{baseUrl}}\/api\/campaigns\/:campaign_id\/start",
                            "variable": [
                                {
                                    "id": "campaign_id",
                                    "key": "campaign_id",
                                    "value": "107",
                                    "description": "The ID of the campaign."
                                }
                            ]
                        },
                        "method": "PATCH",
                        "header": [
                            {
                                "key": "Content-Type",
                                "value": "application\/json"
                            },
                            {
                                "key": "Accept",
                                "value": "application\/json"
                            }
                        ],
                        "body": null,
                        "description": "Performs the lightweight preflight checks before activation.\nOnly newly created campaigns in waiting state are accepted."
                    },
                    "response": [
                        {
                            "header": [],
                            "code": 200,
                            "body": "{\n  \"success\": true,\n  \"message\": \"Start request accepted.\"\n}",
                            "name": ""
                        },
                        {
                            "header": [],
                            "code": 422,
                            "body": "{\n  \"success\": false,\n  \"message\": \"Only newly created campaigns can be started via this endpoint.\"\n}",
                            "name": ""
                        }
                    ]
                },
                {
                    "name": "Run a campaign",
                    "request": {
                        "url": {
                            "host": "{{baseUrl}}",
                            "path": "api\/campaigns\/:campaign_id\/run",
                            "query": [],
                            "raw": "{{baseUrl}}\/api\/campaigns\/:campaign_id\/run",
                            "variable": [
                                {
                                    "id": "campaign_id",
                                    "key": "campaign_id",
                                    "value": "107",
                                    "description": "The ID of the campaign."
                                }
                            ]
                        },
                        "method": "PATCH",
                        "header": [
                            {
                                "key": "Content-Type",
                                "value": "application\/json"
                            },
                            {
                                "key": "Accept",
                                "value": "application\/json"
                            }
                        ],
                        "body": null,
                        "description": "Runs the legacy activation checks (budget, spend, approvals) and queues the campaign for delivery.\nOnly paused campaigns are allowed. Running campaigns quickly fail."
                    },
                    "response": [
                        {
                            "header": [],
                            "code": 200,
                            "body": "{\n  \"success\": true,\n  \"message\": \"Campaign running.\"\n}",
                            "name": ""
                        },
                        {
                            "header": [],
                            "code": 422,
                            "body": "{\n  \"success\": false,\n  \"message\": \"Campaign can only be activated from a paused state.\"\n}",
                            "name": ""
                        },
                        {
                            "header": [],
                            "code": 422,
                            "body": "{\n  \"success\": false,\n  \"message\": \"Insufficient funds.\"\n}",
                            "name": ""
                        }
                    ]
                },
                {
                    "name": "Pause a campaign",
                    "request": {
                        "url": {
                            "host": "{{baseUrl}}",
                            "path": "api\/campaigns\/:campaign_id\/pause",
                            "query": [],
                            "raw": "{{baseUrl}}\/api\/campaigns\/:campaign_id\/pause",
                            "variable": [
                                {
                                    "id": "campaign_id",
                                    "key": "campaign_id",
                                    "value": "107",
                                    "description": "The ID of the campaign."
                                }
                            ]
                        },
                        "method": "PATCH",
                        "header": [
                            {
                                "key": "Content-Type",
                                "value": "application\/json"
                            },
                            {
                                "key": "Accept",
                                "value": "application\/json"
                            }
                        ],
                        "body": null,
                        "description": ""
                    },
                    "response": [
                        {
                            "header": [],
                            "code": 200,
                            "body": "{\n  \"success\": true,\n  \"message\": \"Campaign paused.\"\n}",
                            "name": ""
                        }
                    ]
                }
            ]
        },
        {
            "name": "Campaigns",
            "description": "",
            "item": [
                {
                    "name": "List campaigns",
                    "request": {
                        "url": {
                            "host": "{{baseUrl}}",
                            "path": "api\/campaigns",
                            "query": [
                                {
                                    "key": "page",
                                    "value": "1",
                                    "description": "The page number to return.",
                                    "disabled": false
                                },
                                {
                                    "key": "per_page",
                                    "value": "50",
                                    "description": "Number of items per page (defaults to 20).",
                                    "disabled": false
                                }
                            ],
                            "raw": "{{baseUrl}}\/api\/campaigns?page=1&per_page=50"
                        },
                        "method": "GET",
                        "header": [
                            {
                                "key": "Content-Type",
                                "value": "application\/json"
                            },
                            {
                                "key": "Accept",
                                "value": "application\/json"
                            }
                        ],
                        "body": null,
                        "description": "Retrieve a paginated list of campaigns that belong to the authenticated advertiser."
                    },
                    "response": [
                        {
                            "header": [],
                            "code": 200,
                            "body": "{\n  \"data\": [\n    {\n      \"id\": 17,\n      \"campaign_name\": \"Spring Retargeting\",\n      \"status\": \"approved\",\n      \"category_ids\": [12, 44]\n    }\n  ],\n  \"links\": {\n    \"first\": \"https:\/\/api.localhost\/api\/campaigns?page=1\",\n    \"last\": \"https:\/\/api.localhost\/api\/campaigns?page=5\",\n    \"prev\": null,\n    \"next\": \"https:\/\/api.localhost\/api\/campaigns?page=2\"\n  },\n  \"meta\": {\n    \"current_page\": 1,\n    \"per_page\": 20,\n    \"total\": 100\n  }\n}",
                            "name": ""
                        }
                    ]
                },
                {
                    "name": "Create a new campaign",
                    "request": {
                        "url": {
                            "host": "{{baseUrl}}",
                            "path": "api\/campaigns",
                            "query": [],
                            "raw": "{{baseUrl}}\/api\/campaigns"
                        },
                        "method": "POST",
                        "header": [
                            {
                                "key": "Content-Type",
                                "value": "application\/json"
                            },
                            {
                                "key": "Accept",
                                "value": "application\/json"
                            }
                        ],
                        "body": {
                            "mode": "raw",
                            "raw": "{\"advertiserName\":\"\\\"Acme Media\\\"\",\"campaignName\":\"\\\"Q1 Retargeting\\\"\",\"campaignCategories\":[108,116]}"
                        },
                        "description": ""
                    },
                    "response": [
                        {
                            "header": [],
                            "code": 200,
                            "body": "{\n  \"success\": true,\n  \"message\": \"Ad Campaign successfully saved.\",\n  \"campaign\": 123\n}",
                            "name": ""
                        }
                    ]
                },
                {
                    "name": "Show campaign details",
                    "request": {
                        "url": {
                            "host": "{{baseUrl}}",
                            "path": "api\/campaigns\/:id",
                            "query": [],
                            "raw": "{{baseUrl}}\/api\/campaigns\/:id",
                            "variable": [
                                {
                                    "id": "id",
                                    "key": "id",
                                    "value": "107",
                                    "description": "The ID of the campaign."
                                }
                            ]
                        },
                        "method": "GET",
                        "header": [
                            {
                                "key": "Content-Type",
                                "value": "application\/json"
                            },
                            {
                                "key": "Accept",
                                "value": "application\/json"
                            }
                        ],
                        "body": null,
                        "description": ""
                    },
                    "response": [
                        {
                            "header": [],
                            "code": 200,
                            "body": "{\n  \"data\": {\n    \"id\": 123,\n    \"campaign_name\": \"Q1 Retargeting\",\n    \"status\": \"approved\",\n    \"category_ids\": [108, 116]\n  }\n}",
                            "name": ""
                        }
                    ]
                },
                {
                    "name": "Update a campaign",
                    "request": {
                        "url": {
                            "host": "{{baseUrl}}",
                            "path": "api\/campaigns\/:id",
                            "query": [],
                            "raw": "{{baseUrl}}\/api\/campaigns\/:id",
                            "variable": [
                                {
                                    "id": "id",
                                    "key": "id",
                                    "value": "107",
                                    "description": "The ID of the campaign."
                                }
                            ]
                        },
                        "method": "PUT",
                        "header": [
                            {
                                "key": "Content-Type",
                                "value": "application\/json"
                            },
                            {
                                "key": "Accept",
                                "value": "application\/json"
                            }
                        ],
                        "body": {
                            "mode": "raw",
                            "raw": "{\"campaignName\":\"\\\"Holiday Push\\\"\",\"advertiserName\":\"\\\"Acme Media\\\"\",\"dateStart\":\"2025-01-01\",\"dateEnd\":\"2025-02-01\",\"campaignCategories\":[108,116],\"campaignCountries\":[0],\"campaignDevices\":[1,3],\"campaignDemography\":[{\"gender\":1,\"from\":25,\"to\":34}],\"cpc\":0.45,\"spendGoal\":\"\\\"daily\\\"\",\"dailySpend\":150,\"weeklySpend\":1000}"
                        },
                        "description": ""
                    },
                    "response": [
                        {
                            "header": [],
                            "code": 200,
                            "body": "{\n  \"success\": true,\n  \"message\": \"Campaign updated.\",\n  \"campaignData\": {\n    \"id\": 123,\n    \"status\": \"approved\"\n  }\n}",
                            "name": ""
                        }
                    ]
                }
            ]
        },
        {
            "name": "Campaign targeting",
            "description": "",
            "item": [
                {
                    "name": "List available devices",
                    "request": {
                        "url": {
                            "host": "{{baseUrl}}",
                            "path": "api\/campaigns\/devices",
                            "query": [],
                            "raw": "{{baseUrl}}\/api\/campaigns\/devices"
                        },
                        "method": "GET",
                        "header": [
                            {
                                "key": "Content-Type",
                                "value": "application\/json"
                            },
                            {
                                "key": "Accept",
                                "value": "application\/json"
                            }
                        ],
                        "body": null,
                        "description": "Returns the device codes and labels supported by the `campaignDevices` payload field."
                    },
                    "response": [
                        {
                            "header": [],
                            "code": 200,
                            "body": "{\n  \"data\": [\n    { \"code\": 1, \"label\": \"Mobile Android\" },\n    { \"code\": 3, \"label\": \"Tablet Android\" }\n  ]\n}",
                            "name": ""
                        }
                    ]
                }
            ]
        }
    ],
    "auth": {
        "type": "apikey",
        "apikey": [
            {
                "key": "in",
                "value": "header",
                "type": "string"
            },
            {
                "key": "key",
                "value": "ADMAILR-ADS-API-KEY",
                "type": "string"
            }
        ]
    }
}