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
StatusVisible on /blogEditableDescription
draftNoYesWork in progress
publishedYesYesLive on your public blog
archivedNoYesRemoved 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 publishedAt timestamp
  • Makes the post visible at /blog and /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 publishedAt timestamp
  • 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

  1. Preview before publishing -- Use GET /blog/posts/{postId} to review content before publishing
  2. Use excerpts -- Always set an excerpt for a good listing card preview
  3. Set meta descriptions -- Helps with SEO and social sharing
  4. Unpublish, don't delete -- If you need to take a post down temporarily, unpublish instead of deleting

Next: See the Blog API Reference