# Push Notifications

Page: https://microblog.dev/api/push/
API base URL: https://micro.blog

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

Notes:
- Push notifications require additional setup on the Micro.blog side for your app's push credentials. Email [help@micro.blog](mailto:help@micro.blog) before using these endpoints with a custom `app_name`.

## Endpoints
### GET /users/push/info

URL: `https://micro.blog/users/push/info`

Returns registered push devices for the authenticated user and push environment.




Query parameters:
- `push_env` (string, required): Push environment, for example `production` or `sandbox`.
  Example: `production`
- `app_name` (string, optional): Name of the app requesting access.
  Example: `Micro.blog for Android`
- `device_token` (string, optional): Push notification device token.
  Example: `TEST`



Header parameters:
- `Authorization` (string, required): Bearer token for authentication. Format: `Bearer {token}`.
  Example: `Bearer EF7BB9BCAC1F6D561C93`




Example request:

```sh
curl -X GET "https://micro.blog/users/push/info?push_env=production" \
  --header "Authorization: Bearer EF7BB9BCAC1F6D561C93"
```

Response:
- Status: 200
- Content-Type: `application/json`
- Description: Returns a JSON response for the requested resource.
Example response:

```json
[
  {
    "token": "DEVICE_TOKEN",
    "app_name": "Micro.blog for iOS",
    "push_env": "production",
    "created_at": "2026-04-26T12:00:00+00:00"
  }
]
```

### POST /users/push/register

URL: `https://micro.blog/users/push/register`

Registers a device token for push notifications.




Query parameters:
- `device_token` (string, required): Push notification device token.
  Example: `TEST`
- `push_env` (string, required): Push environment, for example `production` or `sandbox`.
  Example: `production`
- `app_name` (string, optional): Name of the app requesting access.
  Example: `Micro.blog for Android`



Header parameters:
- `Authorization` (string, required): Bearer token for authentication. Format: `Bearer {token}`.
  Example: `Bearer EF7BB9BCAC1F6D561C93`




Example request:

```sh
curl -X POST "https://micro.blog/users/push/register?device_token=TEST&push_env=production" \
  --header "Authorization: Bearer EF7BB9BCAC1F6D561C93"
```

Response:
- Status: 201
- Content-Type: `application/json`
- Description: Returns registration status and device metadata. Already-registered devices return 200 with the same shape.
Example response:

```json
{
  "status": "success",
  "message": "Device registered",
  "device": {
    "token": "DEVICE_TOKEN",
    "app_name": "Micro.blog for Android",
    "push_env": "production",
    "created_at": "2026-04-26T12:00:00+00:00"
  }
}
```

### POST /users/push/unregister

URL: `https://micro.blog/users/push/unregister`

Unregisters a device token for push notifications.




Query parameters:
- `device_token` (string, required): Push notification device token.
  Example: `TEST`
- `push_env` (string, required): Push environment, for example `production` or `sandbox`.
  Example: `production`
- `app_name` (string, optional): Name of the app requesting access.
  Example: `Micro.blog for Android`



Header parameters:
- `Authorization` (string, required): Bearer token for authentication. Format: `Bearer {token}`.
  Example: `Bearer EF7BB9BCAC1F6D561C93`




Example request:

```sh
curl -X POST "https://micro.blog/users/push/unregister?device_token=TEST&push_env=production" \
  --header "Authorization: Bearer EF7BB9BCAC1F6D561C93"
```

Response:
- Status: 200
- Content-Type: `application/json`
- Description: Returns unregister status.
Example response:

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

