# Microsub

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

Microsub endpoints for channels, timelines, and follow actions.

## Endpoints
### GET /microsub

URL: `https://micro.blog/microsub`

Handles Microsub channel and timeline queries.




Query parameters:
- `action` (string, required): Microsub action.
  Example: `timeline`
- `channel` (string, optional): Microsub channel identifier.
  Example: `default`
- `before` (string, optional): Microsub pagination cursor for older items.
  Example: `12345`
- `after` (string, optional): Microsub pagination cursor for newer items.
  Example: `67890`






Example request:

```sh
curl -X GET "https://micro.blog/microsub?action=timeline"
```

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

```json
{
  "items": [
    {
      "type": "entry",
      "published": "2026-04-26T12:00:00+00:00",
      "content": {
        "html": "<p>Hello from Micro.blog.</p>"
      },
      "url": "https://example.com/post",
      "author": {
        "type": "card",
        "name": "Vincent",
        "url": "https://vincent.micro.blog/",
        "photo": "https://avatars.micro.blog/avatars/2025/39/3008.jpg"
      },
      "_id": "12345"
    }
  ],
  "paging": {
    "before": "12345"
  }
}
```

### POST /microsub

URL: `https://micro.blog/microsub`

Handles Microsub write actions such as follow.




Query parameters:
- `action` (string, required): Microsub action.
  Example: `timeline`
- `channel` (string, optional): Microsub channel identifier.
  Example: `default`
- `url` (string, optional): URL for the target resource.
  Example: `https://example.com/post`
- `username` (string, optional): Micro.blog username.
  Example: `vincent`






Example request:

```sh
curl -X POST "https://micro.blog/microsub?action=timeline"
```

Response:
- Status: 200
- Content-Type: `application/json`
- Description: Returns an empty JSON object on success.
Example response:

```json
{}
```

