MediaAvatarIngestRequest media.avatar-ingest-request@1

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

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

media.avatar-ingest-request@1: the body of POST /internal/avatar-ingest on OpenVibe.Media (capability media.avatar.ingest; Network calls it while adopting an avatar a person pointed at somewhere else on the web). Media fetches the URL once through its egress guard (https only, public addresses only, at most 8 MB and 10 s), re-encodes it to a 512×512 WebP and stores it as an unlisted screenshot paste owned by user_id, so no OpenVibe site ever serves or stores a third-party address. Refusals are { ok: false, error } (400 without url or user_id, 422 when the link is not a usable picture).

Fields

FieldTypeRequiredDescriptionConstraints
urlstringyesThe https address of the picture to import.
user_idinteger | stringyesThe account that owns the stored paste.
usernamestring | nullUsed only for the paste title.

Examples

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

Valid: import
{
  "url": "https://cdn.example.com/me.png",
  "user_id": 4821,
  "username": "aurora"
}
Rejected: no-url
{
  "user_id": 4821,
  "username": "aurora"
}

Validate

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