MediaAvatarAdoptResult media.avatar-adopt-result@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-result.v1.json

media.avatar-adopt-result@1: the answer of POST /internal/avatar-adopt on OpenVibe.Media: { ok: true, ref }, the active reference the slot now holds. A reference is released, never deleted, so Media keeps the history of the objects a person's picture moved through.

Fields

FieldTypeRequiredDescriptionConstraints
okconstyes
  • = true
refobjectyes
ref.idinteger | string
ref.object_idstringyesThe avatar object (med_…) the slot points at.
  • pattern ^med_
ref.subjectstring | nullThe person (usr_…) when the product knows it; Media refuses an object owned by someone else.
  • pattern ^usr_
ref.productstringyesThe product whose profile holds the picture: network (users.avatar_url) or live (its own users.avatar_url, a channel banner).
  • pattern ^[a-z][a-z0-9-]{1,31}$
ref.refstringyesThe slot in that product: the person's id there, or the id and the slot (for example 42:banner).
  • minLength 1
  • maxLength 64
ref.created_atstringyesWhen the slot started pointing at the object.
ref.released_atstring | nullAlways null in this answer: the reference is the active one.

Examples

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

Valid: active
{
  "ok": true,
  "ref": {
    "id": 7,
    "object_id": "med_01JC5Z8K2Q4X7V9B3N6M1R0T2Y",
    "subject": null,
    "product": "network",
    "ref": "42",
    "created_at": "2026-11-06 22:40:00",
    "released_at": null
  }
}
Rejected: no-ref
{
  "ok": true
}

Validate

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