Delete product
Removes a product, service or category, and everything inside it. Articles and Brand Alignment facts that named it keep their text and lose the link.
Requires the write:brand_profile scope, and the workspace must be enabled for API writes.
DELETE /v1/brands/{brand_id}/products/{product_id}Authorization
| Header | Type | Required |
|---|---|---|
Authorization | Bearer asky_sk_… | required |
Idempotency-Key | string | required |
Path parameters
| Parameter | Type | Required | Description |
|---|---|---|---|
brand_id | uuid | required | From List brands |
product_id | uuid | required | From products[].id on Get brand profile |
Query parameters
None.
Deleting a category also deletes the products and services inside it. To keep them, move them to
the top level or another category first with Update product
(parent_product_id).
Request
cURL
curl --request DELETE \
--url 'https://api.askylabs.com/v1/brands/242546de-4cee-4a7d-952e-f6aa60c63ef8/products/c41e9a20-7b5d-4e83-a1f6-3d2b8c0e9f17' \
--header 'Authorization: Bearer <api-key>' \
--header 'Idempotency-Key: <unique-per-attempt>'Response
200
{
"data": {
"deleted_product_id": "c41e9a20-7b5d-4e83-a1f6-3d2b8c0e9f17",
"also_deleted": 0
},
"request_id": "req_7d21b0af59c34e18b6ac"
}Response fields
| Field | Type | Description |
|---|---|---|
data.deleted_product_id | uuid | required. The item that was removed |
data.also_deleted | integer | required. How many items inside it were removed with it |
request_id | string | required. Also returned as the x-request-id header |
Errors
| Status | Code | When |
|---|---|---|
| 401 | invalid_token | The key is missing, malformed, or does not exist |
| 403 | insufficient_scope | The key does not carry write:brand_profile |
| 403 | plan_required | This workspace is not enabled for API writes |
| 404 | not_found | The item does not exist, was already deleted, or belongs to another brand |
| 429 | rate_limited | Over 60 requests per minute. See the Retry-After header |
Notes
Idempotency-Key is required. Reuse it when retrying the same attempt. See
Idempotency.
Last updated on