Search Documentation

Search for a documentation page...

Posts API

REST API endpoints for managing blog posts.

List Posts

GET /api/v1/posts

Query Parameters

ParameterTypeDefaultDescription
limitnumber50Posts per page (1-100)
offsetnumber0Posts to skip
querystringSearch by post title
activebooleanFilter by published status
tagstringFilter by tag

Response

{
"data": [
{
"id": "0191abc0-1234-7def-8000-000000000001",
"title": "Welcome to Our Store",
"slug": "welcome-to-our-store",
"image": "https://cdn.example.com/welcome.jpg",
"tag": "news",
"active": true,
"publishedAt": "2024-06-01T12:00:00.000Z",
"createdAt": "2024-05-28T09:00:00.000Z"
}
],
"meta": {
"count": 12
}
}

Get Post

GET /api/v1/posts/:idOrSlug

Returns a single blog post by UUID or slug, with full TipTap JSON content and SEO metadata.


Create Post

POST /api/v1/posts

Content must be valid TipTap JSON with type: "doc". The slug must be unique within the store.

Request Body

FieldTypeRequiredDescription
titlestringYesPost title
slugstringYesURL slug (lowercase, numbers, hyphens)
contentobjectYesTipTap JSON content ({ type: "doc", content: [...] })
imagestringNoFeatured image URL
tagstringNoPost tag/category
activebooleanNoVisible on storefront
publishedAtstringNoISO 8601 publication date
seoobjectNoSEO metadata (see below)
filtersobjectNoKey-value metadata filters

SEO Object

FieldTypeDescription
titlestringMeta title
descriptionstringMeta description
canonicalstringCanonical URL
curl -X POST \
-H "Authorization: Bearer your_api_key" \
-H "Content-Type: application/json" \
-d '{
"title": "Welcome to Our Store",
"slug": "welcome-to-our-store",
"content": {
"type": "doc",
"content": [
{
"type": "paragraph",
"content": [
{ "type": "text", "text": "Hello and welcome!" }
]
}
]
},
"tag": "news",
"active": true,
"seo": {
"title": "Welcome | Our Store",
"description": "Learn about our store and products."
}
}' \
https://your-store.yns.store/api/v1/posts

Update Post

PATCH /api/v1/posts/:idOrSlug

Partially updates a blog post. Only the provided fields are changed. Accepts the same fields as create (all optional).


Delete Post

DELETE /api/v1/posts/:idOrSlug

Permanently deletes a blog post.