MediaAvatarAdoptRequest media.avatar-adopt-request@1
Generated at from
openvibe-contracts v0.419.0 and
openvibe-sdk v0.161.0.
- Version
- 1.0.0
- Owner
- media
- Visibility
- first-party
- Status
- active
- Compatibility
- backward
- Schema
https://openvibe.network/contracts/media/avatar-adopt-request.v1.json
media.avatar-adopt-request@1: the body of POST /internal/avatar-adopt on OpenVibe.Media (capability media.avatar.adopt). A product records that one of its profile slots points at an avatar object, so a cleanup can never delete the picture a working profile shows (incident 2026-11-06: eleven avatars were deleted with the public screenshot copies). Recording a slot releases the slot's previous reference in the same transaction. Ingest records the reference itself; this route is for a picture the product already holds. Refusals are { ok: false, error }: 400 without object_id, product or ref, 404 for an unknown object, 409 for an object that is not ready, 422 for an object that is not an avatar or belongs to someone else.
Fields
| Field | Type | Required | Description | Constraints |
|---|---|---|---|---|
object_id | string | yes | The avatar object (med_…) the slot points at. |
|
product | string | yes | The product whose profile holds the picture: network (users.avatar_url) or live (its own users.avatar_url, a channel banner). |
|
ref | string | yes | The slot in that product: the person's id there, or the id and the slot (for example 42:banner). |
|
subject | string | null | The person (usr_…) when the product knows it; Media refuses an object owned by someone else. |
|
Examples
From the contract's own test fixtures: valid ones validate, rejected ones must fail.
Valid: live-banner
{
"object_id": "med_01JC5Z8K2Q4X7V9B3N6M1R0T2Y",
"product": "live",
"ref": "42:banner"
}Valid: network-profile
{
"object_id": "med_01JC5Z8K2Q4X7V9B3N6M1R0T2Y",
"product": "network",
"ref": "42",
"subject": "usr_01JC5Z8K2Q4X7V9B3N6M1R0T2Y"
}Rejected: no-ref
{
"object_id": "med_01JC5Z8K2Q4X7V9B3N6M1R0T2Y",
"product": "network"
}Rejected: not-an-object
{
"object_id": "https://example.com/a.png",
"product": "network",
"ref": "42"
}Validate
const contracts = require('openvibe-contracts');
contracts.validate('media.avatar-adopt-request@1', value); // { valid, errors: [{ path, message }] }