---
title: "media.job.cancelled@1 · OpenVibe.Services"
canonical: "https://openvibe.services/docs/contracts/media.job.cancelled"
updated: null
---

# media.job.cancelled@1 · OpenVibe.Services

HTML: [media.job.cancelled@1 · OpenVibe.Services](https://openvibe.services/docs/contracts/media.job.cancelled)

# MediaJobCancelledPayload `media.job.cancelled@1`

Generated at 2026-12-01 05:42:00 UTC from [`openvibe-contracts v0.454.0`](https://github.com/OpenVibers/OpenVibe.Contracts/tree/v0.454.0) and [`openvibe-sdk v0.193.0`](https://github.com/OpenVibers/OpenVibe.SDK/tree/v0.193.0).

- Version: 1.0.0
- Owner: media
- Visibility: first-party
- Status: active
- Compatibility: backward
- Decision: [ADR-004](/docs/adr/ADR-004)
- Schema: [`https://openvibe.network/contracts/events/payloads/media.job.cancelled.v1.json`](/docs/contracts/media.job.cancelled.json)

media.job.cancelled v1 (OpenVibe.Media server/jobs/queue.js cancel, markCancelled; server/events.js recordJob). The job was cancelled: a proposal or a queued job at once, by its owner (POST /api/v2/:app/jobs/:id/cancel or DELETE /api/v2/:app/jobs/:id) or by the validator withdrawing a proposal that no longer applies (decided\_at set, error\_code cancelled when a reason was given); a running job once it stopped after its owner asked (cancel\_requested true, error\_code cancelled). Emitted in the SQLite transaction that records the state change, so the event exists if and only if the change committed; it goes to OpenVibe.Events only (no app webhook). The payload is an event projection of the job (queue.jobEvent): its identity, state, counters, stable error\_code, times and has\_result. Deliberately left out, because events travel beyond the tenant: the tenant's params (object.split keeps whatever the caller sent), the caller's idempotency\_key, the free-text error (raw handler or ffmpeg output), the result (thumbnail.regenerate's is the thumbnail URL, of a private VOD too), created\_by/decided\_by and owner\_user\_id (tenant-local user ids), and the handler's checkpoint, lease and request hash. GET the job with a tenant token for params/result/error (GET /api/v2/:app/jobs/:id with a token for app\_id; has\_result says whether there is a result to fetch). Times are ISO 8601 UTC (YYYY-MM-DDTHH:MM:SS.sssZ) or null. Jobs of developer-project sandbox tenants are not announced. Envelope: subject { type: job, id: <id> }, visibility internal, priority important, actor service:media.

## Fields

| Field | Type | Required | Description | Constraints |
| --- | --- | --- | --- | --- |
| `id` | string | yes | The job. GET /api/v2/:app/jobs/:id with a token for app\_id answers the rest of it. | - `pattern ^mjob_[0-9A-HJKMNP-TV-Z]{26}$` |
| `app_id` | string | yes | The tenant that owns the job: an app (live, tools…) or a developer project's production tenant (prj\_…). | - `minLength 1`<br>- `maxLength 200` |
| `object_id` | string \| null | yes | The object the job works on; null for a tenant-wide job (invariant.scan). | - `maxLength 200` |
| `type` | string | yes | Job type: thumbnail.regenerate, invariant.scan, object.split or object.remux. | - `pattern ^[a-z][a-z0-9]*\.[a-z0-9_.]+$`<br>- `maxLength 80` |
| `status` | const | yes |  | - `= "cancelled"` |
| `attempts` | integer | yes | Attempts started so far. | - `minimum 0` |
| `max_attempts` | integer | yes |  | - `minimum 1`<br>- `maximum 10` |
| `error_code` | string \| null | yes | Stable code of the last failure (media\_unavailable, interrupted, cancelled, media.job.invalid…), or null when there was none or the handler gave no code. Never the message: GET the job for it. |  |
| `cancel_requested` | boolean | yes | Its owner asked a running job to stop. |  |
| `has_result` | boolean | yes | A stopped running job left a partial result. The result itself is never in the event: GET the job with a tenant token for it. |  |
| `run_after` | string \| null | yes | A queued job waits until then (retry backoff); null otherwise. | - `pattern ^[0-9]{4}-[0-9]{2}-[0-9]{2}T[0-9]{2}:[0-9]{2}:[0-9]{2}(\.[0-9]{1,3})?Z$`<br>- `format date-time` |
| `decided_at` | string \| null | yes | When its owner approved it, or cancelled it while it was proposed or queued; null otherwise. | - `pattern ^[0-9]{4}-[0-9]{2}-[0-9]{2}T[0-9]{2}:[0-9]{2}:[0-9]{2}(\.[0-9]{1,3})?Z$`<br>- `format date-time` |
| `created_at` | string | yes |  | - `pattern ^[0-9]{4}-[0-9]{2}-[0-9]{2}T[0-9]{2}:[0-9]{2}:[0-9]{2}(\.[0-9]{1,3})?Z$`<br>- `format date-time` |
| `updated_at` | string | yes |  | - `pattern ^[0-9]{4}-[0-9]{2}-[0-9]{2}T[0-9]{2}:[0-9]{2}:[0-9]{2}(\.[0-9]{1,3})?Z$`<br>- `format date-time` |
| `started_at` | string \| null | yes | The first attempt's start; null when the job was cancelled before it ever ran. | - `pattern ^[0-9]{4}-[0-9]{2}-[0-9]{2}T[0-9]{2}:[0-9]{2}:[0-9]{2}(\.[0-9]{1,3})?Z$`<br>- `format date-time` |
| `finished_at` | string | yes |  | - `pattern ^[0-9]{4}-[0-9]{2}-[0-9]{2}T[0-9]{2}:[0-9]{2}:[0-9]{2}(\.[0-9]{1,3})?Z$`<br>- `format date-time` |

## Examples

From the contract's own test fixtures: valid ones validate, rejected ones must fail.

 Valid: queued-cancelled-without-reason

~~~~
{
  "id": "mjob_01JAB3C4D5E6F7G8H9J0K1MNPQ",
  "app_id": "live",
  "object_id": "med_01JAB2C3D4E5F6G7H8J9K0MNPQ",
  "type": "thumbnail.regenerate",
  "status": "cancelled",
  "attempts": 0,
  "max_attempts": 3,
  "error_code": null,
  "cancel_requested": false,
  "has_result": false,
  "run_after": null,
  "decided_at": "2026-09-23T18:02:30.000Z",
  "created_at": "2026-09-23T18:02:11.000Z",
  "updated_at": "2026-09-23T18:02:30.000Z",
  "started_at": null,
  "finished_at": "2026-09-23T18:02:30.000Z"
}
~~~~

Valid: running-stopped

~~~~
{
  "id": "mjob_01JAB3C4D5E6F7G8H9J0K1MNPQ",
  "app_id": "live",
  "object_id": "med_01JAB2C3D4E5F6G7H8J9K0MNPQ",
  "type": "object.split",
  "status": "cancelled",
  "attempts": 1,
  "max_attempts": 3,
  "error_code": "cancelled",
  "cancel_requested": true,
  "has_result": false,
  "run_after": null,
  "decided_at": null,
  "created_at": "2026-09-23T18:02:11.000Z",
  "updated_at": "2026-09-23T18:04:00.000Z",
  "started_at": "2026-09-23T18:02:12.000Z",
  "finished_at": "2026-09-23T18:04:00.000Z"
}
~~~~

Valid: withdrawn-proposal

~~~~
{
  "id": "mjob_01JAB3C4D5E6F7G8H9J0K1MNPQ",
  "app_id": "live",
  "object_id": "med_01JAB2C3D4E5F6G7H8J9K0MNPQ",
  "type": "object.split",
  "status": "cancelled",
  "attempts": 0,
  "max_attempts": 3,
  "error_code": "cancelled",
  "cancel_requested": false,
  "has_result": false,
  "run_after": null,
  "decided_at": "2026-09-24T04:00:03.000Z",
  "created_at": "2026-09-23T18:02:11.000Z",
  "updated_at": "2026-09-24T04:00:03.000Z",
  "started_at": null,
  "finished_at": "2026-09-24T04:00:03.000Z"
}
~~~~

Rejected: missing-fields

~~~~
{
  "id": "mjob_01JAB3C4D5E6F7G8H9J0K1MNPQ",
  "app_id": "live",
  "status": "cancelled"
}
~~~~

Rejected: names-the-canceller

~~~~
{
  "id": "mjob_01JAB3C4D5E6F7G8H9J0K1MNPQ",
  "app_id": "live",
  "object_id": "med_01JAB2C3D4E5F6G7H8J9K0MNPQ",
  "type": "object.split",
  "status": "cancelled",
  "attempts": 0,
  "max_attempts": 3,
  "error_code": "cancelled",
  "cancel_requested": false,
  "has_result": false,
  "run_after": null,
  "decided_at": "2026-09-23T18:10:40.000Z",
  "created_at": "2026-09-23T18:02:11.000Z",
  "updated_at": "2026-09-23T18:10:40.000Z",
  "started_at": null,
  "finished_at": "2026-09-23T18:10:40.000Z",
  "decided_by": "app:live:user:57"
}
~~~~

Rejected: unfinished

~~~~
{
  "id": "mjob_01JAB3C4D5E6F7G8H9J0K1MNPQ",
  "app_id": "live",
  "object_id": "med_01JAB2C3D4E5F6G7H8J9K0MNPQ",
  "type": "object.split",
  "status": "cancelled",
  "attempts": 0,
  "max_attempts": 3,
  "error_code": "cancelled",
  "cancel_requested": false,
  "has_result": false,
  "run_after": null,
  "decided_at": "2026-09-23T18:10:40.000Z",
  "created_at": "2026-09-23T18:02:11.000Z",
  "updated_at": "2026-09-23T18:10:40.000Z",
  "started_at": null,
  "finished_at": null
}
~~~~

## Validate

~~~~
const contracts = require('openvibe-contracts');
contracts.validate('media.job.cancelled@1', value);   // { valid, errors: [{ path, message }] }
~~~~
