v1

latestOpenAPI 3.1.02026-07-13305453.8 KB
Posts

Create post

Create a new post. Requires a private API key. Category is required. If authors are not provided, the first workspace author is used.

post/v1/posts

Request body

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

Array of tag IDs to attach to the post

authorsstring[]

Array of author IDs. If omitted, the first workspace author is used.

featuredboolean
coverImagestring uri nullable
publishedAtstring date-time

ISO 8601 datetime. Defaults to current time if omitted.

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": "Getting Started with Next.js",
  "content": "<p>Hello world</p>",
  "description": "A beginner's guide to Next.js",
  "slug": "getting-started-with-nextjs",
  "categoryId": "cryitfjp2345kl05weoybfk9",
  "status": "draft",
  "tags": [
    "cryitfjp4567no07ygqadhm1"
  ],
  "authors": [
    "cryitfjp3456lm06xfpzcgl0"
  ],
  "coverImage": "https://media.marblecms.com/cover.jpg",
  "publishedAt": "2024-01-15T10:00:00Z",
  "fields": {
    "release_date": "2024-01-15",
    "priority_score": 5,
    "audience": [
      "developers",
      "founders"
    ],
    "featured_customer": true,
    "subtitle": null
  }
}

Response

Post created successfully

Example response

{
  "post": {
    "id": "cryitfjp5678mn09qrstuvwx",
    "slug": "getting-started-with-nextjs",
    "title": "Getting Started with Next.js",
    "status": "draft",
    "publishedAt": "2024-01-15T10:00:00.000Z",
    "createdAt": "2024-01-15T10:00:00.000Z"
  }
}