Blog operations
2 operations named blog.*. Every one runs in a batch through apply_ops, dry_run_ops, the CLI or the admin.
| Operation | What it does | Permission | Confirmation |
|---|---|---|---|
| blog.create | blog.create with entry validation and ownership checks. | site.edit | none |
| blog.update | blog.update with entry validation and ownership checks. | site.edit | none |
blog.create
blog.create with entry validation and ownership checks.
Example input
{
"title": "Journal",
"templateId": "blog-index-editorial-grid"
}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". |
Output
| Field | Type | Required | Notes |
|---|---|---|---|
| id | string | yes | |
| slug | string | yes | |
| templateId | string | yes | |
| blogId | string | no |
Try it
yarn splash blog.create '{"title":"Journal","templateId":"blog-index-editorial-grid"}' --dry-runblog.update
blog.update with entry validation and ownership checks.
Example input
{
"id": "5f6a7b8c-9d0e-4f1a-8b2c-3d4e5f6a7b8c",
"patch": {
"title": {
"en-US": "Journal"
}
}
}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 blog.update '{"id":"5f6a7b8c-9d0e-4f1a-8b2c-3d4e5f6a7b8c","patch":{"title":{"en-US":"Journal"}}}' --dry-runGenerated from the operation registry and the MCP tool catalogue (source 30542ad92100d508).
Something wrong on this page? Write to docs@librettocms.com.