{
  "info": {
    "_postman_id": "6b638fc0-e685-53a1-8588-42c0c4ebd84b",
    "name": "libreserv",
    "description": "Middleware and queue service between authenticated clients and headless LibreOffice. Submit document-conversion jobs, poll their status, download results, receive signed webhooks.\n\nAll `/api/v1` endpoints require `Authorization: Bearer <api-key>` (keys are issued by admins and look like `lsv_<prefix>_<secret>`). `/api/v1/admin/*` additionally requires the key's user to be an admin. Full reference with examples: `docs/API.md`.",
    "schema": "https://schema.getpostman.com/json/collection/v2.1.0/collection.json"
  },
  "auth": {
    "type": "bearer",
    "bearer": [
      {
        "key": "token",
        "value": "{{apiKey}}",
        "type": "string"
      }
    ]
  },
  "variable": [
    {
      "key": "baseUrl",
      "value": "http://127.0.0.1:8080"
    },
    {
      "key": "apiKey",
      "value": "lsv_paste_your_key_here"
    },
    {
      "key": "jobId",
      "value": ""
    },
    {
      "key": "userId",
      "value": "1"
    },
    {
      "key": "keyId",
      "value": "1"
    },
    {
      "key": "slotIndex",
      "value": "0"
    }
  ],
  "item": [
    {
      "name": "health",
      "item": [
        {
          "name": "Liveness: process is up (no auth)",
          "request": {
            "method": "GET",
            "header": [],
            "url": {
              "raw": "{{baseUrl}}/health",
              "host": [
                "{{baseUrl}}"
              ],
              "path": [
                "health"
              ]
            },
            "description": "GET /health",
            "auth": {
              "type": "noauth"
            }
          },
          "response": []
        },
        {
          "name": "Readiness: database, queue, and pool checks (no auth)",
          "request": {
            "method": "GET",
            "header": [],
            "url": {
              "raw": "{{baseUrl}}/ready",
              "host": [
                "{{baseUrl}}"
              ],
              "path": [
                "ready"
              ]
            },
            "description": "GET /ready",
            "auth": {
              "type": "noauth"
            }
          },
          "response": []
        }
      ]
    },
    {
      "name": "meta",
      "item": [
        {
          "name": "Calling app's identity, quotas, restrictions, and webhook secret",
          "request": {
            "method": "GET",
            "header": [],
            "url": {
              "raw": "{{baseUrl}}/api/v1/me",
              "host": [
                "{{baseUrl}}"
              ],
              "path": [
                "api",
                "v1",
                "me"
              ]
            },
            "description": "GET /api/v1/me"
          },
          "response": []
        },
        {
          "name": "Supported target formats",
          "request": {
            "method": "GET",
            "header": [],
            "url": {
              "raw": "{{baseUrl}}/api/v1/formats",
              "host": [
                "{{baseUrl}}"
              ],
              "path": [
                "api",
                "v1",
                "formats"
              ]
            },
            "description": "GET /api/v1/formats"
          },
          "response": []
        },
        {
          "name": "Calling app's own usage report (daily rows + totals)",
          "request": {
            "method": "GET",
            "header": [],
            "url": {
              "raw": "{{baseUrl}}/api/v1/me/usage",
              "host": [
                "{{baseUrl}}"
              ],
              "path": [
                "api",
                "v1",
                "me",
                "usage"
              ],
              "query": [
                {
                  "key": "from",
                  "value": "",
                  "disabled": true,
                  "description": ""
                },
                {
                  "key": "to",
                  "value": "",
                  "disabled": true,
                  "description": ""
                }
              ]
            },
            "description": "GET /api/v1/me/usage"
          },
          "response": []
        }
      ]
    },
    {
      "name": "jobs",
      "item": [
        {
          "name": "Submit a conversion job",
          "request": {
            "method": "POST",
            "header": [],
            "url": {
              "raw": "{{baseUrl}}/api/v1/jobs",
              "host": [
                "{{baseUrl}}"
              ],
              "path": [
                "api",
                "v1",
                "jobs"
              ]
            },
            "description": "POST /api/v1/jobs",
            "body": {
              "mode": "formdata",
              "formdata": [
                {
                  "key": "file",
                  "type": "file",
                  "src": []
                },
                {
                  "key": "target_format",
                  "type": "text",
                  "value": "pdf",
                  "disabled": false
                },
                {
                  "key": "filter_options",
                  "type": "text",
                  "value": "",
                  "disabled": true
                },
                {
                  "key": "webhook_url",
                  "type": "text",
                  "value": "",
                  "disabled": true
                }
              ]
            }
          },
          "response": []
        },
        {
          "name": "List your jobs",
          "request": {
            "method": "GET",
            "header": [],
            "url": {
              "raw": "{{baseUrl}}/api/v1/jobs",
              "host": [
                "{{baseUrl}}"
              ],
              "path": [
                "api",
                "v1",
                "jobs"
              ],
              "query": [
                {
                  "key": "status",
                  "value": "",
                  "disabled": true,
                  "description": ""
                },
                {
                  "key": "limit",
                  "value": "",
                  "disabled": true,
                  "description": ""
                },
                {
                  "key": "offset",
                  "value": "",
                  "disabled": true,
                  "description": ""
                }
              ]
            },
            "description": "GET /api/v1/jobs"
          },
          "response": []
        },
        {
          "name": "Job status with event timeline",
          "request": {
            "method": "GET",
            "header": [],
            "url": {
              "raw": "{{baseUrl}}/api/v1/jobs/{{jobId}}",
              "host": [
                "{{baseUrl}}"
              ],
              "path": [
                "api",
                "v1",
                "jobs",
                "{{jobId}}"
              ]
            },
            "description": "GET /api/v1/jobs/{job_id}"
          },
          "response": []
        },
        {
          "name": "Cancel a queued/running job, or delete a finished job's artifacts",
          "request": {
            "method": "DELETE",
            "header": [],
            "url": {
              "raw": "{{baseUrl}}/api/v1/jobs/{{jobId}}",
              "host": [
                "{{baseUrl}}"
              ],
              "path": [
                "api",
                "v1",
                "jobs",
                "{{jobId}}"
              ]
            },
            "description": "DELETE /api/v1/jobs/{job_id}\n\nCancel a queued/running job; for finished jobs, delete the artifacts."
          },
          "response": []
        },
        {
          "name": "Download the converted document",
          "request": {
            "method": "GET",
            "header": [],
            "url": {
              "raw": "{{baseUrl}}/api/v1/jobs/{{jobId}}/result",
              "host": [
                "{{baseUrl}}"
              ],
              "path": [
                "api",
                "v1",
                "jobs",
                "{{jobId}}",
                "result"
              ]
            },
            "description": "GET /api/v1/jobs/{job_id}/result"
          },
          "response": []
        },
        {
          "name": "Download the original uploaded document",
          "request": {
            "method": "GET",
            "header": [],
            "url": {
              "raw": "{{baseUrl}}/api/v1/jobs/{{jobId}}/source",
              "host": [
                "{{baseUrl}}"
              ],
              "path": [
                "api",
                "v1",
                "jobs",
                "{{jobId}}",
                "source"
              ]
            },
            "description": "GET /api/v1/jobs/{job_id}/source"
          },
          "response": []
        },
        {
          "name": "Download the job log (plain text)",
          "request": {
            "method": "GET",
            "header": [],
            "url": {
              "raw": "{{baseUrl}}/api/v1/jobs/{{jobId}}/log",
              "host": [
                "{{baseUrl}}"
              ],
              "path": [
                "api",
                "v1",
                "jobs",
                "{{jobId}}",
                "log"
              ]
            },
            "description": "GET /api/v1/jobs/{job_id}/log"
          },
          "response": []
        },
        {
          "name": "Convert synchronously: upload, wait, download in one request",
          "request": {
            "method": "POST",
            "header": [],
            "url": {
              "raw": "{{baseUrl}}/api/v1/convert",
              "host": [
                "{{baseUrl}}"
              ],
              "path": [
                "api",
                "v1",
                "convert"
              ]
            },
            "description": "POST /api/v1/convert",
            "body": {
              "mode": "formdata",
              "formdata": [
                {
                  "key": "file",
                  "type": "file",
                  "src": []
                },
                {
                  "key": "target_format",
                  "type": "text",
                  "value": "pdf",
                  "disabled": false
                },
                {
                  "key": "filter_options",
                  "type": "text",
                  "value": "",
                  "disabled": true
                }
              ]
            }
          },
          "response": []
        }
      ]
    },
    {
      "name": "admin",
      "item": [
        {
          "name": "List all apps",
          "request": {
            "method": "GET",
            "header": [],
            "url": {
              "raw": "{{baseUrl}}/api/v1/admin/apps",
              "host": [
                "{{baseUrl}}"
              ],
              "path": [
                "api",
                "v1",
                "admin",
                "apps"
              ]
            },
            "description": "GET /api/v1/admin/apps"
          },
          "response": []
        },
        {
          "name": "Create an app (webhook secret is generated automatically)",
          "request": {
            "method": "POST",
            "header": [],
            "url": {
              "raw": "{{baseUrl}}/api/v1/admin/apps",
              "host": [
                "{{baseUrl}}"
              ],
              "path": [
                "api",
                "v1",
                "admin",
                "apps"
              ]
            },
            "description": "POST /api/v1/admin/apps",
            "body": {
              "mode": "raw",
              "raw": "{\n  \"name\": \"<name>\",\n  \"description\": \"<description>\",\n  \"is_admin\": false,\n  \"max_file_mb\": 0,\n  \"max_jobs_per_day\": 0,\n  \"max_jobs_per_minute\": 0,\n  \"max_concurrent\": 0,\n  \"allowed_sources\": \"<allowed_sources>\",\n  \"allowed_referers\": \"<allowed_referers>\"\n}",
              "options": {
                "raw": {
                  "language": "json"
                }
              }
            }
          },
          "response": []
        },
        {
          "name": "Get one app",
          "request": {
            "method": "GET",
            "header": [],
            "url": {
              "raw": "{{baseUrl}}/api/v1/admin/apps/{{appId}}",
              "host": [
                "{{baseUrl}}"
              ],
              "path": [
                "api",
                "v1",
                "admin",
                "apps",
                "{{appId}}"
              ]
            },
            "description": "GET /api/v1/admin/apps/{app_id}"
          },
          "response": []
        },
        {
          "name": "Update an app (quotas, restrictions, active/admin flags)",
          "request": {
            "method": "PATCH",
            "header": [],
            "url": {
              "raw": "{{baseUrl}}/api/v1/admin/apps/{{appId}}",
              "host": [
                "{{baseUrl}}"
              ],
              "path": [
                "api",
                "v1",
                "admin",
                "apps",
                "{{appId}}"
              ]
            },
            "description": "PATCH /api/v1/admin/apps/{app_id}",
            "body": {
              "mode": "raw",
              "raw": "{\n  \"description\": \"<description>\",\n  \"is_admin\": false,\n  \"is_active\": false,\n  \"max_file_mb\": 0,\n  \"max_jobs_per_day\": 0,\n  \"max_jobs_per_minute\": 0,\n  \"max_concurrent\": 0,\n  \"allowed_sources\": \"<allowed_sources>\",\n  \"allowed_referers\": \"<allowed_referers>\"\n}",
              "options": {
                "raw": {
                  "language": "json"
                }
              }
            }
          },
          "response": []
        },
        {
          "name": "Delete an app and everything owned by it (keys, jobs, usage)",
          "request": {
            "method": "DELETE",
            "header": [],
            "url": {
              "raw": "{{baseUrl}}/api/v1/admin/apps/{{appId}}",
              "host": [
                "{{baseUrl}}"
              ],
              "path": [
                "api",
                "v1",
                "admin",
                "apps",
                "{{appId}}"
              ]
            },
            "description": "DELETE /api/v1/admin/apps/{app_id}"
          },
          "response": []
        },
        {
          "name": "Issue an API key \u2014 the plaintext token is returned exactly once",
          "request": {
            "method": "POST",
            "header": [],
            "url": {
              "raw": "{{baseUrl}}/api/v1/admin/apps/{{appId}}/keys",
              "host": [
                "{{baseUrl}}"
              ],
              "path": [
                "api",
                "v1",
                "admin",
                "apps",
                "{{appId}}",
                "keys"
              ]
            },
            "description": "POST /api/v1/admin/apps/{app_id}/keys",
            "body": {
              "mode": "raw",
              "raw": "{\n  \"label\": \"<label>\"\n}",
              "options": {
                "raw": {
                  "language": "json"
                }
              }
            }
          },
          "response": []
        },
        {
          "name": "List an app's API keys (hashes never leave the server)",
          "request": {
            "method": "GET",
            "header": [],
            "url": {
              "raw": "{{baseUrl}}/api/v1/admin/apps/{{appId}}/keys",
              "host": [
                "{{baseUrl}}"
              ],
              "path": [
                "api",
                "v1",
                "admin",
                "apps",
                "{{appId}}",
                "keys"
              ]
            },
            "description": "GET /api/v1/admin/apps/{app_id}/keys"
          },
          "response": []
        },
        {
          "name": "Revoke an API key (idempotent)",
          "request": {
            "method": "DELETE",
            "header": [],
            "url": {
              "raw": "{{baseUrl}}/api/v1/admin/keys/{{keyId}}",
              "host": [
                "{{baseUrl}}"
              ],
              "path": [
                "api",
                "v1",
                "admin",
                "keys",
                "{{keyId}}"
              ]
            },
            "description": "DELETE /api/v1/admin/keys/{key_id}"
          },
          "response": []
        },
        {
          "name": "List web-UI admin accounts",
          "request": {
            "method": "GET",
            "header": [],
            "url": {
              "raw": "{{baseUrl}}/api/v1/admin/admins",
              "host": [
                "{{baseUrl}}"
              ],
              "path": [
                "api",
                "v1",
                "admin",
                "admins"
              ]
            },
            "description": "GET /api/v1/admin/admins"
          },
          "response": []
        },
        {
          "name": "Create a web-UI admin account (name and email are unique)",
          "request": {
            "method": "POST",
            "header": [],
            "url": {
              "raw": "{{baseUrl}}/api/v1/admin/admins",
              "host": [
                "{{baseUrl}}"
              ],
              "path": [
                "api",
                "v1",
                "admin",
                "admins"
              ]
            },
            "description": "POST /api/v1/admin/admins",
            "body": {
              "mode": "raw",
              "raw": "{\n  \"name\": \"<name>\",\n  \"email\": \"<email>\",\n  \"password\": \"<password>\"\n}",
              "options": {
                "raw": {
                  "language": "json"
                }
              }
            }
          },
          "response": []
        },
        {
          "name": "Update a web-UI admin (name, email, active flag, password)",
          "request": {
            "method": "PATCH",
            "header": [],
            "url": {
              "raw": "{{baseUrl}}/api/v1/admin/admins/{{adminId}}",
              "host": [
                "{{baseUrl}}"
              ],
              "path": [
                "api",
                "v1",
                "admin",
                "admins",
                "{{adminId}}"
              ]
            },
            "description": "PATCH /api/v1/admin/admins/{admin_id}",
            "body": {
              "mode": "raw",
              "raw": "{\n  \"name\": \"<name>\",\n  \"email\": \"<email>\",\n  \"is_active\": false,\n  \"password\": \"<password>\"\n}",
              "options": {
                "raw": {
                  "language": "json"
                }
              }
            }
          },
          "response": []
        },
        {
          "name": "Delete a web-UI admin account",
          "request": {
            "method": "DELETE",
            "header": [],
            "url": {
              "raw": "{{baseUrl}}/api/v1/admin/admins/{{adminId}}",
              "host": [
                "{{baseUrl}}"
              ],
              "path": [
                "api",
                "v1",
                "admin",
                "admins",
                "{{adminId}}"
              ]
            },
            "description": "DELETE /api/v1/admin/admins/{admin_id}"
          },
          "response": []
        },
        {
          "name": "List jobs across all apps (filter by status and/or app)",
          "request": {
            "method": "GET",
            "header": [],
            "url": {
              "raw": "{{baseUrl}}/api/v1/admin/jobs",
              "host": [
                "{{baseUrl}}"
              ],
              "path": [
                "api",
                "v1",
                "admin",
                "jobs"
              ],
              "query": [
                {
                  "key": "status",
                  "value": "",
                  "disabled": true,
                  "description": ""
                },
                {
                  "key": "app_id",
                  "value": "",
                  "disabled": true,
                  "description": ""
                },
                {
                  "key": "limit",
                  "value": "",
                  "disabled": true,
                  "description": ""
                },
                {
                  "key": "offset",
                  "value": "",
                  "disabled": true,
                  "description": ""
                }
              ]
            },
            "description": "GET /api/v1/admin/jobs"
          },
          "response": []
        },
        {
          "name": "Usage report across apps (daily rows + totals)",
          "request": {
            "method": "GET",
            "header": [],
            "url": {
              "raw": "{{baseUrl}}/api/v1/admin/usage",
              "host": [
                "{{baseUrl}}"
              ],
              "path": [
                "api",
                "v1",
                "admin",
                "usage"
              ],
              "query": [
                {
                  "key": "app_id",
                  "value": "",
                  "disabled": true,
                  "description": ""
                },
                {
                  "key": "from",
                  "value": "",
                  "disabled": true,
                  "description": ""
                },
                {
                  "key": "to",
                  "value": "",
                  "disabled": true,
                  "description": ""
                }
              ]
            },
            "description": "GET /api/v1/admin/usage"
          },
          "response": []
        },
        {
          "name": "LibreOffice pool status as published by the worker",
          "request": {
            "method": "GET",
            "header": [],
            "url": {
              "raw": "{{baseUrl}}/api/v1/admin/pool",
              "host": [
                "{{baseUrl}}"
              ],
              "path": [
                "api",
                "v1",
                "admin",
                "pool"
              ]
            },
            "description": "GET /api/v1/admin/pool"
          },
          "response": []
        },
        {
          "name": "Request a pool slot restart (picked up by the worker's health loop)",
          "request": {
            "method": "POST",
            "header": [],
            "url": {
              "raw": "{{baseUrl}}/api/v1/admin/pool/{{slotIndex}}/restart",
              "host": [
                "{{baseUrl}}"
              ],
              "path": [
                "api",
                "v1",
                "admin",
                "pool",
                "{{slotIndex}}",
                "restart"
              ]
            },
            "description": "POST /api/v1/admin/pool/{slot_index}/restart"
          },
          "response": []
        },
        {
          "name": "Actively ping a pool slot and wait for the worker's live result",
          "request": {
            "method": "POST",
            "header": [],
            "url": {
              "raw": "{{baseUrl}}/api/v1/admin/pool/{{slotIndex}}/ping",
              "host": [
                "{{baseUrl}}"
              ],
              "path": [
                "api",
                "v1",
                "admin",
                "pool",
                "{{slotIndex}}",
                "ping"
              ]
            },
            "description": "POST /api/v1/admin/pool/{slot_index}/ping"
          },
          "response": []
        }
      ]
    }
  ]
}
