Restore a deleted campaign
POST/campaigns/:campaignId/undelete
Restores a deleted campaign and the creatives that were deleted with it, and returns the campaign — the same body GET /campaigns/{id} returns. There is no time limit, but the restored campaign counts against the plan’s campaign limit like a new one (403 LIMIT_EXCEEDED at the cap). A creative deleted on its own stays deleted, and the campaign’s review links stay revoked. Restoring a campaign that is already live is a no-op 200; Idempotency-Key is required.
Request
Responses
- 200
- 400
- 401
- 403
- 404
- 409
- 429
- 503
OK. The restored campaign (or the replay of an earlier restore with this key).
Response Headers
Strong hash of this response body.
Bad Request. The Idempotency-Key header is missing (IDEMPOTENCY_KEY_REQUIRED) or malformed (INVALID_IDEMPOTENCY_KEY).
Unauthorized. Missing, malformed, unknown, revoked, or expired bearer token — or the token owner no longer holds the required entitlement (ENTITLEMENT_LOST). A uniform problem body is returned with a distinct code; no owner/condition detail (no-leak).
Forbidden. The key lacks the campaigns:write scope, the account's plan does not include campaigns, or restoring would put the account over its plan’s campaign limit (LIMIT_EXCEEDED, with limitKey, limit and current).
Not Found (CAMPAIGN_NOT_FOUND). No campaign with this id belongs to the key's account — a campaign of another account returns this SAME uniform 404 (no-leak).
Conflict. The campaign's previous change is still finishing (CAMPAIGN_CASCADE_PENDING, retry after Retry-After); or a request under this key is still in progress (IDEMPOTENCY_IN_PROGRESS, retry after Retry-After); or the key was already used for a different request (IDEMPOTENCY_KEY_REUSED).
Response Headers
Seconds to wait before retrying — on an in-progress or cascade-pending conflict only.
Too Many Requests. The per-token sliding window of 60 requests/minute was exceeded. The body is express-rate-limit's DEFAULT plain-text message (NOT the JSON problem+json envelope).
Response Headers
IETF draft-7 rate-limit policy/state (limit, remaining, reset).
Seconds to wait before retrying.
Service Unavailable. Writes are paused for this account (WRITES_PAUSED), or another campaign write raced this restore at the plan limit and it lost (SERVICE_UNAVAILABLE). Nothing was changed and the Idempotency-Key is still usable: retry the SAME request after Retry-After.
Response Headers
Seconds to wait before retrying.