Node.js
import Shoply from "@shoplygg/node";
const shoply = new Shoply({ apiKey: process.env.SHOPLY_API_KEY });
const result = await shoply.blogPosts.setStatus("POST_ID", {
status: "draft",
});<?php
require 'vendor/autoload.php';
$shoply = new Shoply\Client(['apiKey' => getenv('SHOPLY_API_KEY')]);
$result = $shoply->blogPosts->setStatus('POST_ID', [
'status' => 'draft',
]);
import shoply
client = shoply.Client() # reads SHOPLY_API_KEY
result = client.blogPosts.setStatus("POST_ID", status="draft")
curl --request PUT \
--url https://api.shoply.gg/v1/stores/{storeId}/blog/posts/{postId}/status \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '{}'package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "https://api.shoply.gg/v1/stores/{storeId}/blog/posts/{postId}/status"
payload := strings.NewReader("{}")
req, _ := http.NewRequest("PUT", url, payload)
req.Header.Add("Authorization", "Bearer <token>")
req.Header.Add("Content-Type", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.put("https://api.shoply.gg/v1/stores/{storeId}/blog/posts/{postId}/status")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.shoply.gg/v1/stores/{storeId}/blog/posts/{postId}/status")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Put.new(url)
request["Authorization"] = 'Bearer <token>'
request["Content-Type"] = 'application/json'
request.body = "{}"
response = http.request(request)
puts response.read_body{
"success": true,
"message": null,
"code": null,
"data": {
"id": "57d066e1-e807-42dc-8d81-b0ff59fa7eb3",
"categoryId": "c3b25928-c119-4d41-8df1-0525a3a69be5",
"title": "Activating Northwind Pro",
"slug": "activating-northwind-pro",
"path": "/blog/guides/activating-northwind-pro/",
"status": "published",
"coverUrl": null,
"views": 0,
"publishedAt": "2026-10-22 16:20:18",
"updatedAt": "2026-10-22 16:20:18.858"
}
}{
"success": false,
"message": "<string>",
"code": "<string>",
"data": null,
"errors": {}
}{
"success": false,
"message": "<string>",
"code": "<string>",
"data": null,
"errors": {}
}{
"success": false,
"message": "<string>",
"code": "<string>",
"data": null,
"errors": {}
}{
"success": false,
"message": "<string>",
"code": "<string>",
"data": null,
"errors": {}
}{
"success": false,
"message": "<string>",
"code": "<string>",
"data": null,
"errors": {}
}Blog
Publish or unpublish a blog post
Puts a post out, or takes it back to a draft, and changes nothing else about it.
Needs the blog.write permission (Change Blog).
PUT
/
stores
/
{storeId}
/
blog
/
posts
/
{postId}
/
status
Node.js
import Shoply from "@shoplygg/node";
const shoply = new Shoply({ apiKey: process.env.SHOPLY_API_KEY });
const result = await shoply.blogPosts.setStatus("POST_ID", {
status: "draft",
});<?php
require 'vendor/autoload.php';
$shoply = new Shoply\Client(['apiKey' => getenv('SHOPLY_API_KEY')]);
$result = $shoply->blogPosts->setStatus('POST_ID', [
'status' => 'draft',
]);
import shoply
client = shoply.Client() # reads SHOPLY_API_KEY
result = client.blogPosts.setStatus("POST_ID", status="draft")
curl --request PUT \
--url https://api.shoply.gg/v1/stores/{storeId}/blog/posts/{postId}/status \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '{}'package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "https://api.shoply.gg/v1/stores/{storeId}/blog/posts/{postId}/status"
payload := strings.NewReader("{}")
req, _ := http.NewRequest("PUT", url, payload)
req.Header.Add("Authorization", "Bearer <token>")
req.Header.Add("Content-Type", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.put("https://api.shoply.gg/v1/stores/{storeId}/blog/posts/{postId}/status")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.shoply.gg/v1/stores/{storeId}/blog/posts/{postId}/status")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Put.new(url)
request["Authorization"] = 'Bearer <token>'
request["Content-Type"] = 'application/json'
request.body = "{}"
response = http.request(request)
puts response.read_body{
"success": true,
"message": null,
"code": null,
"data": {
"id": "57d066e1-e807-42dc-8d81-b0ff59fa7eb3",
"categoryId": "c3b25928-c119-4d41-8df1-0525a3a69be5",
"title": "Activating Northwind Pro",
"slug": "activating-northwind-pro",
"path": "/blog/guides/activating-northwind-pro/",
"status": "published",
"coverUrl": null,
"views": 0,
"publishedAt": "2026-10-22 16:20:18",
"updatedAt": "2026-10-22 16:20:18.858"
}
}{
"success": false,
"message": "<string>",
"code": "<string>",
"data": null,
"errors": {}
}{
"success": false,
"message": "<string>",
"code": "<string>",
"data": null,
"errors": {}
}{
"success": false,
"message": "<string>",
"code": "<string>",
"data": null,
"errors": {}
}{
"success": false,
"message": "<string>",
"code": "<string>",
"data": null,
"errors": {}
}{
"success": false,
"message": "<string>",
"code": "<string>",
"data": null,
"errors": {}
}Authorizations
A secret API key, made under Developers in the dashboard: Authorization: Bearer shoply_sk_...
Headers
A word of your own for this one change, up to 180 letters, digits, dots, dashes, underscores and colons. Sent again with the same key, the request is not carried out twice: the first answer comes back, with Idempotent-Replay: true.
Path Parameters
The store's ID. A key reaches the store it was made in: GET /key answers which.
The post.
Body
application/json
The new status.
Available options:
draft, published 
