NetworkAvatarWriteRequest network.avatar-write-request@1

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

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

network.avatar-write-request@1: the body of POST /internal/user-avatar on OpenVibe.Network (capability network.avatar.write, held by the site a person picked the avatar on; Live posts here through its notify helper). Adopts the picture as the account's avatar and fans it out to the other sites. Only an openvibe.media address is accepted, so an avatar can never be a tracking pixel or a third-party file. Refusals are { error }: 400 without a user_id, 404 for an unknown user, 422 for anything but an openvibe.media address, 503 while the avatar service is down.

Fields

FieldTypeRequiredDescriptionConstraints
user_idintegeryesThe Network (SSO) user id.
  • minimum 1
avatar_urlstring | nullyesAn https://openvibe.media/… picture; null clears the avatar.
  • pattern ^https://openvibe\.media/
  • maxLength 500
originstringWho asked ('live', 'network'); kept in the audit row and used to avoid echoing a push back.
  • maxLength 40

Examples

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

Valid: live-pick
{
  "user_id": 4821,
  "avatar_url": "https://openvibe.media/p/hero-shot/screenshot",
  "origin": "live"
}
Rejected: no-user
{
  "avatar_url": "https://openvibe.media/p/hero-shot/screenshot",
  "origin": "live"
}

Validate

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