Network Schema Authoring Guide
Use this guide when creating a new network schema for a real use case.
Start With The Business Model
Section titled “Start With The Business Model”Before writing JSON, answer these questions:
- What network are you creating?
- Which actors participate?
- Which actor records need to be discoverable?
- Which interactions are allowed?
- Which payload is needed to request each interaction?
- Which event/status payload should be produced after the interaction changes?
- Which instances serve each actor/domain?
Step 1: Define Domains
Section titled “Step 1: Define Domains”Each domain should represent a stable role in the network.
Good examples:
studenttutorseekerprovidercase_workerfarmertravel_agent
Avoid making domains too narrow. Use item schema fields for details such as service type, city, category, crop, skill, or subject.
Step 2: Define Item Types
Section titled “Step 2: Define Item Types”An item_type is the schema id for the record being published.
Use versioned names:
profile_1.0profile_1.1job_posting_1.0service_listing_1.0trip_package_1.0crop_advisory_request_1.0
Avoid loose names:
profilejobdata
Step 3: Add item_schemas
Section titled “Step 3: Add item_schemas”Each domain exposes a map of item types to JSON Schemas.
{ "id": "seeker", "minimum_cache_ttl_seconds": 300, "item_schemas": { "profile_1.0": { "$schema": "https://json-schema.org/draft/2020-12/schema", "type": "object", "required": ["name", "skills"], "properties": { "name": { "type": "string" }, "skills": { "type": "array", "items": { "type": "string" } }, "phone": { "type": "string", "private": true } } } }}Current API behavior:
POST /api/v1/item/createrejects unknown item typesitem_stateis validated against the selected schema- missing partitions can be created lazily by the API
GET /api/v1/network/schema/:network/:domain/:itemTypeexposes the concrete schema
Step 4: Add Instances
Section titled “Step 4: Add Instances”Instances tell the network which API serves a domain.
{ "domain_id": "provider", "instance_name": "Blue Dot Provider", "instance_url": "https://provider.bluedot.example.com", "custom_item_schema_urls": { "job_posting_1.1": "https://provider.bluedot.example.com/schemas/job_posting_1.1.json" }}Current API behavior:
- network fetch discovers instances by domain
- source action calls validate target instance URLs
custom_item_schema_urlscan override item schemas per instance
Step 5: Define Actions
Section titled “Step 5: Define Actions”An action defines a named business interaction and one or more allowed domain pairs.
{ "apply": { "description": "A seeker applies to a provider's job posting.", "interactions": [ { "from_domain": "seeker", "to_domain": "provider", "requirement_schema": { "type": "object", "required": ["job_id", "cover_note"], "properties": { "job_id": { "type": "string" }, "cover_note": { "type": "string" } } }, "event_schema": { "type": "object", "required": ["status", "remark"], "properties": { "status": { "type": "string" }, "remark": { "type": "string" } } } } ] }}Use requirement_schema for the request payload. Use event_schema for status/event updates.
Step 6: Add Cache Policy
Section titled “Step 6: Add Cache Policy”Every domain can define minimum_cache_ttl_seconds.
{ "id": "provider", "minimum_cache_ttl_seconds": 300}This gives the network administrator a baseline rule for inter-instance item fetch caching.
Step 7: Test With The API
Section titled “Step 7: Test With The API”Use this sequence:
- configure
SERVED_DOMAINS - set
NETWORK_CONFIG_SOURCE - start the API
- call
POST /api/v1/network/refetch_schemas - create an item with
POST /api/v1/item/create - fetch local items with
GET /api/v1/item/fetch - fetch network items with
GET /api/v1/network/item/fetch - perform an action with
POST /api/v1/action/perform - update action status with
POST /api/v1/action/update-status
Final Authoring Rules
Section titled “Final Authoring Rules”- networks define contracts, not only examples
- domains define stable roles
item_typevalues are schema identifiers- actions declare permission and payload shape together
- instances are explicit and enumerable
- cache policy belongs in the network contract
- continuous flows should use multiple action types instead of overloading one action with every step