OpenreStreamWriteRequest openre.stream-write-request@1

Generated at from openvibe-contracts v0.53.0 and openvibe-sdk v0.11.0.

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

openre.stream-write-request@1: the body of POST /api/v1/streams and PATCH /api/v1/streams/:id on OpenRe.Stream (openre.stream.write). A person creates streams for themselves; a service names the owner with X-OV-Subject (or owner_subject, which must then match). title is cleaned and cut to 140 characters (Untitled stream when blank), description to 2000; protocols is a non-empty subset of rtmp, whip, webrtc, jsmpeg; external_refs (create only, at most 10, each bound to one stream) link it to another service's record, e.g. { service: live, type: managed_stream, id: 12 }; state (update only) is active or disabled. Fields left out keep their value. DELETE /api/v1/streams/:id (archive; refused while live) takes no body. Refusals are 400 openre.invalid_* and 409 openre.ref_taken / openre.stream_live.

Fields

This schema has no named fields.

Examples

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

Valid: create
{
  "title": "Main cam",
  "protocols": [
    "rtmp",
    "whip"
  ],
  "recording_mode": "vod",
  "external_refs": [
    {
      "service": "live",
      "type": "managed_stream",
      "id": "12"
    }
  ]
}
Rejected: no-protocols
{
  "protocols": []
}

Validate

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