Update media metadata
POST
/media/{id}/metadata
const url = 'https://api.colourbox.com/media/1/metadata';const options = { method: 'POST', headers: { Authorization: 'CBX-SIMPLE-TOKEN Token=<token>', 'Content-Type': 'application/json' }, body: '{"editorial":false,"adult_content":false,"keywords":{"en":["keyword1","keyword2"]},"title":{"en":"Title"},"description":{"en":"Description"},"iptc":{"Keywords":["keyword1","keyword2"],"Caption-Abstract":"title"},"geolocation":{"source":"gps","longitude":7.26627,"latitude":43.7034}}'};
try { const response = await fetch(url, options); const data = await response.json(); console.log(data);} catch (error) { console.error(error);}curl --request POST \ --url https://api.colourbox.com/media/1/metadata \ --header 'Authorization: CBX-SIMPLE-TOKEN Token=<token>' \ --header 'Content-Type: application/json' \ --data '{ "editorial": false, "adult_content": false, "keywords": { "en": [ "keyword1", "keyword2" ] }, "title": { "en": "Title" }, "description": { "en": "Description" }, "iptc": { "Keywords": [ "keyword1", "keyword2" ], "Caption-Abstract": "title" }, "geolocation": { "source": "gps", "longitude": 7.26627, "latitude": 43.7034 } }'Update the entire metadata sub-document of the media.
Note that on title, description and keywords, only en is indexed by the
Colourbox search engines for your own files. All languages are
indexed on Colourbox media.
Authorizations
Section titled “Authorizations”Parameters
Section titled “Parameters”Path Parameters
Section titled “Path Parameters”id
required
integer
Request Bodyrequired
Section titled “Request Bodyrequired”Media typeapplication/json
object
editorial
required
boolean
adult_content
required
boolean
keywords
required
Keywords per language, e.g. en
object
key
additional properties
Array<string>
title
required
Title per language, e.g. en
object
key
additional properties
string
description
required
Description per language, e.g. en
object
key
additional properties
string
iptc
required
object
geolocation
required
object
latitude
required
A number. GET /media/{id} returns it as a string; convert it before sending it back.
number
longitude
required
A number. GET /media/{id} returns it as a string; convert it before sending it back.
number
source
required
string
camera_created
The time the picture was taken as a UNIX timestamp
number
Example
{ "editorial": false, "adult_content": false, "keywords": { "en": [ "keyword1", "keyword2" ] }, "title": { "en": "Title" }, "description": { "en": "Description" }, "iptc": { "Keywords": [ "keyword1", "keyword2" ], "Caption-Abstract": "title" }, "geolocation": { "source": "gps", "longitude": 7.26627, "latitude": 43.7034 }}Responses
Section titled “Responses”Metadata updated