Build with Micro.blog logo
Build with Micro.blog
API Documentation

Push Notifications

View .md

Endpoints for registering, unregistering, and inspecting push notification devices.

Note: Push notifications require additional setup on the Micro.blog side for your app’s push credentials. Email help@micro.blog before using these endpoints with a custom app_name.
BASE URL https://micro.blog
GET /users/push/info

Returns the authenticated user’s registered push devices for a push environment. Requires the read scope.

Example Request

curl -X GET "https://micro.blog/users/push/info?push_env=production&app_name=Example+App" \
  --header "Authorization: Bearer ABCDEF1234567890ABCD"

Query Parameters

Name Type Required Description
push_env string Required Push environment the devices were registered with, such as production.
Example: production
app_name string Optional App name the devices were registered with. When blank, returns devices registered without an app name or as Micro.blog for iOS.
Example: Example App
device_token string Optional Only return the device with this token.
Example: DEVICE_TOKEN

Header Parameters

Name Type Required Description
Authorization string Required Bearer token for authentication. Format: Bearer {token}.

Response

200 OK application/json

Returns an array of devices, which is empty when nothing matches. A missing push_env returns 400 with {"status": "error", "message": "Missing required parameters: push_env"}.

Example Response

[
  {
    "token": "DEVICE_TOKEN",
    "app_name": "Example App",
    "push_env": "production",
    "created_at": "2026-04-26T12:00:00+00:00"
  }
]
POST /users/push/register

Registers a device token for push notifications for the authenticated user. Requires the write scope.

Example Request

curl -X POST "https://micro.blog/users/push/register?device_token=DEVICE_TOKEN&push_env=production&app_name=Example+App" \
  --header "Authorization: Bearer ABCDEF1234567890ABCD"

Query Parameters

Name Type Required Description
device_token string Required Push notification token from APNs or Firebase Cloud Messaging.
Example: DEVICE_TOKEN
push_env string Required Push environment label stored with the device, such as production. Use the same value for GET /users/push/info and POST /users/push/unregister.
Example: production
app_name string Optional Your app’s name. Micro.blog uses it to choose the push credentials, so it must match the name set up for your app.
Example: Example App

Header Parameters

Name Type Required Description
Authorization string Required Bearer token for authentication. Format: Bearer {token}.

Response

201 OK text/html

Returns registration status and device metadata. A device that is already registered returns 200 with the message Device already registered. A missing device_token or push_env, or a token over 200 characters, returns 400 with {"status": "error", "message": "..."}. A device that can’t be saved returns 422 with an errors array. The body is JSON, but this route doesn’t set a JSON Content-Type.

Example Response

{
  "status": "success",
  "message": "Device registered",
  "device": {
    "token": "DEVICE_TOKEN",
    "app_name": "Example App",
    "push_env": "production",
    "created_at": "2026-04-26T12:00:00+00:00"
  }
}
POST /users/push/unregister

Unregisters a device token so it stops receiving push notifications for the authenticated user. Requires the write scope.

Example Request

curl -X POST "https://micro.blog/users/push/unregister?device_token=DEVICE_TOKEN&push_env=production&app_name=Example+App" \
  --header "Authorization: Bearer ABCDEF1234567890ABCD"

Query Parameters

Name Type Required Description
device_token string Required Push notification token that was registered.
Example: DEVICE_TOKEN
push_env string Required Push environment the device was registered with.
Example: production
app_name string Optional App name the device was registered with. When blank, matches devices registered without an app name or as Micro.blog for iOS.
Example: Example App

Header Parameters

Name Type Required Description
Authorization string Required Bearer token for authentication. Format: Bearer {token}.

Response

200 OK text/html

Returns unregister status. A missing device_token or push_env returns 400, and no matching device returns 404 with {"status": "error", "message": "No matching device found"}. The body is JSON, but this route doesn’t set a JSON Content-Type.

Example Response

{
  "status": "success",
  "message": "Device unregistered"
}