Skip to content

Create and save an item inside a package

POST
/api/content/management/packages/auto-package/create-and-save
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.

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
Allowed values: addToExisting createNew
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

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"
}