Skip to Content
APIEndpointsUpdate product

Update product

Changes a product, service or category: any of its details, its kind, or the category it sits in (parent_product_id; null moves it to the top level). Send only what you want to change.

Requires the write:brand_profile scope, and the workspace must be enabled for API writes.

PATCH /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.

Any parameter you pass returns 400 invalid_request naming the offending key, rather than being ignored silently.

Body

application/json. At least one field is required. Every field is the same as on Create product.

FieldTypeRequiredDescription
namestring, 1–120 charsoptionalWhat customers call it
kindline | category | product | serviceoptionalIts level. Refused when what sits inside it could no longer sit there
parent_product_iduuid | nulloptionalMoves it inside another line or category. null moves it to the top level
summarystring, up to 600 charsoptionalWhat it is
audiencestring, up to 300 charsoptionalWho it’s for. An empty string follows its line or the brand profile
capabilitiesstring[], up to 20optionalReplaces the list
outcomesstring[], up to 10optionalReplaces the list
differentiatorsstring[], up to 10optionalReplaces the list
aliasesstring[], up to 10optionalReplaces the list
custom_fields{label, value}[], up to 5optionalReplaces custom product context; [] clears it. Unique labels up to 60 characters; each value up to 10,000 characters
page_urlstring | nulloptionalnull clears it
marketsstring[] | nulloptionalnull makes it follow its line or the brand profile again
topic_idsuuid[], up to 50optionalReplaces its topics. An empty array clears them

Request

curl --request PATCH \ --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>' \ --header 'Content-Type: application/json' \ --data '{"audience":"Marketing leads at multi-market B2B brands","markets":null}'

Response

{ "data": { "product": { "id": "c41e9a20-7b5d-4e83-a1f6-3d2b8c0e9f17", "parent_product_id": "5d0b3a7e-2c41-4f8e-9b6a-1f7c2e8d4a90", "kind": "product", "name": "Brand Alignment", "summary": "", "audience": "Marketing leads at multi-market B2B brands", "capabilities": [], "outcomes": [], "differentiators": [], "aliases": [], "page_url": null, "markets": null, "topic_ids": [], "drafted_from_website": false, "reviewed": true } }, "request_id": "req_7d21b0af59c34e18b6ac" }

Response fields

The updated item, in the same shape as Create product.

FieldTypeDescription
data.productobjectrequired. The item after the change
request_idstringrequired. Also returned as the x-request-id header

Errors

StatusCodeWhen
400invalid_requestAn unknown field, no fields at all, a value over its limit, or a level or parent that does not fit
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, the new parent or a topic does not exist, or belongs to another brand
409conflictSomething with that name already sits at that level
429rate_limitedOver 60 requests per minute. See the Retry-After header

Notes

An update counts as a review: an item Asky drafted from the website returns reviewed: true afterwards, the same as when someone edits it on the Products & services tab.

Idempotency-Key is required. See Idempotency.

Last updated on