v1

latestOpenAPI 3.1.02026-07-13305453.8 KB
Posts

Update post

Update an existing post by ID or slug. All fields are optional — only provided fields are updated. Requires a private API key.

patch/v1/posts/{identifier}

Path parameters

identifierstring required

Post ID or slug

Example:my-post-slug

Post ID or slug

Request body

titlestring
contentstring
descriptionstring
slugstring
categoryIdstring
status'published' | 'draft'
tagsstring[]

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

authorsstring[]

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

featuredboolean
coverImagestring uri nullable
publishedAtstring date-time
fieldsobject

Custom field values keyed by field key. Select values must use option values; multiselect values must be arrays of option values. Use null to clear optional fields.

Example request

{
  "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",
  "fields": {
    "release_date": "2024-01-15",
    "priority_score": 5,
    "audience": [
      "developers",
      "founders"
    ],
    "featured_customer": true,
    "subtitle": null
  }
}

Response

Post updated successfully

Example response

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