SourcesSourceWriteRequest sources.source-write-request@1

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

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

sources.source-write-request@1: bodies of sources.source.manage on OpenVibe.Sources. POST /api/v1/sources registers a source (key, name, type and category required; the other sources.source@1 fields take their defaults; endpoints may be given as bare URLs; a manual source has none, any other at least one) and PATCH /api/v1/sources/:key changes one (merged over the stored source and validated again; key never changes, type not once it has items). Both refuse unknown fields. POST /api/v1/sources/:key/items adds an item to a manual source: url (the evidence) and title required. DELETE /api/v1/items/:id takes { reason } (takedown, licence, error…). DELETE /api/v1/sources/:key (only a source that never produced an item) and POST /api/v1/sources/:key/fetch take no body.

Fields

This schema has no named fields.

Examples

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

Valid: manual-item
{
  "url": "https://city.example.gov/notices/2026-114",
  "title": "Road closure on 5th Street",
  "kind": "notice",
  "published_at": "2026-09-24",
  "fields": {
    "street": "5th",
    "days": 3
  }
}
Valid: register
{
  "key": "example-news",
  "name": "Example News",
  "type": "rss",
  "category": "news",
  "homepage_url": "https://news.example.com/",
  "endpoints": [
    "https://news.example.com/feed.xml"
  ],
  "poll_interval_sec": 900,
  "enabled": false
}
Valid: remove-item
{
  "reason": "takedown request from the publisher"
}
Rejected: unknown-field
{
  "key": "example-news",
  "name": "Example News",
  "type": "rss",
  "category": "news",
  "password": "hunter2"
}

Validate

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