PublishRules
PublishRules
PublishRules is a tool that allows you to streamline the process of content creation and publishing, and lets you manage the content lifecycle of your project smoothly.
create
The Create Publish Rules request allows you to create publish rules for the publish rules of a stack.
| Name | Type | Description |
|---|---|---|
| params.workflow | object | The workflow details with workflow stages. |
import * as contentstack from '@contentstack/management'
const client = contentstack.client({ authtoken })
const publishing_rule = {
"publish rules": "publish rules_uid",
"actions": [],
"content_types": ["$all"],
"locales": ["en-us"],
"environment": "environment_uid",
"approvers": {
"users": ["user_uid"],
"roles": ["role_uid"]
},
"publish rules_stage": "publish rules_stage_uid",
"disable_approver_publishing": false
}
client.stack({ api_key: 'api_key'}).publishRules()
.create({ publishing_rule })
.then((publishRules) => console.log(publishRules))