Skip to main content
PATCH
/
admin
/
posts
/
{id}
/
publish
Publish a post
curl --request PATCH \
  --url https://psn-api.paystub.dev/admin/posts/{id}/publish \
  --header 'Authorization: Bearer <token>'
{
  "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 published successfully"
}

Authorizations

Authorization
string
header
required

Use your API token

Path Parameters

id
integer
required

Post ID

Response

Post published successfully

success
boolean
Example:

true

data
object
message
string
Example:

"Post published successfully"