Skip to content

Remove asset links

DELETE
/stores/{storeRef}/assets/links
curl --request DELETE \
--url https://apibase.ecomweb.app/api/v1/stores/example/assets/links \
--header 'Content-Type: application/json' \
--header 'x-api-key: <x-api-key>' \
--data '{ "asset_ids": [ "example" ], "entity_type": "example", "entity_id": "example", "entity_field": "example" }'

Removes the links between the listed assets and the records that use them, without deleting the assets. Narrow it with entity_type, entity_id and entity_field; with none of them the assets are unlinked from every record.

Required scopes: write:assets

storeRef
required
string

The store’s ref, as returned by GET /stores.

Media typeapplication/json
object
asset_ids
required

Array of asset IDs to unlink

Array<string>
entity_type

Entity type filter (optional - if not provided, unlinks from all entities)

string
entity_id

Entity ID filter (optional)

string
entity_field

Entity field filter (optional)

string

Example generated

{
"asset_ids": [
"example"
],
"entity_type": "example",
"entity_id": "example",
"entity_field": "example"
}
Media typeapplication/json
object
count
required

Number of links removed.

number
message
required

A readable confirmation.

string

Example generated

{
"count": 1,
"message": "example"
}

The request is malformed or failed validation.

Media typeapplication/json
One of:
object
statusCode
required

The HTTP status code.

number
message
required

What went wrong; validation failures list one message per problem.

One of:
string
error

The HTTP status text, such as Bad Request.

string

Example generated

{
"statusCode": 1,
"message": [
"example"
],
"error": "example"
}

The key is missing, invalid, revoked or expired.

Media typeapplication/json
One of:
object
statusCode
required

The HTTP status code.

number
message
required

What went wrong; validation failures list one message per problem.

One of:
string
error

The HTTP status text, such as Bad Request.

string

Example generated

{
"statusCode": 1,
"message": [
"example"
],
"error": "example"
}

The key may not do this: a missing scope, a readonly key, a publishable key on a Store API route, or a disallowed origin.

Media typeapplication/json
One of:
object
statusCode
required

The HTTP status code.

number
message
required

What went wrong; validation failures list one message per problem.

One of:
string
error

The HTTP status text, such as Bad Request.

string

Example generated

{
"statusCode": 1,
"message": [
"example"
],
"error": "example"
}