PasIT provides a RESTful API for publishing and managing articles. All write operations
require an API key passed via the X-API-Key header.
Getting an API Key
Register a new account to get your API key. Email is required -- your key will be emailed to you.
curl -X POST https://pas.it.com/api/users/register \
-H "Content-Type: application/json" \
-d '{
"username": "yourname",
"display_name": "Your Name",
"email": "[email protected]"
}'
The response includes your api_key and it will be emailed to you. Save it securely -- it will not be shown again.
Key Management
Lost your key? Request a new one emailed to your registered address:
curl -X POST "https://pas.it.com/api/users/[email protected]"
Your old key is revoked immediately. The new key is emailed to you.
Revoke a key without deleting your account:
curl -X DELETE https://pas.it.com/api/users/me/revoke-key \
-H "X-API-Key: pasit_your_key_here"
Delete your account and all associated data permanently:
curl -X DELETE https://pas.it.com/api/users/me \
-H "X-API-Key: pasit_your_key_here"
Interactive Docs
Full interactive API documentation is available at:
- Swagger UI -- interactive request builder
- ReDoc -- reference documentation
Quick Reference
Articles
| Method | Endpoint | Description | Auth |
|---|---|---|---|
| GET | /api/articles | List published articles | No |
| GET | /api/articles/{id} | Get a single article | No |
| POST | /api/articles | Create a new article | Yes |
| PUT | /api/articles/{id} | Update an article | Yes |
| DELETE | /api/articles/{id} | Delete an article | Yes |
Users
| Method | Endpoint | Description | Auth |
|---|---|---|---|
| POST | /api/users/register | Register new user (email required) | No |
| GET | /api/users/me | Get your profile | Yes |
| PUT | /api/users/me | Update your profile | Yes |
| POST | /api/users/me/regenerate-key | Generate new API key (emailed) | Yes |
| POST | /api/users/request-key | Request new key via email | No |
| DELETE | /api/users/me/revoke-key | Revoke current API key | Yes |
| DELETE | /api/users/me | Delete account permanently | Yes |
| GET | /api/users/{username} | Get user profile | No |
Tags
| Method | Endpoint | Description | Auth |
|---|---|---|---|
| GET | /api/tags | List all tags | No |
| GET | /api/tags/{slug} | Get tag details | No |
Feeds
Publishing an Article
curl -X POST https://pas.it.com/api/articles \
-H "Content-Type: application/json" \
-H "X-API-Key: pasit_your_key_here" \
-d '{
"title": "My First Article",
"body_markdown": "# Hello World\n\nThis is my first post on PasIT.",
"tags": ["tutorial", "hello-world"],
"published": true
}'