{"components":{"schemas":{"ErrorEnvelope":{"properties":{"error":{"example":"Invalid credentials","type":"string"},"success":{"example":false,"type":"boolean"}},"required":["success","error"],"type":"object"},"LoginRequest":{"properties":{"password":{"format":"password","type":"string"},"totp_code":{"example":"123456","type":"string"},"username":{"example":"militante12","type":"string"}},"required":["username","password"],"type":"object"},"Post":{"properties":{"author":{"type":"string"},"comments":{"type":"integer"},"content":{"type":"string"},"created_at":{"format":"date-time","type":"string"},"id":{"type":"integer"},"likes":{"type":"integer"},"media":{"nullable":true,"type":"string"},"media_type":{"nullable":true,"type":"string"},"user_id":{"type":"integer"}},"type":"object"},"SuccessEnvelope":{"properties":{"data":{"type":"object"},"success":{"example":true,"type":"boolean"}},"required":["success"],"type":"object"},"TokenResponse":{"properties":{"expires_at":{"format":"date-time","type":"string"},"token":{"type":"string"},"user_id":{"type":"integer"},"username":{"type":"string"}},"type":"object"}},"securitySchemes":{"bearerAuth":{"bearerFormat":"API Token (64 hex characters)","description":"Pass token in header: Authorization: Bearer \u003ctoken\u003e","scheme":"bearer","type":"http"}}},"info":{"contact":{"name":"Militant Collective","url":"https://joinmilitant.revlibertaire.com"},"description":"Emancipatory, decentralized, and autonomous REST API for Militant social platform, federated Fediverse interactions, and real-time communication.","license":{"name":"GNU Affero General Public License v3.0","url":"https://www.gnu.org/licenses/agpl-3.0.html"},"title":"Militant API","version":"2.0.0"},"openapi":"3.1.0","paths":{"/healthz":{"get":{"description":"Checks whether the API process is alive.","responses":{"200":{"description":"Process is healthy"}},"security":[],"summary":"Liveness Probe"}},"/readyz":{"get":{"description":"Checks database connectivity and readiness.","responses":{"200":{"description":"Database is ready"},"503":{"description":"Database unavailable"}},"security":[],"summary":"Readiness Probe"}},"/v2":{"get":{"description":"Returns version information and list of available endpoints.","responses":{"200":{"description":"API metadata and endpoints catalogue"}},"security":[],"summary":"API Catalog and Metadata"}},"/v2/auth/login":{"post":{"description":"Authenticate via username/email and password (with optional TOTP code).","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/LoginRequest"}}},"required":true},"responses":{"200":{"description":"Authentication successful"},"401":{"description":"Invalid credentials or TOTP code required"}},"security":[],"summary":"Authenticate User"}},"/v2/auth/refresh":{"post":{"description":"Rotates an active API token.","responses":{"200":{"description":"Token rotated successfully"}},"summary":"Refresh Token"}},"/v2/auth/revoke":{"post":{"description":"Revokes current active token.","responses":{"200":{"description":"Token revoked successfully"}},"summary":"Revoke Token"}},"/v2/comments":{"get":{"description":"Retrieves comments for a post or page.","parameters":[{"in":"query","name":"post_id","required":true,"schema":{"type":"integer"}}],"responses":{"200":{"description":"List of comments"}},"summary":"List Comments"},"post":{"description":"Adds a comment or reply to an existing comment using optional parent_id.","responses":{"201":{"description":"Comment added"}},"summary":"Create Comment or Nested Reply"}},"/v2/fediverse":{"get":{"description":"Returns ActivityPub public key, WebFinger resolution, and remote profiles.","responses":{"200":{"description":"Fediverse metadata"}},"summary":"Fediverse Federation Info"}},"/v2/groups":{"get":{"description":"Lists collective self-managed groups and causes.","responses":{"200":{"description":"Groups list"}},"summary":"List Social Groups"}},"/v2/messages":{"get":{"description":"Retrieves private conversations or message thread with a user.","responses":{"200":{"description":"Conversations list"}},"summary":"List Conversations"},"post":{"description":"Sends an encrypted or standard private message.","responses":{"201":{"description":"Message sent"}},"summary":"Send Message"}},"/v2/pages":{"get":{"description":"Lists autonomous collective pages and initiatives.","responses":{"200":{"description":"Pages list"}},"summary":"List Pages and Initiatives"}},"/v2/posts":{"get":{"description":"Retrieves timeline, feed, or user-specific posts.","parameters":[{"in":"query","name":"feed","schema":{"enum":["following","global","user"],"type":"string"}},{"in":"query","name":"user_id","schema":{"type":"integer"}},{"in":"query","name":"page","schema":{"default":1,"type":"integer"}},{"in":"query","name":"limit","schema":{"default":20,"type":"integer"}}],"responses":{"200":{"description":"List of posts"}},"summary":"List Posts"},"post":{"description":"Creates a new publication on the timeline.","responses":{"201":{"description":"Post created"}},"summary":"Create Post"}},"/v2/reactions":{"post":{"description":"Adds, updates, or removes an emoji/symbol reaction on an item.","responses":{"200":{"description":"Reaction updated"}},"summary":"Toggle Reaction"}},"/v2/tokens":{"get":{"description":"Returns active API tokens for current authenticated user.","responses":{"200":{"description":"List of active tokens"}},"summary":"List Personal Access Tokens"},"post":{"description":"Creates a labeled API token with customized lifetime.","responses":{"201":{"description":"Token created"}},"summary":"Create Personal Access Token"}},"/v2/tokens/{id}":{"delete":{"description":"Revokes a specific user token by ID.","parameters":[{"description":"Token ID","in":"path","name":"id","required":true,"schema":{"type":"integer"}}],"responses":{"200":{"description":"Token revoked"},"404":{"description":"Token not found"}},"summary":"Revoke Personal Access Token"}},"/v2/translate":{"post":{"description":"Translates content via decentralized LibreTranslate instances with auto-detection.","responses":{"200":{"description":"Translated text"}},"summary":"Translate Text"}}},"security":[{"bearerAuth":[]}],"servers":[{"description":"Production Server","url":"https://api.militant.revlibertaire.com"},{"description":"Local Development Server","url":"http://localhost:8080"}]}
