Skip to Content
APIEndpointsDelete product

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

HeaderTypeRequired
AuthorizationBearer asky_sk_…required
Idempotency-Keystringrequired

Path parameters

ParameterTypeRequiredDescription
brand_iduuidrequiredFrom List brands
product_iduuidrequiredFrom 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 --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

{ "data": { "deleted_product_id": "c41e9a20-7b5d-4e83-a1f6-3d2b8c0e9f17", "also_deleted": 0 }, "request_id": "req_7d21b0af59c34e18b6ac" }

Response fields

FieldTypeDescription
data.deleted_product_iduuidrequired. The item that was removed
data.also_deletedintegerrequired. How many items inside it were removed with it
request_idstringrequired. Also returned as the x-request-id header

Errors

StatusCodeWhen
401invalid_tokenThe key is missing, malformed, or does not exist
403insufficient_scopeThe key does not carry write:brand_profile
403plan_requiredThis workspace is not enabled for API writes
404not_foundThe item does not exist, was already deleted, or belongs to another brand
429rate_limitedOver 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