Skip to content

API Overview

The Thogits REST API provides full programmatic access to all features — creating and managing thogits, defining tag schemas, filtering, views, and more. This page covers the conventions shared across all endpoints.

All API routes are prefixed with /api:

https://app.thogits.com/api/

All API examples in this documentation use the production URL above.

Most endpoints require an authenticated session. Thogits uses session cookies — after logging in via /api/auth/login, the server sets an HTTP-only cookie that must be included in subsequent requests.

For curl, use the cookie jar flags:

Terminal window
# Login and save the session cookie
curl -X POST https://app.thogits.com/api/auth/login \
-H "Content-Type: application/json" \
-d '{"email":"user@example.com","password":"secret123"}' \
-b cookies.txt -c cookies.txt
# Use the saved cookie for authenticated requests
curl https://app.thogits.com/api/thogits/01JTEST1234567890ABCDE \
-b cookies.txt -c cookies.txt

For browser-based clients, include credentials: "include" in fetch requests.

All request and response bodies use JSON:

Content-Type: application/json

Thogits uses ULIDs (Universally Unique Lexicographically Sortable Identifiers) for all entity IDs. ULIDs are 26-character base32-encoded strings that are sortable by creation time:

01HQ3K5P7YGXJV8N2M4W6R0T1S

The full OpenAPI spec is available at runtime:

  • JSON spec: GET /api/openapi.json
  • Swagger UI: GET /api/swagger-ui/

The Swagger UI provides an interactive explorer for trying out endpoints directly in the browser.

All error responses follow a consistent JSON structure:

{
"error": "NotFound",
"message": "Thogit not found",
"path": "/api/thogits/01JTEST1234567890ABCDE",
"suggestion": "Check the thogit ID and try again",
"details": {}
}
FieldTypeDescription
errorstringError code (e.g., NotFound, BadRequest, Conflict)
messagestringHuman-readable description
pathstringThe request path that triggered the error
suggestionstringOptional hint for resolving the error
detailsobjectOptional additional context
CodeMeaning
200Success
400Bad request — invalid input, validation failure
401Unauthorized — no session or session expired
404Not found — entity does not exist or was soft-deleted
409Conflict — duplicate (e.g., applying a tag already on a thogit)
500Internal server error

Both thogits and tags support soft deletes. When you delete a thogit or tag, it is marked as deleted rather than permanently removed. Soft-deleted entities:

  • No longer appear in search results
  • Cannot be fetched by ID (return 404)
  • Can be restored via the audit log or future restore endpoints
  • Maintain their audit trail

This ensures data is never permanently lost through normal API operations.