Docs · GET /job/{jobId}
Reference · Jobs

GET/job/{jobId}

Returns an async job’s status and, once it has completed, its result. Poll it until status is completed, failed or cancelled. A job can be read until its directory is deleted.

Parameters

Parameters
jobIdstringThe job_id that POST /ffmpeg/process/async returned.

Request body

This request has no body.

Example

Request
curl https://media.logicboostkit.com/job/job_0mv6ihz6vfx5ua0h05x8bmql \
  -H "Authorization: Basic $MEDIA_KEY"
Response
HTTP/1.1 200 OK
X-Request-Id: job_0mv6img4ztlm392wz8t7f205

{
  "ok": true,
  "job_id": "job_0mv6ihz6vfx5ua0h05x8bmql",
  "status": "completed",
  "request_id": "job_0mv6ihz6vfx5ua0h05x8bmql",
  "result": [
    {
      "file_name": "source-720p.mp4",
      "size_bytes": 412316860,
      "download_url": "https://…"
    }
  ],
  "usage": {
    "time_sec": 41.27,
    "input_size_gb": 1.804199982,
    "output_size_gb": 0.384,
    "gb_sec": 90.307013221
  },
  "amount_usd": 1.202889416
}

Response fields

Response fields
okbooleantrue while the job is pending or processing and when it has completed; false when it failed or was cancelled.
job_idstringThe job’s id.
statusstringpending, processing, completed, failed or cancelled.
request_idstringThe job’s request id: the same value as job_id.
result[]arrayCompleted only. One entry per output file: file_name, size_bytes and download_url. Every call returns fresh download URLs, each good for 1 hour.
usageobjectCompleted only. time_sec, input_size_gb, output_size_gb and gb_sec, as for POST /ffmpeg/process.
amount_usdnumberCompleted only. What the job was charged, in USD.
errorstringFailed only. What went wrong, with FFmpeg’s last message.

The job’s task is not returned: it is deleted when the job ends.

Status codes

Status codes
200The job’s state, whatever it is. A failed or cancelled job also answers 200, with ok false. Not charged.
401The Authorization header is missing, or the key is invalid, revoked or expired.
403The account isn’t active. The error says what to do.
404Job not found: the job isn’t in your account, or it went when its directory was deleted.
429More than 300 requests in a minute on this key. Wait for the number of seconds in Retry-After.

Every error has the shape {"ok": false, "error": "…"} and is never charged.

Other states

Pending or processing
{
  "ok": true,
  "job_id": "job_0mv6ihz6vfx5ua0h05x8bmql",
  "status": "processing",
  "request_id": "job_0mv6ihz6vfx5ua0h05x8bmql"
}
Failed
{
  "ok": false,
  "job_id": "job_0mv6ihz6vfx5ua0h05x8bmql",
  "status": "failed",
  "request_id": "job_0mv6ihz6vfx5ua0h05x8bmql",
  "error": "FFmpeg command failed with exit code 1: Conversion failed!"
}
Cancelled
{
  "ok": false,
  "job_id": "job_0mv6ihz6vfx5ua0h05x8bmql",
  "status": "cancelled",
  "request_id": "job_0mv6ihz6vfx5ua0h05x8bmql"
}