LaTeX API
API referenceJobs

Create an asynchronous compile job

POST
/v1/jobs

Accepts the same bodies as /v1/compile and returns immediately with a job you can poll, stream (/events) or get notified about through options.webhookUrl.

Authorization

bearerAuth
headerAuthorizationBearer <token>

A personal API token (lta_...) from the dashboard or latex-api auth login. Also accepted in the X-API-Key header.

Query Parameters

engine?string
entrypoint?string
timeoutMs?string
bibliography?string
force?string

Request Body

  1. body
files*array<>
Items1 <= items <= 1000
entrypoint?string

Main .tex file. Guessed when there is a single .tex or a main.tex.

engine?Engine

TeX engine. Detected from a % !TEX program = ... magic comment when omitted; defaults to pdflatex.

Value in"pdflatex""xelatex""lualatex"
options?

Response Body

Job accepted (or served from cache, in which case it is already finished).

application/json
  1. response
job*
Example Request
curl -X POST 'https://latex-api.crafter.run/v1/jobs' \  -H 'Content-Type: application/json' \  -d '{  "files": [    {      "path": "string",      "content": "string"    }  ]}'
Example Response
{  "job": {    "id": "497f6eca-6276-4993-bfeb-53cbbbba6f08",    "status": "queued",    "mode": "sync",    "engine": "pdflatex",    "entrypoint": "string",    "templateId": "string",    "createdAt": "2019-08-24T14:15:22Z",    "startedAt": "2019-08-24T14:15:22Z",    "finishedAt": "2019-08-24T14:15:22Z",    "expiresAt": "2019-08-24T14:15:22Z",    "options": {      "timeoutMs": 0,      "bibliography": "auto",      "webhookUrl": "string"    },    "result": {      "cached": true,      "durationMs": 0,      "exitCode": 0,      "errors": 0,      "warnings": 0,      "pages": 0,      "pdfBytes": 0,      "pdfUrl": "string",      "logUrl": "string",      "diagnostics": [        {          "severity": "error",          "message": "string",          "file": "string",          "line": 0,          "context": "string",          "source": "string"        }      ]    },    "error": {      "reason": "compile_failed",      "message": "string"    },    "links": {      "self": "string",      "events": "string",      "pdf": "string",      "log": "string"    }  }}