{
  "openapi": "3.1.0",
  "info": {
    "title": "EzPharma scoped client data API",
    "version": "2026-10",
    "description": "Synthetic/sandbox only; live and clinical authoring unsupported. Credentials never grant tenant capability or clinician authority."
  },
  "servers": [
    {
      "url": "https://www.ezpharma.app",
      "description": "Use only after the candidate is deployed and your test tenant is approved."
    }
  ],
  "paths": {
    "/v1/client/2026-10/query": {
      "post": {
        "operationId": "clientQuery",
        "summary": "Read authorized resource summaries",
        "security": [
          {
            "ClientCredential": []
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "additionalProperties": false,
                "required": [
                  "resource"
                ],
                "properties": {
                  "resource": {
                    "type": "string",
                    "enum": [
                      "patients",
                      "episodes",
                      "intakes",
                      "consents",
                      "appointments",
                      "prescriptions",
                      "labs",
                      "results",
                      "records",
                      "documents",
                      "payments",
                      "fulfillment",
                      "packages",
                      "communications",
                      "renewals"
                    ]
                  },
                  "limit": {
                    "type": "integer",
                    "minimum": 1,
                    "maximum": 100,
                    "default": 50
                  },
                  "cursor": {
                    "type": "string",
                    "maxLength": 2048
                  },
                  "patientId": {
                    "type": "string",
                    "maxLength": 160
                  },
                  "id": {
                    "type": "string",
                    "maxLength": 160
                  }
                }
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Authorized result; version is 2026-10. See maintained field matrix.",
            "content": {
              "application/json": {
                "schema": {
                  "oneOf": [
                    {
                      "type": "object",
                      "required": [
                        "version",
                        "resource",
                        "data",
                        "nextCursor",
                        "changeCursor"
                      ],
                      "additionalProperties": false,
                      "properties": {
                        "version": {
                          "const": "2026-10"
                        },
                        "resource": {
                          "const": "patients"
                        },
                        "data": {
                          "type": "array",
                          "items": {
                            "$ref": "#/components/schemas/patients"
                          }
                        },
                        "nextCursor": {
                          "type": [
                            "string",
                            "null"
                          ]
                        },
                        "changeCursor": {
                          "type": "string"
                        }
                      }
                    },
                    {
                      "type": "object",
                      "required": [
                        "version",
                        "resource",
                        "data",
                        "nextCursor",
                        "changeCursor"
                      ],
                      "additionalProperties": false,
                      "properties": {
                        "version": {
                          "const": "2026-10"
                        },
                        "resource": {
                          "const": "episodes"
                        },
                        "data": {
                          "type": "array",
                          "items": {
                            "$ref": "#/components/schemas/episodes"
                          }
                        },
                        "nextCursor": {
                          "type": [
                            "string",
                            "null"
                          ]
                        },
                        "changeCursor": {
                          "type": "string"
                        }
                      }
                    },
                    {
                      "type": "object",
                      "required": [
                        "version",
                        "resource",
                        "data",
                        "nextCursor",
                        "changeCursor"
                      ],
                      "additionalProperties": false,
                      "properties": {
                        "version": {
                          "const": "2026-10"
                        },
                        "resource": {
                          "const": "intakes"
                        },
                        "data": {
                          "type": "array",
                          "items": {
                            "$ref": "#/components/schemas/intakes"
                          }
                        },
                        "nextCursor": {
                          "type": [
                            "string",
                            "null"
                          ]
                        },
                        "changeCursor": {
                          "type": "string"
                        }
                      }
                    },
                    {
                      "type": "object",
                      "required": [
                        "version",
                        "resource",
                        "data",
                        "nextCursor",
                        "changeCursor"
                      ],
                      "additionalProperties": false,
                      "properties": {
                        "version": {
                          "const": "2026-10"
                        },
                        "resource": {
                          "const": "consents"
                        },
                        "data": {
                          "type": "array",
                          "items": {
                            "$ref": "#/components/schemas/consents"
                          }
                        },
                        "nextCursor": {
                          "type": [
                            "string",
                            "null"
                          ]
                        },
                        "changeCursor": {
                          "type": "string"
                        }
                      }
                    },
                    {
                      "type": "object",
                      "required": [
                        "version",
                        "resource",
                        "data",
                        "nextCursor",
                        "changeCursor"
                      ],
                      "additionalProperties": false,
                      "properties": {
                        "version": {
                          "const": "2026-10"
                        },
                        "resource": {
                          "const": "appointments"
                        },
                        "data": {
                          "type": "array",
                          "items": {
                            "$ref": "#/components/schemas/appointments"
                          }
                        },
                        "nextCursor": {
                          "type": [
                            "string",
                            "null"
                          ]
                        },
                        "changeCursor": {
                          "type": "string"
                        }
                      }
                    },
                    {
                      "type": "object",
                      "required": [
                        "version",
                        "resource",
                        "data",
                        "nextCursor",
                        "changeCursor"
                      ],
                      "additionalProperties": false,
                      "properties": {
                        "version": {
                          "const": "2026-10"
                        },
                        "resource": {
                          "const": "prescriptions"
                        },
                        "data": {
                          "type": "array",
                          "items": {
                            "$ref": "#/components/schemas/prescriptions"
                          }
                        },
                        "nextCursor": {
                          "type": [
                            "string",
                            "null"
                          ]
                        },
                        "changeCursor": {
                          "type": "string"
                        }
                      }
                    },
                    {
                      "type": "object",
                      "required": [
                        "version",
                        "resource",
                        "data",
                        "nextCursor",
                        "changeCursor"
                      ],
                      "additionalProperties": false,
                      "properties": {
                        "version": {
                          "const": "2026-10"
                        },
                        "resource": {
                          "const": "labs"
                        },
                        "data": {
                          "type": "array",
                          "items": {
                            "$ref": "#/components/schemas/labs"
                          }
                        },
                        "nextCursor": {
                          "type": [
                            "string",
                            "null"
                          ]
                        },
                        "changeCursor": {
                          "type": "string"
                        }
                      }
                    },
                    {
                      "type": "object",
                      "required": [
                        "version",
                        "resource",
                        "data",
                        "nextCursor",
                        "changeCursor"
                      ],
                      "additionalProperties": false,
                      "properties": {
                        "version": {
                          "const": "2026-10"
                        },
                        "resource": {
                          "const": "results"
                        },
                        "data": {
                          "type": "array",
                          "items": {
                            "$ref": "#/components/schemas/results"
                          }
                        },
                        "nextCursor": {
                          "type": [
                            "string",
                            "null"
                          ]
                        },
                        "changeCursor": {
                          "type": "string"
                        }
                      }
                    },
                    {
                      "type": "object",
                      "required": [
                        "version",
                        "resource",
                        "data",
                        "nextCursor",
                        "changeCursor"
                      ],
                      "additionalProperties": false,
                      "properties": {
                        "version": {
                          "const": "2026-10"
                        },
                        "resource": {
                          "const": "records"
                        },
                        "data": {
                          "type": "array",
                          "items": {
                            "$ref": "#/components/schemas/records"
                          }
                        },
                        "nextCursor": {
                          "type": [
                            "string",
                            "null"
                          ]
                        },
                        "changeCursor": {
                          "type": "string"
                        }
                      }
                    },
                    {
                      "type": "object",
                      "required": [
                        "version",
                        "resource",
                        "data",
                        "nextCursor",
                        "changeCursor"
                      ],
                      "additionalProperties": false,
                      "properties": {
                        "version": {
                          "const": "2026-10"
                        },
                        "resource": {
                          "const": "documents"
                        },
                        "data": {
                          "type": "array",
                          "items": {
                            "$ref": "#/components/schemas/documents"
                          }
                        },
                        "nextCursor": {
                          "type": [
                            "string",
                            "null"
                          ]
                        },
                        "changeCursor": {
                          "type": "string"
                        }
                      }
                    },
                    {
                      "type": "object",
                      "required": [
                        "version",
                        "resource",
                        "data",
                        "nextCursor",
                        "changeCursor"
                      ],
                      "additionalProperties": false,
                      "properties": {
                        "version": {
                          "const": "2026-10"
                        },
                        "resource": {
                          "const": "payments"
                        },
                        "data": {
                          "type": "array",
                          "items": {
                            "$ref": "#/components/schemas/payments"
                          }
                        },
                        "nextCursor": {
                          "type": [
                            "string",
                            "null"
                          ]
                        },
                        "changeCursor": {
                          "type": "string"
                        }
                      }
                    },
                    {
                      "type": "object",
                      "required": [
                        "version",
                        "resource",
                        "data",
                        "nextCursor",
                        "changeCursor"
                      ],
                      "additionalProperties": false,
                      "properties": {
                        "version": {
                          "const": "2026-10"
                        },
                        "resource": {
                          "const": "fulfillment"
                        },
                        "data": {
                          "type": "array",
                          "items": {
                            "$ref": "#/components/schemas/fulfillment"
                          }
                        },
                        "nextCursor": {
                          "type": [
                            "string",
                            "null"
                          ]
                        },
                        "changeCursor": {
                          "type": "string"
                        }
                      }
                    },
                    {
                      "type": "object",
                      "required": [
                        "version",
                        "resource",
                        "data",
                        "nextCursor",
                        "changeCursor"
                      ],
                      "additionalProperties": false,
                      "properties": {
                        "version": {
                          "const": "2026-10"
                        },
                        "resource": {
                          "const": "packages"
                        },
                        "data": {
                          "type": "array",
                          "items": {
                            "$ref": "#/components/schemas/packages"
                          }
                        },
                        "nextCursor": {
                          "type": [
                            "string",
                            "null"
                          ]
                        },
                        "changeCursor": {
                          "type": "string"
                        }
                      }
                    },
                    {
                      "type": "object",
                      "required": [
                        "version",
                        "resource",
                        "data",
                        "nextCursor",
                        "changeCursor"
                      ],
                      "additionalProperties": false,
                      "properties": {
                        "version": {
                          "const": "2026-10"
                        },
                        "resource": {
                          "const": "communications"
                        },
                        "data": {
                          "type": "array",
                          "items": {
                            "$ref": "#/components/schemas/communications"
                          }
                        },
                        "nextCursor": {
                          "type": [
                            "string",
                            "null"
                          ]
                        },
                        "changeCursor": {
                          "type": "string"
                        }
                      }
                    },
                    {
                      "type": "object",
                      "required": [
                        "version",
                        "resource",
                        "data",
                        "nextCursor",
                        "changeCursor"
                      ],
                      "additionalProperties": false,
                      "properties": {
                        "version": {
                          "const": "2026-10"
                        },
                        "resource": {
                          "const": "renewals"
                        },
                        "data": {
                          "type": "array",
                          "items": {
                            "$ref": "#/components/schemas/renewals"
                          }
                        },
                        "nextCursor": {
                          "type": [
                            "string",
                            "null"
                          ]
                        },
                        "changeCursor": {
                          "type": "string"
                        }
                      }
                    }
                  ]
                }
              }
            }
          },
          "401": {
            "description": "Credential invalid/expired/revoked",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "error"
                  ],
                  "additionalProperties": false,
                  "properties": {
                    "error": {
                      "type": "string"
                    }
                  }
                }
              }
            }
          },
          "403": {
            "description": "Scope, capability or live boundary denied",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "error"
                  ],
                  "additionalProperties": false,
                  "properties": {
                    "error": {
                      "type": "string"
                    }
                  }
                }
              }
            }
          },
          "404": {
            "description": "Resource not found or unauthorized",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "error"
                  ],
                  "additionalProperties": false,
                  "properties": {
                    "error": {
                      "type": "string"
                    }
                  }
                }
              }
            }
          },
          "409": {
            "description": "Conflicting immutable mapping",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "error"
                  ],
                  "additionalProperties": false,
                  "properties": {
                    "error": {
                      "type": "string"
                    }
                  }
                }
              }
            }
          },
          "410": {
            "description": "Cursor expired; initial sync required",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "error"
                  ],
                  "additionalProperties": false,
                  "properties": {
                    "error": {
                      "type": "string"
                    }
                  }
                }
              }
            }
          },
          "422": {
            "description": "Malformed or unknown request field/cursor",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "error"
                  ],
                  "additionalProperties": false,
                  "properties": {
                    "error": {
                      "type": "string"
                    }
                  }
                }
              }
            }
          },
          "429": {
            "description": "120 requests/minute/credential; Retry-After: 60",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "error"
                  ],
                  "additionalProperties": false,
                  "properties": {
                    "error": {
                      "type": "string"
                    }
                  }
                }
              }
            }
          },
          "503": {
            "description": "Dependency unavailable",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "error"
                  ],
                  "additionalProperties": false,
                  "properties": {
                    "error": {
                      "type": "string"
                    }
                  }
                }
              }
            }
          }
        }
      }
    },
    "/v1/client/2026-10/events": {
      "post": {
        "operationId": "clientEvents",
        "summary": "Read minimal ordered change notifications",
        "security": [
          {
            "ClientCredential": []
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "additionalProperties": false,
                "required": [],
                "properties": {
                  "limit": {
                    "type": "integer",
                    "minimum": 1,
                    "maximum": 100,
                    "default": 50
                  },
                  "cursor": {
                    "type": "string",
                    "maxLength": 2048
                  }
                }
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Authorized result; version is 2026-10. See maintained field matrix.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "version",
                    "events",
                    "hasMore",
                    "cursor"
                  ],
                  "additionalProperties": false,
                  "properties": {
                    "version": {
                      "const": "2026-10"
                    },
                    "events": {
                      "type": "array",
                      "items": {
                        "$ref": "#/components/schemas/ResourceEvent"
                      }
                    },
                    "hasMore": {
                      "type": "boolean"
                    },
                    "cursor": {
                      "type": "string"
                    }
                  }
                }
              }
            }
          },
          "401": {
            "description": "Credential invalid/expired/revoked",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "error"
                  ],
                  "additionalProperties": false,
                  "properties": {
                    "error": {
                      "type": "string"
                    }
                  }
                }
              }
            }
          },
          "403": {
            "description": "Scope, capability or live boundary denied",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "error"
                  ],
                  "additionalProperties": false,
                  "properties": {
                    "error": {
                      "type": "string"
                    }
                  }
                }
              }
            }
          },
          "404": {
            "description": "Resource not found or unauthorized",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "error"
                  ],
                  "additionalProperties": false,
                  "properties": {
                    "error": {
                      "type": "string"
                    }
                  }
                }
              }
            }
          },
          "409": {
            "description": "Conflicting immutable mapping",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "error"
                  ],
                  "additionalProperties": false,
                  "properties": {
                    "error": {
                      "type": "string"
                    }
                  }
                }
              }
            }
          },
          "410": {
            "description": "Cursor expired; initial sync required",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "error"
                  ],
                  "additionalProperties": false,
                  "properties": {
                    "error": {
                      "type": "string"
                    }
                  }
                }
              }
            }
          },
          "422": {
            "description": "Malformed or unknown request field/cursor",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "error"
                  ],
                  "additionalProperties": false,
                  "properties": {
                    "error": {
                      "type": "string"
                    }
                  }
                }
              }
            }
          },
          "429": {
            "description": "120 requests/minute/credential; Retry-After: 60",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "error"
                  ],
                  "additionalProperties": false,
                  "properties": {
                    "error": {
                      "type": "string"
                    }
                  }
                }
              }
            }
          },
          "503": {
            "description": "Dependency unavailable",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "error"
                  ],
                  "additionalProperties": false,
                  "properties": {
                    "error": {
                      "type": "string"
                    }
                  }
                }
              }
            }
          }
        }
      }
    },
    "/v1/client/2026-10/crosswalks": {
      "post": {
        "operationId": "clientCrosswalks",
        "summary": "Create an immutable scoped external-ID mapping",
        "security": [
          {
            "ClientCredential": []
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "additionalProperties": false,
                "required": [
                  "resource",
                  "id",
                  "externalId"
                ],
                "properties": {
                  "resource": {
                    "type": "string",
                    "enum": [
                      "patients",
                      "episodes",
                      "intakes",
                      "consents",
                      "appointments",
                      "prescriptions",
                      "labs",
                      "results",
                      "records",
                      "documents",
                      "payments",
                      "fulfillment",
                      "packages",
                      "communications",
                      "renewals"
                    ]
                  },
                  "id": {
                    "type": "string",
                    "maxLength": 160
                  },
                  "externalId": {
                    "type": "string",
                    "minLength": 1,
                    "maxLength": 160
                  }
                }
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Authorized result; version is 2026-10. See maintained field matrix.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "ok"
                  ],
                  "additionalProperties": false,
                  "properties": {
                    "ok": {
                      "const": true
                    }
                  }
                }
              }
            }
          },
          "401": {
            "description": "Credential invalid/expired/revoked",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "error"
                  ],
                  "additionalProperties": false,
                  "properties": {
                    "error": {
                      "type": "string"
                    }
                  }
                }
              }
            }
          },
          "403": {
            "description": "Scope, capability or live boundary denied",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "error"
                  ],
                  "additionalProperties": false,
                  "properties": {
                    "error": {
                      "type": "string"
                    }
                  }
                }
              }
            }
          },
          "404": {
            "description": "Resource not found or unauthorized",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "error"
                  ],
                  "additionalProperties": false,
                  "properties": {
                    "error": {
                      "type": "string"
                    }
                  }
                }
              }
            }
          },
          "409": {
            "description": "Conflicting immutable mapping",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "error"
                  ],
                  "additionalProperties": false,
                  "properties": {
                    "error": {
                      "type": "string"
                    }
                  }
                }
              }
            }
          },
          "410": {
            "description": "Cursor expired; initial sync required",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "error"
                  ],
                  "additionalProperties": false,
                  "properties": {
                    "error": {
                      "type": "string"
                    }
                  }
                }
              }
            }
          },
          "422": {
            "description": "Malformed or unknown request field/cursor",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "error"
                  ],
                  "additionalProperties": false,
                  "properties": {
                    "error": {
                      "type": "string"
                    }
                  }
                }
              }
            }
          },
          "429": {
            "description": "120 requests/minute/credential; Retry-After: 60",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "error"
                  ],
                  "additionalProperties": false,
                  "properties": {
                    "error": {
                      "type": "string"
                    }
                  }
                }
              }
            }
          },
          "503": {
            "description": "Dependency unavailable",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "error"
                  ],
                  "additionalProperties": false,
                  "properties": {
                    "error": {
                      "type": "string"
                    }
                  }
                }
              }
            }
          }
        }
      }
    }
  },
  "components": {
    "securitySchemes": {
      "ClientCredential": {
        "type": "http",
        "scheme": "bearer",
        "description": "Backend-only expiring resource/patient-scoped test credential. Tenant is credential-resolved."
      }
    },
    "schemas": {
      "patients": {
        "type": "object",
        "properties": {
          "id": {
            "type": "string"
          },
          "patientId": {
            "type": "string"
          },
          "name": {
            "type": "string"
          },
          "email": {
            "type": "string"
          },
          "updatedAt": {
            "type": "string"
          }
        },
        "required": [
          "id",
          "patientId",
          "name",
          "email",
          "updatedAt"
        ],
        "additionalProperties": false,
        "description": "Authorized summary only; see field release rules. Consumers must tolerate future additive fields."
      },
      "episodes": {
        "type": "object",
        "properties": {
          "id": {
            "type": "string"
          },
          "patientId": {
            "type": "string"
          },
          "updatedAt": {
            "type": "string"
          },
          "domains": {
            "type": "array",
            "items": {
              "type": "object",
              "required": [
                "domain",
                "status",
                "occurredAt"
              ],
              "properties": {
                "domain": {
                  "type": "string"
                },
                "status": {
                  "type": "string"
                },
                "occurredAt": {
                  "type": "string"
                }
              },
              "additionalProperties": false
            }
          }
        },
        "required": [
          "id",
          "patientId",
          "updatedAt",
          "domains"
        ],
        "additionalProperties": false,
        "description": "Authorized summary only; see field release rules. Consumers must tolerate future additive fields."
      },
      "intakes": {
        "type": "object",
        "properties": {
          "id": {
            "type": "string"
          },
          "patientId": {
            "type": "string"
          },
          "episodeId": {
            "type": "string"
          },
          "intakeStatus": {
            "type": "string"
          },
          "clinicalStatus": {
            "type": "string"
          },
          "paymentStatus": {
            "type": "string"
          },
          "journeyVersion": {
            "type": "integer"
          },
          "updatedAt": {
            "type": "string"
          }
        },
        "required": [
          "id",
          "patientId",
          "episodeId",
          "intakeStatus",
          "clinicalStatus",
          "paymentStatus",
          "journeyVersion",
          "updatedAt"
        ],
        "additionalProperties": false,
        "description": "Authorized summary only; see field release rules. Consumers must tolerate future additive fields."
      },
      "consents": {
        "type": "object",
        "properties": {
          "id": {
            "type": "string"
          },
          "patientId": {
            "type": "string"
          },
          "intakeId": {
            "type": "string"
          },
          "documentVersion": {
            "type": "string"
          },
          "acceptedAt": {
            "type": "string"
          }
        },
        "required": [
          "id",
          "patientId",
          "intakeId",
          "documentVersion",
          "acceptedAt"
        ],
        "additionalProperties": false,
        "description": "Authorized summary only; see field release rules. Consumers must tolerate future additive fields."
      },
      "appointments": {
        "type": "object",
        "properties": {
          "id": {
            "type": "string"
          },
          "patientId": {
            "type": "string"
          },
          "episodeId": {
            "type": "string"
          },
          "status": {
            "type": "string"
          },
          "startsAt": {
            "type": "string"
          },
          "endsAt": {
            "type": [
              "string",
              "null"
            ]
          },
          "modality": {
            "type": "string"
          }
        },
        "required": [
          "id",
          "patientId",
          "episodeId",
          "status",
          "startsAt",
          "endsAt",
          "modality"
        ],
        "additionalProperties": false,
        "description": "Authorized summary only; see field release rules. Consumers must tolerate future additive fields."
      },
      "prescriptions": {
        "type": "object",
        "properties": {
          "id": {
            "type": "string"
          },
          "patientId": {
            "type": "string"
          },
          "episodeId": {
            "type": "string"
          },
          "status": {
            "type": "string"
          },
          "signedAt": {
            "type": "string"
          },
          "version": {
            "type": "integer"
          },
          "transmissionStatus": {
            "type": [
              "string",
              "null"
            ]
          }
        },
        "required": [
          "id",
          "patientId",
          "episodeId",
          "status",
          "signedAt",
          "version",
          "transmissionStatus"
        ],
        "additionalProperties": false,
        "description": "Authorized summary only; see field release rules. Consumers must tolerate future additive fields."
      },
      "labs": {
        "type": "object",
        "properties": {
          "id": {
            "type": "string"
          },
          "patientId": {
            "type": "string"
          },
          "episodeId": {
            "type": "string"
          },
          "status": {
            "type": "string"
          },
          "orderedAt": {
            "type": "string"
          }
        },
        "required": [
          "id",
          "patientId",
          "episodeId",
          "status",
          "orderedAt"
        ],
        "additionalProperties": false,
        "description": "Authorized summary only; see field release rules. Consumers must tolerate future additive fields."
      },
      "results": {
        "type": "object",
        "properties": {
          "id": {
            "type": "string"
          },
          "patientId": {
            "type": "string"
          },
          "labId": {
            "type": "string"
          },
          "status": {
            "type": "string"
          },
          "releasedAt": {
            "type": "string"
          }
        },
        "required": [
          "id",
          "patientId",
          "labId",
          "status",
          "releasedAt"
        ],
        "additionalProperties": false,
        "description": "Authorized summary only; see field release rules. Consumers must tolerate future additive fields."
      },
      "records": {
        "type": "object",
        "properties": {
          "id": {
            "type": "string"
          },
          "patientId": {
            "type": "string"
          },
          "episodeId": {
            "type": [
              "string",
              "null"
            ]
          },
          "type": {
            "type": "string"
          },
          "status": {
            "type": "string"
          },
          "version": {
            "type": "integer"
          },
          "releasedAt": {
            "type": "string"
          }
        },
        "required": [
          "id",
          "patientId",
          "episodeId",
          "type",
          "status",
          "version",
          "releasedAt"
        ],
        "additionalProperties": false,
        "description": "Authorized summary only; see field release rules. Consumers must tolerate future additive fields."
      },
      "documents": {
        "type": "object",
        "properties": {
          "id": {
            "type": "string"
          },
          "patientId": {
            "type": "string"
          },
          "episodeId": {
            "type": [
              "string",
              "null"
            ]
          },
          "status": {
            "type": "string"
          },
          "version": {
            "type": "integer"
          },
          "releasedAt": {
            "type": "string"
          }
        },
        "required": [
          "id",
          "patientId",
          "episodeId",
          "status",
          "version",
          "releasedAt"
        ],
        "additionalProperties": false,
        "description": "Authorized summary only; see field release rules. Consumers must tolerate future additive fields."
      },
      "payments": {
        "type": "object",
        "properties": {
          "id": {
            "type": "string"
          },
          "patientId": {
            "type": "string"
          },
          "intakeId": {
            "type": "string"
          },
          "status": {
            "type": "string"
          },
          "amount": {
            "type": "number"
          },
          "currency": {
            "type": "string"
          },
          "updatedAt": {
            "type": "string"
          }
        },
        "required": [
          "id",
          "patientId",
          "intakeId",
          "status",
          "amount",
          "currency",
          "updatedAt"
        ],
        "additionalProperties": false,
        "description": "Authorized summary only; see field release rules. Consumers must tolerate future additive fields."
      },
      "fulfillment": {
        "type": "object",
        "properties": {
          "id": {
            "type": "string"
          },
          "patientId": {
            "type": "string"
          },
          "episodeId": {
            "type": [
              "string",
              "null"
            ]
          },
          "status": {
            "type": "string"
          },
          "updatedAt": {
            "type": "string"
          }
        },
        "required": [
          "id",
          "patientId",
          "episodeId",
          "status",
          "updatedAt"
        ],
        "additionalProperties": false,
        "description": "Authorized summary only; see field release rules. Consumers must tolerate future additive fields."
      },
      "packages": {
        "type": "object",
        "properties": {
          "id": {
            "type": "string"
          },
          "patientId": {
            "type": "string"
          },
          "orderId": {
            "type": "string"
          },
          "reshipOf": {
            "type": [
              "string",
              "null"
            ]
          },
          "status": {
            "type": "string"
          },
          "carrier": {
            "type": [
              "string",
              "null"
            ]
          },
          "trackingNumber": {
            "type": [
              "string",
              "null"
            ]
          },
          "updatedAt": {
            "type": "string"
          }
        },
        "required": [
          "id",
          "patientId",
          "orderId",
          "reshipOf",
          "status",
          "carrier",
          "trackingNumber",
          "updatedAt"
        ],
        "additionalProperties": false,
        "description": "Authorized summary only; see field release rules. Consumers must tolerate future additive fields."
      },
      "communications": {
        "type": "object",
        "properties": {
          "id": {
            "type": "string"
          },
          "patientId": {
            "type": "string"
          },
          "episodeId": {
            "type": [
              "string",
              "null"
            ]
          },
          "status": {
            "type": "string"
          },
          "updatedAt": {
            "type": "string"
          }
        },
        "required": [
          "id",
          "patientId",
          "episodeId",
          "status",
          "updatedAt"
        ],
        "additionalProperties": false,
        "description": "Authorized summary only; see field release rules. Consumers must tolerate future additive fields."
      },
      "renewals": {
        "type": "object",
        "properties": {
          "id": {
            "type": "string"
          },
          "patientId": {
            "type": "string"
          },
          "episodeId": {
            "type": "string"
          },
          "status": {
            "type": "string"
          },
          "dueAt": {
            "type": [
              "string",
              "null"
            ]
          },
          "updatedAt": {
            "type": "string"
          }
        },
        "required": [
          "id",
          "patientId",
          "episodeId",
          "status",
          "dueAt",
          "updatedAt"
        ],
        "additionalProperties": false,
        "description": "Authorized summary only; see field release rules. Consumers must tolerate future additive fields."
      },
      "ResourceEvent": {
        "title": "Client resource notification 2026-10",
        "type": "object",
        "additionalProperties": false,
        "required": [
          "id",
          "schemaVersion",
          "type",
          "resource",
          "resourceId",
          "occurredAt"
        ],
        "properties": {
          "id": {
            "type": "string",
            "minLength": 1,
            "maxLength": 160
          },
          "schemaVersion": {
            "const": "2026-10"
          },
          "type": {
            "enum": [
              "resource.changed",
              "resource.removed"
            ]
          },
          "resource": {
            "enum": [
              "patients",
              "episodes",
              "intakes",
              "consents",
              "appointments",
              "prescriptions",
              "labs",
              "results",
              "records",
              "documents",
              "payments",
              "fulfillment",
              "packages",
              "communications",
              "renewals"
            ]
          },
          "resourceId": {
            "type": "string",
            "minLength": 1,
            "maxLength": 400
          },
          "occurredAt": {
            "type": "string",
            "format": "date-time"
          }
        }
      }
    }
  }
}
