---
title: "watch.watch-request@1 · OpenVibe.Services"
canonical: "https://openvibe.services/docs/contracts/watch.watch-request"
updated: null
---

# watch.watch-request@1 · OpenVibe.Services

HTML: [watch.watch-request@1 · OpenVibe.Services](https://openvibe.services/docs/contracts/watch.watch-request)

# WatchRequest `watch.watch-request@1`

Generated at 2026-12-01 05:42:00 UTC from [`openvibe-contracts v0.454.0`](https://github.com/OpenVibers/OpenVibe.Contracts/tree/v0.454.0) and [`openvibe-sdk v0.193.0`](https://github.com/OpenVibers/OpenVibe.SDK/tree/v0.193.0).

- Version: 1.0.0
- Owner: watch
- Visibility: first-party
- Status: planned
- Compatibility: backward
- Schema: [`https://openvibe.network/contracts/watch/watch-request.v1.json`](/docs/contracts/watch.watch-request.json)

watch.watch-request@1: the body of POST /api/v1/watches and PATCH /api/v1/watches/:id on OpenVibe.Watch (watch.watch.manage; the acting person). Every field is optional on a patch, project\_id included (null clears it); a create requires source, extraction, condition and action, which the service enforces in code (422 watch.invalid).

## Fields

| Field | Type | Required | Description | Constraints |
| --- | --- | --- | --- | --- |
| `name` | string |  |  | - `minLength 1`<br>- `maxLength 120` |
| `labels` | object |  |  |  |
| `project_id` | string \| null |  | The project the watch's project work belongs to (its run-job actions are billed to it). The acting person must be an admin or owner of the unarchived project: Watch checks with Network when it is saved (network.project.member.read; 403 project.not\_delegated otherwise) and OpenVibe.Run checks again at every job (ADR-003 amendment 2026-10-12). null clears it. | - `pattern ^prj_[0-9A-HJKMNP-TV-Z]{26}$` |
| `project_env` | enum |  | The project environment the watch's project secrets (ADR-056: a source credential's or a webhook action's secret\_ref) are looked up in. Defaults to production when the watch names a project; meaningless without one. | - `one of "sandbox", "production"` |
| `source` | `https://openvibe.network/contracts/watch/watch.v1.json#/$defs/source` |  |  |  |
| `cadence` | `https://openvibe.network/contracts/watch/watch.v1.json#/$defs/cadence` |  |  |  |
| `extraction` | `https://openvibe.network/contracts/watch/watch.v1.json#/$defs/extraction` |  |  |  |
| `comparison` | `https://openvibe.network/contracts/watch/watch.v1.json#/$defs/comparison` |  |  |  |
| `condition` | `https://openvibe.network/contracts/watch/watch.v1.json#/$defs/condition` |  |  |  |
| `action` | `https://openvibe.network/contracts/watch/watch.v1.json#/$defs/action` |  |  | - `minItems 1`<br>- `maxItems 8` |
| `budget` | `https://openvibe.network/contracts/watch/watch.v1.json#/$defs/budget` |  |  |  |
| `retention` | `https://openvibe.network/contracts/watch/watch.v1.json#/$defs/retention` |  |  |  |
| `status` | enum |  |  | - `one of "active", "paused", "disabled", "failed"` |

## Examples

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

 Valid: create-event-watch

~~~~
{
  "name": "Release 0.102.0 published",
  "source": {
    "kind": "event",
    "pattern": "host.release.published",
    "filter": null
  },
  "cadence": null,
  "extraction": {
    "kind": "json",
    "selector": null,
    "fields": null,
    "value_path": "$.release",
    "ai": null
  },
  "comparison": {
    "mode": "changed",
    "tolerance": null,
    "percent": null
  },
  "condition": {
    "op": "changed",
    "value": null,
    "for_sec": null
  },
  "action": [
    {
      "kind": "notification",
      "category": "service",
      "priority": "normal"
    }
  ],
  "budget": {
    "checks_per_day": 100,
    "usd_per_month": 0,
    "max_runtime_ms": 5000,
    "max_bytes": 1048576
  },
  "retention": {
    "observations_days": 30,
    "keep_snapshots": false
  },
  "status": "active"
}
~~~~

Valid: project-run-job

~~~~
{
  "name": "Rebuild the docs site on release",
  "source": {
    "kind": "event",
    "pattern": "host.release.published",
    "filter": null
  },
  "cadence": null,
  "extraction": {
    "kind": "json",
    "selector": null,
    "fields": null,
    "value_path": "$.release",
    "ai": null
  },
  "comparison": {
    "mode": "changed",
    "tolerance": null,
    "percent": null
  },
  "condition": {
    "op": "changed",
    "value": null,
    "for_sec": null
  },
  "action": [
    {
      "kind": "run-job",
      "class": "function",
      "artifact": {
        "name": "docs-build",
        "version": "1.4.0"
      },
      "args": {
        "site": "docs"
      },
      "limits": {
        "wall_ms": 120000,
        "cpu_ms": 60000,
        "mem_bytes": 268435456
      },
      "egress": "openvibe-only",
      "firing_arg": "firing"
    }
  ],
  "budget": {
    "checks_per_day": 100,
    "usd_per_month": 0,
    "max_runtime_ms": 5000,
    "max_bytes": 1048576
  },
  "retention": {
    "observations_days": 30,
    "keep_snapshots": false
  },
  "status": "active",
  "project_id": "prj_01JAB2C3D4E5F6G7H8J9K0MNPS"
}
~~~~

Valid: project-webhook-secret

~~~~
{
  "name": "Tell my server when the release changes",
  "source": {
    "kind": "event",
    "pattern": "host.release.published",
    "filter": null
  },
  "cadence": null,
  "extraction": {
    "kind": "json",
    "selector": null,
    "fields": null,
    "value_path": "$.release",
    "ai": null
  },
  "comparison": {
    "mode": "changed",
    "tolerance": null,
    "percent": null
  },
  "condition": {
    "op": "changed",
    "value": null,
    "for_sec": null
  },
  "action": [
    {
      "kind": "webhook",
      "url": "https://hooks.example.com/watch",
      "secret_ref": "webhook-signing"
    }
  ],
  "budget": {
    "checks_per_day": 100,
    "usd_per_month": 0,
    "max_runtime_ms": 5000,
    "max_bytes": 1048576
  },
  "retention": {
    "observations_days": 30,
    "keep_snapshots": false
  },
  "status": "active",
  "project_id": "prj_01JAB2C3D4E5F6G7H8J9K0MNPR",
  "project_env": "production"
}
~~~~

Rejected: bad-project-id

~~~~
{
  "name": "Rebuild the docs site on release",
  "source": {
    "kind": "event",
    "pattern": "host.release.published",
    "filter": null
  },
  "cadence": null,
  "extraction": {
    "kind": "json",
    "selector": null,
    "fields": null,
    "value_path": "$.release",
    "ai": null
  },
  "comparison": {
    "mode": "changed",
    "tolerance": null,
    "percent": null
  },
  "condition": {
    "op": "changed",
    "value": null,
    "for_sec": null
  },
  "action": [
    {
      "kind": "run-job",
      "class": "function",
      "artifact": {
        "name": "docs-build",
        "version": "1.4.0"
      },
      "args": {
        "site": "docs"
      },
      "limits": {
        "wall_ms": 120000,
        "cpu_ms": 60000,
        "mem_bytes": 268435456
      },
      "egress": "openvibe-only",
      "firing_arg": "firing"
    }
  ],
  "budget": {
    "checks_per_day": 100,
    "usd_per_month": 0,
    "max_runtime_ms": 5000,
    "max_bytes": 1048576
  },
  "retention": {
    "observations_days": 30,
    "keep_snapshots": false
  },
  "status": "active",
  "project_id": "project-1"
}
~~~~

Rejected: run-job-partial-limits

~~~~
{
  "name": "Rebuild the docs site on release",
  "source": {
    "kind": "event",
    "pattern": "host.release.published",
    "filter": null
  },
  "cadence": null,
  "extraction": {
    "kind": "json",
    "selector": null,
    "fields": null,
    "value_path": "$.release",
    "ai": null
  },
  "comparison": {
    "mode": "changed",
    "tolerance": null,
    "percent": null
  },
  "condition": {
    "op": "changed",
    "value": null,
    "for_sec": null
  },
  "action": [
    {
      "kind": "run-job",
      "class": "function",
      "artifact": {
        "name": "docs-build",
        "version": "1.4.0"
      },
      "args": {
        "site": "docs"
      },
      "limits": {
        "wall_ms": 120000
      },
      "egress": "openvibe-only",
      "firing_arg": "firing"
    }
  ],
  "budget": {
    "checks_per_day": 100,
    "usd_per_month": 0,
    "max_runtime_ms": 5000,
    "max_bytes": 1048576
  },
  "retention": {
    "observations_days": 30,
    "keep_snapshots": false
  },
  "status": "active",
  "project_id": "prj_01JAB2C3D4E5F6G7H8J9K0MNPS"
}
~~~~

Rejected: unknown-status

~~~~
{
  "name": "Release 0.102.0 published",
  "source": {
    "kind": "event",
    "pattern": "host.release.published"
  },
  "condition": {
    "op": "changed"
  },
  "action": [
    {
      "kind": "notification"
    }
  ],
  "status": "archived"
}
~~~~

Rejected: webhook-without-secret

~~~~
{
  "name": "Tell my server when the release changes",
  "source": {
    "kind": "event",
    "pattern": "host.release.published",
    "filter": null
  },
  "cadence": null,
  "extraction": {
    "kind": "json",
    "selector": null,
    "fields": null,
    "value_path": "$.release",
    "ai": null
  },
  "comparison": {
    "mode": "changed",
    "tolerance": null,
    "percent": null
  },
  "condition": {
    "op": "changed",
    "value": null,
    "for_sec": null
  },
  "action": [
    {
      "kind": "webhook",
      "url": "https://hooks.example.com/watch"
    }
  ],
  "budget": {
    "checks_per_day": 100,
    "usd_per_month": 0,
    "max_runtime_ms": 5000,
    "max_bytes": 1048576
  },
  "retention": {
    "observations_days": 30,
    "keep_snapshots": false
  },
  "status": "active",
  "project_id": "prj_01JAB2C3D4E5F6G7H8J9K0MNPR",
  "project_env": "production"
}
~~~~

## Validate

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