Skip to main content
cURL
Cost: 1 API credit per write.
Needs the seller’s Chrome open somewhere, with the Alura extension and signed in to Etsy for this shop. The script or agent can run on another computer. An offline extension answers extension_offline; the live status can name a more specific connection problem. Errors cost no API credits. See Chrome extension.
Needs the ads:write scope and the Etsy Ads workspace permission. Send dry_run=true to see the writes it would send, without sending them. Send the preview’s plan_hash to be sure you apply the plan you read.
This changes your live Etsy Ads. Undo it with Revert optimizer run, or in Alura’s Etsy Ads history, where the seller sees it.
A run is applied once. Applying it again, with any Idempotency-Key, answers the run as recorded.

When it is refused

Each of these sends nothing to Etsy:

How the writes run

Just before writing, Alura reads each listing on Etsy:
  • A listing already paused, or already on Lower click cost, is left out.
  • A listing it can’t read is skipped.
  • A move records the strategy Etsy shows now, which a revert restores.
Then it sends one Etsy write per 15 listings of one kind, pauses first, each read back from Etsy before the next. A write that doesn’t succeed stops the ones after it (not_sent). Search terms go one write per term, at most 7, each read back from the listing’s search terms. A term Etsy’s read-back doesn’t list stays unconfirmed. A change counts as applied only when Etsy shows it. One Etsy can’t show back stays unconfirmed and is never counted in projected_monthly_spend_freed. Alura records the run in its Etsy Ads history with source: api.

Limits

The shop takes 20 Etsy writes a minute and 500 a day, and 30 live reads a minute. Each change is read on Etsy before and after. A request that needs more than are left is refused first: 429 live_rate_limited, nothing sent. Only a write that lands is charged. See Credits and limits. Past its time budget, or when Etsy has not shown the outcome yet, it answers 202 with its change (a retry under the same Idempotency-Key then answers the result).

Authorizations

Authorization
string
header
required

An API key: Authorization: Bearer alura_sk_....

Headers

Idempotency-Key
string

Makes a retry safe: the same key with the same request within 24 hours answers from the first write (with Idempotent-Replayed: true) and never writes to Etsy twice; a write that failed with nothing written (Retry-After set) is tried again under it. The same key with a different request is a 409 conflict; while the first request still runs, 409 idempotency_processing (or the same 202). Required for relative changes such as adjust_price, and to add a listing file, image or video, or to change the alt text of an image (each uploads to Etsy, so a blind retry would upload again); a dry_run=true needs none.

Required string length: 1 - 255

Path Parameters

id
string
required

The run ID: a preview's, or a run in the shop's history.

Required string length: 1 - 80
Pattern: ^[A-Za-z0-9_-]{1,80}$
Example:

"0b9f0e3a-6d2c-4f0e-9a51-3c2d8e7f1a42"

Query Parameters

dry_run
boolean

true: plan the write and send nothing: what it would change, the Etsy calls it would make, and nothing reserved, charged or recorded. Free; counts toward the per-minute write limit.

Body

application/json
plan_hash
string

The preview's plan_hash: when sent, the apply is refused (409 optimize_plan_changed, nothing sent) unless it is still the plan kept for this run.

Pattern: ^[0-9a-f]{64}$

Response

OK: the write landed on Etsy (or, with dry_run=true, what it would do).

object
string
required
Allowed value: "workspace.ads_optimize_run"
id
string
required
readable
boolean
required
status
enum<string>
required

applying: writes in flight; applied: every change sent; partial: some failed or were not sent (an interrupted run included, interrupted_at).

Available options:
applying,
applied,
partial
shop_id
string
required
target
enum<string>
required
Available options:
listings,
search_terms
source
enum<string>
required

Who wrote it: api, app (Alura's Etsy Ads page) or restore (the app's strategy repair).

Available options:
api,
app,
restore
created_at
string
required

ISO 8601, UTC.

strategy_name
string
required

The name of the strategy the run used.

period
string
required

The stats period the plan judged: last_30_days, last_3_months, last_12_months or all_time.

basis
enum<string> | null
required
Available options:
saved,
explicit,
default
applied_by
object | null
required

Who applied an API run: the API key or OAuth grant; null for app runs.

verified
enum<string> | null
required

confirmed: Etsy's read-back answered for the run; unverified: writes went out but nothing confirmed them; null: nothing needed confirming (or an older app run).

Available options:
confirmed,
unverified
undone
boolean
required
closed_manually
boolean
required
interrupted_at
string | null
required

When a run that stopped mid-apply was finalized; its unanswered writes are unconfirmed with outcome_unknown.

projected_monthly_spend_freed
object | null
required

The spend freed the run still claims, as Alura's Etsy Ads page shows it: the paused listings' spend over the period, as 30 days (spend freed, not guaranteed cash saved), for changes Etsy's read-back showed and still standing (none once undone; a restored, resolved or restore-pending change no longer counts), only spend Etsy reported; with spend_unknown_count above 0 a lower bound. In US dollars, whatever currency the run recorded (Etsy Ads money is US dollars for every shop); null when it is unknown.

spend_unknown_count
integer
required

Changes the figure had to leave out because Etsy didn't report their spend: never added as 0.

action_counts
object
required

The actions by how they ended: a run applied with any unconfirmed action is not proven done.

advertised_before
integer | null
required
advertised_after
integer | null
required

Etsy's advertised total read back after the run; null when not read.

actions
object[]
required
actions_next_offset
integer | null
required

Where the run's next actions start when actions holds only some of them (MCP's history shows a large run a page at a time: pass it back as actions_offset); null when actions runs to the run's last. Always null over REST, which answers every action.