LiveAvatarWriteRequest live.avatar-write-request@1

Generated at from openvibe-contracts v0.79.0 and openvibe-sdk v0.25.0.

Version
1.0.0
Owner
live
Visibility
first-party
Status
active
Compatibility
backward
Schema
https://openvibe.network/contracts/live/avatar-write-request.v1.json

live.avatar-write-request@1: the body of POST /internal/user-avatar on OpenVibe.Live (capability live.avatar.write). Network tells Live that a person's avatar changed — the avatar is network-wide, and Live keeps a copy on its own user row for stream cards, chat and profiles. The account is found by openvibenetwork_id (through linked_accounts) or, failing that, by username; avatar_url must be an https://openvibe.media/… address of at most 500 characters, and null clears the picture. Refusals are { ok: false, error }: 400 for a malformed URL, 404 when no Live user matches, 422 when the URL is not on openvibe.media.

Fields

FieldTypeRequiredDescriptionConstraints
openvibenetwork_idinteger | stringyesThe Network (SSO) user id; matched against linked_accounts. A Live id never goes here.
usernamestring | nullFallback when no linked account matches.
avatar_urlstring | nullyesAn https://openvibe.media/… picture; null clears the avatar.
  • pattern ^https://openvibe\.media/
  • maxLength 500

Examples

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

Valid: push
{
  "openvibenetwork_id": 4821,
  "username": "aurora",
  "avatar_url": "https://openvibe.media/p/hero-shot/screenshot"
}
Rejected: no-avatar
{
  "openvibenetwork_id": 4821,
  "username": "aurora"
}

Validate

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