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

# media.replica.requested@1 · OpenVibe.Services

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

# MediaReplicaRequestedPayload `media.replica.requested@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
- Schema: [`https://openvibe.network/contracts/events/payloads/media.replica.requested.v1.json`](/docs/contracts/media.replica.requested.json)

media.replica.requested v1 (OpenVibe.Media server/objects/tiering.js promote(), the recordPlacement inside the transaction that starts the copy; PR #18). Media decided to place a replica of a ready object: the canonical copy stays where it is and the bytes are copied to the target provider (R2, the popularity cache). Recorded before the copy, so a request with no following media.replica.ready means the copy never verified and no replica exists. The payload is deliberately narrow: the object id and its tenant, the placement class, the decision and the two providers. Envelope: subject { type: object, id: <object\_id> }, visibility internal, priority low, actor service:media, source media. Sandbox tenants produce none. The event type is inside media.\* because OpenVibe.Events gates a service's event\_type to a prefix that starts with its source name.

## Fields

| Field | Type | Required | Description | Constraints |
| --- | --- | --- | --- | --- |
| `object_id` | string | yes |  | - `pattern ^med_[0-9A-HJKMNP-TV-Z]{26}$` |
| `app_id` | string \| null | yes | The tenant that owns the object: an app (live, tools…) or a developer project's production tenant (prj\_…); null when the object has no tenant. | - `minLength 1`<br>- `maxLength 200` |
| `class` | enum | yes | The placement class the move was budgeted against (media.storage\_policy classes; tiering.classOf). | - `one of "video", "image", "download", "game-asset", "attachment", "backup"` |
| `action` | enum | yes | promote copies the object to the target provider, demote removes a replica from it. | - `one of "promote", "demote"` |
| `from` | enum | yes | The canonical provider the copy is read from; null when the object has no canonical copy at request time. | - `one of "local", "b2", "r2", null` |
| `to` | enum | yes | The provider the replica is placed on. | - `one of "local", "b2", "r2"` |
| `provider` | enum | yes | The replica provider, named again so the decision is readable on its own. | - `one of "local", "b2", "r2"` |

## Examples

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

 Valid: no-canonical-copy

~~~~
{
  "object_id": "med_01JAB2C3D4E5F6G7H8J9K0MNPQ",
  "app_id": "prj_01JAB2C3D4E5F6G7H8J9K0MNPQ",
  "class": "image",
  "action": "promote",
  "from": null,
  "to": "r2",
  "provider": "r2"
}
~~~~

Valid: promote-local-to-r2

~~~~
{
  "object_id": "med_01JAB2C3D4E5F6G7H8J9K0MNPQ",
  "app_id": "live",
  "class": "video",
  "action": "promote",
  "from": "local",
  "to": "r2",
  "provider": "r2"
}
~~~~

Rejected: leaks-title

~~~~
{
  "object_id": "med_01JAB2C3D4E5F6G7H8J9K0MNPQ",
  "app_id": "live",
  "class": "video",
  "action": "promote",
  "from": "local",
  "to": "r2",
  "provider": "r2",
  "title": "My stream"
}
~~~~

Rejected: unknown-action

~~~~
{
  "object_id": "med_01JAB2C3D4E5F6G7H8J9K0MNPQ",
  "app_id": "live",
  "class": "video",
  "action": "move",
  "from": "local",
  "to": "r2",
  "provider": "r2"
}
~~~~

## Validate

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