Skip to main content
POST
/
admin
/
post-categories
Create a post category
curl --request POST \
  --url https://psn-api.paystub.dev/admin/post-categories \
  --header 'Authorization: Bearer <token>' \
  --header 'Content-Type: application/json' \
  --data '
{
  "site_id": 123,
  "type": "article",
  "country": "us",
  "name": "<string>",
  "slug": "<string>"
}
'
{
  "success": true,
  "data": {
    "category": {
      "id": 123,
      "site_id": 123,
      "type": "<string>",
      "country": "<string>",
      "name": "<string>",
      "slug": "<string>",
      "created_at": "2023-11-07T05:31:56Z",
      "updated_at": "2023-11-07T05:31:56Z"
    }
  },
  "message": "Post category created successfully"
}

Authorizations

Authorization
string
header
required

Use your API token

Body

application/json
site_id
integer
required

ID of the site

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
name
string
required

Category name

slug
string

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

Response

Post category created successfully

success
boolean
Example:

true

data
object
message
string
Example:

"Post category created successfully"