Article operations
4 operations named article.*. Every one runs in a batch through apply_ops, dry_run_ops, the CLI or the admin.
| Operation | What it does | Permission | Confirmation |
|---|---|---|---|
| article.create | article.create with entry validation and ownership checks. | site.edit | none |
| article.update | article.update with entry validation and ownership checks. | site.edit | none |
| article.publish | article.publish with entry validation and ownership checks. | site.edit | publish |
| article.unpublish | article.unpublish with entry validation and ownership checks. | site.edit | publish |
article.create
article.create with entry validation and ownership checks.
Example input
{
"title": "A house on the hill",
"templateId": "article-gallery-sticky",
"blogId": "5f6a7b8c-9d0e-4f1a-8b2c-3d4e5f6a7b8c"
}Input
| Field | Type | Required | Notes |
|---|---|---|---|
| title | string | yes | At least 1 character. At most 200 characters. |
| slug | string | no | |
| templateId | string | yes | At least 1 character. |
| locale | string | no | At least 1 character. Default "en-US". |
| blogId | string (uuid) | yes |
Output
| Field | Type | Required | Notes |
|---|---|---|---|
| id | string | yes | |
| slug | string | yes | |
| templateId | string | yes | |
| blogId | string | no |
Try it
yarn splash article.create '{"title":"A house on the hill","templateId":"article-gallery-sticky","blogId":"5f6a7b8c-9d0e-4f1a-8b2c-3d4e5f6a7b8c"}' --dry-runarticle.update
article.update with entry validation and ownership checks.
Example input
{
"id": "4e5f6a7b-8c9d-4e0f-9a1b-2c3d4e5f6a7b",
"patch": {
"title": {
"en-US": "A house on the hill"
},
"excerpt": {
"en-US": "Notes from the site."
}
}
}Input
| Field | Type | Required | Notes |
|---|---|---|---|
| id | string | yes | At least 1 character. |
| patch | object | yes | |
| patch.slug | string | no | |
| patch.title | record of string | no | |
| patch.excerpt | record of string | null | no | |
| patch.featuredImageId | string | null | no | |
| patch.authorUserId | string | null | no | |
| patch.authorName | string | null | no | |
| patch.canonicalUrl | string | null | no | |
| patch.seo | object | no | |
| patch.templateId | string | no | At least 1 character. |
| patch.requireAuth | boolean | no | |
| patch.requiredRoles | array of string | no | At most 50 items. |
{
"type": "object",
"properties": {
"id": {
"type": "string",
"minLength": 1
},
"patch": {
"type": "object",
"properties": {
"slug": {
"type": "string"
},
"title": {
"$ref": "#/$defs/__schema0"
},
"excerpt": {
"anyOf": [
{
"$ref": "#/$defs/__schema0"
},
{
"type": "null"
}
]
},
"featuredImageId": {
"anyOf": [
{
"type": "string"
},
{
"type": "null"
}
]
},
"authorUserId": {
"anyOf": [
{
"type": "string"
},
{
"type": "null"
}
]
},
"authorName": {
"anyOf": [
{
"type": "string"
},
{
"type": "null"
}
]
},
"canonicalUrl": {
"anyOf": [
{
"type": "string"
},
{
"type": "null"
}
]
},
"seo": {
"type": "object",
"properties": {
"metaTitle": {
"anyOf": [
{
"$ref": "#/$defs/__schema0"
},
{
"type": "null"
}
]
},
"metaDescription": {
"anyOf": [
{
"$ref": "#/$defs/__schema0"
},
{
"type": "null"
}
]
},
"ogImageId": {
"anyOf": [
{
"type": "string"
},
{
"type": "null"
}
]
},
"noIndex": {
"type": "boolean"
}
},
"additionalProperties": false
},
"templateId": {
"type": "string",
"minLength": 1
},
"requireAuth": {
"type": "boolean"
},
"requiredRoles": {
"maxItems": 50,
"type": "array",
"items": {
"$ref": "#/$defs/__schema1"
}
}
},
"additionalProperties": false
}
},
"required": [
"id",
"patch"
],
"additionalProperties": false,
"$defs": {
"__schema0": {
"type": "object",
"propertyNames": {
"type": "string"
},
"additionalProperties": {
"type": "string"
}
},
"__schema1": {
"type": "string",
"maxLength": 40,
"pattern": "^[a-z][a-z0-9-]*$"
}
}
}Output
| Field | Type | Required | Notes |
|---|---|---|---|
| id | string | yes | At least 1 character. |
Try it
yarn splash article.update '{"id":"4e5f6a7b-8c9d-4e0f-9a1b-2c3d4e5f6a7b","patch":{"title":{"en-US":"A house on the hill"},"excerpt":{"en-US":"Notes from the site."}}}' --dry-runarticle.publish
article.publish with entry validation and ownership checks.
Example input
{
"id": "4e5f6a7b-8c9d-4e0f-9a1b-2c3d4e5f6a7b"
}Input
| Field | Type | Required | Notes |
|---|---|---|---|
| id | string | yes | At least 1 character. |
Output
| Field | Type | Required | Notes |
|---|---|---|---|
| ok | true | yes |
Publishing cannot run in a dry run, and the single-operation CLI form sets no confirmation: put it in a batch with confirmed: ["publish"] and run yarn splash apply <file>.
article.unpublish
article.unpublish with entry validation and ownership checks.
Example input
{
"id": "4e5f6a7b-8c9d-4e0f-9a1b-2c3d4e5f6a7b"
}Input
| Field | Type | Required | Notes |
|---|---|---|---|
| id | string | yes | At least 1 character. |
Output
| Field | Type | Required | Notes |
|---|---|---|---|
| ok | true | yes |
Publishing cannot run in a dry run, and the single-operation CLI form sets no confirmation: put it in a batch with confirmed: ["publish"] and run yarn splash apply <file>.
Generated from the operation registry and the MCP tool catalogue (source 037123ffc94bf85a).
Something wrong on this page? Write to docs@librettocms.com.