Asset APIs
POSTCreate Assets
Create or update asset links with rank assignment. Supports batch input.
Requests go to the live API through streamoid.com and act on your real data.
Create or update the assets linked to products. Each item names one
parent_code and, per channel, an ordered list of URLs: the Nth URL becomes rank N and is stored under the Nth image attribute of that channel's image configuration. A blank URL, or the text null, none, nan or nat, is skipped but keeps its position, so the following URLs keep their rank. A channel cannot hold more URLs than its image configuration has positions. A URL may appear only once per channel list, and a parent_code may appear only once per channel and asset_type in a request. The parent_code must belong to a product in the store: when none exists the code is skipped and reported in error_info with reason product_not_found, while the other items are still written. Pass product_uuid to skip that check for an item. Each new image asset is stored first without an asset_id; the assets service then re-hosts the image and assigns asset_id and the Streamoid URL, so read them back with GET /v1/assets. For an image added to a product and channel that already has assets this always runs. For the first image of a product and channel, or an image that links an existing unlinked document to the product, the assets service runs the store's enabled automations instead, and asset_id is assigned only when image_upload is one of them. Assets of any other asset_type are stored but never re-hosted, so they get no asset_id from this call. A request carries at most 100 items and 10 MiB, otherwise it fails with 413. failed counts assets the assets service rejected plus one per unknown parent_code.Authorization
AuthorizationstringrequiredheaderBearer token,
Bearer <token>. Create one under Tokens in your workspace.Query parameters
store_uuidstringrequiredStore identifier
Example:
699ec31355208b213e56059aHeaders
X-Request-IdstringOptional trace ID
Body
application/json required
An array of objects. Each item:
parent_codestringrequiredParent code of an existing product in the store. It cannot be blank. When no product has this code the item is skipped and reported in
error_info as product_not_found.Example:
SKU001asset_typestringDefaults to image. Must be one of the store's supported doc types, or the request fails with 400.
Allowed:
image video pdf 3D textExample:
imageproduct_uuidstringOptional. When omitted it is looked up from the
parent_code. When given, the product lookup and the product_not_found check are skipped for this item.channelsobjectrequiredChannels to upsert this parent_code's assets under, keyed by channel name, each an ordered URL list (see below). Each channel must be enabled on the store's own settings, or the request fails with 400 before any asset is written.
Responses
200Assets created or updated
statusobjectFields
codeinteger0 = success, -1 = error
Example:
0messagestringExample:
SUCCESSrequest_idstringExample:
8c8b2b7e-23d7-4c2a-91b0-2a7c4dfbb312dataobjectFields
createdintegerExample:
1updatedintegerExample:
0failedintegerAssets the assets service rejected, plus one per unknown parent_code
Example:
0error_infoobject[]One entry per failure. A
product_not_found entry carries parent_code and store_uuid; a downstream_api_failed entry carries the asset's asset_id, parent_code and store_uuid when the assets service returned them.Item fields
parent_codestringExample:
SKU001store_uuidstringasset_idstringreasonstringproduct_not_found when no product has the parent_code, or downstream_api_failed when the assets service rejected the asset.Example:
product_not_founddetailsstringWhy the asset was not written.
400Validation error: an empty request, an item with no non-blank URL, an asset_type not in the store's supported doc types, a channel not enabled for this store, or a channel's URL list longer than its image-config attribute order.
statusstringdefault: "error"The status of the request, typically 'error'
detailstringrequiredA description of the error
401Unauthorized – Bearer token missing or invalid
statusobjectFields
codeintegerExample:
-1messagestringExample:
Unauthorized – invalid or missing Bearer token413More than 100 items in the request, or a request body over 10 MiB
statusstringdefault: "error"The status of the request, typically 'error'
detailstringrequiredA description of the error
422Validation error: a malformed body, a blank `parent_code`, a repeated URL in one channel list, a repeated `parent_code` for the same channel and `asset_type`, or a wrongly typed field
detailobject[]Item fields
locstring | integer[]requireddefault: ["body",""]msgstringrequireddefault: "Field Required"typestringrequireddefault: "missing"500Internal server error
statusobjectFields
codeintegerExample:
-1messagestringExample:
Internal server error. Please contact support@catalogix.ai502The product lookup or the assets service is unavailable
statusstringdefault: "error"The status of the request, typically 'error'
detailstringrequiredA description of the error
Something missing or unclear? Write to support@streamoid.com.