Skip to content

Update an asset's name, folder and text

PUT
/assets/management/v1/assets/{id}
curl --request PUT \
--url https://api.ebitex.io/assets/management/v1/assets/2489E9AD-2EE2-8E00-8EC9-32D5F69181C0 \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '{ "name": "example", "folderId": "2489E9AD-2EE2-8E00-8EC9-32D5F69181C0", "title": { "default": "example", "locales": "example" }, "alt": { "default": "example", "locales": "example" }, "caption": { "default": "example", "locales": "example" }, "rowVersion": 1, "openInBrowser": true, "metadata": {} }'

Replaces an asset’s name, folderId, and its title, alt and caption. Each text is { "default": "…", "locales": { "fr": "…" } }; this call replaces all of them, so a text you leave out is cleared: read the asset first and send back what you want kept. Send the rowVersion from the asset you read to be refused if someone changed it since. Set alt on every image you upload: it is the text a page shows when the image cannot be seen.

Key: an Assets management key with assets.management.write.

id
required
string format: uuid
Media typeapplication/json
object
name
required
string
folderId
required
null | string format: uuid
title
required
One of:
null
alt
required
One of:
null
caption
required
One of:
null
rowVersion
null | integer | string format: uint32
/^-?(?:0|[1-9]\d*)$/
openInBrowser
null | boolean
metadata
One of:
null
Examplegenerated
{
"name": "example",
"folderId": "2489E9AD-2EE2-8E00-8EC9-32D5F69181C0",
"title": {
"default": "example",
"locales": "example"
},
"alt": {
"default": "example",
"locales": "example"
},
"caption": {
"default": "example",
"locales": "example"
},
"rowVersion": 1,
"openInBrowser": true,
"metadata": {}
}

OK

validation_failed: the name is empty or too long, a text has no default, or the folder does not exist.

missing_api_key or invalid_api_key: no key was sent, or it is unknown, revoked or expired.

payment_required: the organization’s subscription needs attention.

scope_denied: the key is not an Assets management key. permission_denied: a read key was used for a write. app_not_available: Assets is not enabled for the organization. origin_denied or ip_denied: the key was used from an origin or address outside its restrictions.

not_found: there is no such asset in the organization.

The asset changed since rowVersion was read.

too_many_failed_authentications: too many bad keys from this address; rate_limited: too many requests from the organization. Retry-After says how long to wait.