Skip to main content
PATCH
/
v1
/
posts
/
{identifier}
Update post
curl --request PATCH \
  --url https://api.marblecms.com/v1/posts/{identifier} \
  --header 'Authorization: <api-key>' \
  --header 'Content-Type: application/json' \
  --data '
{
  "title": "Updated Post Title",
  "content": "<p>Updated content</p>",
  "description": "Updated description",
  "slug": "updated-post-slug",
  "categoryId": "cryitfjp2345kl05weoybfk9",
  "status": "published",
  "tags": [
    "cryitfjp4567no07ygqadhm1"
  ],
  "authors": [
    "cryitfjp3456lm06xfpzcgl0"
  ],
  "featured": true,
  "coverImage": "https://media.marblecms.com/new-cover.jpg",
  "publishedAt": "2024-02-01T10:00:00Z",
  "attribution": {
    "author": "<string>",
    "url": "<string>"
  }
}
'
{
  "post": {
    "id": "cryitfjp5678mn09qrstuvwx",
    "slug": "updated-post-slug",
    "title": "Updated Post Title",
    "status": "published",
    "featured": true,
    "publishedAt": "2024-02-01T10:00:00.000Z",
    "updatedAt": "2024-02-01T12:00:00.000Z"
  }
}

Authorizations

Authorization
string
header
required

Your Marble API key

Path Parameters

identifier
string
required

Post ID or slug

Example:

"my-post-slug"

Body

application/json
title
string
Minimum string length: 1
Example:

"Updated Post Title"

content
string
Minimum string length: 1
Example:

"<p>Updated content</p>"

description
string
Minimum string length: 1
Example:

"Updated description"

slug
string
Minimum string length: 1
Example:

"updated-post-slug"

categoryId
string
Minimum string length: 1
Example:

"cryitfjp2345kl05weoybfk9"

status
enum<string>
Available options:
published,
draft
Example:

"published"

tags
string[]

Array of tag IDs. Replaces all existing tags when provided.

Example:
["cryitfjp4567no07ygqadhm1"]
authors
string[]

Array of author IDs. Replaces all existing authors when provided.

Example:
["cryitfjp3456lm06xfpzcgl0"]
Example:

true

coverImage
string<uri> | null
Example:

"https://media.marblecms.com/new-cover.jpg"

publishedAt
string<date-time>
Example:

"2024-02-01T10:00:00Z"

attribution
object

Attribution to original author when republishing content

Response

Post updated successfully

post
object
required