If you are building a web app and want to call the API, the best experience will be to use IndieAuth. This API is based on OAuth and will let any user sign in with their blog and give your app access to their account.

Start by showing a web form with a single field: the URL for the web site owned by the user signing in. This could be a custom domain name or

After the user types in their URL, your app should request the HTML for their home page and look for the following tags:

<link rel="authorization_endpoint" href="" />
<link rel="token_endpoint" href="" />

These URLs are the same for all users, but by checking their home page your app can be more compatible with other platforms. For example, if your app only needs to create new blog posts, it can work with both and other Micropub servers.

Redirect the user to that first URL, appending 6 parameters:

  • me: the URL of the user’s blog
  • redirect_uri: the callback URL for your app
  • client_id: the URL for your app’s home page, to identify your app to the user
  • state: a random number you generate, which you can use to verify the request when redirects back to your app
  • scope: the value “create”, because you might want to create new posts
  • response_type: the value “code”, because you want a new auth code

The full URL you redirect to might look like this:

(Make sure to URL-encode each parameter. In the example above the URLs are not encoded to make them easier to read.)

The user will then confirm on whether it’s okay to allow your application to access the user’s account on If they approve it, you will get a request back to your application’s redirect URL with a temporary auth code in the code parameter, as well as a state parameter. Make sure to verify that the state matches the original value that you generated for this session.

Finally, make a POST request to to verify the temporary auth code and get a permanent access token to be used in requests to the API. Use the other URL retrieved in the link tags on the user’s home page above, with 2 parameters:

  • client_id: the URL for your app’s home page, to identify your app
  • code: the temporary auth code passed to your app’s redirect URL

The full POST request might look like this:

POST /indieauth/token


Check the JSON response for the access_token field. You can use this access token in the “Authorization” header as documented in the JSON API and Micropub API.

Back to Help Table of Contents