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

- `jobId` (string): The job_id that POST /ffmpeg/process/async returned.

## Request body

This request has no body.

## Example

Request

```bash
curl https://media.logicboostkit.com/job/job_0mv6ihz6vfx5ua0h05x8bmql \
  -H "Authorization: Basic $MEDIA_KEY"
```

Response

```http
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

- `ok` (boolean): true while the job is pending or processing and when it has completed; false when it failed or was cancelled.
- `job_id` (string): The job’s id.
- `status` (string): pending, processing, completed, failed or cancelled.
- `request_id` (string): The job’s request id: the same value as job_id.
- `result[]` (array): Completed only. One entry per output file: file_name, size_bytes and download_url. Every call returns fresh download URLs, each good for 1 hour.
- `usage` (object): Completed only. time_sec, input_size_gb, output_size_gb and gb_sec, as for POST /ffmpeg/process.
- `amount_usd` (number): Completed only. What the job was charged, in USD.
- `error` (string): Failed 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

- **200**: The job’s state, whatever it is. A failed or cancelled job also answers 200, with ok false. Not charged.
- **401**: The `Authorization` header is missing, or the key is invalid, revoked or expired.
- **403**: The account isn’t active. The error says what to do.
- **404**: `Job not found`: the job isn’t in your account, or it went when its directory was deleted.
- **429**: More 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

```json
{
  "ok": true,
  "job_id": "job_0mv6ihz6vfx5ua0h05x8bmql",
  "status": "processing",
  "request_id": "job_0mv6ihz6vfx5ua0h05x8bmql"
}
```

Failed

```json
{
  "ok": false,
  "job_id": "job_0mv6ihz6vfx5ua0h05x8bmql",
  "status": "failed",
  "request_id": "job_0mv6ihz6vfx5ua0h05x8bmql",
  "error": "FFmpeg command failed with exit code 1: Conversion failed!"
}
```

Cancelled

```json
{
  "ok": false,
  "job_id": "job_0mv6ihz6vfx5ua0h05x8bmql",
  "status": "cancelled",
  "request_id": "job_0mv6ihz6vfx5ua0h05x8bmql"
}
```
