Skip to main content
POST
/
admin
/
posts
Create a post
curl --request POST \
  --url https://psn-api.paystub.dev/admin/posts \
  --header 'Authorization: Bearer <token>' \
  --header 'Content-Type: application/json' \
  --data '
{
  "site_id": 123,
  "post_category_id": 123,
  "type": "article",
  "country": "us",
  "redirects_to": "<string>",
  "title": "<string>",
  "slug": "<string>",
  "excerpt": "<string>",
  "content": "<string>",
  "meta": {},
  "faq": [
    {
      "question": "<string>",
      "answer": "<string>"
    }
  ],
  "fact_check": {},
  "is_draft": true,
  "published_at": "2023-11-07T05:31:56Z"
}
'
{
  "success": true,
  "data": {
    "post": {
      "id": 123,
      "site_id": 123,
      "post_category_id": 123,
      "user_id": 123,
      "type": "<string>",
      "country": "<string>",
      "title": "<string>",
      "slug": "<string>",
      "excerpt": "<string>",
      "content": "<string>",
      "meta": {},
      "faq": {},
      "fact_check": {},
      "minutes_to_read": 123,
      "view_count": 123,
      "is_draft": true,
      "media": [
        {
          "id": 123,
          "name": "<string>",
          "file_name": "<string>",
          "mime_type": "<string>",
          "size": 123,
          "url": "<string>",
          "created_at": "2023-11-07T05:31:56Z"
        }
      ],
      "published_at": "2023-11-07T05:31:56Z",
      "created_at": "2023-11-07T05:31:56Z",
      "updated_at": "2023-11-07T05:31:56Z"
    }
  },
  "message": "Post created successfully"
}

Authorizations

Authorization
string
header
required

Use your API token

Body

application/json
site_id
integer
required

ID of the site

post_category_id
integer
required

ID of the post category

type
enum<string>
required

Post type

Available options:
article,
guide,
review,
news,
faq
country
enum<string>
required

Country code

Available options:
us,
ca,
uk,
au,
nz,
global
title
string
required

Post title

content
string
required

Post content

redirects_to
string<url> | null

URL to redirect to

slug
string

URL-friendly slug (generated from title if not provided)

excerpt
string | null

Short excerpt

meta
object | null

Meta information for SEO

faq
object[] | null

FAQ items

fact_check
object | null

Fact checking information

is_draft
boolean
default:true

Is this post a draft

published_at
string<date-time> | null

When to publish this post

Response

Post created successfully

success
boolean
Example:

true

data
object
message
string
Example:

"Post created successfully"