MediaObject media.object@1

Generated at from openvibe-contracts v0.76.0 and openvibe-sdk v0.20.1.

Version
1.0.0
Owner
media
Visibility
public
Status
active
Compatibility
backward
Schema
https://openvibe.network/contracts/media/object.v1.json

media.object@1: one object of the OpenVibe.Media object API v2 (/api/v2/:app/objects; Media server/objects/model.js objectPublic): its id and legacy ref, tenant and namespace (the tenant's root, or a namespace below it), kind, owner, visibility, lifecycle, type, size and hash, readiness, and where it is served. Copies are described by provider and state, never by path or key. More fields may be added.

Fields

FieldTypeRequiredDescriptionConstraints
idstringyes
  • pattern ^med_[0-9A-HJKMNP-TV-Z]{26}$
media_refmedia.media-ref
legacy_refstring | nulllegacy:<app>:<kind>:<id> for an object projected from a VOD, clip, file or paste row; null for a native v2 object.
app_idstringyesThe tenant: an app id, or prj_<ULID> / prj_<ULID>-sandbox for a developer project.
namespacestringyesThe namespace grants name: the tenant's root (its app id; app.<project_id> or app.<project_id>.sandbox for a developer project) or a namespace below it (<root>.<segment>…).
  • minLength 1
kindenumyes
  • one of "vod", "clip", "file", "thumbnail", "screenshot", "avatar", "asset"
ownerobject
owner.subjectstring | null
owner.appstring | null
owner.user_idinteger | null
visibilityenumyes
  • one of "public", "unlisted", "private"
lifecycle_statusenumyes
  • one of "uploading", "ready", "failed", "archived", "deleted"
mime_typestring | null
size_bytesintegeryes
  • minimum 0
content_hashstring | nullsha256 hex of the bytes, once known.
metadataobject
heldbooleanUnder a retention hold (its own, or a clip's source VOD's).
readinessobject
readiness.metadataboolean
readiness.bytes_verifiedboolean
readiness.playableboolean
readiness.reasonstring | null
public_urlstring | nullWhere a public or unlisted ready object is served; null for private and sandbox objects (download signs them).
sandboxconst
  • = true
locationsarray of object
locations[].providerenumyes
  • one of "local", "b2", "r2"
locations[].storage_classstring | null
locations[].stateenumyes
  • one of "present", "missing", "pending", "corrupt"
locations[].size_bytesinteger | null
locations[].verified_atstring | null
locations[].canonicalboolean
created_atstringyes
updated_atstring | null
deleted_atstring | null

Examples

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

Valid: native-in-child-namespace
{
  "id": "med_01K5WZX7S7Q4D2B8N3M6V1C9TZ",
  "media_ref": {
    "media_id": "med_01K5WZX7S7Q4D2B8N3M6V1C9TZ"
  },
  "legacy_ref": null,
  "app_id": "prj_01K5WZX7S7Q4D2B8N3M6V1C9TA",
  "namespace": "app.prj_01K5WZX7S7Q4D2B8N3M6V1C9TA.avatars",
  "kind": "file",
  "owner": {
    "subject": null,
    "app": "prj_01K5WZX7S7Q4D2B8N3M6V1C9TA",
    "user_id": null
  },
  "visibility": "private",
  "lifecycle_status": "ready",
  "mime_type": "image/png",
  "size_bytes": 48213,
  "content_hash": "3f1c0b8e2a9d7c6b5a4f3e2d1c0b9a8f7e6d5c4b3a2f1e0d9c8b7a6f5e4d3c2b",
  "metadata": {
    "filename": "a.png"
  },
  "held": false,
  "readiness": {
    "metadata": true,
    "bytes_verified": true,
    "playable": false,
    "reason": "not_playback_kind"
  },
  "public_url": null,
  "created_at": "2026-09-26 08:00:00",
  "updated_at": "2026-09-26 08:00:01",
  "deleted_at": null,
  "locations": [
    {
      "provider": "local",
      "storage_class": "hot",
      "state": "present",
      "size_bytes": 48213,
      "verified_at": "2026-09-26 08:00:01",
      "canonical": true
    }
  ]
}
Valid: projected-vod
{
  "id": "med_01K5WZX7S7Q4D2B8N3M6V1C9TB",
  "legacy_ref": "legacy:live:vod:1277",
  "app_id": "live",
  "namespace": "live",
  "kind": "vod",
  "visibility": "public",
  "lifecycle_status": "ready",
  "size_bytes": 1073741824,
  "public_url": "https://openvibe.media/v/1277",
  "created_at": "2026-09-01 12:00:00"
}
Rejected: no-namespace
{
  "id": "med_01K5WZX7S7Q4D2B8N3M6V1C9TB",
  "app_id": "live",
  "kind": "vod",
  "visibility": "public",
  "lifecycle_status": "ready",
  "size_bytes": 10,
  "created_at": "2026-09-01 12:00:00"
}
Rejected: unknown-lifecycle
{
  "id": "med_01K5WZX7S7Q4D2B8N3M6V1C9TB",
  "app_id": "live",
  "namespace": "live",
  "kind": "vod",
  "visibility": "public",
  "lifecycle_status": "expired",
  "size_bytes": 10,
  "created_at": "2026-09-01 12:00:00"
}

Validate

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