Publishing Blog Posts
Blog posts follow a simple lifecycle: draft, published, and archived. This guide covers how to manage the publication state of your posts.
Post Lifecycle
Create → Draft → Publish → Published
↑ ↓
└── Unpublish
| Status | Visible on /blog | Editable | Description |
|---|---|---|---|
draft | No | Yes | Work in progress |
published | Yes | Yes | Live on your public blog |
archived | No | Yes | Removed from public view |
Publishing a Post
When you're ready to make a post public:
curl -X POST https://solomail.io/api/v1/blog/posts/{postId}/publish \ -H "Authorization: Bearer <your-api-key>"
This:
- Sets the status to
published - Records the
publishedAttimestamp - Makes the post visible at
/blogand/blog/{slug}
Unpublishing a Post
To remove a post from public view without deleting it:
curl -X POST https://solomail.io/api/v1/blog/posts/{postId}/unpublish \ -H "Authorization: Bearer <your-api-key>"
This:
- Reverts the status to
draft - Clears the
publishedAttimestamp - Removes the post from the public blog
The post and all its content are preserved -- you can edit and re-publish it later.
Deleting a Post
To permanently remove a post:
curl -X DELETE https://solomail.io/api/v1/blog/posts/{postId} \ -H "Authorization: Bearer <your-api-key>"
This action is irreversible.
Listing Posts by Status
Filter your posts by status to manage your content pipeline:
# See all drafts GET /api/v1/blog/posts?status=draft # See published posts GET /api/v1/blog/posts?status=published # See archived posts GET /api/v1/blog/posts?status=archived
Best Practices
- Preview before publishing -- Use
GET /blog/posts/{postId}to review content before publishing - Use excerpts -- Always set an excerpt for a good listing card preview
- Set meta descriptions -- Helps with SEO and social sharing
- Unpublish, don't delete -- If you need to take a post down temporarily, unpublish instead of deleting
Next: See the Blog API Reference