---
title: "network.machine.roles_changed@1 · OpenVibe.Services"
canonical: "https://openvibe.services/docs/contracts/network.machine.roles_changed"
updated: null
---

# network.machine.roles\_changed@1 · OpenVibe.Services

HTML: [network.machine.roles\_changed@1 · OpenVibe.Services](https://openvibe.services/docs/contracts/network.machine.roles_changed)

# NetworkMachineRolesChangedPayload `network.machine.roles_changed@1`

Generated at 2026-11-13 06:25:48 UTC from [`openvibe-contracts v0.419.0`](https://github.com/OpenVibers/OpenVibe.Contracts/tree/v0.419.0) and [`openvibe-sdk v0.161.0`](https://github.com/OpenVibers/OpenVibe.SDK/tree/v0.161.0).

- Version: 1.0.0
- Owner: network
- Visibility: first-party
- Status: active
- Compatibility: backward
- Schema: [`https://openvibe.network/contracts/events/payloads/network.machine.roles_changed.v1.json`](/docs/contracts/network.machine.roles_changed.json)

network.machine.roles\_changed v1 (OpenVibe.Network, plan L34, step M4). A machine's roles changed: the whole set after the change, from the catalogue (network.machine-roles@1). The machine applies them at its next check-in, so this event says what was asked for, not what the machine has already done. Envelope: subject { type: machine, id: <dev\_…> }, visibility internal, actor service:network.

## Fields

| Field | Type | Required | Description | Constraints |
| --- | --- | --- | --- | --- |
| `machine_id` | string | yes |  | - `pattern ^dev_[0-9A-HJKMNP-TV-Z]{26}$` |
| `owner` | string | yes | The person the machine belongs to. | - `pattern ^usr_[0-9A-HJKMNP-TV-Z]{26}$` |
| `roles` | array of string | yes | The machine's roles after the change. | - `unique items`<br>- `items: pattern ^[a-z][a-z0-9-]*\.[a-z][a-z0-9-]*$` |
| `changed_by` | string |  | Who asked for the change: the person, or an app acting with their consent. | - `pattern ^(usr_[0-9A-HJKMNP-TV-Z]{26}\|app:[a-z0-9-]+)$` |
| `at` | string | yes |  | - `format date-time` |

## Examples

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

 Valid: changed

~~~~
{
  "machine_id": "dev_01JAB2C3D4E5F6G7H8J9K0MNPS",
  "owner": "usr_01JAB2C3D4E5F6G7H8J9K0MNPS",
  "roles": [
    "codes.worker",
    "ai.host"
  ],
  "changed_by": "usr_01JAB2C3D4E5F6G7H8J9K0MNPS",
  "at": "2026-10-31T09:00:00.000Z"
}
~~~~

Rejected: bad-role

~~~~
{
  "machine_id": "dev_01JAB2C3D4E5F6G7H8J9K0MNPS",
  "owner": "usr_01JAB2C3D4E5F6G7H8J9K0MNPS",
  "roles": [
    "nope"
  ],
  "at": "2026-10-31T09:00:00.000Z"
}
~~~~

## Validate

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