Static Ads Lab
API ReferenceProductsV1ProductsIdArchive

Archive a product

Archives a product (hidden by default, references intact, reversible). With active children, responds 409 unless cascade=true, which archives the whole subtree.

POST
/v1/products/{id}/archive
X-API-Key<token>

API key for authentication. Include in the X-API-Key header.

In: header

Path Parameters

idstring
Length1 <= length

Query Parameters

cascade?string

Also archive all active variants and audiences of this product

Value in"true" | "false"

Response Body

curl -X POST "https://api.staticadslab.com/v1/products/prod_a1b2c3d4e5f67890/archive?cascade=true"
{
  "archived": true,
  "children": {
    "products": 0,
    "product_variants": 0,
    "audiences": 0
  }
}
{
  "error": {
    "code": "VALIDATION_ERROR",
    "message": "Invalid request body",
    "details": [
      {
        "field": "string",
        "message": "string"
      }
    ]
  },
  "meta": {
    "request_id": "req_a1b2c3d4e5f67890",
    "timestamp": "2026-03-27T12:00:00.000Z"
  }
}
{
  "error": {
    "code": "VALIDATION_ERROR",
    "message": "Invalid request body",
    "details": [
      {
        "field": "string",
        "message": "string"
      }
    ]
  },
  "meta": {
    "request_id": "req_a1b2c3d4e5f67890",
    "timestamp": "2026-03-27T12:00:00.000Z"
  }
}
{
  "error": {
    "code": "RESOURCE_HAS_CHILDREN",
    "message": "string",
    "children": {
      "products": 0,
      "product_variants": 0,
      "audiences": 0
    }
  },
  "meta": {
    "request_id": "req_a1b2c3d4e5f67890",
    "timestamp": "2026-03-27T12:00:00.000Z"
  }
}
{
  "error": {
    "code": "VALIDATION_ERROR",
    "message": "Invalid request body",
    "details": [
      {
        "field": "string",
        "message": "string"
      }
    ]
  },
  "meta": {
    "request_id": "req_a1b2c3d4e5f67890",
    "timestamp": "2026-03-27T12:00:00.000Z"
  }
}