---
name: mdrop
description: Post markdown to mdrop and get preview/raw/instant-view URLs.
---

# mdrop Skill

Use this service when you need to publish markdown quickly and share a URL.

Base URL:
https://mdrop.md

Auth:
- Required for create/update/delete
- Header: `Authorization: Bearer <MDROP_API_KEY>`
- Any user/agent can self-issue API key via `POST /api/api-keys` (rate-limited: 3 keys/IP/24h default)
- Each API key can create up to 100 pastes per 24h (default)

## Endpoints

1) Create paste
- POST `/api/pastes`
- Body:
```json
{
  "title": "optional",
  "content": "# markdown",
  "visibility": "unlisted",
  "ttl_hours": 24,
  "created_by": "agent-name",
  "private_view_token": "required if private"
}
```
- Returns: `id`, `preview_url`, `raw_url`, `instant_view_url` (null), `telegraph_url`, `expires_at`

2) Get paste JSON
- GET `/api/pastes/{id}`
- For private paste add query `?t=<private_view_token>`

3) Update paste
- PATCH `/api/pastes/{id}`
- Body (any field optional, at least one required):
```json
{
  "title": "Updated title",
  "content": "# Updated markdown",
  "visibility": "private",
  "ttl_hours": 24,
  "private_view_token": "new-token",
  "clear_private_view_token": false
}
```

4) Delete paste
- DELETE `/api/pastes/{id}`

5) Rendered markdown page
- GET `/p/{id}`

6) Raw markdown
- GET `/raw/{id}`

7) Cleanup expired (cron)
- POST `/api/cleanup-expired`
- Header: `x-cron-secret: <MDROP_CRON_SECRET>`

8) API keys
- POST `/api/api-keys` (public create; rate-limited)
- GET `/api/api-keys` (owner-only list metadata)
- DELETE `/api/api-keys/{id}` (owner-only revoke key)

## Quick curl

Create:
```bash
curl -X POST "https://mdrop.md/api/pastes" \
  -H "Authorization: Bearer $MDROP_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "title":"Agent report",
    "content":"# Hello\n\nGenerated by agent.",
    "visibility":"unlisted",
    "ttl_hours":24,
    "created_by":"agent"
  }'
```

Update:
```bash
curl -X PATCH "https://mdrop.md/api/pastes/<id>" \
  -H "Authorization: Bearer $MDROP_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{"title":"Updated","content":"# New"}'
```

Create API key (public):
```bash
curl -X POST "https://mdrop.md/api/api-keys" \
  -H "Content-Type: application/json" \
  -d '{"name":"agent-team","created_by":"owner"}'
```

Notes:
- `visibility=private` requires a view token.
- Free-tier TTL max is 24h.
- `instant_view_url` is intentionally `null`.
- `telegraph_url` is returned for public/unlisted as Telegram-friendly fallback.
