---
title: "Goal → campaign → ad group → ad item → keywords, registered as Autron's in the same request"
method: POST
path: "/walmart/advertisers/{public_id}/campaigns"
tags: ["walmart"]
---

# Goal → campaign → ad group → ad item → keywords, registered as Autron's in the same request

`POST /walmart/advertisers/{public_id}/campaigns`

## Request

- Base URL: `https://api.autron.ai`
- URL: `https://api.autron.ai/walmart/advertisers/{public_id}/campaigns`
- Auth: API key in header `Authorization`

The campaign is created paused; with state=enabled it is enabled as the last step, once the whole tree exists and only if the item's goal is still on. It starts tomorrow (Walmart refuses a start date that is not in the future), so an enabled campaign reads "Scheduled" in Ad Center until then. A complete tree always answers 201: if the enable did not land, retry it with PUT .../campaigns/<campaign_id>/state, never by building again (every build makes a new campaign).

## Request body

- WalmartCampaignBuildRequest
  - `item_id` string, required: Walmart item ID; a live goal must already be set for it
  - `targeting_type` string: auto (default) | manual
  - `keywords` WalmartCampaignKeyword[]: manual targeting only, at least one; bids come from Walmart's keyword_suggestions per match type
    - `text` string, required: the keyword
    - `match_type` string: exact (default) | phrase | broad
  - `daily_budget` number: greater than zero; when absent, the goal's daily budget (strategy maximum_daily_budget; a 400 when it can't be used), else 50
  - `state` string: paused (default) | enabled: enabled needs the item's goal on, and enables the campaign once the whole tree exists

## Response `201`

Campaign, ad group, ad item (and keywords) created and recorded as Autron's. With state=enabled, `state` says whether the enable landed (enabled, paused or unknown) and `state_message` why not.

- WalmartCampaignTree
  - `campaign_id` integer: Walmart campaign id
  - `name` string: Autron | <item_id> | auto, or Autron | <item_id> | manual | <keyword> (the first keyword, cut to fit 255 characters); a label, not what makes it Autron's
  - `state` string: enabled | paused | unknown: what Walmart most likely shows now (unknown: it may have been enabled without confirming, and the safety pause failed; check Ad Center)
  - `requested_state` string: the state the request asked for: paused | enabled
  - `state_message` string: why `state` differs from `requested_state`: Walmart's text, the safety-pause sentence, or that the goal was switched off during the build; or, when the enable landed but recording it failed, what Autron could not record; or, when the goal went off while the enable was in flight, what Autron did about it. Null when the change simply landed, or the build stayed paused as asked
  - `targeting_type` string: auto | manual
  - `registry_public_id` string: public_id of the walmart_campaign row recorded for it
  - `ad_group_id` integer
  - `ad_item_id` integer
  - `keyword_ids` integer[]: empty for auto
  - `daily_budget` number: the campaign's daily budget, in dollars
  - `daily_budget_source` string: request | goal | default

## Other responses

- `400`: No live goal for the item, the goal is off and state=enabled, or a bad request.
- `403`: Walmart has not granted Autron Campaign Management on this advertiser.
- `502`: Walmart refused a write; `created` lists what exists so far.
- `503`: No Walmart credentials on this environment.

---

[API](https://skmtc.dev/autron/apis/autron-api.md) · [All operations](https://skmtc.dev/autron/apis/autron-api/llms.txt) · [OpenAPI document](https://skmtc.dev/autron/apis/autron-api/revisions/f696bfa7295f?raw)
