# Create an Amazon Ads campaign from an agent

Creating an Amazon Ads campaign takes two calls: `ads.validateCampaignPlan`, a dry run, then `ads.createCampaignPlan`, which leaves `state: PAUSED` on the campaign, ad group, and product ad. A signed-in workspace owner activates it in the web app; MCP refuses.

## What PubNio supports in an Amazon plan

Beyond a name, an objective, and a budget, an Amazon plan needs:

- A daily campaign budget; a lifetime budget or none is refused at create.
- `creative.providerSettings.asin` or `sku` on every ad; the product ad create is refused without either.

The plan's `schedule` goes to Amazon as the date part of `startAt` and `endAt`, written as `startDate` and `endDate` on the campaign. Without `startAt`, `startDate` is today, and `endDate` is sent only with `endAt`.

| Plan objective | Amazon receives |
| --- | --- |
| every objective | not sent: a Sponsored Products campaign has no objective |

## Spend controls

- `ads.validateCampaignPlan` compiles the plan and checks account readiness, capabilities, budget, currency, and the spend policy without calling the provider.
- Activating a campaign takes `confirmation: "activate_spend"` from a signed-in workspace owner in the web app; an API key or an MCP session gets 403 `human_actor_required`.

## 1. Validate the plan (dry run)

```http
POST /api/v1/ads/campaigns/validate?workspaceId=3d9a1f20-7c4b-4e8a-9f61-2b5c8d7e0a14
Authorization: Bearer <token>
Content-Type: application/json

{
  "name": "Insulated bottle auto targeting",
  "objective": "sales",
  "budget": {
    "amountMinor": 1500,
    "currency": "USD",
    "kind": "daily"
  },
  "schedule": {
    "startAt": "2027-01-04T08:00:00Z",
    "endAt": null,
    "timezone": "America/Los_Angeles"
  },
  "targets": [
    {
      "accountId": "7f3c2a10-5b4e-4d6f-8a9b-0c1d2e3f4a5b",
      "providerSettings": {
        "targetingType": "AUTO"
      }
    }
  ],
  "adGroups": [
    {
      "name": "32 oz bottles",
      "providerSettings": {
        "defaultBid": 0.85
      },
      "ads": [
        {
          "name": "Steel bottle, slate",
          "creative": {
            "providerSettings": {
              "asin": "B0CX7H2K9P"
            }
          }
        }
      ]
    }
  ]
}
```

A ready account gets 200 with `valid: true` and no issues. Amazon's rules run only at create, so a valid plan can still be refused there.

## 2. Create it paused

Send the same plan with `Idempotency-Key: plan-amazon-ads-1`: PubNio answers 202 `queued`, and `ads.getOperation` reports when every level exists paused. The same key with the same plan returns the same `planId`; with another plan it gets 400 `idempotency_conflict`.

## Limits

- Amazon's adapter has no local draft check, so Amazon's own rules run only at create and validation can pass a plan Amazon then refuses.

## Related

- [Amazon Ads through PubNio](https://pubnio.com/ads/amazon-ads)
- [All ad providers](https://pubnio.com/ads)
- API reference: [ads.createCampaignPlan](https://pubnio.com/docs/reference/ads-create-campaign-plan/)

