ℹ️ Posting API: Multiple blogs

Micro.blog uses the Micropub API for posting. Micro.blog can manage multiple blogs on the same Micro.blog account, so apps using Micropub can also work with multiple blogs.

For more about creating multiple blogs with Micro.blog Premium, see this help page.

There are three things you’ll want to support in your apps or scripts that work with Micro.blog:

  • Getting a list of blogs for a user’s account
  • Setting the specific blog to post to
  • Remembering the last blog used in your app

If you don’t set a blog to post to with Micropub, Micro.blog will use the user’s default blog, which is the last blog they selected on the web.

Getting a list of blogs

Request with the q parameter:

GET /micropub?q=config
Authorization: Bearer ABCDEFGH

Response:

{
  "destination": [
    {
      "uid": "https://myblog.micro.blog/",
      "name": "myblog.com",
      "microblog-title": "My Blog"
    },
    {
      "uid": "https://anotherblog.micro.blog/",
      "name": "anotherblog.com",
      "microblog-title": "Another blog"
    }
  ]
}

The field you want to use is uid.

Setting the blog when posting

Request with mp-destination:

POST /micropub
Authorization: Bearer
Content-Type: application/x-www-form-urlencoded

content=Hello&mp-destination=https://myblog.micro.blog/

Remembering the user’s preferred blog

Generally the app should store a preference for which blog to use by default. It could be a setting in the UI or it could remember the last blog used.