{
  "components": {
    "examples": {
      "HealthOk": {
        "summary": "Public metadata health response",
        "value": {
          "data": {
            "apiVersion": "v1",
            "classification": "PUBLIC_METADATA",
            "name": "Elynext API",
            "status": "ok"
          },
          "meta": {
            "apiVersion": "v1",
            "requestId": "req_0000000000000001",
            "timestamp": "2026-08-12T00:00:00Z"
          }
        }
      },
      "OAuthClientCredentialsRequest": {
        "summary": "OAuth2 Client Credentials request",
        "value": {
          "client_id": "partner_client_01",
          "client_secret": "example_client_secret_min_24_chars",
          "grant_type": "client_credentials",
          "scope": "api.health.read api.version.read"
        }
      },
      "OAuthTokenIssued": {
        "summary": "OAuth2 bearer token response",
        "value": {
          "access_token": "<access-token>",
          "api_version": "v1",
          "expires_in": 3600,
          "scope": "api.health.read api.version.read",
          "tenant_id": "studio_001",
          "token_type": "Bearer"
        }
      },
      "OpenApiJson": {
        "summary": "OpenAPI contract response",
        "value": {
          "info": {
            "title": "Elynext API",
            "version": "1.0.0"
          },
          "openapi": "3.1.0"
        }
      },
      "VersionFoundation": {
        "summary": "Public metadata version response",
        "value": {
          "data": {
            "apiVersion": "v1",
            "applicationVersion": "0.0.0",
            "capabilities": [
              "api.health.read",
              "api.openapi.read",
              "api.version.read"
            ],
            "contractVersion": "1.0.0",
            "name": "Elynext API",
            "resources": [
              "docs",
              "health",
              "oauth/token",
              "webhook-subscriptions",
              "patients",
              "appointments",
              "clinical-records",
              "documents",
              "reports",
              "services",
              "locations",
              "doctors",
              "availability",
              "openapi.json",
              "openapi.yaml",
              "version"
            ],
            "stage": "foundation"
          },
          "meta": {
            "apiVersion": "v1",
            "requestId": "req_0000000000000001",
            "timestamp": "2026-08-12T00:00:00Z"
          }
        }
      }
    },
    "headers": {
      "RateLimitLimit": {
        "description": "Maximum number of requests allowed in the current window.",
        "schema": {
          "minimum": 0,
          "type": "integer"
        }
      },
      "RateLimitRemaining": {
        "description": "Remaining number of requests in the current window.",
        "schema": {
          "minimum": 0,
          "type": "integer"
        }
      },
      "RateLimitReset": {
        "description": "Epoch second when the current rate-limit window resets.",
        "schema": {
          "minimum": 0,
          "type": "integer"
        }
      },
      "RequestId": {
        "description": "Opaque request correlation identifier.",
        "schema": {
          "maxLength": 128,
          "minLength": 1,
          "type": "string"
        }
      },
      "RetryAfter": {
        "description": "Seconds to wait before retrying a rate-limited request.",
        "schema": {
          "minimum": 0,
          "type": "integer"
        }
      }
    },
    "parameters": {
      "IdempotencyKeyHeader": {
        "description": "Optional key used to make critical POST requests safe to retry.",
        "in": "header",
        "name": "Idempotency-Key",
        "required": false,
        "schema": {
          "maxLength": 255,
          "minLength": 1,
          "type": "string"
        }
      },
      "RequestIdHeader": {
        "description": "Optional opaque request correlation identifier supplied by the client.",
        "in": "header",
        "name": "X-Request-Id",
        "required": false,
        "schema": {
          "maxLength": 128,
          "minLength": 1,
          "type": "string"
        }
      },
      "ResourceIdPath": {
        "description": "Opaque Elynext resource identifier.",
        "in": "path",
        "name": "id",
        "required": true,
        "schema": {
          "maxLength": 160,
          "minLength": 1,
          "type": "string"
        }
      },
      "SubscriptionIdPath": {
        "description": "Opaque Elynext webhook subscription identifier.",
        "in": "path",
        "name": "id",
        "required": true,
        "schema": {
          "maxLength": 160,
          "minLength": 1,
          "type": "string"
        }
      }
    },
    "responses": {
      "BadRequest": {
        "content": {
          "application/json": {
            "examples": {
              "badRequest": {
                "value": {
                  "error": {
                    "code": "unsupported_grant_type",
                    "details": {},
                    "message": "Only client_credentials grant type is supported.",
                    "requestId": "req_0000000000000001"
                  }
                }
              }
            },
            "schema": {
              "$ref": "#/components/schemas/Error"
            }
          }
        },
        "description": "Request is invalid.",
        "headers": {
          "RateLimit-Limit": {
            "$ref": "#/components/headers/RateLimitLimit"
          },
          "RateLimit-Remaining": {
            "$ref": "#/components/headers/RateLimitRemaining"
          },
          "RateLimit-Reset": {
            "$ref": "#/components/headers/RateLimitReset"
          },
          "X-Request-Id": {
            "$ref": "#/components/headers/RequestId"
          }
        }
      },
      "Conflict": {
        "content": {
          "application/json": {
            "examples": {
              "idempotencyConflict": {
                "value": {
                  "error": {
                    "code": "idempotency_conflict",
                    "details": {},
                    "message": "Idempotency key was already used with a different payload.",
                    "requestId": "req_0000000000000001"
                  }
                }
              }
            },
            "schema": {
              "$ref": "#/components/schemas/Error"
            }
          }
        },
        "description": "Request conflicts with a previous idempotent request.",
        "headers": {
          "RateLimit-Limit": {
            "$ref": "#/components/headers/RateLimitLimit"
          },
          "RateLimit-Remaining": {
            "$ref": "#/components/headers/RateLimitRemaining"
          },
          "RateLimit-Reset": {
            "$ref": "#/components/headers/RateLimitReset"
          },
          "X-Request-Id": {
            "$ref": "#/components/headers/RequestId"
          }
        }
      },
      "Forbidden": {
        "content": {
          "application/json": {
            "examples": {
              "forbidden": {
                "value": {
                  "error": {
                    "code": "forbidden",
                    "details": {},
                    "message": "Insufficient permissions.",
                    "requestId": "req_0000000000000001"
                  }
                }
              }
            },
            "schema": {
              "$ref": "#/components/schemas/Error"
            }
          }
        },
        "description": "Insufficient permissions.",
        "headers": {
          "RateLimit-Limit": {
            "$ref": "#/components/headers/RateLimitLimit"
          },
          "RateLimit-Remaining": {
            "$ref": "#/components/headers/RateLimitRemaining"
          },
          "RateLimit-Reset": {
            "$ref": "#/components/headers/RateLimitReset"
          },
          "X-Request-Id": {
            "$ref": "#/components/headers/RequestId"
          }
        }
      },
      "InternalError": {
        "content": {
          "application/json": {
            "schema": {
              "$ref": "#/components/schemas/Error"
            }
          }
        },
        "description": "Request failed.",
        "headers": {
          "RateLimit-Limit": {
            "$ref": "#/components/headers/RateLimitLimit"
          },
          "RateLimit-Remaining": {
            "$ref": "#/components/headers/RateLimitRemaining"
          },
          "RateLimit-Reset": {
            "$ref": "#/components/headers/RateLimitReset"
          },
          "X-Request-Id": {
            "$ref": "#/components/headers/RequestId"
          }
        }
      },
      "MethodNotAllowed": {
        "content": {
          "application/json": {
            "schema": {
              "$ref": "#/components/schemas/Error"
            }
          }
        },
        "description": "HTTP method is not allowed for this resource.",
        "headers": {
          "RateLimit-Limit": {
            "$ref": "#/components/headers/RateLimitLimit"
          },
          "RateLimit-Remaining": {
            "$ref": "#/components/headers/RateLimitRemaining"
          },
          "RateLimit-Reset": {
            "$ref": "#/components/headers/RateLimitReset"
          },
          "X-Request-Id": {
            "$ref": "#/components/headers/RequestId"
          }
        }
      },
      "NotFound": {
        "content": {
          "application/json": {
            "examples": {
              "notFound": {
                "value": {
                  "error": {
                    "code": "not_found",
                    "details": {},
                    "message": "Elynext API resource not found.",
                    "requestId": "req_0000000000000001"
                  }
                }
              }
            },
            "schema": {
              "$ref": "#/components/schemas/Error"
            }
          }
        },
        "description": "Resource not found.",
        "headers": {
          "RateLimit-Limit": {
            "$ref": "#/components/headers/RateLimitLimit"
          },
          "RateLimit-Remaining": {
            "$ref": "#/components/headers/RateLimitRemaining"
          },
          "RateLimit-Reset": {
            "$ref": "#/components/headers/RateLimitReset"
          },
          "X-Request-Id": {
            "$ref": "#/components/headers/RequestId"
          }
        }
      },
      "RateLimited": {
        "content": {
          "application/json": {
            "examples": {
              "rateLimited": {
                "value": {
                  "error": {
                    "code": "rate_limited",
                    "details": {},
                    "message": "Rate limit exceeded.",
                    "requestId": "req_0000000000000001"
                  }
                }
              }
            },
            "schema": {
              "$ref": "#/components/schemas/Error"
            }
          }
        },
        "description": "Rate limit exceeded.",
        "headers": {
          "RateLimit-Limit": {
            "$ref": "#/components/headers/RateLimitLimit"
          },
          "RateLimit-Remaining": {
            "$ref": "#/components/headers/RateLimitRemaining"
          },
          "RateLimit-Reset": {
            "$ref": "#/components/headers/RateLimitReset"
          },
          "Retry-After": {
            "$ref": "#/components/headers/RetryAfter"
          },
          "X-Request-Id": {
            "$ref": "#/components/headers/RequestId"
          }
        }
      },
      "Unauthorized": {
        "content": {
          "application/json": {
            "examples": {
              "unauthorized": {
                "value": {
                  "error": {
                    "code": "unauthorized",
                    "details": {},
                    "message": "Authentication is required.",
                    "requestId": "req_0000000000000001"
                  }
                }
              }
            },
            "schema": {
              "$ref": "#/components/schemas/Error"
            }
          }
        },
        "description": "Authentication is required.",
        "headers": {
          "RateLimit-Limit": {
            "$ref": "#/components/headers/RateLimitLimit"
          },
          "RateLimit-Remaining": {
            "$ref": "#/components/headers/RateLimitRemaining"
          },
          "RateLimit-Reset": {
            "$ref": "#/components/headers/RateLimitReset"
          },
          "X-Request-Id": {
            "$ref": "#/components/headers/RequestId"
          }
        }
      }
    },
    "schemas": {
      "ApiKeyCredential": {
        "additionalProperties": false,
        "description": "Runtime API key credential model reserved for future protected Domain API requests.",
        "properties": {
          "header": {
            "const": "X-Elynext-API-Key",
            "type": "string"
          },
          "key_id": {
            "minLength": 1,
            "type": "string"
          },
          "scopes": {
            "items": {
              "type": "string"
            },
            "type": "array"
          },
          "status": {
            "enum": [
              "active",
              "revoked"
            ],
            "type": "string"
          },
          "tenant_id": {
            "minLength": 1,
            "type": "string"
          }
        },
        "required": [
          "key_id",
          "tenant_id",
          "scopes",
          "status"
        ],
        "type": "object"
      },
      "Appointment": {
        "additionalProperties": false,
        "properties": {
          "accessType": {
            "type": "string"
          },
          "createdAt": {
            "format": "date-time",
            "type": "string"
          },
          "doctorId": {
            "type": "string"
          },
          "endsAt": {
            "format": "date-time",
            "type": "string"
          },
          "id": {
            "type": "string"
          },
          "patientId": {
            "type": "string"
          },
          "reason": {
            "type": "string"
          },
          "room": {
            "type": "string"
          },
          "startsAt": {
            "format": "date-time",
            "type": "string"
          },
          "status": {
            "type": "string"
          },
          "tenantId": {
            "type": "string"
          },
          "type": {
            "type": "string"
          },
          "updatedAt": {
            "format": "date-time",
            "type": "string"
          }
        },
        "type": "object"
      },
      "AppointmentCollection": {
        "additionalProperties": false,
        "properties": {
          "data": {
            "items": {
              "$ref": "#/components/schemas/Appointment"
            },
            "type": "array"
          },
          "meta": {
            "additionalProperties": false,
            "properties": {
              "filters": {
                "type": "object"
              },
              "pagination": {
                "$ref": "#/components/schemas/PaginationMeta"
              },
              "sort": {
                "type": "string"
              }
            },
            "required": [
              "pagination",
              "sort",
              "filters"
            ],
            "type": "object"
          }
        },
        "required": [
          "data",
          "meta"
        ],
        "type": "object"
      },
      "AppointmentEnvelope": {
        "additionalProperties": false,
        "properties": {
          "data": {
            "$ref": "#/components/schemas/Appointment"
          }
        },
        "required": [
          "data"
        ],
        "type": "object"
      },
      "AppointmentWrite": {
        "additionalProperties": false,
        "description": "Business validations apply. serviceId and locationId are not accepted fields in this version. Timestamps require explicit offsets and normalize to Europe/Rome. Conflicting bookings return 409; retry concurrent_request with the same idempotency key.",
        "properties": {
          "accessType": {
            "type": "string"
          },
          "doctorId": {
            "type": "string"
          },
          "endsAt": {
            "format": "date-time",
            "type": "string"
          },
          "patientId": {
            "type": "string"
          },
          "reason": {
            "type": "string"
          },
          "room": {
            "type": "string"
          },
          "startsAt": {
            "format": "date-time",
            "type": "string"
          },
          "status": {
            "type": "string"
          },
          "type": {
            "type": "string"
          }
        },
        "type": "object"
      },
      "ArchiveEnvelope": {
        "additionalProperties": false,
        "properties": {
          "data": {
            "additionalProperties": false,
            "properties": {
              "archived": {
                "const": true,
                "type": "boolean"
              },
              "id": {
                "type": "string"
              },
              "status": {
                "type": "string"
              }
            },
            "required": [
              "id",
              "archived",
              "status"
            ],
            "type": "object"
          }
        },
        "required": [
          "data"
        ],
        "type": "object"
      },
      "AvailabilityEnvelope": {
        "properties": {
          "data": {
            "additionalProperties": false,
            "properties": {
              "date": {
                "format": "date",
                "type": "string"
              },
              "doctorId": {
                "type": "string"
              },
              "durationMinutes": {
                "maximum": 1440,
                "minimum": 5,
                "type": "integer"
              },
              "locationId": {
                "type": "string"
              },
              "serviceId": {
                "type": "string"
              },
              "slots": {
                "items": {
                  "additionalProperties": false,
                  "properties": {
                    "endsAt": {
                      "format": "date-time",
                      "type": "string"
                    },
                    "startsAt": {
                      "format": "date-time",
                      "type": "string"
                    }
                  },
                  "required": [
                    "startsAt",
                    "endsAt"
                  ],
                  "type": "object"
                },
                "type": "array"
              },
              "timezone": {
                "type": "string"
              }
            },
            "required": [
              "date",
              "timezone",
              "locationId",
              "doctorId",
              "serviceId",
              "durationMinutes",
              "slots"
            ],
            "type": "object"
          }
        },
        "required": [
          "data"
        ],
        "type": "object"
      },
      "ClinicalRecord": {
        "additionalProperties": false,
        "properties": {
          "createdAt": {
            "format": "date-time",
            "type": "string"
          },
          "doctorId": {
            "type": "string"
          },
          "id": {
            "type": "string"
          },
          "occurredAt": {
            "format": "date-time",
            "type": "string"
          },
          "patientId": {
            "type": "string"
          },
          "reason": {
            "type": "string"
          },
          "status": {
            "type": "string"
          },
          "tenantId": {
            "type": "string"
          },
          "type": {
            "type": "string"
          },
          "updatedAt": {
            "format": "date-time",
            "type": "string"
          }
        },
        "type": "object"
      },
      "ClinicalRecordCollection": {
        "additionalProperties": false,
        "properties": {
          "data": {
            "items": {
              "$ref": "#/components/schemas/ClinicalRecord"
            },
            "type": "array"
          },
          "meta": {
            "additionalProperties": false,
            "properties": {
              "filters": {
                "type": "object"
              },
              "pagination": {
                "$ref": "#/components/schemas/PaginationMeta"
              },
              "sort": {
                "type": "string"
              }
            },
            "required": [
              "pagination",
              "sort",
              "filters"
            ],
            "type": "object"
          }
        },
        "required": [
          "data",
          "meta"
        ],
        "type": "object"
      },
      "ClinicalRecordEnvelope": {
        "additionalProperties": false,
        "properties": {
          "data": {
            "$ref": "#/components/schemas/ClinicalRecord"
          }
        },
        "required": [
          "data"
        ],
        "type": "object"
      },
      "ClinicalRecordWrite": {
        "additionalProperties": false,
        "description": "Field shapes only; environment business validations and required fields also apply.",
        "properties": {
          "doctorId": {
            "type": "string"
          },
          "occurredAt": {
            "format": "date-time",
            "type": "string"
          },
          "patientId": {
            "type": "string"
          },
          "reason": {
            "type": "string"
          },
          "status": {
            "type": "string"
          },
          "type": {
            "type": "string"
          }
        },
        "type": "object"
      },
      "DoctorsCollection": {
        "properties": {
          "data": {
            "items": {
              "additionalProperties": false,
              "properties": {
                "id": {
                  "type": "string"
                },
                "locationId": {
                  "type": "string"
                },
                "name": {
                  "type": "string"
                }
              },
              "required": [
                "id",
                "name",
                "locationId"
              ],
              "type": "object"
            },
            "type": "array"
          },
          "meta": {
            "properties": {
              "pagination": {
                "$ref": "#/components/schemas/PaginationMeta"
              }
            },
            "type": "object"
          }
        },
        "required": [
          "data",
          "meta"
        ],
        "type": "object"
      },
      "Document": {
        "additionalProperties": false,
        "properties": {
          "author": {
            "type": "string"
          },
          "clinicalRecordId": {
            "type": "string"
          },
          "createdAt": {
            "format": "date-time",
            "type": "string"
          },
          "doctorId": {
            "type": "string"
          },
          "generatedAt": {
            "format": "date-time",
            "type": "string"
          },
          "id": {
            "type": "string"
          },
          "patientId": {
            "type": "string"
          },
          "status": {
            "type": "string"
          },
          "tenantId": {
            "type": "string"
          },
          "type": {
            "type": "string"
          },
          "updatedAt": {
            "format": "date-time",
            "type": "string"
          },
          "version": {
            "type": "string"
          }
        },
        "type": "object"
      },
      "DocumentCollection": {
        "additionalProperties": false,
        "properties": {
          "data": {
            "items": {
              "$ref": "#/components/schemas/Document"
            },
            "type": "array"
          },
          "meta": {
            "additionalProperties": false,
            "properties": {
              "filters": {
                "type": "object"
              },
              "pagination": {
                "$ref": "#/components/schemas/PaginationMeta"
              },
              "sort": {
                "type": "string"
              }
            },
            "required": [
              "pagination",
              "sort",
              "filters"
            ],
            "type": "object"
          }
        },
        "required": [
          "data",
          "meta"
        ],
        "type": "object"
      },
      "DocumentEnvelope": {
        "additionalProperties": false,
        "properties": {
          "data": {
            "$ref": "#/components/schemas/Document"
          }
        },
        "required": [
          "data"
        ],
        "type": "object"
      },
      "DocumentWrite": {
        "additionalProperties": false,
        "description": "Field shapes only; environment business validations and required fields also apply.",
        "properties": {
          "author": {
            "type": "string"
          },
          "clinicalRecordId": {
            "type": "string"
          },
          "doctorId": {
            "type": "string"
          },
          "generatedAt": {
            "format": "date-time",
            "type": "string"
          },
          "patientId": {
            "type": "string"
          },
          "status": {
            "type": "string"
          },
          "type": {
            "type": "string"
          },
          "version": {
            "type": "string"
          }
        },
        "type": "object"
      },
      "Error": {
        "additionalProperties": false,
        "properties": {
          "error": {
            "additionalProperties": false,
            "properties": {
              "code": {
                "type": "string"
              },
              "details": {
                "type": "object"
              },
              "message": {
                "type": "string"
              },
              "requestId": {
                "type": "string"
              }
            },
            "required": [
              "code",
              "message",
              "details",
              "requestId"
            ],
            "type": "object"
          }
        },
        "required": [
          "error"
        ],
        "type": "object"
      },
      "Health": {
        "additionalProperties": false,
        "properties": {
          "apiVersion": {
            "const": "v1",
            "type": "string"
          },
          "classification": {
            "const": "PUBLIC_METADATA",
            "type": "string"
          },
          "name": {
            "const": "Elynext API",
            "type": "string"
          },
          "status": {
            "enum": [
              "ok"
            ],
            "type": "string"
          }
        },
        "required": [
          "status",
          "name",
          "apiVersion",
          "classification"
        ],
        "type": "object"
      },
      "HealthEnvelope": {
        "additionalProperties": false,
        "properties": {
          "data": {
            "$ref": "#/components/schemas/Health"
          },
          "meta": {
            "$ref": "#/components/schemas/ResponseMeta"
          }
        },
        "required": [
          "data",
          "meta"
        ],
        "type": "object"
      },
      "LocationsCollection": {
        "properties": {
          "data": {
            "items": {
              "additionalProperties": false,
              "properties": {
                "address": {
                  "type": "string"
                },
                "id": {
                  "type": "string"
                },
                "name": {
                  "type": "string"
                }
              },
              "required": [
                "id",
                "name",
                "address"
              ],
              "type": "object"
            },
            "type": "array"
          },
          "meta": {
            "properties": {
              "pagination": {
                "$ref": "#/components/schemas/PaginationMeta"
              }
            },
            "type": "object"
          }
        },
        "required": [
          "data",
          "meta"
        ],
        "type": "object"
      },
      "OAuthTokenRequest": {
        "additionalProperties": false,
        "properties": {
          "client_id": {
            "maxLength": 128,
            "minLength": 1,
            "type": "string"
          },
          "client_secret": {
            "maxLength": 512,
            "minLength": 24,
            "type": "string",
            "writeOnly": true
          },
          "grant_type": {
            "const": "client_credentials",
            "type": "string"
          },
          "scope": {
            "description": "Optional space-delimited subset of scopes assigned to the partner client.",
            "type": "string"
          }
        },
        "required": [
          "grant_type"
        ],
        "type": "object"
      },
      "OAuthTokenResponse": {
        "additionalProperties": false,
        "properties": {
          "access_token": {
            "minLength": 1,
            "type": "string"
          },
          "api_version": {
            "const": "v1",
            "type": "string"
          },
          "expires_in": {
            "minimum": 1,
            "type": "integer"
          },
          "scope": {
            "type": "string"
          },
          "tenant_id": {
            "minLength": 1,
            "type": "string"
          },
          "token_type": {
            "const": "Bearer",
            "type": "string"
          }
        },
        "required": [
          "access_token",
          "token_type",
          "expires_in",
          "scope",
          "tenant_id",
          "api_version"
        ],
        "type": "object"
      },
      "PaginationMeta": {
        "additionalProperties": false,
        "properties": {
          "limit": {
            "maximum": 100,
            "minimum": 1,
            "type": "integer"
          },
          "offset": {
            "minimum": 0,
            "type": "integer"
          },
          "total": {
            "minimum": 0,
            "type": "integer"
          }
        },
        "required": [
          "limit",
          "offset",
          "total"
        ],
        "type": "object"
      },
      "Patient": {
        "additionalProperties": false,
        "properties": {
          "city": {
            "type": "string"
          },
          "createdAt": {
            "format": "date-time",
            "type": "string"
          },
          "dateOfBirth": {
            "format": "date",
            "type": "string"
          },
          "doctorId": {
            "type": "string"
          },
          "email": {
            "type": "string"
          },
          "firstName": {
            "type": "string"
          },
          "healthDataConsent": {
            "type": "boolean"
          },
          "id": {
            "type": "string"
          },
          "lastName": {
            "type": "string"
          },
          "mobile": {
            "type": "string"
          },
          "phone": {
            "type": "string"
          },
          "postalCode": {
            "type": "string"
          },
          "privacyConsent": {
            "type": "boolean"
          },
          "province": {
            "type": "string"
          },
          "sex": {
            "type": "string"
          },
          "status": {
            "type": "string"
          },
          "taxCode": {
            "type": "string"
          },
          "tenantId": {
            "type": "string"
          },
          "updatedAt": {
            "format": "date-time",
            "type": "string"
          }
        },
        "type": "object"
      },
      "PatientCollection": {
        "additionalProperties": false,
        "properties": {
          "data": {
            "items": {
              "$ref": "#/components/schemas/Patient"
            },
            "type": "array"
          },
          "meta": {
            "additionalProperties": false,
            "properties": {
              "filters": {
                "type": "object"
              },
              "pagination": {
                "$ref": "#/components/schemas/PaginationMeta"
              },
              "sort": {
                "type": "string"
              }
            },
            "required": [
              "pagination",
              "sort",
              "filters"
            ],
            "type": "object"
          }
        },
        "required": [
          "data",
          "meta"
        ],
        "type": "object"
      },
      "PatientEnvelope": {
        "additionalProperties": false,
        "properties": {
          "data": {
            "$ref": "#/components/schemas/Patient"
          }
        },
        "required": [
          "data"
        ],
        "type": "object"
      },
      "PatientWrite": {
        "additionalProperties": false,
        "description": "Business validations apply in addition to field shapes. Language and communication/marketing consent are not in this version; privacyConsent and healthDataConsent are not marketing consent.",
        "properties": {
          "city": {
            "type": "string"
          },
          "dateOfBirth": {
            "format": "date",
            "type": "string"
          },
          "doctorId": {
            "type": "string"
          },
          "email": {
            "type": "string"
          },
          "firstName": {
            "type": "string"
          },
          "healthDataConsent": {
            "type": "boolean"
          },
          "lastName": {
            "type": "string"
          },
          "mobile": {
            "type": "string"
          },
          "phone": {
            "type": "string"
          },
          "postalCode": {
            "type": "string"
          },
          "privacyConsent": {
            "type": "boolean"
          },
          "province": {
            "type": "string"
          },
          "sex": {
            "type": "string"
          },
          "status": {
            "type": "string"
          },
          "taxCode": {
            "type": "string"
          }
        },
        "type": "object"
      },
      "Report": {
        "additionalProperties": false,
        "properties": {
          "clinicalRecordId": {
            "type": "string"
          },
          "createdAt": {
            "format": "date-time",
            "type": "string"
          },
          "doctorId": {
            "type": "string"
          },
          "documentId": {
            "type": "string"
          },
          "examId": {
            "type": "string"
          },
          "generatedAt": {
            "format": "date-time",
            "type": "string"
          },
          "id": {
            "type": "string"
          },
          "patientId": {
            "type": "string"
          },
          "status": {
            "type": "string"
          },
          "tenantId": {
            "type": "string"
          },
          "title": {
            "type": "string"
          },
          "type": {
            "type": "string"
          },
          "updatedAt": {
            "format": "date-time",
            "type": "string"
          }
        },
        "type": "object"
      },
      "ReportCollection": {
        "additionalProperties": false,
        "properties": {
          "data": {
            "items": {
              "$ref": "#/components/schemas/Report"
            },
            "type": "array"
          },
          "meta": {
            "additionalProperties": false,
            "properties": {
              "filters": {
                "type": "object"
              },
              "pagination": {
                "$ref": "#/components/schemas/PaginationMeta"
              },
              "sort": {
                "type": "string"
              }
            },
            "required": [
              "pagination",
              "sort",
              "filters"
            ],
            "type": "object"
          }
        },
        "required": [
          "data",
          "meta"
        ],
        "type": "object"
      },
      "ReportEnvelope": {
        "additionalProperties": false,
        "properties": {
          "data": {
            "$ref": "#/components/schemas/Report"
          }
        },
        "required": [
          "data"
        ],
        "type": "object"
      },
      "ReportWrite": {
        "additionalProperties": false,
        "description": "Field shapes only; environment business validations and required fields also apply.",
        "properties": {
          "clinicalRecordId": {
            "type": "string"
          },
          "doctorId": {
            "type": "string"
          },
          "documentId": {
            "type": "string"
          },
          "examId": {
            "type": "string"
          },
          "generatedAt": {
            "format": "date-time",
            "type": "string"
          },
          "patientId": {
            "type": "string"
          },
          "status": {
            "type": "string"
          },
          "title": {
            "type": "string"
          },
          "type": {
            "type": "string"
          }
        },
        "type": "object"
      },
      "ResponseMeta": {
        "additionalProperties": false,
        "properties": {
          "apiVersion": {
            "const": "v1",
            "type": "string"
          },
          "requestId": {
            "maxLength": 128,
            "minLength": 1,
            "type": "string"
          },
          "timestamp": {
            "format": "date-time",
            "type": "string"
          }
        },
        "required": [
          "apiVersion",
          "requestId",
          "timestamp"
        ],
        "type": "object"
      },
      "SearchRequest": {
        "additionalProperties": true,
        "description": "Portable contract: equality filters on documented public fields, free-text search and pagination. No dedicated date-range or incremental synchronization cursor is specified. Do not depend on unspecified filter operators.",
        "properties": {
          "filters": {
            "type": "object"
          },
          "limit": {
            "maximum": 100,
            "minimum": 1,
            "type": "integer"
          },
          "offset": {
            "minimum": 0,
            "type": "integer"
          },
          "search": {
            "type": "string"
          },
          "sort": {
            "type": "string"
          }
        },
        "type": "object"
      },
      "ServicesCollection": {
        "properties": {
          "data": {
            "items": {
              "additionalProperties": false,
              "properties": {
                "durationMinutes": {
                  "maximum": 1440,
                  "minimum": 5,
                  "type": [
                    "integer",
                    "null"
                  ]
                },
                "id": {
                  "type": "string"
                },
                "name": {
                  "type": "string"
                }
              },
              "required": [
                "id",
                "name",
                "durationMinutes"
              ],
              "type": "object"
            },
            "type": "array"
          },
          "meta": {
            "properties": {
              "pagination": {
                "$ref": "#/components/schemas/PaginationMeta"
              }
            },
            "type": "object"
          }
        },
        "required": [
          "data",
          "meta"
        ],
        "type": "object"
      },
      "Version": {
        "additionalProperties": false,
        "properties": {
          "apiVersion": {
            "const": "v1",
            "type": "string"
          },
          "applicationVersion": {
            "type": "string"
          },
          "capabilities": {
            "items": {
              "pattern": "^(api\\.|[a-z][a-z0-9-]*\\.(read|write|create|update|delete|download|export|publish|manage)$)",
              "type": "string"
            },
            "type": "array"
          },
          "contractVersion": {
            "type": "string"
          },
          "name": {
            "const": "Elynext API",
            "type": "string"
          },
          "resources": {
            "items": {
              "type": "string"
            },
            "type": "array"
          },
          "stage": {
            "const": "foundation",
            "type": "string"
          }
        },
        "required": [
          "name",
          "apiVersion",
          "contractVersion",
          "applicationVersion",
          "stage",
          "capabilities",
          "resources"
        ],
        "type": "object"
      },
      "VersionEnvelope": {
        "additionalProperties": false,
        "properties": {
          "data": {
            "$ref": "#/components/schemas/Version"
          },
          "meta": {
            "$ref": "#/components/schemas/ResponseMeta"
          }
        },
        "required": [
          "data",
          "meta"
        ],
        "type": "object"
      },
      "WebhookEvent": {
        "additionalProperties": false,
        "description": "Minimal signed webhook event payload. Clinical details must be fetched through authorized Domain API calls.",
        "properties": {
          "eventId": {
            "type": "string"
          },
          "eventType": {
            "enum": [
              "patient.created",
              "patient.updated",
              "appointment.created",
              "appointment.updated",
              "appointment.cancelled",
              "clinical-record.created",
              "document.created",
              "report.created",
              "report.updated"
            ],
            "type": "string"
          },
          "eventVersion": {
            "const": "1",
            "type": "string"
          },
          "metadata": {
            "additionalProperties": false,
            "properties": {
              "apiVersion": {
                "const": "v1",
                "type": "string"
              },
              "requestId": {
                "type": "string"
              },
              "resourceType": {
                "type": "string"
              }
            },
            "required": [
              "apiVersion",
              "requestId",
              "resourceType"
            ],
            "type": "object"
          },
          "resourceId": {
            "type": "string"
          },
          "tenantId": {
            "type": "string"
          },
          "timestamp": {
            "format": "date-time",
            "type": "string"
          }
        },
        "required": [
          "eventId",
          "eventType",
          "eventVersion",
          "tenantId",
          "resourceId",
          "timestamp",
          "metadata"
        ],
        "type": "object"
      },
      "WebhookSubscription": {
        "additionalProperties": false,
        "properties": {
          "createdAt": {
            "format": "date-time",
            "type": "string"
          },
          "eventTypes": {
            "items": {
              "enum": [
                "patient.created",
                "patient.updated",
                "appointment.created",
                "appointment.updated",
                "appointment.cancelled",
                "clinical-record.created",
                "document.created",
                "report.created",
                "report.updated"
              ],
              "type": "string"
            },
            "type": "array"
          },
          "id": {
            "type": "string"
          },
          "status": {
            "enum": [
              "active",
              "paused",
              "revoked"
            ],
            "type": "string"
          },
          "targetUrl": {
            "format": "uri",
            "type": "string"
          },
          "tenantId": {
            "type": "string"
          },
          "updatedAt": {
            "format": "date-time",
            "type": "string"
          }
        },
        "required": [
          "id",
          "tenantId",
          "targetUrl",
          "eventTypes",
          "status",
          "createdAt",
          "updatedAt"
        ],
        "type": "object"
      },
      "WebhookSubscriptionCollection": {
        "additionalProperties": false,
        "properties": {
          "data": {
            "items": {
              "$ref": "#/components/schemas/WebhookSubscription"
            },
            "type": "array"
          },
          "meta": {
            "additionalProperties": false,
            "properties": {
              "total": {
                "minimum": 0,
                "type": "integer"
              }
            },
            "required": [
              "total"
            ],
            "type": "object"
          }
        },
        "required": [
          "data",
          "meta"
        ],
        "type": "object"
      },
      "WebhookSubscriptionEnvelope": {
        "additionalProperties": false,
        "properties": {
          "data": {
            "$ref": "#/components/schemas/WebhookSubscription"
          }
        },
        "required": [
          "data"
        ],
        "type": "object"
      },
      "WebhookSubscriptionWrite": {
        "additionalProperties": false,
        "properties": {
          "eventTypes": {
            "items": {
              "enum": [
                "patient.created",
                "patient.updated",
                "appointment.created",
                "appointment.updated",
                "appointment.cancelled",
                "clinical-record.created",
                "document.created",
                "report.created",
                "report.updated"
              ],
              "type": "string"
            },
            "type": "array"
          },
          "signingSecret": {
            "minLength": 24,
            "type": "string",
            "writeOnly": true
          },
          "status": {
            "enum": [
              "active",
              "paused",
              "revoked"
            ],
            "type": "string"
          },
          "targetUrl": {
            "format": "uri",
            "type": "string"
          }
        },
        "type": "object"
      }
    },
    "securitySchemes": {
      "ElynextApiKey": {
        "description": "Alternative assigned API key for protected server-to-server integrations. Keys are subject to tenant restrictions, scopes, quotas, rotation and revocation.",
        "in": "header",
        "name": "X-Elynext-API-Key",
        "type": "apiKey"
      },
      "ElynextBearerToken": {
        "description": "Bearer access token issued through OAuth2 Client Credentials. Tenant and scope restrictions apply to every protected request.",
        "scheme": "bearer",
        "type": "http"
      },
      "ElynextOAuth2": {
        "description": "OAuth2 Client Credentials for protected server-to-server API resources. Clients and scopes are assigned before access; discovery endpoints are public.",
        "flows": {
          "clientCredentials": {
            "scopes": {
              "api.health.read": "Read non-sensitive Elynext Public API health metadata.",
              "api.openapi.read": "Read the non-sensitive Elynext Public API OpenAPI contract.",
              "api.version.read": "Read non-sensitive Elynext Public API version metadata.",
              "appointments.read": "Read tenant-scoped appointment resources.",
              "appointments.write": "Create, update and archive tenant-scoped appointment resources.",
              "clinical-records.read": "Read tenant-scoped clinical record resources.",
              "clinical-records.write": "Create, update and archive tenant-scoped clinical record resources.",
              "documents.read": "Read tenant-scoped document metadata resources.",
              "documents.write": "Create, update and archive tenant-scoped document metadata resources.",
              "patients.read": "Read tenant-scoped patient resources.",
              "patients.write": "Create, update and archive tenant-scoped patient resources.",
              "reports.read": "Read tenant-scoped report metadata resources.",
              "reports.write": "Create, update and archive tenant-scoped report metadata resources.",
              "webhook-subscriptions.read": "Read tenant-scoped webhook subscription metadata.",
              "webhook-subscriptions.write": "Create, update and revoke tenant-scoped webhook subscriptions."
            },
            "tokenUrl": "/api/v1/oauth/token"
          }
        },
        "type": "oauth2"
      }
    }
  },
  "info": {
    "description": "Partner-independent API reference. See the developer guide and capability status before implementation. This specification describes the contract, not the activation state of any environment. Tenant access, scopes and credentials are assigned separately.",
    "summary": "Standard server-to-server integration contract",
    "title": "Elynext Public API v1",
    "version": "1.0.0"
  },
  "openapi": "3.1.0",
  "paths": {
    "/appointments": {
      "get": {
        "description": "List tenant-scoped Elynext appointments resources.",
        "operationId": "listAppointment",
        "parameters": [
          {
            "$ref": "#/components/parameters/RequestIdHeader"
          },
          {
            "in": "query",
            "name": "limit",
            "schema": {
              "default": 50,
              "maximum": 100,
              "minimum": 1,
              "type": "integer"
            }
          },
          {
            "in": "query",
            "name": "offset",
            "schema": {
              "default": 0,
              "minimum": 0,
              "type": "integer"
            }
          },
          {
            "description": "Public field name, optionally prefixed with - for descending order.",
            "in": "query",
            "name": "sort",
            "schema": {
              "type": "string"
            }
          },
          {
            "description": "Free-text search. Use POST search for structured filters.",
            "in": "query",
            "name": "search",
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/AppointmentCollection"
                }
              }
            },
            "description": "Appointments response.",
            "headers": {
              "RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimitLimit"
              },
              "RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimitRemaining"
              },
              "RateLimit-Reset": {
                "$ref": "#/components/headers/RateLimitReset"
              },
              "X-Request-Id": {
                "$ref": "#/components/headers/RequestId"
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          },
          "405": {
            "$ref": "#/components/responses/MethodNotAllowed"
          },
          "409": {
            "$ref": "#/components/responses/Conflict"
          },
          "429": {
            "$ref": "#/components/responses/RateLimited"
          },
          "500": {
            "$ref": "#/components/responses/InternalError"
          }
        },
        "security": [
          {
            "ElynextOAuth2": [
              "appointments.read"
            ]
          },
          {
            "ElynextApiKey": []
          }
        ],
        "summary": "List appointments",
        "tags": [
          "Appointments"
        ]
      },
      "post": {
        "description": "Create tenant-scoped Elynext appointments resources.",
        "operationId": "createAppointment",
        "parameters": [
          {
            "$ref": "#/components/parameters/RequestIdHeader"
          },
          {
            "$ref": "#/components/parameters/IdempotencyKeyHeader"
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/AppointmentWrite",
                "required": [
                  "doctorId",
                  "patientId",
                  "startsAt",
                  "endsAt"
                ]
              }
            }
          },
          "required": true
        },
        "responses": {
          "201": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/AppointmentEnvelope"
                }
              }
            },
            "description": "Appointments response.",
            "headers": {
              "RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimitLimit"
              },
              "RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimitRemaining"
              },
              "RateLimit-Reset": {
                "$ref": "#/components/headers/RateLimitReset"
              },
              "X-Request-Id": {
                "$ref": "#/components/headers/RequestId"
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          },
          "405": {
            "$ref": "#/components/responses/MethodNotAllowed"
          },
          "409": {
            "$ref": "#/components/responses/Conflict"
          },
          "429": {
            "$ref": "#/components/responses/RateLimited"
          },
          "500": {
            "$ref": "#/components/responses/InternalError"
          }
        },
        "security": [
          {
            "ElynextOAuth2": [
              "appointments.write"
            ]
          },
          {
            "ElynextApiKey": []
          }
        ],
        "summary": "Create appointments",
        "tags": [
          "Appointments"
        ]
      }
    },
    "/appointments/search": {
      "post": {
        "description": "Search tenant-scoped Elynext appointments resources.",
        "operationId": "searchAppointment",
        "parameters": [
          {
            "$ref": "#/components/parameters/RequestIdHeader"
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/SearchRequest"
              }
            }
          },
          "required": false
        },
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/AppointmentCollection"
                }
              }
            },
            "description": "Appointments response.",
            "headers": {
              "RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimitLimit"
              },
              "RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimitRemaining"
              },
              "RateLimit-Reset": {
                "$ref": "#/components/headers/RateLimitReset"
              },
              "X-Request-Id": {
                "$ref": "#/components/headers/RequestId"
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          },
          "405": {
            "$ref": "#/components/responses/MethodNotAllowed"
          },
          "409": {
            "$ref": "#/components/responses/Conflict"
          },
          "429": {
            "$ref": "#/components/responses/RateLimited"
          },
          "500": {
            "$ref": "#/components/responses/InternalError"
          }
        },
        "security": [
          {
            "ElynextOAuth2": [
              "appointments.read"
            ]
          },
          {
            "ElynextApiKey": []
          }
        ],
        "summary": "Search appointments",
        "tags": [
          "Appointments"
        ]
      }
    },
    "/appointments/{id}": {
      "delete": {
        "description": "Set status to Annullato, without physically deleting the record. Cancellation policies and reason handling require acceptance verification.",
        "operationId": "deleteAppointment",
        "parameters": [
          {
            "$ref": "#/components/parameters/RequestIdHeader"
          },
          {
            "$ref": "#/components/parameters/ResourceIdPath"
          }
        ],
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ArchiveEnvelope"
                }
              }
            },
            "description": "Appointments response.",
            "headers": {
              "RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimitLimit"
              },
              "RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimitRemaining"
              },
              "RateLimit-Reset": {
                "$ref": "#/components/headers/RateLimitReset"
              },
              "X-Request-Id": {
                "$ref": "#/components/headers/RequestId"
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          },
          "405": {
            "$ref": "#/components/responses/MethodNotAllowed"
          },
          "409": {
            "$ref": "#/components/responses/Conflict"
          },
          "429": {
            "$ref": "#/components/responses/RateLimited"
          },
          "500": {
            "$ref": "#/components/responses/InternalError"
          }
        },
        "security": [
          {
            "ElynextOAuth2": [
              "appointments.write"
            ]
          },
          {
            "ElynextApiKey": []
          }
        ],
        "summary": "Cancel an appointment",
        "tags": [
          "Appointments"
        ]
      },
      "get": {
        "description": "Get tenant-scoped Elynext appointments resources.",
        "operationId": "getAppointment",
        "parameters": [
          {
            "$ref": "#/components/parameters/RequestIdHeader"
          },
          {
            "$ref": "#/components/parameters/ResourceIdPath"
          }
        ],
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/AppointmentEnvelope"
                }
              }
            },
            "description": "Appointments response.",
            "headers": {
              "RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimitLimit"
              },
              "RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimitRemaining"
              },
              "RateLimit-Reset": {
                "$ref": "#/components/headers/RateLimitReset"
              },
              "X-Request-Id": {
                "$ref": "#/components/headers/RequestId"
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          },
          "405": {
            "$ref": "#/components/responses/MethodNotAllowed"
          },
          "409": {
            "$ref": "#/components/responses/Conflict"
          },
          "429": {
            "$ref": "#/components/responses/RateLimited"
          },
          "500": {
            "$ref": "#/components/responses/InternalError"
          }
        },
        "security": [
          {
            "ElynextOAuth2": [
              "appointments.read"
            ]
          },
          {
            "ElynextApiKey": []
          }
        ],
        "summary": "Get appointments",
        "tags": [
          "Appointments"
        ]
      },
      "patch": {
        "description": "Update tenant-scoped Elynext appointments resources.",
        "operationId": "updateAppointment",
        "parameters": [
          {
            "$ref": "#/components/parameters/RequestIdHeader"
          },
          {
            "$ref": "#/components/parameters/ResourceIdPath"
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/AppointmentWrite"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/AppointmentEnvelope"
                }
              }
            },
            "description": "Appointments response.",
            "headers": {
              "RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimitLimit"
              },
              "RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimitRemaining"
              },
              "RateLimit-Reset": {
                "$ref": "#/components/headers/RateLimitReset"
              },
              "X-Request-Id": {
                "$ref": "#/components/headers/RequestId"
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          },
          "405": {
            "$ref": "#/components/responses/MethodNotAllowed"
          },
          "409": {
            "$ref": "#/components/responses/Conflict"
          },
          "429": {
            "$ref": "#/components/responses/RateLimited"
          },
          "500": {
            "$ref": "#/components/responses/InternalError"
          }
        },
        "security": [
          {
            "ElynextOAuth2": [
              "appointments.write"
            ]
          },
          {
            "ElynextApiKey": []
          }
        ],
        "summary": "Update appointments",
        "tags": [
          "Appointments"
        ]
      }
    },
    "/availability": {
      "get": {
        "description": "Credential-scoped read. Locations represent the credential's studio. Availability is advisory for one doctor/service/day, not a reservation or a service eligibility guarantee.",
        "operationId": "readBookingAvailability",
        "parameters": [
          {
            "$ref": "#/components/parameters/RequestIdHeader"
          },
          {
            "in": "query",
            "name": "date",
            "required": true,
            "schema": {
              "format": "date",
              "type": "string"
            }
          },
          {
            "in": "query",
            "name": "doctorId",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "in": "query",
            "name": "serviceId",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "in": "query",
            "name": "locationId",
            "required": false,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/AvailabilityEnvelope"
                }
              }
            },
            "description": "Booking response.",
            "headers": {
              "RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimitLimit"
              },
              "RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimitRemaining"
              },
              "RateLimit-Reset": {
                "$ref": "#/components/headers/RateLimitReset"
              },
              "X-Request-Id": {
                "$ref": "#/components/headers/RequestId"
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          },
          "405": {
            "$ref": "#/components/responses/MethodNotAllowed"
          },
          "409": {
            "$ref": "#/components/responses/Conflict"
          },
          "429": {
            "$ref": "#/components/responses/RateLimited"
          },
          "500": {
            "$ref": "#/components/responses/InternalError"
          }
        },
        "security": [
          {
            "ElynextOAuth2": [
              "appointments.read"
            ]
          },
          {
            "ElynextApiKey": []
          }
        ],
        "summary": "Read booking availability",
        "tags": [
          "Booking"
        ]
      }
    },
    "/clinical-records": {
      "get": {
        "description": "List tenant-scoped Elynext clinical-records resources.",
        "operationId": "listClinicalRecord",
        "parameters": [
          {
            "$ref": "#/components/parameters/RequestIdHeader"
          },
          {
            "in": "query",
            "name": "limit",
            "schema": {
              "default": 50,
              "maximum": 100,
              "minimum": 1,
              "type": "integer"
            }
          },
          {
            "in": "query",
            "name": "offset",
            "schema": {
              "default": 0,
              "minimum": 0,
              "type": "integer"
            }
          },
          {
            "description": "Public field name, optionally prefixed with - for descending order.",
            "in": "query",
            "name": "sort",
            "schema": {
              "type": "string"
            }
          },
          {
            "description": "Free-text search. Use POST search for structured filters.",
            "in": "query",
            "name": "search",
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ClinicalRecordCollection"
                }
              }
            },
            "description": "Clinical Records response.",
            "headers": {
              "RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimitLimit"
              },
              "RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimitRemaining"
              },
              "RateLimit-Reset": {
                "$ref": "#/components/headers/RateLimitReset"
              },
              "X-Request-Id": {
                "$ref": "#/components/headers/RequestId"
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          },
          "405": {
            "$ref": "#/components/responses/MethodNotAllowed"
          },
          "409": {
            "$ref": "#/components/responses/Conflict"
          },
          "429": {
            "$ref": "#/components/responses/RateLimited"
          },
          "500": {
            "$ref": "#/components/responses/InternalError"
          }
        },
        "security": [
          {
            "ElynextOAuth2": [
              "clinical-records.read"
            ]
          },
          {
            "ElynextApiKey": []
          }
        ],
        "summary": "List clinical-records",
        "tags": [
          "Clinical Records"
        ]
      },
      "post": {
        "description": "Create tenant-scoped Elynext clinical-records resources.",
        "operationId": "createClinicalRecord",
        "parameters": [
          {
            "$ref": "#/components/parameters/RequestIdHeader"
          },
          {
            "$ref": "#/components/parameters/IdempotencyKeyHeader"
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/ClinicalRecordWrite",
                "required": [
                  "doctorId",
                  "patientId",
                  "occurredAt"
                ]
              }
            }
          },
          "required": true
        },
        "responses": {
          "201": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ClinicalRecordEnvelope"
                }
              }
            },
            "description": "Clinical Records response.",
            "headers": {
              "RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimitLimit"
              },
              "RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimitRemaining"
              },
              "RateLimit-Reset": {
                "$ref": "#/components/headers/RateLimitReset"
              },
              "X-Request-Id": {
                "$ref": "#/components/headers/RequestId"
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          },
          "405": {
            "$ref": "#/components/responses/MethodNotAllowed"
          },
          "409": {
            "$ref": "#/components/responses/Conflict"
          },
          "429": {
            "$ref": "#/components/responses/RateLimited"
          },
          "500": {
            "$ref": "#/components/responses/InternalError"
          }
        },
        "security": [
          {
            "ElynextOAuth2": [
              "clinical-records.write"
            ]
          },
          {
            "ElynextApiKey": []
          }
        ],
        "summary": "Create clinical-records",
        "tags": [
          "Clinical Records"
        ]
      }
    },
    "/clinical-records/search": {
      "post": {
        "description": "Search tenant-scoped Elynext clinical-records resources.",
        "operationId": "searchClinicalRecord",
        "parameters": [
          {
            "$ref": "#/components/parameters/RequestIdHeader"
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/SearchRequest"
              }
            }
          },
          "required": false
        },
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ClinicalRecordCollection"
                }
              }
            },
            "description": "Clinical Records response.",
            "headers": {
              "RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimitLimit"
              },
              "RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimitRemaining"
              },
              "RateLimit-Reset": {
                "$ref": "#/components/headers/RateLimitReset"
              },
              "X-Request-Id": {
                "$ref": "#/components/headers/RequestId"
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          },
          "405": {
            "$ref": "#/components/responses/MethodNotAllowed"
          },
          "409": {
            "$ref": "#/components/responses/Conflict"
          },
          "429": {
            "$ref": "#/components/responses/RateLimited"
          },
          "500": {
            "$ref": "#/components/responses/InternalError"
          }
        },
        "security": [
          {
            "ElynextOAuth2": [
              "clinical-records.read"
            ]
          },
          {
            "ElynextApiKey": []
          }
        ],
        "summary": "Search clinical-records",
        "tags": [
          "Clinical Records"
        ]
      }
    },
    "/clinical-records/{id}": {
      "delete": {
        "description": "Archive tenant-scoped Elynext clinical-records resources.",
        "operationId": "deleteClinicalRecord",
        "parameters": [
          {
            "$ref": "#/components/parameters/RequestIdHeader"
          },
          {
            "$ref": "#/components/parameters/ResourceIdPath"
          }
        ],
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ArchiveEnvelope"
                }
              }
            },
            "description": "Clinical Records response.",
            "headers": {
              "RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimitLimit"
              },
              "RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimitRemaining"
              },
              "RateLimit-Reset": {
                "$ref": "#/components/headers/RateLimitReset"
              },
              "X-Request-Id": {
                "$ref": "#/components/headers/RequestId"
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          },
          "405": {
            "$ref": "#/components/responses/MethodNotAllowed"
          },
          "409": {
            "$ref": "#/components/responses/Conflict"
          },
          "429": {
            "$ref": "#/components/responses/RateLimited"
          },
          "500": {
            "$ref": "#/components/responses/InternalError"
          }
        },
        "security": [
          {
            "ElynextOAuth2": [
              "clinical-records.write"
            ]
          },
          {
            "ElynextApiKey": []
          }
        ],
        "summary": "Archive clinical-records",
        "tags": [
          "Clinical Records"
        ]
      },
      "get": {
        "description": "Get tenant-scoped Elynext clinical-records resources.",
        "operationId": "getClinicalRecord",
        "parameters": [
          {
            "$ref": "#/components/parameters/RequestIdHeader"
          },
          {
            "$ref": "#/components/parameters/ResourceIdPath"
          }
        ],
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ClinicalRecordEnvelope"
                }
              }
            },
            "description": "Clinical Records response.",
            "headers": {
              "RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimitLimit"
              },
              "RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimitRemaining"
              },
              "RateLimit-Reset": {
                "$ref": "#/components/headers/RateLimitReset"
              },
              "X-Request-Id": {
                "$ref": "#/components/headers/RequestId"
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          },
          "405": {
            "$ref": "#/components/responses/MethodNotAllowed"
          },
          "409": {
            "$ref": "#/components/responses/Conflict"
          },
          "429": {
            "$ref": "#/components/responses/RateLimited"
          },
          "500": {
            "$ref": "#/components/responses/InternalError"
          }
        },
        "security": [
          {
            "ElynextOAuth2": [
              "clinical-records.read"
            ]
          },
          {
            "ElynextApiKey": []
          }
        ],
        "summary": "Get clinical-records",
        "tags": [
          "Clinical Records"
        ]
      },
      "patch": {
        "description": "Update tenant-scoped Elynext clinical-records resources.",
        "operationId": "updateClinicalRecord",
        "parameters": [
          {
            "$ref": "#/components/parameters/RequestIdHeader"
          },
          {
            "$ref": "#/components/parameters/ResourceIdPath"
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/ClinicalRecordWrite"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ClinicalRecordEnvelope"
                }
              }
            },
            "description": "Clinical Records response.",
            "headers": {
              "RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimitLimit"
              },
              "RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimitRemaining"
              },
              "RateLimit-Reset": {
                "$ref": "#/components/headers/RateLimitReset"
              },
              "X-Request-Id": {
                "$ref": "#/components/headers/RequestId"
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          },
          "405": {
            "$ref": "#/components/responses/MethodNotAllowed"
          },
          "409": {
            "$ref": "#/components/responses/Conflict"
          },
          "429": {
            "$ref": "#/components/responses/RateLimited"
          },
          "500": {
            "$ref": "#/components/responses/InternalError"
          }
        },
        "security": [
          {
            "ElynextOAuth2": [
              "clinical-records.write"
            ]
          },
          {
            "ElynextApiKey": []
          }
        ],
        "summary": "Update clinical-records",
        "tags": [
          "Clinical Records"
        ]
      }
    },
    "/docs": {
      "get": {
        "operationId": "getApiDocs",
        "parameters": [
          {
            "$ref": "#/components/parameters/RequestIdHeader"
          }
        ],
        "responses": {
          "200": {
            "content": {
              "text/html": {
                "schema": {
                  "type": "string"
                }
              }
            },
            "description": "Swagger UI for the Elynext Public API.",
            "headers": {
              "RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimitLimit"
              },
              "RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimitRemaining"
              },
              "RateLimit-Reset": {
                "$ref": "#/components/headers/RateLimitReset"
              },
              "X-Request-Id": {
                "$ref": "#/components/headers/RequestId"
              }
            }
          },
          "405": {
            "$ref": "#/components/responses/MethodNotAllowed"
          },
          "429": {
            "$ref": "#/components/responses/RateLimited"
          },
          "500": {
            "$ref": "#/components/responses/InternalError"
          }
        },
        "security": [],
        "summary": "Open Swagger UI",
        "tags": [
          "Metadata"
        ]
      }
    },
    "/doctors": {
      "get": {
        "description": "Credential-scoped read. Locations represent the credential's studio. Availability is advisory for one doctor/service/day, not a reservation or a service eligibility guarantee.",
        "operationId": "readBookingDoctors",
        "parameters": [
          {
            "$ref": "#/components/parameters/RequestIdHeader"
          },
          {
            "in": "query",
            "name": "limit",
            "required": false,
            "schema": {
              "default": 50,
              "maximum": 100,
              "minimum": 1,
              "type": "integer"
            }
          },
          {
            "in": "query",
            "name": "offset",
            "required": false,
            "schema": {
              "default": 0,
              "maximum": 100000,
              "minimum": 0,
              "type": "integer"
            }
          }
        ],
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/DoctorsCollection"
                }
              }
            },
            "description": "Booking response.",
            "headers": {
              "RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimitLimit"
              },
              "RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimitRemaining"
              },
              "RateLimit-Reset": {
                "$ref": "#/components/headers/RateLimitReset"
              },
              "X-Request-Id": {
                "$ref": "#/components/headers/RequestId"
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          },
          "405": {
            "$ref": "#/components/responses/MethodNotAllowed"
          },
          "409": {
            "$ref": "#/components/responses/Conflict"
          },
          "429": {
            "$ref": "#/components/responses/RateLimited"
          },
          "500": {
            "$ref": "#/components/responses/InternalError"
          }
        },
        "security": [
          {
            "ElynextOAuth2": [
              "appointments.read"
            ]
          },
          {
            "ElynextApiKey": []
          }
        ],
        "summary": "Read booking doctors",
        "tags": [
          "Booking"
        ]
      }
    },
    "/documents": {
      "get": {
        "description": "List tenant-scoped Elynext documents resources.",
        "operationId": "listDocument",
        "parameters": [
          {
            "$ref": "#/components/parameters/RequestIdHeader"
          },
          {
            "in": "query",
            "name": "limit",
            "schema": {
              "default": 50,
              "maximum": 100,
              "minimum": 1,
              "type": "integer"
            }
          },
          {
            "in": "query",
            "name": "offset",
            "schema": {
              "default": 0,
              "minimum": 0,
              "type": "integer"
            }
          },
          {
            "description": "Public field name, optionally prefixed with - for descending order.",
            "in": "query",
            "name": "sort",
            "schema": {
              "type": "string"
            }
          },
          {
            "description": "Free-text search. Use POST search for structured filters.",
            "in": "query",
            "name": "search",
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/DocumentCollection"
                }
              }
            },
            "description": "Documents response.",
            "headers": {
              "RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimitLimit"
              },
              "RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimitRemaining"
              },
              "RateLimit-Reset": {
                "$ref": "#/components/headers/RateLimitReset"
              },
              "X-Request-Id": {
                "$ref": "#/components/headers/RequestId"
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          },
          "405": {
            "$ref": "#/components/responses/MethodNotAllowed"
          },
          "409": {
            "$ref": "#/components/responses/Conflict"
          },
          "429": {
            "$ref": "#/components/responses/RateLimited"
          },
          "500": {
            "$ref": "#/components/responses/InternalError"
          }
        },
        "security": [
          {
            "ElynextOAuth2": [
              "documents.read"
            ]
          },
          {
            "ElynextApiKey": []
          }
        ],
        "summary": "List documents",
        "tags": [
          "Documents"
        ]
      },
      "post": {
        "description": "Create tenant-scoped Elynext documents resources.",
        "operationId": "createDocument",
        "parameters": [
          {
            "$ref": "#/components/parameters/RequestIdHeader"
          },
          {
            "$ref": "#/components/parameters/IdempotencyKeyHeader"
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/DocumentWrite",
                "required": [
                  "doctorId",
                  "patientId"
                ]
              }
            }
          },
          "required": true
        },
        "responses": {
          "201": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/DocumentEnvelope"
                }
              }
            },
            "description": "Documents response.",
            "headers": {
              "RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimitLimit"
              },
              "RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimitRemaining"
              },
              "RateLimit-Reset": {
                "$ref": "#/components/headers/RateLimitReset"
              },
              "X-Request-Id": {
                "$ref": "#/components/headers/RequestId"
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          },
          "405": {
            "$ref": "#/components/responses/MethodNotAllowed"
          },
          "409": {
            "$ref": "#/components/responses/Conflict"
          },
          "429": {
            "$ref": "#/components/responses/RateLimited"
          },
          "500": {
            "$ref": "#/components/responses/InternalError"
          }
        },
        "security": [
          {
            "ElynextOAuth2": [
              "documents.write"
            ]
          },
          {
            "ElynextApiKey": []
          }
        ],
        "summary": "Create documents",
        "tags": [
          "Documents"
        ]
      }
    },
    "/documents/search": {
      "post": {
        "description": "Search tenant-scoped Elynext documents resources.",
        "operationId": "searchDocument",
        "parameters": [
          {
            "$ref": "#/components/parameters/RequestIdHeader"
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/SearchRequest"
              }
            }
          },
          "required": false
        },
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/DocumentCollection"
                }
              }
            },
            "description": "Documents response.",
            "headers": {
              "RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimitLimit"
              },
              "RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimitRemaining"
              },
              "RateLimit-Reset": {
                "$ref": "#/components/headers/RateLimitReset"
              },
              "X-Request-Id": {
                "$ref": "#/components/headers/RequestId"
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          },
          "405": {
            "$ref": "#/components/responses/MethodNotAllowed"
          },
          "409": {
            "$ref": "#/components/responses/Conflict"
          },
          "429": {
            "$ref": "#/components/responses/RateLimited"
          },
          "500": {
            "$ref": "#/components/responses/InternalError"
          }
        },
        "security": [
          {
            "ElynextOAuth2": [
              "documents.read"
            ]
          },
          {
            "ElynextApiKey": []
          }
        ],
        "summary": "Search documents",
        "tags": [
          "Documents"
        ]
      }
    },
    "/documents/{id}": {
      "delete": {
        "description": "Archive tenant-scoped Elynext documents resources.",
        "operationId": "deleteDocument",
        "parameters": [
          {
            "$ref": "#/components/parameters/RequestIdHeader"
          },
          {
            "$ref": "#/components/parameters/ResourceIdPath"
          }
        ],
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ArchiveEnvelope"
                }
              }
            },
            "description": "Documents response.",
            "headers": {
              "RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimitLimit"
              },
              "RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimitRemaining"
              },
              "RateLimit-Reset": {
                "$ref": "#/components/headers/RateLimitReset"
              },
              "X-Request-Id": {
                "$ref": "#/components/headers/RequestId"
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          },
          "405": {
            "$ref": "#/components/responses/MethodNotAllowed"
          },
          "409": {
            "$ref": "#/components/responses/Conflict"
          },
          "429": {
            "$ref": "#/components/responses/RateLimited"
          },
          "500": {
            "$ref": "#/components/responses/InternalError"
          }
        },
        "security": [
          {
            "ElynextOAuth2": [
              "documents.write"
            ]
          },
          {
            "ElynextApiKey": []
          }
        ],
        "summary": "Archive documents",
        "tags": [
          "Documents"
        ]
      },
      "get": {
        "description": "Get tenant-scoped Elynext documents resources.",
        "operationId": "getDocument",
        "parameters": [
          {
            "$ref": "#/components/parameters/RequestIdHeader"
          },
          {
            "$ref": "#/components/parameters/ResourceIdPath"
          }
        ],
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/DocumentEnvelope"
                }
              }
            },
            "description": "Documents response.",
            "headers": {
              "RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimitLimit"
              },
              "RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimitRemaining"
              },
              "RateLimit-Reset": {
                "$ref": "#/components/headers/RateLimitReset"
              },
              "X-Request-Id": {
                "$ref": "#/components/headers/RequestId"
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          },
          "405": {
            "$ref": "#/components/responses/MethodNotAllowed"
          },
          "409": {
            "$ref": "#/components/responses/Conflict"
          },
          "429": {
            "$ref": "#/components/responses/RateLimited"
          },
          "500": {
            "$ref": "#/components/responses/InternalError"
          }
        },
        "security": [
          {
            "ElynextOAuth2": [
              "documents.read"
            ]
          },
          {
            "ElynextApiKey": []
          }
        ],
        "summary": "Get documents",
        "tags": [
          "Documents"
        ]
      },
      "patch": {
        "description": "Update tenant-scoped Elynext documents resources.",
        "operationId": "updateDocument",
        "parameters": [
          {
            "$ref": "#/components/parameters/RequestIdHeader"
          },
          {
            "$ref": "#/components/parameters/ResourceIdPath"
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/DocumentWrite"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/DocumentEnvelope"
                }
              }
            },
            "description": "Documents response.",
            "headers": {
              "RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimitLimit"
              },
              "RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimitRemaining"
              },
              "RateLimit-Reset": {
                "$ref": "#/components/headers/RateLimitReset"
              },
              "X-Request-Id": {
                "$ref": "#/components/headers/RequestId"
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          },
          "405": {
            "$ref": "#/components/responses/MethodNotAllowed"
          },
          "409": {
            "$ref": "#/components/responses/Conflict"
          },
          "429": {
            "$ref": "#/components/responses/RateLimited"
          },
          "500": {
            "$ref": "#/components/responses/InternalError"
          }
        },
        "security": [
          {
            "ElynextOAuth2": [
              "documents.write"
            ]
          },
          {
            "ElynextApiKey": []
          }
        ],
        "summary": "Update documents",
        "tags": [
          "Documents"
        ]
      }
    },
    "/health": {
      "get": {
        "operationId": "getApiHealth",
        "parameters": [
          {
            "$ref": "#/components/parameters/RequestIdHeader"
          }
        ],
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "examples": {
                  "ok": {
                    "$ref": "#/components/examples/HealthOk"
                  }
                },
                "schema": {
                  "$ref": "#/components/schemas/HealthEnvelope"
                }
              }
            },
            "description": "API health metadata.",
            "headers": {
              "RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimitLimit"
              },
              "RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimitRemaining"
              },
              "RateLimit-Reset": {
                "$ref": "#/components/headers/RateLimitReset"
              },
              "X-Request-Id": {
                "$ref": "#/components/headers/RequestId"
              }
            }
          },
          "405": {
            "$ref": "#/components/responses/MethodNotAllowed"
          },
          "429": {
            "$ref": "#/components/responses/RateLimited"
          },
          "500": {
            "$ref": "#/components/responses/InternalError"
          }
        },
        "security": [],
        "summary": "Read API health metadata",
        "tags": [
          "Metadata"
        ]
      }
    },
    "/locations": {
      "get": {
        "description": "Credential-scoped read. Locations represent the credential's studio. Availability is advisory for one doctor/service/day, not a reservation or a service eligibility guarantee.",
        "operationId": "readBookingLocations",
        "parameters": [
          {
            "$ref": "#/components/parameters/RequestIdHeader"
          },
          {
            "in": "query",
            "name": "limit",
            "required": false,
            "schema": {
              "default": 50,
              "maximum": 100,
              "minimum": 1,
              "type": "integer"
            }
          },
          {
            "in": "query",
            "name": "offset",
            "required": false,
            "schema": {
              "default": 0,
              "maximum": 100000,
              "minimum": 0,
              "type": "integer"
            }
          }
        ],
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/LocationsCollection"
                }
              }
            },
            "description": "Booking response.",
            "headers": {
              "RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimitLimit"
              },
              "RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimitRemaining"
              },
              "RateLimit-Reset": {
                "$ref": "#/components/headers/RateLimitReset"
              },
              "X-Request-Id": {
                "$ref": "#/components/headers/RequestId"
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          },
          "405": {
            "$ref": "#/components/responses/MethodNotAllowed"
          },
          "409": {
            "$ref": "#/components/responses/Conflict"
          },
          "429": {
            "$ref": "#/components/responses/RateLimited"
          },
          "500": {
            "$ref": "#/components/responses/InternalError"
          }
        },
        "security": [
          {
            "ElynextOAuth2": [
              "appointments.read"
            ]
          },
          {
            "ElynextApiKey": []
          }
        ],
        "summary": "Read booking locations",
        "tags": [
          "Booking"
        ]
      }
    },
    "/oauth/token": {
      "post": {
        "description": "Issues an Elynext Public API bearer token for a registered partner client.",
        "operationId": "createOAuthClientCredentialsToken",
        "parameters": [
          {
            "$ref": "#/components/parameters/RequestIdHeader"
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/OAuthTokenRequest"
              }
            },
            "application/x-www-form-urlencoded": {
              "examples": {
                "clientCredentials": {
                  "$ref": "#/components/examples/OAuthClientCredentialsRequest"
                }
              },
              "schema": {
                "$ref": "#/components/schemas/OAuthTokenRequest"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "examples": {
                  "issued": {
                    "$ref": "#/components/examples/OAuthTokenIssued"
                  }
                },
                "schema": {
                  "$ref": "#/components/schemas/OAuthTokenResponse"
                }
              }
            },
            "description": "OAuth2 access token issued.",
            "headers": {
              "RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimitLimit"
              },
              "RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimitRemaining"
              },
              "RateLimit-Reset": {
                "$ref": "#/components/headers/RateLimitReset"
              },
              "X-Request-Id": {
                "$ref": "#/components/headers/RequestId"
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "429": {
            "$ref": "#/components/responses/RateLimited"
          },
          "500": {
            "$ref": "#/components/responses/InternalError"
          }
        },
        "security": [],
        "summary": "Issue OAuth2 client credentials token",
        "tags": [
          "Authentication"
        ]
      }
    },
    "/openapi.json": {
      "get": {
        "operationId": "getOpenApiJson",
        "parameters": [
          {
            "$ref": "#/components/parameters/RequestIdHeader"
          }
        ],
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "examples": {
                  "openapi": {
                    "$ref": "#/components/examples/OpenApiJson"
                  }
                },
                "schema": {
                  "type": "object"
                }
              }
            },
            "description": "OpenAPI 3.1 contract for the Elynext Public API.",
            "headers": {
              "RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimitLimit"
              },
              "RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimitRemaining"
              },
              "RateLimit-Reset": {
                "$ref": "#/components/headers/RateLimitReset"
              },
              "X-Request-Id": {
                "$ref": "#/components/headers/RequestId"
              }
            }
          },
          "405": {
            "$ref": "#/components/responses/MethodNotAllowed"
          },
          "429": {
            "$ref": "#/components/responses/RateLimited"
          },
          "500": {
            "$ref": "#/components/responses/InternalError"
          }
        },
        "security": [],
        "summary": "Read the OpenAPI contract",
        "tags": [
          "Metadata"
        ]
      }
    },
    "/openapi.yaml": {
      "get": {
        "operationId": "getOpenApiYaml",
        "parameters": [
          {
            "$ref": "#/components/parameters/RequestIdHeader"
          }
        ],
        "responses": {
          "200": {
            "content": {
              "application/yaml": {
                "schema": {
                  "type": "string"
                }
              }
            },
            "description": "OpenAPI 3.1 YAML contract for the Elynext Public API.",
            "headers": {
              "RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimitLimit"
              },
              "RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimitRemaining"
              },
              "RateLimit-Reset": {
                "$ref": "#/components/headers/RateLimitReset"
              },
              "X-Request-Id": {
                "$ref": "#/components/headers/RequestId"
              }
            }
          },
          "405": {
            "$ref": "#/components/responses/MethodNotAllowed"
          },
          "429": {
            "$ref": "#/components/responses/RateLimited"
          },
          "500": {
            "$ref": "#/components/responses/InternalError"
          }
        },
        "security": [],
        "summary": "Read the OpenAPI contract as YAML",
        "tags": [
          "Metadata"
        ]
      }
    },
    "/patients": {
      "get": {
        "description": "List tenant-scoped Elynext patients resources.",
        "operationId": "listPatient",
        "parameters": [
          {
            "$ref": "#/components/parameters/RequestIdHeader"
          },
          {
            "in": "query",
            "name": "limit",
            "schema": {
              "default": 50,
              "maximum": 100,
              "minimum": 1,
              "type": "integer"
            }
          },
          {
            "in": "query",
            "name": "offset",
            "schema": {
              "default": 0,
              "minimum": 0,
              "type": "integer"
            }
          },
          {
            "description": "Public field name, optionally prefixed with - for descending order.",
            "in": "query",
            "name": "sort",
            "schema": {
              "type": "string"
            }
          },
          {
            "description": "Free-text search. Use POST search for structured filters.",
            "in": "query",
            "name": "search",
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PatientCollection"
                }
              }
            },
            "description": "Patients response.",
            "headers": {
              "RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimitLimit"
              },
              "RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimitRemaining"
              },
              "RateLimit-Reset": {
                "$ref": "#/components/headers/RateLimitReset"
              },
              "X-Request-Id": {
                "$ref": "#/components/headers/RequestId"
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          },
          "405": {
            "$ref": "#/components/responses/MethodNotAllowed"
          },
          "409": {
            "$ref": "#/components/responses/Conflict"
          },
          "429": {
            "$ref": "#/components/responses/RateLimited"
          },
          "500": {
            "$ref": "#/components/responses/InternalError"
          }
        },
        "security": [
          {
            "ElynextOAuth2": [
              "patients.read"
            ]
          },
          {
            "ElynextApiKey": []
          }
        ],
        "summary": "List patients",
        "tags": [
          "Patients"
        ]
      },
      "post": {
        "description": "Create tenant-scoped Elynext patients resources.",
        "operationId": "createPatient",
        "parameters": [
          {
            "$ref": "#/components/parameters/RequestIdHeader"
          },
          {
            "$ref": "#/components/parameters/IdempotencyKeyHeader"
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/PatientWrite",
                "required": [
                  "doctorId",
                  "firstName",
                  "lastName"
                ]
              }
            }
          },
          "required": true
        },
        "responses": {
          "201": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PatientEnvelope"
                }
              }
            },
            "description": "Patients response.",
            "headers": {
              "RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimitLimit"
              },
              "RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimitRemaining"
              },
              "RateLimit-Reset": {
                "$ref": "#/components/headers/RateLimitReset"
              },
              "X-Request-Id": {
                "$ref": "#/components/headers/RequestId"
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          },
          "405": {
            "$ref": "#/components/responses/MethodNotAllowed"
          },
          "409": {
            "$ref": "#/components/responses/Conflict"
          },
          "429": {
            "$ref": "#/components/responses/RateLimited"
          },
          "500": {
            "$ref": "#/components/responses/InternalError"
          }
        },
        "security": [
          {
            "ElynextOAuth2": [
              "patients.write"
            ]
          },
          {
            "ElynextApiKey": []
          }
        ],
        "summary": "Create patients",
        "tags": [
          "Patients"
        ]
      }
    },
    "/patients/search": {
      "post": {
        "description": "Search tenant-scoped Elynext patients resources.",
        "operationId": "searchPatient",
        "parameters": [
          {
            "$ref": "#/components/parameters/RequestIdHeader"
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/SearchRequest"
              }
            }
          },
          "required": false
        },
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PatientCollection"
                }
              }
            },
            "description": "Patients response.",
            "headers": {
              "RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimitLimit"
              },
              "RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimitRemaining"
              },
              "RateLimit-Reset": {
                "$ref": "#/components/headers/RateLimitReset"
              },
              "X-Request-Id": {
                "$ref": "#/components/headers/RequestId"
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          },
          "405": {
            "$ref": "#/components/responses/MethodNotAllowed"
          },
          "409": {
            "$ref": "#/components/responses/Conflict"
          },
          "429": {
            "$ref": "#/components/responses/RateLimited"
          },
          "500": {
            "$ref": "#/components/responses/InternalError"
          }
        },
        "security": [
          {
            "ElynextOAuth2": [
              "patients.read"
            ]
          },
          {
            "ElynextApiKey": []
          }
        ],
        "summary": "Search patients",
        "tags": [
          "Patients"
        ]
      }
    },
    "/patients/{id}": {
      "delete": {
        "description": "Archive tenant-scoped Elynext patients resources.",
        "operationId": "deletePatient",
        "parameters": [
          {
            "$ref": "#/components/parameters/RequestIdHeader"
          },
          {
            "$ref": "#/components/parameters/ResourceIdPath"
          }
        ],
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ArchiveEnvelope"
                }
              }
            },
            "description": "Patients response.",
            "headers": {
              "RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimitLimit"
              },
              "RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimitRemaining"
              },
              "RateLimit-Reset": {
                "$ref": "#/components/headers/RateLimitReset"
              },
              "X-Request-Id": {
                "$ref": "#/components/headers/RequestId"
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          },
          "405": {
            "$ref": "#/components/responses/MethodNotAllowed"
          },
          "409": {
            "$ref": "#/components/responses/Conflict"
          },
          "429": {
            "$ref": "#/components/responses/RateLimited"
          },
          "500": {
            "$ref": "#/components/responses/InternalError"
          }
        },
        "security": [
          {
            "ElynextOAuth2": [
              "patients.write"
            ]
          },
          {
            "ElynextApiKey": []
          }
        ],
        "summary": "Archive patients",
        "tags": [
          "Patients"
        ]
      },
      "get": {
        "description": "Get tenant-scoped Elynext patients resources.",
        "operationId": "getPatient",
        "parameters": [
          {
            "$ref": "#/components/parameters/RequestIdHeader"
          },
          {
            "$ref": "#/components/parameters/ResourceIdPath"
          }
        ],
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PatientEnvelope"
                }
              }
            },
            "description": "Patients response.",
            "headers": {
              "RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimitLimit"
              },
              "RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimitRemaining"
              },
              "RateLimit-Reset": {
                "$ref": "#/components/headers/RateLimitReset"
              },
              "X-Request-Id": {
                "$ref": "#/components/headers/RequestId"
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          },
          "405": {
            "$ref": "#/components/responses/MethodNotAllowed"
          },
          "409": {
            "$ref": "#/components/responses/Conflict"
          },
          "429": {
            "$ref": "#/components/responses/RateLimited"
          },
          "500": {
            "$ref": "#/components/responses/InternalError"
          }
        },
        "security": [
          {
            "ElynextOAuth2": [
              "patients.read"
            ]
          },
          {
            "ElynextApiKey": []
          }
        ],
        "summary": "Get patients",
        "tags": [
          "Patients"
        ]
      },
      "patch": {
        "description": "Update tenant-scoped Elynext patients resources.",
        "operationId": "updatePatient",
        "parameters": [
          {
            "$ref": "#/components/parameters/RequestIdHeader"
          },
          {
            "$ref": "#/components/parameters/ResourceIdPath"
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/PatientWrite"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PatientEnvelope"
                }
              }
            },
            "description": "Patients response.",
            "headers": {
              "RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimitLimit"
              },
              "RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimitRemaining"
              },
              "RateLimit-Reset": {
                "$ref": "#/components/headers/RateLimitReset"
              },
              "X-Request-Id": {
                "$ref": "#/components/headers/RequestId"
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          },
          "405": {
            "$ref": "#/components/responses/MethodNotAllowed"
          },
          "409": {
            "$ref": "#/components/responses/Conflict"
          },
          "429": {
            "$ref": "#/components/responses/RateLimited"
          },
          "500": {
            "$ref": "#/components/responses/InternalError"
          }
        },
        "security": [
          {
            "ElynextOAuth2": [
              "patients.write"
            ]
          },
          {
            "ElynextApiKey": []
          }
        ],
        "summary": "Update patients",
        "tags": [
          "Patients"
        ]
      }
    },
    "/reports": {
      "get": {
        "description": "List tenant-scoped Elynext reports resources.",
        "operationId": "listReport",
        "parameters": [
          {
            "$ref": "#/components/parameters/RequestIdHeader"
          },
          {
            "in": "query",
            "name": "limit",
            "schema": {
              "default": 50,
              "maximum": 100,
              "minimum": 1,
              "type": "integer"
            }
          },
          {
            "in": "query",
            "name": "offset",
            "schema": {
              "default": 0,
              "minimum": 0,
              "type": "integer"
            }
          },
          {
            "description": "Public field name, optionally prefixed with - for descending order.",
            "in": "query",
            "name": "sort",
            "schema": {
              "type": "string"
            }
          },
          {
            "description": "Free-text search. Use POST search for structured filters.",
            "in": "query",
            "name": "search",
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ReportCollection"
                }
              }
            },
            "description": "Reports response.",
            "headers": {
              "RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimitLimit"
              },
              "RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimitRemaining"
              },
              "RateLimit-Reset": {
                "$ref": "#/components/headers/RateLimitReset"
              },
              "X-Request-Id": {
                "$ref": "#/components/headers/RequestId"
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          },
          "405": {
            "$ref": "#/components/responses/MethodNotAllowed"
          },
          "409": {
            "$ref": "#/components/responses/Conflict"
          },
          "429": {
            "$ref": "#/components/responses/RateLimited"
          },
          "500": {
            "$ref": "#/components/responses/InternalError"
          }
        },
        "security": [
          {
            "ElynextOAuth2": [
              "reports.read"
            ]
          },
          {
            "ElynextApiKey": []
          }
        ],
        "summary": "List reports",
        "tags": [
          "Reports"
        ]
      },
      "post": {
        "description": "Create tenant-scoped Elynext reports resources.",
        "operationId": "createReport",
        "parameters": [
          {
            "$ref": "#/components/parameters/RequestIdHeader"
          },
          {
            "$ref": "#/components/parameters/IdempotencyKeyHeader"
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/ReportWrite",
                "required": [
                  "doctorId",
                  "patientId"
                ]
              }
            }
          },
          "required": true
        },
        "responses": {
          "201": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ReportEnvelope"
                }
              }
            },
            "description": "Reports response.",
            "headers": {
              "RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimitLimit"
              },
              "RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimitRemaining"
              },
              "RateLimit-Reset": {
                "$ref": "#/components/headers/RateLimitReset"
              },
              "X-Request-Id": {
                "$ref": "#/components/headers/RequestId"
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          },
          "405": {
            "$ref": "#/components/responses/MethodNotAllowed"
          },
          "409": {
            "$ref": "#/components/responses/Conflict"
          },
          "429": {
            "$ref": "#/components/responses/RateLimited"
          },
          "500": {
            "$ref": "#/components/responses/InternalError"
          }
        },
        "security": [
          {
            "ElynextOAuth2": [
              "reports.write"
            ]
          },
          {
            "ElynextApiKey": []
          }
        ],
        "summary": "Create reports",
        "tags": [
          "Reports"
        ]
      }
    },
    "/reports/search": {
      "post": {
        "description": "Search tenant-scoped Elynext reports resources.",
        "operationId": "searchReport",
        "parameters": [
          {
            "$ref": "#/components/parameters/RequestIdHeader"
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/SearchRequest"
              }
            }
          },
          "required": false
        },
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ReportCollection"
                }
              }
            },
            "description": "Reports response.",
            "headers": {
              "RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimitLimit"
              },
              "RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimitRemaining"
              },
              "RateLimit-Reset": {
                "$ref": "#/components/headers/RateLimitReset"
              },
              "X-Request-Id": {
                "$ref": "#/components/headers/RequestId"
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          },
          "405": {
            "$ref": "#/components/responses/MethodNotAllowed"
          },
          "409": {
            "$ref": "#/components/responses/Conflict"
          },
          "429": {
            "$ref": "#/components/responses/RateLimited"
          },
          "500": {
            "$ref": "#/components/responses/InternalError"
          }
        },
        "security": [
          {
            "ElynextOAuth2": [
              "reports.read"
            ]
          },
          {
            "ElynextApiKey": []
          }
        ],
        "summary": "Search reports",
        "tags": [
          "Reports"
        ]
      }
    },
    "/reports/{id}": {
      "delete": {
        "description": "Archive tenant-scoped Elynext reports resources.",
        "operationId": "deleteReport",
        "parameters": [
          {
            "$ref": "#/components/parameters/RequestIdHeader"
          },
          {
            "$ref": "#/components/parameters/ResourceIdPath"
          }
        ],
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ArchiveEnvelope"
                }
              }
            },
            "description": "Reports response.",
            "headers": {
              "RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimitLimit"
              },
              "RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimitRemaining"
              },
              "RateLimit-Reset": {
                "$ref": "#/components/headers/RateLimitReset"
              },
              "X-Request-Id": {
                "$ref": "#/components/headers/RequestId"
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          },
          "405": {
            "$ref": "#/components/responses/MethodNotAllowed"
          },
          "409": {
            "$ref": "#/components/responses/Conflict"
          },
          "429": {
            "$ref": "#/components/responses/RateLimited"
          },
          "500": {
            "$ref": "#/components/responses/InternalError"
          }
        },
        "security": [
          {
            "ElynextOAuth2": [
              "reports.write"
            ]
          },
          {
            "ElynextApiKey": []
          }
        ],
        "summary": "Archive reports",
        "tags": [
          "Reports"
        ]
      },
      "get": {
        "description": "Get tenant-scoped Elynext reports resources.",
        "operationId": "getReport",
        "parameters": [
          {
            "$ref": "#/components/parameters/RequestIdHeader"
          },
          {
            "$ref": "#/components/parameters/ResourceIdPath"
          }
        ],
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ReportEnvelope"
                }
              }
            },
            "description": "Reports response.",
            "headers": {
              "RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimitLimit"
              },
              "RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimitRemaining"
              },
              "RateLimit-Reset": {
                "$ref": "#/components/headers/RateLimitReset"
              },
              "X-Request-Id": {
                "$ref": "#/components/headers/RequestId"
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          },
          "405": {
            "$ref": "#/components/responses/MethodNotAllowed"
          },
          "409": {
            "$ref": "#/components/responses/Conflict"
          },
          "429": {
            "$ref": "#/components/responses/RateLimited"
          },
          "500": {
            "$ref": "#/components/responses/InternalError"
          }
        },
        "security": [
          {
            "ElynextOAuth2": [
              "reports.read"
            ]
          },
          {
            "ElynextApiKey": []
          }
        ],
        "summary": "Get reports",
        "tags": [
          "Reports"
        ]
      },
      "patch": {
        "description": "Update tenant-scoped Elynext reports resources.",
        "operationId": "updateReport",
        "parameters": [
          {
            "$ref": "#/components/parameters/RequestIdHeader"
          },
          {
            "$ref": "#/components/parameters/ResourceIdPath"
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/ReportWrite"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ReportEnvelope"
                }
              }
            },
            "description": "Reports response.",
            "headers": {
              "RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimitLimit"
              },
              "RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimitRemaining"
              },
              "RateLimit-Reset": {
                "$ref": "#/components/headers/RateLimitReset"
              },
              "X-Request-Id": {
                "$ref": "#/components/headers/RequestId"
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          },
          "405": {
            "$ref": "#/components/responses/MethodNotAllowed"
          },
          "409": {
            "$ref": "#/components/responses/Conflict"
          },
          "429": {
            "$ref": "#/components/responses/RateLimited"
          },
          "500": {
            "$ref": "#/components/responses/InternalError"
          }
        },
        "security": [
          {
            "ElynextOAuth2": [
              "reports.write"
            ]
          },
          {
            "ElynextApiKey": []
          }
        ],
        "summary": "Update reports",
        "tags": [
          "Reports"
        ]
      }
    },
    "/services": {
      "get": {
        "description": "Credential-scoped read. Locations represent the credential's studio. Availability is advisory for one doctor/service/day, not a reservation or a service eligibility guarantee.",
        "operationId": "readBookingServices",
        "parameters": [
          {
            "$ref": "#/components/parameters/RequestIdHeader"
          },
          {
            "in": "query",
            "name": "limit",
            "required": false,
            "schema": {
              "default": 50,
              "maximum": 100,
              "minimum": 1,
              "type": "integer"
            }
          },
          {
            "in": "query",
            "name": "offset",
            "required": false,
            "schema": {
              "default": 0,
              "maximum": 100000,
              "minimum": 0,
              "type": "integer"
            }
          }
        ],
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ServicesCollection"
                }
              }
            },
            "description": "Booking response.",
            "headers": {
              "RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimitLimit"
              },
              "RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimitRemaining"
              },
              "RateLimit-Reset": {
                "$ref": "#/components/headers/RateLimitReset"
              },
              "X-Request-Id": {
                "$ref": "#/components/headers/RequestId"
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          },
          "405": {
            "$ref": "#/components/responses/MethodNotAllowed"
          },
          "409": {
            "$ref": "#/components/responses/Conflict"
          },
          "429": {
            "$ref": "#/components/responses/RateLimited"
          },
          "500": {
            "$ref": "#/components/responses/InternalError"
          }
        },
        "security": [
          {
            "ElynextOAuth2": [
              "appointments.read"
            ]
          },
          {
            "ElynextApiKey": []
          }
        ],
        "summary": "Read booking services",
        "tags": [
          "Booking"
        ]
      }
    },
    "/version": {
      "get": {
        "operationId": "getApiVersion",
        "parameters": [
          {
            "$ref": "#/components/parameters/RequestIdHeader"
          }
        ],
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "examples": {
                  "foundation": {
                    "$ref": "#/components/examples/VersionFoundation"
                  }
                },
                "schema": {
                  "$ref": "#/components/schemas/VersionEnvelope"
                }
              }
            },
            "description": "API version metadata.",
            "headers": {
              "RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimitLimit"
              },
              "RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimitRemaining"
              },
              "RateLimit-Reset": {
                "$ref": "#/components/headers/RateLimitReset"
              },
              "X-Request-Id": {
                "$ref": "#/components/headers/RequestId"
              }
            }
          },
          "405": {
            "$ref": "#/components/responses/MethodNotAllowed"
          },
          "429": {
            "$ref": "#/components/responses/RateLimited"
          },
          "500": {
            "$ref": "#/components/responses/InternalError"
          }
        },
        "security": [],
        "summary": "Read API version metadata",
        "tags": [
          "Metadata"
        ]
      }
    },
    "/webhook-subscriptions": {
      "get": {
        "description": "Manage tenant-scoped Elynext webhook subscriptions.",
        "operationId": "listWebhookSubscriptions",
        "parameters": [
          {
            "$ref": "#/components/parameters/RequestIdHeader"
          }
        ],
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/WebhookSubscriptionCollection"
                }
              }
            },
            "description": "Webhook subscription response.",
            "headers": {
              "RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimitLimit"
              },
              "RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimitRemaining"
              },
              "RateLimit-Reset": {
                "$ref": "#/components/headers/RateLimitReset"
              },
              "X-Request-Id": {
                "$ref": "#/components/headers/RequestId"
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          },
          "405": {
            "$ref": "#/components/responses/MethodNotAllowed"
          },
          "429": {
            "$ref": "#/components/responses/RateLimited"
          },
          "500": {
            "$ref": "#/components/responses/InternalError"
          }
        },
        "security": [
          {
            "ElynextOAuth2": [
              "webhook-subscriptions.read"
            ]
          },
          {
            "ElynextApiKey": []
          }
        ],
        "summary": "List webhook subscriptions",
        "tags": [
          "Webhooks"
        ]
      },
      "post": {
        "description": "Manage tenant-scoped Elynext webhook subscriptions.",
        "operationId": "createWebhookSubscription",
        "parameters": [
          {
            "$ref": "#/components/parameters/RequestIdHeader"
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/WebhookSubscriptionWrite"
              }
            }
          },
          "required": true
        },
        "responses": {
          "201": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/WebhookSubscriptionEnvelope"
                }
              }
            },
            "description": "Webhook subscription response.",
            "headers": {
              "RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimitLimit"
              },
              "RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimitRemaining"
              },
              "RateLimit-Reset": {
                "$ref": "#/components/headers/RateLimitReset"
              },
              "X-Request-Id": {
                "$ref": "#/components/headers/RequestId"
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          },
          "405": {
            "$ref": "#/components/responses/MethodNotAllowed"
          },
          "429": {
            "$ref": "#/components/responses/RateLimited"
          },
          "500": {
            "$ref": "#/components/responses/InternalError"
          }
        },
        "security": [
          {
            "ElynextOAuth2": [
              "webhook-subscriptions.write"
            ]
          },
          {
            "ElynextApiKey": []
          }
        ],
        "summary": "Create webhook subscription",
        "tags": [
          "Webhooks"
        ]
      }
    },
    "/webhook-subscriptions/{id}": {
      "delete": {
        "description": "Manage tenant-scoped Elynext webhook subscriptions.",
        "operationId": "revokeWebhookSubscription",
        "parameters": [
          {
            "$ref": "#/components/parameters/RequestIdHeader"
          },
          {
            "$ref": "#/components/parameters/SubscriptionIdPath"
          }
        ],
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/WebhookSubscriptionEnvelope"
                }
              }
            },
            "description": "Webhook subscription response.",
            "headers": {
              "RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimitLimit"
              },
              "RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimitRemaining"
              },
              "RateLimit-Reset": {
                "$ref": "#/components/headers/RateLimitReset"
              },
              "X-Request-Id": {
                "$ref": "#/components/headers/RequestId"
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          },
          "405": {
            "$ref": "#/components/responses/MethodNotAllowed"
          },
          "429": {
            "$ref": "#/components/responses/RateLimited"
          },
          "500": {
            "$ref": "#/components/responses/InternalError"
          }
        },
        "security": [
          {
            "ElynextOAuth2": [
              "webhook-subscriptions.write"
            ]
          },
          {
            "ElynextApiKey": []
          }
        ],
        "summary": "Revoke webhook subscription",
        "tags": [
          "Webhooks"
        ]
      },
      "get": {
        "description": "Manage tenant-scoped Elynext webhook subscriptions.",
        "operationId": "getWebhookSubscription",
        "parameters": [
          {
            "$ref": "#/components/parameters/RequestIdHeader"
          },
          {
            "$ref": "#/components/parameters/SubscriptionIdPath"
          }
        ],
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/WebhookSubscriptionEnvelope"
                }
              }
            },
            "description": "Webhook subscription response.",
            "headers": {
              "RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimitLimit"
              },
              "RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimitRemaining"
              },
              "RateLimit-Reset": {
                "$ref": "#/components/headers/RateLimitReset"
              },
              "X-Request-Id": {
                "$ref": "#/components/headers/RequestId"
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          },
          "405": {
            "$ref": "#/components/responses/MethodNotAllowed"
          },
          "429": {
            "$ref": "#/components/responses/RateLimited"
          },
          "500": {
            "$ref": "#/components/responses/InternalError"
          }
        },
        "security": [
          {
            "ElynextOAuth2": [
              "webhook-subscriptions.read"
            ]
          },
          {
            "ElynextApiKey": []
          }
        ],
        "summary": "Get webhook subscription",
        "tags": [
          "Webhooks"
        ]
      },
      "patch": {
        "description": "Manage tenant-scoped Elynext webhook subscriptions.",
        "operationId": "updateWebhookSubscription",
        "parameters": [
          {
            "$ref": "#/components/parameters/RequestIdHeader"
          },
          {
            "$ref": "#/components/parameters/SubscriptionIdPath"
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/WebhookSubscriptionWrite"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/WebhookSubscriptionEnvelope"
                }
              }
            },
            "description": "Webhook subscription response.",
            "headers": {
              "RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimitLimit"
              },
              "RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimitRemaining"
              },
              "RateLimit-Reset": {
                "$ref": "#/components/headers/RateLimitReset"
              },
              "X-Request-Id": {
                "$ref": "#/components/headers/RequestId"
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          },
          "405": {
            "$ref": "#/components/responses/MethodNotAllowed"
          },
          "429": {
            "$ref": "#/components/responses/RateLimited"
          },
          "500": {
            "$ref": "#/components/responses/InternalError"
          }
        },
        "security": [
          {
            "ElynextOAuth2": [
              "webhook-subscriptions.write"
            ]
          },
          {
            "ElynextApiKey": []
          }
        ],
        "summary": "Update webhook subscription",
        "tags": [
          "Webhooks"
        ]
      }
    }
  },
  "servers": [
    {
      "description": "Elynext Public API v1",
      "url": "/api/v1"
    }
  ],
  "tags": [
    {
      "description": "Studio-scoped scheduling reads.",
      "name": "Booking"
    },
    {
      "description": "Non-sensitive API metadata and contract discovery.",
      "name": "Metadata"
    },
    {
      "description": "Enterprise partner authentication runtime.",
      "name": "Authentication"
    },
    {
      "description": "Tenant-scoped webhook subscription management.",
      "name": "Webhooks"
    },
    {
      "description": "Tenant-scoped patients Domain API.",
      "name": "Patients"
    },
    {
      "description": "Tenant-scoped appointments Domain API.",
      "name": "Appointments"
    },
    {
      "description": "Tenant-scoped clinical-records Domain API.",
      "name": "Clinical Records"
    },
    {
      "description": "Tenant-scoped documents Domain API.",
      "name": "Documents"
    },
    {
      "description": "Tenant-scoped reports Domain API.",
      "name": "Reports"
    }
  ],
  "webhooks": {
    "appointment.cancelled": {
      "post": {
        "description": "Signed Elynext webhook delivery with minimized event metadata.",
        "operationId": "receiveAppointmentCancelledWebhook",
        "parameters": [
          {
            "in": "header",
            "name": "X-Elynext-Webhook-Event-Id",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "in": "header",
            "name": "X-Elynext-Webhook-Delivery-Id",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "in": "header",
            "name": "X-Elynext-Webhook-Event-Version",
            "required": true,
            "schema": {
              "const": "1",
              "type": "string"
            }
          },
          {
            "in": "header",
            "name": "X-Elynext-Webhook-Timestamp",
            "required": true,
            "schema": {
              "minimum": 0,
              "type": "integer"
            }
          },
          {
            "in": "header",
            "name": "X-Elynext-Webhook-Signature",
            "required": true,
            "schema": {
              "pattern": "^v1=[a-f0-9]{64}$",
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/WebhookEvent"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "description": "Webhook accepted by the partner endpoint."
          },
          "400": {
            "description": "Webhook rejected by the partner endpoint."
          },
          "500": {
            "description": "Partner endpoint failed; Elynext may retry delivery."
          }
        },
        "summary": "Receive appointment.cancelled webhook",
        "tags": [
          "Webhooks"
        ]
      }
    },
    "appointment.created": {
      "post": {
        "description": "Signed Elynext webhook delivery with minimized event metadata.",
        "operationId": "receiveAppointmentCreatedWebhook",
        "parameters": [
          {
            "in": "header",
            "name": "X-Elynext-Webhook-Event-Id",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "in": "header",
            "name": "X-Elynext-Webhook-Delivery-Id",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "in": "header",
            "name": "X-Elynext-Webhook-Event-Version",
            "required": true,
            "schema": {
              "const": "1",
              "type": "string"
            }
          },
          {
            "in": "header",
            "name": "X-Elynext-Webhook-Timestamp",
            "required": true,
            "schema": {
              "minimum": 0,
              "type": "integer"
            }
          },
          {
            "in": "header",
            "name": "X-Elynext-Webhook-Signature",
            "required": true,
            "schema": {
              "pattern": "^v1=[a-f0-9]{64}$",
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/WebhookEvent"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "description": "Webhook accepted by the partner endpoint."
          },
          "400": {
            "description": "Webhook rejected by the partner endpoint."
          },
          "500": {
            "description": "Partner endpoint failed; Elynext may retry delivery."
          }
        },
        "summary": "Receive appointment.created webhook",
        "tags": [
          "Webhooks"
        ]
      }
    },
    "appointment.updated": {
      "post": {
        "description": "Signed Elynext webhook delivery with minimized event metadata.",
        "operationId": "receiveAppointmentUpdatedWebhook",
        "parameters": [
          {
            "in": "header",
            "name": "X-Elynext-Webhook-Event-Id",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "in": "header",
            "name": "X-Elynext-Webhook-Delivery-Id",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "in": "header",
            "name": "X-Elynext-Webhook-Event-Version",
            "required": true,
            "schema": {
              "const": "1",
              "type": "string"
            }
          },
          {
            "in": "header",
            "name": "X-Elynext-Webhook-Timestamp",
            "required": true,
            "schema": {
              "minimum": 0,
              "type": "integer"
            }
          },
          {
            "in": "header",
            "name": "X-Elynext-Webhook-Signature",
            "required": true,
            "schema": {
              "pattern": "^v1=[a-f0-9]{64}$",
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/WebhookEvent"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "description": "Webhook accepted by the partner endpoint."
          },
          "400": {
            "description": "Webhook rejected by the partner endpoint."
          },
          "500": {
            "description": "Partner endpoint failed; Elynext may retry delivery."
          }
        },
        "summary": "Receive appointment.updated webhook",
        "tags": [
          "Webhooks"
        ]
      }
    },
    "clinical-record.created": {
      "post": {
        "description": "Signed Elynext webhook delivery with minimized event metadata.",
        "operationId": "receiveClinicalRecordCreatedWebhook",
        "parameters": [
          {
            "in": "header",
            "name": "X-Elynext-Webhook-Event-Id",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "in": "header",
            "name": "X-Elynext-Webhook-Delivery-Id",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "in": "header",
            "name": "X-Elynext-Webhook-Event-Version",
            "required": true,
            "schema": {
              "const": "1",
              "type": "string"
            }
          },
          {
            "in": "header",
            "name": "X-Elynext-Webhook-Timestamp",
            "required": true,
            "schema": {
              "minimum": 0,
              "type": "integer"
            }
          },
          {
            "in": "header",
            "name": "X-Elynext-Webhook-Signature",
            "required": true,
            "schema": {
              "pattern": "^v1=[a-f0-9]{64}$",
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/WebhookEvent"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "description": "Webhook accepted by the partner endpoint."
          },
          "400": {
            "description": "Webhook rejected by the partner endpoint."
          },
          "500": {
            "description": "Partner endpoint failed; Elynext may retry delivery."
          }
        },
        "summary": "Receive clinical-record.created webhook",
        "tags": [
          "Webhooks"
        ]
      }
    },
    "document.created": {
      "post": {
        "description": "Signed Elynext webhook delivery with minimized event metadata.",
        "operationId": "receiveDocumentCreatedWebhook",
        "parameters": [
          {
            "in": "header",
            "name": "X-Elynext-Webhook-Event-Id",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "in": "header",
            "name": "X-Elynext-Webhook-Delivery-Id",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "in": "header",
            "name": "X-Elynext-Webhook-Event-Version",
            "required": true,
            "schema": {
              "const": "1",
              "type": "string"
            }
          },
          {
            "in": "header",
            "name": "X-Elynext-Webhook-Timestamp",
            "required": true,
            "schema": {
              "minimum": 0,
              "type": "integer"
            }
          },
          {
            "in": "header",
            "name": "X-Elynext-Webhook-Signature",
            "required": true,
            "schema": {
              "pattern": "^v1=[a-f0-9]{64}$",
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/WebhookEvent"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "description": "Webhook accepted by the partner endpoint."
          },
          "400": {
            "description": "Webhook rejected by the partner endpoint."
          },
          "500": {
            "description": "Partner endpoint failed; Elynext may retry delivery."
          }
        },
        "summary": "Receive document.created webhook",
        "tags": [
          "Webhooks"
        ]
      }
    },
    "patient.created": {
      "post": {
        "description": "Signed Elynext webhook delivery with minimized event metadata.",
        "operationId": "receivePatientCreatedWebhook",
        "parameters": [
          {
            "in": "header",
            "name": "X-Elynext-Webhook-Event-Id",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "in": "header",
            "name": "X-Elynext-Webhook-Delivery-Id",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "in": "header",
            "name": "X-Elynext-Webhook-Event-Version",
            "required": true,
            "schema": {
              "const": "1",
              "type": "string"
            }
          },
          {
            "in": "header",
            "name": "X-Elynext-Webhook-Timestamp",
            "required": true,
            "schema": {
              "minimum": 0,
              "type": "integer"
            }
          },
          {
            "in": "header",
            "name": "X-Elynext-Webhook-Signature",
            "required": true,
            "schema": {
              "pattern": "^v1=[a-f0-9]{64}$",
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/WebhookEvent"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "description": "Webhook accepted by the partner endpoint."
          },
          "400": {
            "description": "Webhook rejected by the partner endpoint."
          },
          "500": {
            "description": "Partner endpoint failed; Elynext may retry delivery."
          }
        },
        "summary": "Receive patient.created webhook",
        "tags": [
          "Webhooks"
        ]
      }
    },
    "patient.updated": {
      "post": {
        "description": "Signed Elynext webhook delivery with minimized event metadata.",
        "operationId": "receivePatientUpdatedWebhook",
        "parameters": [
          {
            "in": "header",
            "name": "X-Elynext-Webhook-Event-Id",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "in": "header",
            "name": "X-Elynext-Webhook-Delivery-Id",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "in": "header",
            "name": "X-Elynext-Webhook-Event-Version",
            "required": true,
            "schema": {
              "const": "1",
              "type": "string"
            }
          },
          {
            "in": "header",
            "name": "X-Elynext-Webhook-Timestamp",
            "required": true,
            "schema": {
              "minimum": 0,
              "type": "integer"
            }
          },
          {
            "in": "header",
            "name": "X-Elynext-Webhook-Signature",
            "required": true,
            "schema": {
              "pattern": "^v1=[a-f0-9]{64}$",
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/WebhookEvent"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "description": "Webhook accepted by the partner endpoint."
          },
          "400": {
            "description": "Webhook rejected by the partner endpoint."
          },
          "500": {
            "description": "Partner endpoint failed; Elynext may retry delivery."
          }
        },
        "summary": "Receive patient.updated webhook",
        "tags": [
          "Webhooks"
        ]
      }
    },
    "report.created": {
      "post": {
        "description": "Signed Elynext webhook delivery with minimized event metadata.",
        "operationId": "receiveReportCreatedWebhook",
        "parameters": [
          {
            "in": "header",
            "name": "X-Elynext-Webhook-Event-Id",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "in": "header",
            "name": "X-Elynext-Webhook-Delivery-Id",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "in": "header",
            "name": "X-Elynext-Webhook-Event-Version",
            "required": true,
            "schema": {
              "const": "1",
              "type": "string"
            }
          },
          {
            "in": "header",
            "name": "X-Elynext-Webhook-Timestamp",
            "required": true,
            "schema": {
              "minimum": 0,
              "type": "integer"
            }
          },
          {
            "in": "header",
            "name": "X-Elynext-Webhook-Signature",
            "required": true,
            "schema": {
              "pattern": "^v1=[a-f0-9]{64}$",
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/WebhookEvent"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "description": "Webhook accepted by the partner endpoint."
          },
          "400": {
            "description": "Webhook rejected by the partner endpoint."
          },
          "500": {
            "description": "Partner endpoint failed; Elynext may retry delivery."
          }
        },
        "summary": "Receive report.created webhook",
        "tags": [
          "Webhooks"
        ]
      }
    },
    "report.updated": {
      "post": {
        "description": "Signed Elynext webhook delivery with minimized event metadata.",
        "operationId": "receiveReportUpdatedWebhook",
        "parameters": [
          {
            "in": "header",
            "name": "X-Elynext-Webhook-Event-Id",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "in": "header",
            "name": "X-Elynext-Webhook-Delivery-Id",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "in": "header",
            "name": "X-Elynext-Webhook-Event-Version",
            "required": true,
            "schema": {
              "const": "1",
              "type": "string"
            }
          },
          {
            "in": "header",
            "name": "X-Elynext-Webhook-Timestamp",
            "required": true,
            "schema": {
              "minimum": 0,
              "type": "integer"
            }
          },
          {
            "in": "header",
            "name": "X-Elynext-Webhook-Signature",
            "required": true,
            "schema": {
              "pattern": "^v1=[a-f0-9]{64}$",
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/WebhookEvent"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "description": "Webhook accepted by the partner endpoint."
          },
          "400": {
            "description": "Webhook rejected by the partner endpoint."
          },
          "500": {
            "description": "Partner endpoint failed; Elynext may retry delivery."
          }
        },
        "summary": "Receive report.updated webhook",
        "tags": [
          "Webhooks"
        ]
      }
    }
  },
  "x-documentation-revision": "2026-10-30.5"
}
