RunSessionCreateRequest run.session-create-request@1

Generated at from openvibe-contracts v0.419.0 and openvibe-sdk v0.161.0.

Version
1.0.0
Owner
run
Visibility
public
Status
active
Compatibility
backward
Schema
https://openvibe.network/contracts/run/session-create-request.v1.json

run.session-create-request@1 (the Desks plan's D6): the body of POST /api/v1/sessions on OpenVibe.Run (capability run.session.create), answered 201 with run.session@1 (state placing). The session is the caller's own: a person's token, or a first-party service acting for a person (X-OV-Subject; the service is recorded as via). MACHINE names one of the person's own machines (an OpenVibe.Bot device they own and let agents use): the session goes there or ends unplaceable, never elsewhere. Without it Run places the desk: on the person's own machines when REQUIREMENTS name user-owned (and only theirs), else on desk hosts that serve other people (first-party, then community, unless REQUIREMENTS narrow it), each of whose desks runs in its own sandbox. Absent REQUIREMENTS mean { kind: run.browser, mobility: session, latency_class: interactive, objective: balanced }. TTL_S (default 3600) and IDLE_S (default 900) bound its life. IDEMPOTENCY_KEY: a repeat from the same person within 24 h with an identical body answers the first session (200); with a different body 409 run.idempotency.conflict.

Fields

FieldTypeRequiredDescriptionConstraints
kindconstyes
  • = "browser"
widthhttps://openvibe.network/contracts/run/session.v1.json#/$defs/size/properties/widthDefault 1280.
heighthttps://openvibe.network/contracts/run/session.v1.json#/$defs/size/properties/heightDefault 800.
ttl_shttps://openvibe.network/contracts/run/session.v1.json#/properties/ttl_sDefault 3600.
idle_shttps://openvibe.network/contracts/run/session.v1.json#/properties/idle_sDefault 900.
machinestringOne of the person's own machines, by its OpenVibe.Bot id; the session goes there or nowhere.
  • pattern ^dev_[0-9A-HJKMNP-TV-Z]{26}$
originsarray of stringExact HTTP(S) origins allowed for this browser session. Run fixes the list at creation and places it only on a user-owned desk that can enforce it. This option is owner switched off by default.
  • maxItems 32
  • items: pattern ^https?://
  • items: minLength 8
  • items: maxLength 2048
requirementsplatform.workload-requirements
idempotency_keyhttps://openvibe.network/contracts/run/session.v1.json#/$defs/idempotency_key
task_idstringThe OpenVibe.Actor task that asks for this session (plan 2026-11-07: one id across Surf, Computer and Actor). It is carried back on run.session@1, so the session and the task point at each other.
  • pattern ^tsk_[0-9A-HJKMNP-TV-Z]{26}$

Examples

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

Valid: community-only
{
  "kind": "browser",
  "requirements": {
    "kind": "run.browser",
    "mobility": "session",
    "latency_class": "interactive",
    "objective": "cheapest",
    "trust": [
      "community"
    ]
  }
}
Valid: default
{
  "kind": "browser"
}
Valid: own-machine
{
  "kind": "browser",
  "width": 1440,
  "height": 900,
  "ttl_s": 1800,
  "idle_s": 600,
  "machine": "dev_01J8Z4M2Q0R7T9YV3K6N8P1W2X",
  "idempotency_key": "actor:tsk_01JD2C3D4E5F6G7H8J9K0MNPQR"
}
Rejected: no-kind
{
  "width": 1280
}
Rejected: robot-id
{
  "kind": "browser",
  "machine": "rob_01J8Z4M2Q0R7T9YV3K6N8P1W2X"
}
Rejected: too-long
{
  "kind": "browser",
  "ttl_s": 86400
}

Validate

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