Create and save an item inside a package
POST
/api/content/management/packages/auto-package/create-and-save
const url = 'https://example.com/api/content/management/packages/auto-package/create-and-save';const options = { method: 'POST', headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'}, body: '{"repositoryId":"example","ruleId":"example","item":{"additionalProperty":"example"},"packageAction":"addToExisting","packageName":"example","newPackageName":"example","newPackageDescription":"example"}'};
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/content/management/packages/auto-package/create-and-save \ --header 'Authorization: Bearer <token>' \ --header 'Content-Type: application/json' \ --data '{ "repositoryId": "example", "ruleId": "example", "item": { "additionalProperty": "example" }, "packageAction": "addToExisting", "packageName": "example", "newPackageName": "example", "newPackageDescription": "example" }'Creates or updates an item directly inside a package, combining item save and package assignment. Accepts JSON or multipart/form-data.
Authorizations
Section titled “Authorizations”Request Body
Section titled “Request Body”Media typeapplication/json
object
repositoryId
required
Repository configuration ID
string
ruleId
required
Auto-package rule ID that triggered this save
string
item
required
Item data (same shape as POST /api/items)
object
key
additional properties
packageAction
required
Whether to add to an existing package or create a new one
string
packageName
Existing package name (when packageAction is ‘addToExisting’)
string
newPackageName
Name for the new package (when packageAction is ‘createNew’)
string
newPackageDescription
Optional description for the new package
string
Responses
Section titled “Responses”Item saved into package successfully
Media typeapplication/json
Saved item with an autoPackage descriptor
object
Examplegenerated
{}Invalid request
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"}Repository, rule, or package not found
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"}