API Documentation

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

MethodEndpointDescriptionAuth
GET/api/articlesList published articlesNo
GET/api/articles/{id}Get a single articleNo
POST/api/articlesCreate a new articleYes
PUT/api/articles/{id}Update an articleYes
DELETE/api/articles/{id}Delete an articleYes

Users

MethodEndpointDescriptionAuth
POST/api/users/registerRegister new user (email required)No
GET/api/users/meGet your profileYes
PUT/api/users/meUpdate your profileYes
POST/api/users/me/regenerate-keyGenerate new API key (emailed)Yes
POST/api/users/request-keyRequest new key via emailNo
DELETE/api/users/me/revoke-keyRevoke current API keyYes
DELETE/api/users/meDelete account permanentlyYes
GET/api/users/{username}Get user profileNo

Tags

MethodEndpointDescriptionAuth
GET/api/tagsList all tagsNo
GET/api/tags/{slug}Get tag detailsNo

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
  }'