Skip to content

JSON Schemas

This page documents all JSON schemas used by the RCL compiler for validation and tooling support.

All schemas are served from https://rcl.rcsagents.io/schemas/ and can be used in $schema properties for validation.

{
"$schema": "https://rcl.rcsagents.io/schemas/rcl-output.schema.json",
"agent": { /* ... */ },
"flows": { /* ... */ },
"messages": { /* ... */ }
}
{
"$schema": "https://rcl.rcsagents.io/schemas/csm/machine-definition.schema.json",
"id": "MainFlow",
"initial": "Welcome",
"states": { /* ... */ }
}

The RCL compiler produces output following this structure:

{
"$schema": "https://rcl.rcsagents.io/schemas/rcl-output.schema.json",
"agent": {
"name": "AgentName",
"displayName": "Display Name",
"config": { /* Agent configuration */ },
"defaults": { /* Default values */ }
},
"flows": {
"FlowId": {
"$schema": "https://rcl.rcsagents.io/schemas/csm/machine-definition.schema.json",
"id": "FlowId",
"initial": "InitialState",
"states": { /* State definitions */ }
}
},
"messages": {
"MessageId": {
"type": "text|richCard|carousel",
"text": "Message content",
"suggestions": [ /* Suggestions array */ ]
}
}
}

Flows use the Conversation State Machine format:

{
"id": "MainFlow",
"initial": "Welcome",
"states": {
"Welcome": {
"transitions": [
{
"pattern": "order_coffee",
"target": "OrderCoffee",
"context": { "category": "order" }
},
{
"pattern": ":default",
"target": "Welcome"
}
],
"meta": {
"messageId": "WelcomeMessage"
}
}
}
}

Messages use a simplified, flat structure:

{
"type": "richCard",
"title": "Welcome",
"description": "How can we help you?",
"suggestions": [
{
"type": "reply",
"text": "Order Coffee",
"postbackData": "order_coffee"
}
],
"messageTrafficType": "PROMOTION"
}

Add $schema properties to your JSON files for validation and autocomplete:

{
"$schema": "https://rcl.rcsagents.io/schemas/rcl-output.schema.json",
// Your content here...
}

Use JSON Schema validators to check compliance:

Terminal window
# Using ajv-cli
npx ajv validate -s https://rcl.rcsagents.io/schemas/rcl-output.schema.json -d output.json
# Using jsonschema (Python)
jsonschema -i output.json https://rcl.rcsagents.io/schemas/rcl-output.schema.json

Schemas are versioned and backward compatibility is maintained where possible:

  • Breaking changes will result in new schema URLs
  • Non-breaking additions may be made to existing schemas
  • Deprecated fields will be marked but maintained for compatibility

Schema files are located in:

  • /schemas/ - Main schemas
  • /packages/csm/schema/ - CSM-specific schemas

When updating schemas:

  1. Ensure backward compatibility
  2. Update documentation
  3. Run validation tests
  4. Update examples