Create a rendition in a package
POST
/api/renditions/{configId}/_package/{packageName}/{assetId}
const url = 'https://example.com/api/renditions/example/_package/example/example';const form = new FormData();form.append('file', 'example');form.append('rendition', 'example');
const options = {method: 'POST', headers: {Authorization: 'Bearer <token>'}};
options.body = form;
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://example.com/api/renditions/example/_package/example/example \ --header 'Authorization: Bearer <token>' \ --header 'Content-Type: multipart/form-data' \ --form file=example \ --form rendition=exampleCreates a new custom rendition for a content item within a package. Requires multipart/form-data with ‘file’ and ‘rendition’ (JSON) fields.
Authorizations
Section titled “Authorizations”Parameters
Section titled “Parameters”Path Parameters
Section titled “Path Parameters”configId
required
Repository configuration ID
string
packageName
required
Package name
string
assetId
required
Asset ID
string
Request Body
Section titled “Request Body”Media typemultipart/form-data
object
file
Rendition file
rendition
required
JSON string with rendition metadata (name, type)
string
Responses
Section titled “Responses”Rendition created successfully
Media typeapplication/json
object
name
required
Rendition name
string
type
required
Rendition type
string
format
File format/extension
string
url
required
URL to access the rendition
string
storage
Storage details
object
objectName
required
Storage object name
string
version
Storage version ID
string | null
objectName
Object storage name
string
mimeType
MIME type
string
size
File size in bytes
number
fileName
Original file name
string
Example
{ "name": "native", "type": "native", "format": "jpg", "url": "/api/assets/repo/item123/native", "mimeType": "image/jpeg", "size": 1024, "fileName": "image.jpg"}Invalid request or no file provided
Media typeapplication/json
object
error
required
Indicates an error occurred
boolean
message
required
Error message describing what went wrong
string
Example
{ "error": true, "message": "Item not found"}