JJijibora Docs
docs.jijibora.online
On this page (26 sections)

Community starter desk — OpenAPI 1.0.0

<!-- GENERATED by scripts/render-platform-map-api-docs.mjs — do not hand-edit; edit apps/agent-bff/openapi/<spec>.json and re-run. --> Scope: The published reference for Community starter desk. 22 paths — the measured spec-vs-implementation coverage lives in the complete API inventory. Status: rendered 2026-11-09 from the OpenAPI source for Community starter desk — regenerate with node scripts/render-platform-map-api-docs.mjs. See also: the OpenAPI spec index.

Paths — 22 paths / 22 operations

MethodPathOperation IDSummary
POST/v1/soko/gatewaypostSokoboraGatewayExecute capability via unified gateway
POST/v1/community/starter/messagespostCommunityStarterMessageCreate a claim from an inbound resident message
GET/v1/communities/{orgId}/starter/deskgetCommunityStarterDeskList starter claims for one organization
POST/v1/community/starter/dispatchpostCommunityStarterDispatchStart the KV scenario on Kestra and Camel
POST/v1/admin/tenants/provisionpostCommunityTenantProvisionCreate an organization and scope in community_os, then a Keycloak client
POST/v1/ops/alerts/alertmanagerpostAlertmanagerReceiverForward an Alertmanager payload only when COMMUNITY_ALERT_RECEIVER_URL is set
GET/v1/governance/divergencesgetGovernanceDivergencesRead break-glass divergence claims. Empty is an empty list.
POST/v1/community/buildings/eventspostBuildingEventIngest a building event (GTM-12). Creates a claim from lookup CNS type. Accepts legacy body or canonical envelope v1.
GET/v1/communities/{orgId}/buildings/{buildingId}/eventsgetBuildingEventsList stored building claims for one building (GTM-12). Empty is an empty array.
POST/v1/community/buildings/{buildingId}/reflexpostBuildingReflexRun reflex via Kestra and Camel (GTM-12). Governed actions start a PoCE session.
POST/v1/community/sourcing/requestspostSourcingRequirementCreate sourcing requirement claim (GTM-13). Accepts legacy body or canonical envelope v1.
GET/v1/communities/{orgId}/sourcinggetCommunitySourcingList sourcing claims for one organization (GTM-13).
POST/v1/community/sourcing/{requestId}/solvepostSourcingSolveSolve via Solver Gateway and scatter (GTM-13). Fails closed if solver down.
POST/v1/community/safety/sospostMarsIceSosCreate MARS ICE incident from panic button (GTM-14). Accepts legacy body or canonical envelope v1.
GET/v1/communities/{orgId}/safety/incidentsgetMarsIceIncidentsList MARS ICE incidents for one organization (GTM-14).
POST/v1/community/safety/{incidentId}/dispatchpostMarsIceDispatchDispatch via Kestra/Camel (GTM-14). Governed actions start PoCE.
POST/v1/community/properties/{propertyId}/events/{eventId}/completepostPropertyEventCompleteComplete a property event claim (R2).
POST/v1/community/sourcing/offerspostSourcingOfferCreate sourcing offer claim (R3).
POST/v1/community/sourcing/{requestId}/bindpostSourcingBindBind a requirement to an offer (R2).
POST/v1/community/safety/{incidentId}/resolvepostMarsIceResolveResolve a MARS ICE incident (R2).
GET/v1/community/properties/{propertyId}/events/{eventId}getPropertyEventGet a single property event claim (R5).
GET/v1/community/healthgetCommunityHealthEngine reachability + live_gate_met (R7).

Operations

POST /v1/soko/gateway

Summary: Execute capability via unified gateway

Operation ID: postSokoboraGateway Request body:

Content type: application/json

FieldTypeNotes
capabilitystring
actionstring
integrationstring
payloadobject

Responses:

StatusMeaning
200Gateway result from the resolved integration
503Upstream unavailable

POST /v1/community/starter/messages

Summary: Create a claim from an inbound resident message

Operation ID: postCommunityStarterMessage Request body:

Content type: application/json

FieldTypeNotes
org_idstring
message_idstring
kindstring
textstring
channelstring
wa_idstring

Responses:

StatusMeaning
201Claim created
422Missing field, unknown kind, or unregistered CNS type
503Lookup or claim store unavailable

GET /v1/communities/{orgId}/starter/desk

Summary: List starter claims for one organization

Operation ID: getCommunityStarterDesk

Parameters:

NameInRequiredTypeNotes
orgIdpathyesstring

Responses:

StatusMeaning
200data array of stored claims. Empty is an empty array.
503Lookup or claim store unavailable

POST /v1/community/starter/dispatch

Summary: Start the KV scenario on Kestra and Camel

Operation ID: postCommunityStarterDispatch Responses:

StatusMeaning
202Dispatch accepted by both engines named in the scenario
422Missing pins or missing payment proof
503Kestra or Camel unavailable

POST /v1/admin/tenants/provision

Summary: Create an organization and scope in community_os, then a Keycloak client

Operation ID: postCommunityTenantProvision Responses:

StatusMeaning
200dry_run plan. provision_live is false.
201provisioned true after organization, scope, and Keycloak succeed
503Keycloak or the claim store is down. provisioned is false.

POST /v1/ops/alerts/alertmanager

Summary: Forward an Alertmanager payload only when COMMUNITY_ALERT_RECEIVER_URL is set

Operation ID: postAlertmanagerReceiver Responses:

StatusMeaning
202sent true
422sent false because the receiver URL is empty
503sent false because the receiver refused the post

GET /v1/governance/divergences

Summary: Read break-glass divergence claims. Empty is an empty list.

Operation ID: getGovernanceDivergences Responses:

StatusMeaning
200data array

POST /v1/community/buildings/events

Summary: Ingest a building event (GTM-12). Creates a claim from lookup CNS type. Accepts legacy body or canonical envelope v1.

Operation ID: postBuildingEvent Request body:

Content type: application/json

FieldTypeNotes

Responses:

StatusMeaning
200Idempotent replay (claim already exists)
201Claim created
422Missing field, unknown event kind, unregistered CNS type, or invalid envelope
503Lookup or claim store unavailable

GET /v1/communities/{orgId}/buildings/{buildingId}/events

Summary: List stored building claims for one building (GTM-12). Empty is an empty array.

Operation ID: getBuildingEvents Responses:

StatusMeaning
200data array of stored claims

POST /v1/community/buildings/{buildingId}/reflex

Summary: Run reflex via Kestra and Camel (GTM-12). Governed actions start a PoCE session.

Operation ID: postBuildingReflex Responses:

StatusMeaning
202Dispatch accepted by both engines
422Missing field or missing rule pins
503Kestra or Camel unavailable

POST /v1/community/sourcing/requests

Summary: Create sourcing requirement claim (GTM-13). Accepts legacy body or canonical envelope v1.

Operation ID: postSourcingRequirement Request body:

Content type: application/json

FieldTypeNotes

Responses:

StatusMeaning
200Idempotent replay
201Claim created
422Unknown requirement type or invalid envelope
503Store unavailable

GET /v1/communities/{orgId}/sourcing

Summary: List sourcing claims for one organization (GTM-13).

Operation ID: getCommunitySourcing Responses:

StatusMeaning
200data array

POST /v1/community/sourcing/{requestId}/solve

Summary: Solve via Solver Gateway and scatter (GTM-13). Fails closed if solver down.

Operation ID: postSourcingSolve Responses:

StatusMeaning
202Solve dispatched
503Solver or Kestra unavailable

POST /v1/community/safety/sos

Summary: Create MARS ICE incident from panic button (GTM-14). Accepts legacy body or canonical envelope v1.

Operation ID: postMarsIceSos Request body:

Content type: application/json

FieldTypeNotes

Responses:

StatusMeaning
200Idempotent replay
201Incident created
422Unknown channel or invalid envelope
503Store unavailable

GET /v1/communities/{orgId}/safety/incidents

Summary: List MARS ICE incidents for one organization (GTM-14).

Operation ID: getMarsIceIncidents Responses:

StatusMeaning
200data array

POST /v1/community/safety/{incidentId}/dispatch

Summary: Dispatch via Kestra/Camel (GTM-14). Governed actions start PoCE.

Operation ID: postMarsIceDispatch Responses:

StatusMeaning
202Dispatch accepted
503Kestra or Camel unavailable

POST /v1/community/properties/{propertyId}/events/{eventId}/complete

Summary: Complete a property event claim (R2).

Operation ID: postPropertyEventComplete Responses:

StatusMeaning
202Completed
422Missing field or claim not found
503Store unavailable

POST /v1/community/sourcing/offers

Summary: Create sourcing offer claim (R3).

Operation ID: postSourcingOffer Responses:

StatusMeaning
201Offer created
422Missing field
503Store unavailable

POST /v1/community/sourcing/{requestId}/bind

Summary: Bind a requirement to an offer (R2).

Operation ID: postSourcingBind Responses:

StatusMeaning
202Bound
422Missing field or claim not found
503Store unavailable

POST /v1/community/safety/{incidentId}/resolve

Summary: Resolve a MARS ICE incident (R2).

Operation ID: postMarsIceResolve Responses:

StatusMeaning
202Resolved
422Missing field or claim not found
503Store unavailable

GET /v1/community/properties/{propertyId}/events/{eventId}

Summary: Get a single property event claim (R5).

Operation ID: getPropertyEvent Responses:

StatusMeaning
200Claim
404Not found

GET /v1/community/health

Summary: Engine reachability + live_gate_met (R7).

Operation ID: getCommunityHealth Responses:

StatusMeaning
200All engines reachable
503One or more engines down

Full specification — verbatim source of truth

{
  "openapi": "3.0.3",
  "info": {
    "title": "Community starter desk",
    "version": "1.0.0",
    "description": "Routes the community starter desk calls. Gateway execution stays POST /v1/soko/gateway, specified in sokobora-sourcing-v1.json. This document does not define a sample ticket server."
  },
  "paths": {
    "/v1/soko/gateway": {
      "post": {
        "operationId": "postSokoboraGateway",
        "summary": "Execute capability via unified gateway",
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "required": [
                  "capability",
                  "action"
                ],
                "properties": {
                  "capability": {
                    "type": "string"
                  },
                  "action": {
                    "type": "string"
                  },
                  "integration": {
                    "type": "string"
                  },
                  "payload": {
                    "type": "object"
                  }
                }
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Gateway result from the resolved integration"
          },
          "503": {
            "description": "Upstream unavailable"
          }
        }
      }
    },
    "/v1/community/starter/messages": {
      "post": {
        "operationId": "postCommunityStarterMessage",
        "summary": "Create a claim from an inbound resident message",
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "required": [
                  "org_id",
                  "message_id",
                  "kind",
                  "text"
                ],
                "properties": {
                  "org_id": {
                    "type": "string"
                  },
                  "message_id": {
                    "type": "string"
                  },
                  "kind": {
                    "type": "string"
                  },
                  "text": {
                    "type": "string"
                  },
                  "channel": {
                    "type": "string"
                  },
                  "wa_id": {
                    "type": "string"
                  }
                }
              }
            }
          }
        },
        "responses": {
          "201": {
            "description": "Claim created"
          },
          "422": {
            "description": "Missing field, unknown kind, or unregistered CNS type"
          },
          "503": {
            "description": "Lookup or claim store unavailable"
          }
        }
      }
    },
    "/v1/communities/{orgId}/starter/desk": {
      "get": {
        "operationId": "getCommunityStarterDesk",
        "summary": "List starter claims for one organization",
        "parameters": [
          {
            "name": "orgId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "data array of stored claims. Empty is an empty array."
          },
          "503": {
            "description": "Lookup or claim store unavailable"
          }
        }
      }
    },
    "/v1/community/starter/dispatch": {
      "post": {
        "operationId": "postCommunityStarterDispatch",
        "summary": "Start the KV scenario on Kestra and Camel",
        "responses": {
          "202": {
            "description": "Dispatch accepted by both engines named in the scenario"
          },
          "422": {
            "description": "Missing pins or missing payment proof"
          },
          "503": {
            "description": "Kestra or Camel unavailable"
          }
        }
      }
    },
    "/v1/admin/tenants/provision": {
      "post": {
        "operationId": "postCommunityTenantProvision",
        "summary": "Create an organization and scope in community_os, then a Keycloak client",
        "responses": {
          "200": {
            "description": "dry_run plan. provision_live is false."
          },
          "201": {
            "description": "provisioned true after organization, scope, and Keycloak succeed"
          },
          "503": {
            "description": "Keycloak or the claim store is down. provisioned is false."
          }
        }
      }
    },
    "/v1/ops/alerts/alertmanager": {
      "post": {
        "operationId": "postAlertmanagerReceiver",
        "summary": "Forward an Alertmanager payload only when COMMUNITY_ALERT_RECEIVER_URL is set",
        "responses": {
          "202": {
            "description": "sent true"
          },
          "422": {
            "description": "sent false because the receiver URL is empty"
          },
          "503": {
            "description": "sent false because the receiver refused the post"
          }
        }
      }
    },
    "/v1/governance/divergences": {
      "get": {
        "operationId": "getGovernanceDivergences",
        "summary": "Read break-glass divergence claims. Empty is an empty list.",
        "responses": {
          "200": {
            "description": "data array"
          }
        }
      }
    },
    "/v1/community/buildings/events": {
      "post": {
        "operationId": "postBuildingEvent",
        "summary": "Ingest a building event (GTM-12). Creates a claim from lookup CNS type. Accepts legacy body or canonical envelope v1.",
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "oneOf": [
                  {
                    "$ref": "#/components/schemas/CanonicalEnvelope"
                  },
                  {
                    "type": "object",
                    "required": [
                      "org_id",
                      "building_id",
                      "event_id",
                      "event_kind",
                      "event"
                    ],
                    "properties": {
                      "org_id": {
                        "type": "string"
                      },
                      "building_id": {
                        "type": "string"
                      },
                      "event_id": {
                        "type": "string"
                      },
                      "event_kind": {
                        "type": "string",
                        "enum": [
                          "weather",
                          "power",
                          "water",
                          "safety",
                          "occupancy"
                        ]
                      },
                      "event": {
                        "type": "string"
                      }
                    }
                  }
                ]
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Idempotent replay (claim already exists)"
          },
          "201": {
            "description": "Claim created",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "ok": {
                      "type": "boolean"
                    },
                    "created": {
                      "type": "boolean"
                    },
                    "claim_id": {
                      "type": "string"
                    },
                    "cns_name": {
                      "type": "string"
                    },
                    "envelope": {
                      "$ref": "#/components/schemas/CanonicalEnvelope"
                    },
                    "subject": {
                      "type": "string"
                    },
                    "idempotency_key": {
                      "type": "string"
                    },
                    "outbox": {
                      "$ref": "#/components/schemas/OutboxEnvelope"
                    }
                  }
                }
              }
            }
          },
          "422": {
            "description": "Missing field, unknown event kind, unregistered CNS type, or invalid envelope",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorEnvelope"
                }
              }
            }
          },
          "503": {
            "description": "Lookup or claim store unavailable",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorEnvelope"
                }
              }
            }
          }
        }
      }
    },
    "/v1/communities/{orgId}/buildings/{buildingId}/events": {
      "get": {
        "operationId": "getBuildingEvents",
        "summary": "List stored building claims for one building (GTM-12). Empty is an empty array.",
        "responses": {
          "200": {
            "description": "data array of stored claims"
          }
        }
      }
    },
    "/v1/community/buildings/{buildingId}/reflex": {
      "post": {
        "operationId": "postBuildingReflex",
        "summary": "Run reflex via Kestra and Camel (GTM-12). Governed actions start a PoCE session.",
        "responses": {
          "202": {
            "description": "Dispatch accepted by both engines"
          },
          "422": {
            "description": "Missing field or missing rule pins"
          },
          "503": {
            "description": "Kestra or Camel unavailable"
          }
        }
      }
    },
    "/v1/community/sourcing/requests": {
      "post": {
        "operationId": "postSourcingRequirement",
        "summary": "Create sourcing requirement claim (GTM-13). Accepts legacy body or canonical envelope v1.",
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "oneOf": [
                  {
                    "$ref": "#/components/schemas/CanonicalEnvelope"
                  },
                  {
                    "type": "object",
                    "required": [
                      "org_id",
                      "request_id",
                      "requirement_type"
                    ],
                    "properties": {
                      "org_id": {
                        "type": "string"
                      },
                      "request_id": {
                        "type": "string"
                      },
                      "requirement_type": {
                        "type": "string",
                        "enum": [
                          "service",
                          "resource",
                          "material",
                          "labor"
                        ]
                      },
                      "criteria": {
                        "type": "object"
                      },
                      "s2_cell": {
                        "type": "string"
                      }
                    }
                  }
                ]
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Idempotent replay"
          },
          "201": {
            "description": "Claim created",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "ok": {
                      "type": "boolean"
                    },
                    "created": {
                      "type": "boolean"
                    },
                    "claim_id": {
                      "type": "string"
                    },
                    "cns_name": {
                      "type": "string"
                    },
                    "envelope": {
                      "$ref": "#/components/schemas/CanonicalEnvelope"
                    },
                    "subject": {
                      "type": "string"
                    },
                    "idempotency_key": {
                      "type": "string"
                    },
                    "outbox": {
                      "$ref": "#/components/schemas/OutboxEnvelope"
                    }
                  }
                }
              }
            }
          },
          "422": {
            "description": "Unknown requirement type or invalid envelope",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorEnvelope"
                }
              }
            }
          },
          "503": {
            "description": "Store unavailable",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorEnvelope"
                }
              }
            }
          }
        }
      }
    },
    "/v1/communities/{orgId}/sourcing": {
      "get": {
        "operationId": "getCommunitySourcing",
        "summary": "List sourcing claims for one organization (GTM-13).",
        "responses": {
          "200": {
            "description": "data array"
          }
        }
      }
    },
    "/v1/community/sourcing/{requestId}/solve": {
      "post": {
        "operationId": "postSourcingSolve",
        "summary": "Solve via Solver Gateway and scatter (GTM-13). Fails closed if solver down.",
        "responses": {
          "202": {
            "description": "Solve dispatched"
          },
          "503": {
            "description": "Solver or Kestra unavailable"
          }
        }
      }
    },
    "/v1/community/safety/sos": {
      "post": {
        "operationId": "postMarsIceSos",
        "summary": "Create MARS ICE incident from panic button (GTM-14). Accepts legacy body or canonical envelope v1.",
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "oneOf": [
                  {
                    "$ref": "#/components/schemas/CanonicalEnvelope"
                  },
                  {
                    "type": "object",
                    "required": [
                      "org_id",
                      "incident_id",
                      "channel"
                    ],
                    "properties": {
                      "org_id": {
                        "type": "string"
                      },
                      "incident_id": {
                        "type": "string"
                      },
                      "channel": {
                        "type": "string",
                        "enum": [
                          "whatsapp",
                          "sms",
                          "push"
                        ]
                      },
                      "location": {
                        "type": "object"
                      },
                      "reported_by": {
                        "type": "string"
                      }
                    }
                  }
                ]
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Idempotent replay"
          },
          "201": {
            "description": "Incident created",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "ok": {
                      "type": "boolean"
                    },
                    "created": {
                      "type": "boolean"
                    },
                    "claim_id": {
                      "type": "string"
                    },
                    "cns_name": {
                      "type": "string"
                    },
                    "envelope": {
                      "$ref": "#/components/schemas/CanonicalEnvelope"
                    },
                    "subject": {
                      "type": "string"
                    },
                    "idempotency_key": {
                      "type": "string"
                    },
                    "outbox": {
                      "$ref": "#/components/schemas/OutboxEnvelope"
                    }
                  }
                }
              }
            }
          },
          "422": {
            "description": "Unknown channel or invalid envelope",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorEnvelope"
                }
              }
            }
          },
          "503": {
            "description": "Store unavailable",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorEnvelope"
                }
              }
            }
          }
        }
      }
    },
    "/v1/communities/{orgId}/safety/incidents": {
      "get": {
        "operationId": "getMarsIceIncidents",
        "summary": "List MARS ICE incidents for one organization (GTM-14).",
        "responses": {
          "200": {
            "description": "data array"
          }
        }
      }
    },
    "/v1/community/safety/{incidentId}/dispatch": {
      "post": {
        "operationId": "postMarsIceDispatch",
        "summary": "Dispatch via Kestra/Camel (GTM-14). Governed actions start PoCE.",
        "responses": {
          "202": {
            "description": "Dispatch accepted"
          },
          "503": {
            "description": "Kestra or Camel unavailable"
          }
        }
      }
    },
    "/v1/community/properties/{propertyId}/events/{eventId}/complete": {
      "post": {
        "operationId": "postPropertyEventComplete",
        "summary": "Complete a property event claim (R2).",
        "responses": {
          "202": {
            "description": "Completed"
          },
          "422": {
            "description": "Missing field or claim not found"
          },
          "503": {
            "description": "Store unavailable"
          }
        }
      }
    },
    "/v1/community/sourcing/offers": {
      "post": {
        "operationId": "postSourcingOffer",
        "summary": "Create sourcing offer claim (R3).",
        "responses": {
          "201": {
            "description": "Offer created"
          },
          "422": {
            "description": "Missing field"
          },
          "503": {
            "description": "Store unavailable"
          }
        }
      }
    },
    "/v1/community/sourcing/{requestId}/bind": {
      "post": {
        "operationId": "postSourcingBind",
        "summary": "Bind a requirement to an offer (R2).",
        "responses": {
          "202": {
            "description": "Bound"
          },
          "422": {
            "description": "Missing field or claim not found"
          },
          "503": {
            "description": "Store unavailable"
          }
        }
      }
    },
    "/v1/community/safety/{incidentId}/resolve": {
      "post": {
        "operationId": "postMarsIceResolve",
        "summary": "Resolve a MARS ICE incident (R2).",
        "responses": {
          "202": {
            "description": "Resolved"
          },
          "422": {
            "description": "Missing field or claim not found"
          },
          "503": {
            "description": "Store unavailable"
          }
        }
      }
    },
    "/v1/community/properties/{propertyId}/events/{eventId}": {
      "get": {
        "operationId": "getPropertyEvent",
        "summary": "Get a single property event claim (R5).",
        "responses": {
          "200": {
            "description": "Claim"
          },
          "404": {
            "description": "Not found"
          }
        }
      }
    },
    "/v1/community/health": {
      "get": {
        "operationId": "getCommunityHealth",
        "summary": "Engine reachability + live_gate_met (R7).",
        "responses": {
          "200": {
            "description": "All engines reachable"
          },
          "503": {
            "description": "One or more engines down"
          }
        }
      }
    }
  },
  "components": {
    "schemas": {
      "CanonicalEnvelope": {
        "type": "object",
        "required": [
          "event_id",
          "schema_version",
          "event_type",
          "occurred_at",
          "subject",
          "source",
          "payload"
        ],
        "properties": {
          "event_id": {
            "type": "string",
            "minLength": 1,
            "description": "Idempotency key."
          },
          "schema_version": {
            "type": "string",
            "enum": [
              "1.0.0"
            ]
          },
          "event_type": {
            "type": "string",
            "minLength": 1
          },
          "occurred_at": {
            "type": "string",
            "format": "date-time"
          },
          "subject": {
            "type": "string",
            "minLength": 1,
            "description": "Target NATS subject (platform.criteria.v1.*)."
          },
          "source": {
            "type": "string",
            "minLength": 1
          },
          "payload": {
            "type": "object"
          },
          "entity_type": {
            "type": "string"
          },
          "entity_id": {
            "type": "string"
          },
          "causation": {
            "type": "object",
            "properties": {
              "causal_event_id": {
                "type": "string"
              },
              "tx_id": {
                "type": "string"
              },
              "parent_tx_id": {
                "type": "string"
              }
            }
          },
          "correlation_id": {
            "type": "string"
          },
          "meta": {
            "type": "object",
            "properties": {
              "scope_id": {
                "type": "string"
              },
              "tenant": {
                "type": "string"
              },
              "is_test": {
                "type": "boolean"
              },
              "pipeline_id": {
                "type": "string"
              },
              "pipeline_stage": {
                "type": "string"
              },
              "pipeline_depth": {
                "type": "integer",
                "minimum": 0,
                "maximum": 8
              }
            }
          }
        },
        "additionalProperties": false
      },
      "ErrorEnvelope": {
        "type": "object",
        "properties": {
          "ok": {
            "type": "boolean",
            "enum": [
              false
            ]
          },
          "error": {
            "type": "string"
          },
          "code": {
            "type": "string",
            "enum": [
              "E_FIELD_REQUIRED",
              "E_EVENT_KIND_UNKNOWN",
              "E_REQUIREMENT_TYPE_UNKNOWN",
              "E_CHANNEL_UNKNOWN",
              "E_CNS_TYPE_UNREGISTERED",
              "E_REFLEX_LOOKUP_UNRESOLVED",
              "E_SOURCING_LOOKUP_UNRESOLVED",
              "E_ICE_LOOKUP_UNRESOLVED",
              "E_SCENARIO_UNRESOLVED",
              "E_CLAIM_STORE_UNAVAILABLE",
              "E_POCE_UNAVAILABLE",
              "E_KESTRA_UNAVAILABLE",
              "E_CAMEL_UNAVAILABLE",
              "E_SOLVER_UNAVAILABLE",
              "E_ENVELOPE_INVALID",
              "E_SCHEMA_VERSION",
              "E_PIPELINE_DEPTH_EXCEEDED",
              "E_PIPELINE_CYCLE",
              "E_SCHEMA_PLACEMENT_REF",
              "E_RULE_PINS_MISSING"
            ]
          }
        }
      },
      "OutboxEnvelope": {
        "type": "object",
        "properties": {
          "subject": {
            "type": "string"
          },
          "record_key": {
            "type": "string"
          },
          "payload": {
            "$ref": "#/components/schemas/CanonicalEnvelope"
          },
          "causation_depth": {
            "type": "integer"
          },
          "tx_id": {
            "type": "string"
          },
          "parent_tx_id": {
            "type": "string",
            "nullable": true
          }
        }
      }
    }
  }
}