Skip to content

API Reference

Thoth provides a full REST API for programmatic interaction.

1. Authentication

Most API calls require a JWT Token or an API Key.

  • JWT: Pass in the Authorization: Bearer <token> header.

  • API Key: Pass in the X-API-KEY: <key> header.

2. Base URL

The API is accessible at: https://<tenant>.thoth-studio.com/api

3. Core Endpoints

Render a Document

Generate a document and get the raw content (HTML/SVG/PDF).

  • URL: POST /renderers/{id}/render

  • Body:

{
  "variables": {
    "order_id": "12345",
    "optional_comment": "Please handle with care"
  },
  "format": "PDF"
}
  • Response: The raw binary/text content of the document.

Render a document and send it directly to a Printing Client.

  • URL: POST /renderers/{id}/print

  • Body:

{
  "variables": {
    "order_id": "12345"
  },
  "clientId": "uuid-of-printing-client",
  "printerName": "Zebra-ZT411",
  "copies": 1
}
  • Response: A PrintJob object with its initial status.

Track Job Status

  • URL: GET /print-jobs/{jobId}

  • Response:

{
  "id": "jobId",
  "status": "COMPLETED",
  "message": "Printed successfully on Zebra-ZT411",
  "updatedAt": "2026-01-09T14:30:00Z"
}

4. OpenAPI / Swagger

Thoth automatically generates a full OpenAPI 3.0 specification.

  • Swagger UI: https://<tenant>.thoth-studio.com/swagger-ui/index.html

  • OpenAPI JSON: https://<tenant>.thoth-studio.com/v3/api-docs

Use these interactive tools to explore every available endpoint, including those for managing Templates, Datasources, and IAM resources.

5. RSQL Filtering

List endpoints support complex filtering using RSQL.

  • Example: GET /templates?search=name=='*Invoice*';tags=all=('finance','urgent')

  • Operators:

    • == : Equals
    • != : Not equals
    • =re= : Regex match
    • =in= : In list
    • ; : AND
    • , : OR