Authorizations
Use your API token
Path Parameters
Post ID
curl --request PATCH \
--url https://psn-api.paystub.dev/admin/posts/{id}/unpublish \
--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 unpublished successfully"
}Change a post’s status from published to draft
curl --request PATCH \
--url https://psn-api.paystub.dev/admin/posts/{id}/unpublish \
--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 unpublished successfully"
}Use your API token
Post ID