{
  "info": {
    "name": "InKhmer Document Translator — Public API",
    "schema": "https://schema.getpostman.com/json/collection/v2.1.0/collection.json",
    "description": "TosKey-Bearer public API for the AI document translator. Set INKHMER_KEY (sk_test_… / sk_live_…) and INKHMER_API_ORIGIN as collection variables."
  },
  "auth": {
    "type": "bearer",
    "bearer": [
      {
        "key": "token",
        "value": "{{INKHMER_KEY}}",
        "type": "string"
      }
    ]
  },
  "variable": [
    {
      "key": "INKHMER_API_ORIGIN",
      "value": "https://api.inkhmer.com"
    },
    {
      "key": "INKHMER_KEY",
      "value": "sk_test_REPLACE_ME"
    }
  ],
  "item": [
    {
      "name": "createJob",
      "request": {
        "method": "POST",
        "header": [
          {
            "key": "Authorization",
            "value": "Bearer {{INKHMER_KEY}}"
          },
          {
            "key": "Idempotency-Key",
            "value": "{{$guid}}"
          }
        ],
        "url": {
          "raw": "{{INKHMER_API_ORIGIN}}/v1/public/document-translator/jobs",
          "host": [
            "{{INKHMER_API_ORIGIN}}"
          ],
          "path": [
            "v1",
            "public",
            "document-translator",
            "jobs"
          ]
        },
        "description": "Create a translation job (legacy multipart)",
        "body": {
          "mode": "formdata",
          "formdata": [
            {
              "key": "file",
              "type": "file",
              "src": [],
              "description": "Source document (PDF)"
            },
            {
              "key": "source",
              "type": "text",
              "value": "auto"
            },
            {
              "key": "target",
              "type": "text",
              "value": "km"
            }
          ]
        }
      }
    },
    {
      "name": "createJobIntent",
      "request": {
        "method": "POST",
        "header": [
          {
            "key": "Authorization",
            "value": "Bearer {{INKHMER_KEY}}"
          }
        ],
        "url": {
          "raw": "{{INKHMER_API_ORIGIN}}/v1/public/document-translator/jobs/intent",
          "host": [
            "{{INKHMER_API_ORIGIN}}"
          ],
          "path": [
            "v1",
            "public",
            "document-translator",
            "jobs",
            "intent"
          ]
        },
        "description": "Create an upload intent (direct-to-storage flow)"
      }
    },
    {
      "name": "getJob",
      "request": {
        "method": "GET",
        "header": [
          {
            "key": "Authorization",
            "value": "Bearer {{INKHMER_KEY}}"
          }
        ],
        "url": {
          "raw": "{{INKHMER_API_ORIGIN}}/v1/public/document-translator/jobs/:jobId",
          "host": [
            "{{INKHMER_API_ORIGIN}}"
          ],
          "path": [
            "v1",
            "public",
            "document-translator",
            "jobs",
            "{jobId}"
          ]
        },
        "description": "Get a translation job status"
      }
    },
    {
      "name": "finalizeJob",
      "request": {
        "method": "POST",
        "header": [
          {
            "key": "Authorization",
            "value": "Bearer {{INKHMER_KEY}}"
          }
        ],
        "url": {
          "raw": "{{INKHMER_API_ORIGIN}}/v1/public/document-translator/jobs/:jobId/finalize",
          "host": [
            "{{INKHMER_API_ORIGIN}}"
          ],
          "path": [
            "v1",
            "public",
            "document-translator",
            "jobs",
            "{jobId}",
            "finalize"
          ]
        },
        "description": "Finalize a direct-to-storage upload"
      }
    },
    {
      "name": "getJobPdf",
      "request": {
        "method": "GET",
        "header": [
          {
            "key": "Authorization",
            "value": "Bearer {{INKHMER_KEY}}"
          }
        ],
        "url": {
          "raw": "{{INKHMER_API_ORIGIN}}/v1/public/document-translator/jobs/:jobId/pdf",
          "host": [
            "{{INKHMER_API_ORIGIN}}"
          ],
          "path": [
            "v1",
            "public",
            "document-translator",
            "jobs",
            "{jobId}",
            "pdf"
          ]
        },
        "description": "Download the translated PDF"
      }
    },
    {
      "name": "getJobPdfUrl",
      "request": {
        "method": "GET",
        "header": [
          {
            "key": "Authorization",
            "value": "Bearer {{INKHMER_KEY}}"
          }
        ],
        "url": {
          "raw": "{{INKHMER_API_ORIGIN}}/v1/public/document-translator/jobs/:jobId/pdf-url",
          "host": [
            "{{INKHMER_API_ORIGIN}}"
          ],
          "path": [
            "v1",
            "public",
            "document-translator",
            "jobs",
            "{jobId}",
            "pdf-url"
          ]
        },
        "description": "Mint a presigned download URL (direct-from-storage)"
      }
    },
    {
      "name": "cancelJob",
      "request": {
        "method": "POST",
        "header": [
          {
            "key": "Authorization",
            "value": "Bearer {{INKHMER_KEY}}"
          }
        ],
        "url": {
          "raw": "{{INKHMER_API_ORIGIN}}/v1/public/document-translator/jobs/:jobId/cancel",
          "host": [
            "{{INKHMER_API_ORIGIN}}"
          ],
          "path": [
            "v1",
            "public",
            "document-translator",
            "jobs",
            "{jobId}",
            "cancel"
          ]
        },
        "description": "Cancel a translation job"
      }
    }
  ]
}
