{
  "openapi": "3.1.0",
  "info": {
    "title": "FaciliPulse Developer API",
    "version": "2026-09-08",
    "description": "Public facility data and server-to-server organization integrations using x-org-api-key. Each authenticated operation lists its required scope. Interactive requests are real and subject to server CORS. Some payload schemas are still being expanded. Source documentation does not guarantee deployment availability."
  },
  "servers": [
    {
      "url": "https://server2.gp-lights.com"
    }
  ],
  "paths": {
    "/api/v1/{orgId}/effective-status": {
      "get": {
        "summary": "Read effective facility status",
        "operationId": "getApiV1OrgidEffectiveStatus",
        "description": "Public canonical status plan. Response includes serverNow, facility and areas. Cache-Control: public, max-age=30. Missing or stale occupancy is not zero.\n\n**Authentication:** Public; no API credential required. Deployment CORS restrictions can still apply.",
        "tags": [
          "Public status"
        ],
        "security": [],
        "parameters": [
          {
            "name": "orgId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Successful response",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "ok": {
                      "type": "boolean"
                    },
                    "serverNow": {
                      "type": "string"
                    },
                    "facility": {
                      "type": "object",
                      "additionalProperties": true
                    },
                    "areas": {
                      "type": "object",
                      "additionalProperties": {
                        "type": "object"
                      }
                    }
                  },
                  "additionalProperties": true
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "404": {
            "description": "Organization not found"
          },
          "500": {
            "$ref": "#/components/responses/ServerError"
          }
        },
        "x-documentation-detail": "expanded"
      }
    },
    "/api/v1/{orgId}/notification-options": {
      "get": {
        "summary": "Read notification topics",
        "operationId": "getApiV1OrgidNotificationOptions",
        "description": "Read valid topic identifiers and available channels before updating preferences.\n\n**Authentication:** Organization API key with `notifications:read`.",
        "tags": [
          "Identity and members"
        ],
        "security": [
          {
            "OrganizationKey": []
          }
        ],
        "parameters": [
          {
            "name": "orgId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Successful response",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "ok": {
                      "type": "boolean"
                    },
                    "orgId": {
                      "type": "string"
                    },
                    "orgName": {
                      "type": "string"
                    },
                    "categories": {},
                    "areas": {},
                    "customTopics": {},
                    "systemTopics": {},
                    "channels": {
                      "type": "array",
                      "items": {
                        "type": "string",
                        "enum": [
                          "sms",
                          "email",
                          "voice"
                        ]
                      }
                    }
                  },
                  "additionalProperties": true
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "500": {
            "$ref": "#/components/responses/ServerError"
          }
        },
        "x-required-scope": "notifications:read",
        "x-documentation-detail": "expanded"
      }
    },
    "/api/v1/{orgId}/auth/external/resolve": {
      "post": {
        "summary": "Resolve external member identity",
        "operationId": "postApiV1OrgidAuthExternalResolve",
        "description": "May create identity records. An identity or roster import is not evidence of messaging consent.\n\n**Authentication:** Organization API key with `identity:resolve`.",
        "tags": [
          "Identity and members"
        ],
        "security": [
          {
            "OrganizationKey": []
          }
        ],
        "parameters": [
          {
            "name": "orgId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Successful response",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "ok": {
                      "type": "boolean"
                    },
                    "orgId": {
                      "type": "string"
                    },
                    "personId": {
                      "type": "string"
                    },
                    "provider": {
                      "type": "string"
                    },
                    "externalId": {
                      "type": "string"
                    }
                  },
                  "additionalProperties": true
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "500": {
            "$ref": "#/components/responses/ServerError"
          }
        },
        "x-required-scope": "identity:resolve",
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "provider": {
                    "type": "string"
                  },
                  "externalId": {
                    "type": "string"
                  },
                  "phoneE164": {
                    "type": "string"
                  },
                  "firstName": {
                    "type": "string"
                  },
                  "lastName": {
                    "type": "string"
                  },
                  "email": {
                    "type": "string"
                  }
                },
                "additionalProperties": true,
                "required": [
                  "provider",
                  "externalId"
                ]
              },
              "example": {
                "provider": "your_membership_system",
                "externalId": "member_123",
                "email": "member@example.com"
              }
            }
          }
        },
        "x-documentation-detail": "expanded"
      }
    },
    "/api/v1/{orgId}/members/by-external-id/{provider}/{externalId}/prefs": {
      "get": {
        "summary": "Read member preferences",
        "operationId": "getApiV1OrgidMembersByExternalIdProviderExternalidPrefs",
        "description": "URL-encode provider and externalId. Topic values are channel arrays. Read back after updating; do not assume omitted nested fields are removed.\n\n**Authentication:** Organization API key with `members:read`.",
        "tags": [
          "Identity and members"
        ],
        "security": [
          {
            "OrganizationKey": []
          }
        ],
        "parameters": [
          {
            "name": "orgId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "provider",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "externalId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Successful response",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "ok": {
                      "type": "boolean"
                    },
                    "orgId": {
                      "type": "string"
                    },
                    "personId": {
                      "type": "string"
                    },
                    "profile": {
                      "type": "object",
                      "properties": {
                        "phoneE164": {
                          "type": "string"
                        },
                        "firstName": {
                          "type": "string"
                        },
                        "lastName": {
                          "type": "string"
                        },
                        "email": {
                          "type": "string"
                        }
                      },
                      "additionalProperties": true
                    },
                    "notifPrefs": {
                      "type": "object",
                      "properties": {
                        "topics": {
                          "type": "object",
                          "additionalProperties": {
                            "type": "array",
                            "items": {
                              "type": "string",
                              "enum": [
                                "sms",
                                "email",
                                "voice"
                              ]
                            }
                          }
                        }
                      },
                      "additionalProperties": true
                    }
                  },
                  "additionalProperties": true
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "500": {
            "$ref": "#/components/responses/ServerError"
          }
        },
        "x-required-scope": "members:read",
        "x-documentation-detail": "expanded"
      },
      "put": {
        "summary": "Update member preferences",
        "operationId": "putApiV1OrgidMembersByExternalIdProviderExternalidPrefs",
        "description": "URL-encode provider and externalId. Topic values are channel arrays. Read back after updating; do not assume omitted nested fields are removed.\n\n**Authentication:** Organization API key with `members:write`.",
        "tags": [
          "Identity and members"
        ],
        "security": [
          {
            "OrganizationKey": []
          }
        ],
        "parameters": [
          {
            "name": "orgId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "provider",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "externalId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Successful response",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "ok": {
                      "type": "boolean"
                    },
                    "orgId": {
                      "type": "string"
                    },
                    "personId": {
                      "type": "string"
                    },
                    "profile": {
                      "type": "object",
                      "properties": {
                        "phoneE164": {
                          "type": "string"
                        },
                        "firstName": {
                          "type": "string"
                        },
                        "lastName": {
                          "type": "string"
                        },
                        "email": {
                          "type": "string"
                        }
                      },
                      "additionalProperties": true
                    },
                    "notifPrefs": {
                      "type": "object",
                      "properties": {
                        "topics": {
                          "type": "object",
                          "additionalProperties": {
                            "type": "array",
                            "items": {
                              "type": "string",
                              "enum": [
                                "sms",
                                "email",
                                "voice"
                              ]
                            }
                          }
                        }
                      },
                      "additionalProperties": true
                    }
                  },
                  "additionalProperties": true
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "500": {
            "$ref": "#/components/responses/ServerError"
          }
        },
        "x-required-scope": "members:write",
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "topics": {
                    "type": "object",
                    "additionalProperties": {
                      "type": "array",
                      "items": {
                        "type": "string",
                        "enum": [
                          "sms",
                          "email",
                          "voice"
                        ]
                      }
                    }
                  },
                  "phoneE164": {
                    "type": "string"
                  },
                  "firstName": {
                    "type": "string"
                  },
                  "lastName": {
                    "type": "string"
                  },
                  "email": {
                    "type": "string"
                  }
                },
                "additionalProperties": true,
                "required": [
                  "topics"
                ]
              },
              "example": {
                "topics": {
                  "facilityOverride": [
                    "email"
                  ]
                },
                "email": "member@example.com"
              }
            }
          }
        },
        "x-documentation-detail": "expanded"
      }
    },
    "/api/v1/{orgId}/members/batch-sync": {
      "post": {
        "summary": "Synchronize a member batch",
        "operationId": "postApiV1OrgidMembersBatchSync",
        "description": "Maximum 250 entries. Default provider is courtreserve; explicitly supply your own. Sequential, non-atomic writes; entries without externalId are skipped. Does not remove absent members.\n\n**Authentication:** Organization API key with `members:write`.",
        "tags": [
          "Identity and members"
        ],
        "security": [
          {
            "OrganizationKey": []
          }
        ],
        "parameters": [
          {
            "name": "orgId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Successful response",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "ok": {
                      "type": "boolean"
                    },
                    "orgId": {
                      "type": "string"
                    },
                    "provider": {
                      "type": "string"
                    },
                    "totalSubmitted": {
                      "type": "integer"
                    },
                    "syncedCount": {
                      "type": "integer"
                    },
                    "results": {
                      "type": "array",
                      "items": {
                        "type": "object",
                        "properties": {
                          "externalId": {
                            "type": "string"
                          },
                          "personId": {
                            "type": "string"
                          },
                          "status": {
                            "type": "string"
                          }
                        },
                        "additionalProperties": true
                      }
                    }
                  },
                  "additionalProperties": true
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "500": {
            "$ref": "#/components/responses/ServerError"
          }
        },
        "x-required-scope": "members:write",
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "provider": {
                    "type": "string"
                  },
                  "members": {
                    "type": "array",
                    "minItems": 1,
                    "maxItems": 250,
                    "items": {
                      "type": "object",
                      "properties": {
                        "externalId": {
                          "type": "string"
                        },
                        "phoneE164": {
                          "type": "string"
                        },
                        "firstName": {
                          "type": "string"
                        },
                        "lastName": {
                          "type": "string"
                        },
                        "email": {
                          "type": "string"
                        }
                      },
                      "additionalProperties": true,
                      "required": [
                        "externalId"
                      ]
                    }
                  }
                },
                "additionalProperties": true,
                "required": [
                  "members"
                ]
              },
              "example": {
                "provider": "your_membership_system",
                "members": [
                  {
                    "externalId": "member_123",
                    "email": "member@example.com"
                  }
                ]
              }
            }
          }
        },
        "x-documentation-detail": "expanded"
      }
    },
    "/api/v1/{orgId}/auth/launch-link": {
      "post": {
        "summary": "Create a member or admin launch link",
        "operationId": "postApiV1OrgidAuthLaunchLink",
        "description": "Provide provider and externalId, or phoneE164. Default expiry 10 minutes, clamped to 1 minute–30 days. adminPanel also requires an active admin record. Treat ssoUrl as a bearer secret.\n\n**Authentication:** Organization API key with `auth:launch-link`.",
        "tags": [
          "Identity and members"
        ],
        "security": [
          {
            "OrganizationKey": []
          }
        ],
        "parameters": [
          {
            "name": "orgId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Successful response",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "ok": {
                      "type": "boolean"
                    },
                    "ssoUrl": {
                      "type": "string"
                    },
                    "expiresAt": {
                      "type": "string"
                    }
                  },
                  "additionalProperties": true
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "500": {
            "$ref": "#/components/responses/ServerError"
          }
        },
        "x-required-scope": "auth:launch-link",
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "target": {
                    "type": "string",
                    "enum": [
                      "memberPrefs",
                      "adminPanel"
                    ]
                  },
                  "provider": {
                    "type": "string"
                  },
                  "externalId": {
                    "type": "string"
                  },
                  "phoneE164": {
                    "type": "string"
                  },
                  "expiresInMinutes": {
                    "type": "integer"
                  },
                  "expiresInDays": {
                    "type": "integer"
                  }
                },
                "additionalProperties": true,
                "required": [
                  "target"
                ]
              },
              "example": {
                "target": "memberPrefs",
                "provider": "your_membership_system",
                "externalId": "member_123",
                "expiresInMinutes": 10
              }
            }
          }
        },
        "x-documentation-detail": "expanded"
      }
    },
    "/api/v1/{orgId}/members/report": {
      "get": {
        "summary": "Export member preferences",
        "operationId": "getApiV1OrgidMembersReport",
        "description": "Returns the matching member report without pagination. format=csv returns text/csv instead of JSON. Protect exports as personal data.\n\n**Authentication:** Organization API key with `members:read`.",
        "tags": [
          "Identity and members"
        ],
        "security": [
          {
            "OrganizationKey": []
          }
        ],
        "parameters": [
          {
            "name": "orgId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "topic",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "channel",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "format",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string",
              "enum": [
                "json",
                "csv"
              ]
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Successful response",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "ok": {
                      "type": "boolean"
                    },
                    "orgId": {
                      "type": "string"
                    },
                    "count": {
                      "type": "integer"
                    },
                    "members": {
                      "type": "array",
                      "items": {
                        "type": "object"
                      }
                    }
                  },
                  "additionalProperties": true
                }
              },
              "text/csv": {
                "schema": {
                  "type": "string"
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "500": {
            "$ref": "#/components/responses/ServerError"
          }
        },
        "x-required-scope": "members:read",
        "x-documentation-detail": "expanded"
      }
    },
    "/api/v1/{orgId}/notification-logs": {
      "get": {
        "summary": "Read notification delivery logs",
        "operationId": "getApiV1OrgidNotificationLogs",
        "description": "Inspect status rather than treating provider acceptance as confirmed delivery. Results are limited and are not a paginated archive export.\n\n**Authentication:** Organization API key with `notifications:read`.",
        "tags": [
          "Identity and members"
        ],
        "security": [
          {
            "OrganizationKey": []
          }
        ],
        "parameters": [
          {
            "name": "orgId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "topic",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "startDate",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "endDate",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "status",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "limit",
            "in": "query",
            "required": false,
            "schema": {
              "type": "integer",
              "minimum": 1,
              "maximum": 200,
              "default": 50
            }
          },
          {
            "name": "scope",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string"
            },
            "description": "Handler query field; see operation notes for constraints."
          }
        ],
        "responses": {
          "200": {
            "description": "Successful response",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "ok": {
                      "type": "boolean"
                    },
                    "orgId": {
                      "type": "string"
                    },
                    "count": {
                      "type": "integer"
                    },
                    "logs": {
                      "type": "array",
                      "items": {
                        "type": "object"
                      }
                    }
                  },
                  "additionalProperties": true
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "500": {
            "$ref": "#/components/responses/ServerError"
          }
        },
        "x-required-scope": "notifications:read",
        "x-documentation-detail": "expanded"
      }
    },
    "/api/v1/{orgId}/webhooks": {
      "get": {
        "summary": "List webhook registrations",
        "operationId": "getApiV1OrgidWebhooks",
        "description": "Returns metadata and hasSecret, never the original signing secret.\n\n**Authentication:** Organization API key with `webhooks:read`.",
        "tags": [
          "Webhooks"
        ],
        "security": [
          {
            "OrganizationKey": []
          }
        ],
        "parameters": [
          {
            "name": "orgId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Successful response",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "ok": {
                      "type": "boolean"
                    },
                    "orgId": {
                      "type": "string"
                    },
                    "webhooks": {
                      "type": "array",
                      "items": {
                        "type": "object"
                      }
                    }
                  },
                  "additionalProperties": true
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "500": {
            "$ref": "#/components/responses/ServerError"
          }
        },
        "x-required-scope": "webhooks:read",
        "x-documentation-detail": "expanded"
      },
      "post": {
        "summary": "Register a webhook",
        "operationId": "postApiV1OrgidWebhooks",
        "description": "Public HTTPS URL required. Supply a secret for signed deliveries. Events default to wildcard; registration support does not guarantee every event is emitted by every deployed producer.\n\n**Authentication:** Organization API key with `webhooks:write`.",
        "tags": [
          "Webhooks"
        ],
        "security": [
          {
            "OrganizationKey": []
          }
        ],
        "parameters": [
          {
            "name": "orgId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Successful response",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "ok": {
                      "type": "boolean"
                    },
                    "orgId": {
                      "type": "string"
                    },
                    "webhookId": {
                      "type": "string"
                    },
                    "name": {
                      "type": "string"
                    },
                    "url": {
                      "type": "string"
                    },
                    "events": {
                      "type": "array",
                      "items": {
                        "type": "string"
                      }
                    },
                    "hasSecret": {
                      "type": "boolean"
                    },
                    "createdAt": {
                      "type": "string"
                    }
                  },
                  "additionalProperties": true
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "500": {
            "$ref": "#/components/responses/ServerError"
          }
        },
        "x-required-scope": "webhooks:write",
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "url": {
                    "type": "string",
                    "format": "uri"
                  },
                  "name": {
                    "type": "string"
                  },
                  "secret": {
                    "type": "string",
                    "writeOnly": true
                  },
                  "events": {
                    "type": "array",
                    "items": {
                      "type": "string",
                      "enum": [
                        "*",
                        "facility.override_changed",
                        "facility.status_changed",
                        "area.status_changed",
                        "notification.sent",
                        "member.prefs_updated"
                      ]
                    }
                  }
                },
                "additionalProperties": true,
                "required": [
                  "url"
                ]
              },
              "example": {
                "url": "https://example.com/facilipulse/webhook",
                "name": "Facility updates",
                "secret": "REPLACE_WITH_A_RANDOM_SECRET",
                "events": [
                  "facility.status_changed"
                ]
              }
            }
          }
        },
        "x-documentation-detail": "expanded"
      }
    },
    "/api/v1/{orgId}/webhooks/{webhookId}": {
      "delete": {
        "summary": "Remove a webhook",
        "operationId": "deleteApiV1OrgidWebhooksWebhookid",
        "description": "Removes a registration. This is not a general deletion of historical delivery records.\n\n**Authentication:** Organization API key with `webhooks:write`.",
        "tags": [
          "Webhooks"
        ],
        "security": [
          {
            "OrganizationKey": []
          }
        ],
        "parameters": [
          {
            "name": "orgId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "webhookId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Successful response",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "ok": {
                      "type": "boolean"
                    }
                  },
                  "additionalProperties": true
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "500": {
            "$ref": "#/components/responses/ServerError"
          }
        },
        "x-required-scope": "webhooks:write",
        "x-documentation-detail": "expanded"
      }
    },
    "/api/v1/{orgId}/webhooks/{webhookId}/test": {
      "post": {
        "summary": "Send a test webhook",
        "operationId": "postApiV1OrgidWebhooksWebhookidTest",
        "description": "Makes a real outbound request with event test.ping. This direct test payload does not include the normal queue eventId and does not exercise queued retries.\n\n**Authentication:** Organization API key with `webhooks:write`.",
        "tags": [
          "Webhooks"
        ],
        "security": [
          {
            "OrganizationKey": []
          }
        ],
        "parameters": [
          {
            "name": "orgId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "webhookId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Successful response",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "ok": {
                      "type": "boolean"
                    },
                    "status": {
                      "type": "integer"
                    },
                    "statusText": {
                      "type": "string"
                    },
                    "delivered": {
                      "type": "boolean"
                    }
                  },
                  "additionalProperties": true
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "500": {
            "$ref": "#/components/responses/ServerError"
          },
          "502": {
            "description": "Destination rejected the request or could not be reached"
          }
        },
        "x-required-scope": "webhooks:write",
        "x-documentation-detail": "expanded"
      }
    },
    "/api/v1/{orgId}/webhook-deliveries": {
      "get": {
        "summary": "Read webhook delivery history",
        "operationId": "getApiV1OrgidWebhookDeliveries",
        "description": "Review pending, delivered, and dead-letter attempts. History is bounded by the requested limit.\n\n**Authentication:** Organization API key with `webhooks:read`.",
        "tags": [
          "Webhooks"
        ],
        "security": [
          {
            "OrganizationKey": []
          }
        ],
        "parameters": [
          {
            "name": "orgId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "limit",
            "in": "query",
            "required": false,
            "schema": {
              "type": "integer",
              "default": 50,
              "minimum": 1,
              "maximum": 100
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Successful response",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "ok": {
                      "type": "boolean"
                    },
                    "orgId": {
                      "type": "string"
                    },
                    "deliveries": {
                      "type": "array",
                      "items": {
                        "type": "object"
                      }
                    }
                  },
                  "additionalProperties": true
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "500": {
            "$ref": "#/components/responses/ServerError"
          }
        },
        "x-required-scope": "webhooks:read",
        "x-documentation-detail": "expanded"
      }
    },
    "/api/v1/{orgId}/webhook-deliveries/{deliveryId}/replay": {
      "post": {
        "summary": "Replay a webhook delivery",
        "operationId": "postApiV1OrgidWebhookDeliveriesDeliveryidReplay",
        "description": "Queues a real delivery attempt. Reconcile receiver state first to avoid repeating business actions.\n\n**Authentication:** Organization API key with `webhooks:write`.",
        "tags": [
          "Webhooks"
        ],
        "security": [
          {
            "OrganizationKey": []
          }
        ],
        "parameters": [
          {
            "name": "orgId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "deliveryId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Successful response",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "ok": {
                      "type": "boolean"
                    },
                    "deliveryId": {
                      "type": "string"
                    },
                    "status": {
                      "type": "string"
                    }
                  },
                  "additionalProperties": true
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "500": {
            "$ref": "#/components/responses/ServerError"
          }
        },
        "x-required-scope": "webhooks:write",
        "x-documentation-detail": "expanded"
      }
    },
    "/{orgId}/areas": {
      "get": {
        "summary": "GET /{orgId}/areas",
        "description": "Route and authentication reference. Detailed payload contracts for this operation are still being documented; do not infer fields or retry guarantees from its path.\n\n**Authentication:** Public; no API credential required. Deployment CORS restrictions can still apply.",
        "parameters": [
          {
            "name": "orgId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Successful handler response. Response fields vary by operation; a complete response schema is not yet documented."
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "500": {
            "$ref": "#/components/responses/ServerError"
          }
        },
        "x-documentation-detail": "route-and-authentication",
        "operationId": "getOrgidAreas",
        "tags": [
          "Administration"
        ],
        "security": []
      }
    },
    "/api/v1/{orgId}/admin/admins": {
      "get": {
        "summary": "GET /api/v1/{orgId}/admin/admins",
        "description": "Route and authentication reference. Detailed payload contracts for this operation are still being documented; do not infer fields or retry guarantees from its path.\n\n**Authentication:** Organization API key with `admin:read`.",
        "parameters": [
          {
            "name": "orgId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Successful handler response. Response fields vary by operation; a complete response schema is not yet documented."
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "500": {
            "$ref": "#/components/responses/ServerError"
          }
        },
        "x-documentation-detail": "route-and-authentication",
        "operationId": "getApiV1OrgidAdminAdmins",
        "tags": [
          "Administration"
        ],
        "security": [
          {
            "OrganizationKey": []
          }
        ],
        "x-required-scope": "admin:read"
      }
    },
    "/api/v1/{orgId}/admin/admins/invite": {
      "post": {
        "summary": "POST /api/v1/{orgId}/admin/admins/invite",
        "description": "Route and authentication reference. Detailed payload contracts for this operation are still being documented; do not infer fields or retry guarantees from its path.\n\n**Authentication:** Organization API key with `admin:write`.",
        "parameters": [
          {
            "name": "orgId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Successful handler response. Response fields vary by operation; a complete response schema is not yet documented."
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "500": {
            "$ref": "#/components/responses/ServerError"
          }
        },
        "x-documentation-detail": "route-and-authentication",
        "operationId": "postApiV1OrgidAdminAdminsInvite",
        "tags": [
          "Administration"
        ],
        "security": [
          {
            "OrganizationKey": []
          }
        ],
        "x-required-scope": "admin:write",
        "requestBody": {
          "description": "Fields referenced by the handler. Types, conditional requirements, and nested structures are not yet fully documented.",
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "additionalProperties": true,
                "properties": {
                  "phoneE164": {},
                  "role": {}
                }
              }
            }
          }
        }
      }
    },
    "/api/v1/{orgId}/admin/admins/{personId}": {
      "patch": {
        "summary": "PATCH /api/v1/{orgId}/admin/admins/{personId}",
        "description": "Route and authentication reference. Detailed payload contracts for this operation are still being documented; do not infer fields or retry guarantees from its path.\n\n**Authentication:** Organization API key with `admin:write`.",
        "parameters": [
          {
            "name": "orgId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "personId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Successful handler response. Response fields vary by operation; a complete response schema is not yet documented."
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "500": {
            "$ref": "#/components/responses/ServerError"
          }
        },
        "x-documentation-detail": "route-and-authentication",
        "operationId": "patchApiV1OrgidAdminAdminsPersonid",
        "tags": [
          "Administration"
        ],
        "security": [
          {
            "OrganizationKey": []
          }
        ],
        "x-required-scope": "admin:write",
        "requestBody": {
          "description": "Fields referenced by the handler. Types, conditional requirements, and nested structures are not yet fully documented.",
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "additionalProperties": true,
                "properties": {
                  "profile": {},
                  "role": {},
                  "status": {}
                }
              }
            }
          }
        }
      },
      "delete": {
        "summary": "DELETE /api/v1/{orgId}/admin/admins/{personId}",
        "description": "Route and authentication reference. Detailed payload contracts for this operation are still being documented; do not infer fields or retry guarantees from its path.\n\n**Authentication:** Organization API key with `admin:write`.",
        "parameters": [
          {
            "name": "orgId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "personId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Successful handler response. Response fields vary by operation; a complete response schema is not yet documented."
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "500": {
            "$ref": "#/components/responses/ServerError"
          }
        },
        "x-documentation-detail": "route-and-authentication",
        "operationId": "deleteApiV1OrgidAdminAdminsPersonid",
        "tags": [
          "Administration"
        ],
        "security": [
          {
            "OrganizationKey": []
          }
        ],
        "x-required-scope": "admin:write"
      }
    },
    "/api/v1/{orgId}/members/by-phone/{phoneE164}/prefs": {
      "get": {
        "summary": "GET /api/v1/{orgId}/members/by-phone/{phoneE164}/prefs",
        "description": "Route and authentication reference. Detailed payload contracts for this operation are still being documented; do not infer fields or retry guarantees from its path.\n\n**Authentication:** Organization API key with `members:read`.\n\nPrefer the external-ID member routes for new integrations. Phone-based read isolation is under review.",
        "parameters": [
          {
            "name": "orgId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "phoneE164",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Successful handler response. Response fields vary by operation; a complete response schema is not yet documented."
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "500": {
            "$ref": "#/components/responses/ServerError"
          }
        },
        "x-documentation-detail": "route-and-authentication",
        "operationId": "getApiV1OrgidMembersByPhonePhonee164Prefs",
        "tags": [
          "Identity and members"
        ],
        "security": [
          {
            "OrganizationKey": []
          }
        ],
        "x-required-scope": "members:read"
      },
      "put": {
        "summary": "PUT /api/v1/{orgId}/members/by-phone/{phoneE164}/prefs",
        "description": "Route and authentication reference. Detailed payload contracts for this operation are still being documented; do not infer fields or retry guarantees from its path.\n\n**Authentication:** Organization API key with `members:write`.\n\nPrefer the external-ID member routes for new integrations. Phone-based read isolation is under review.",
        "parameters": [
          {
            "name": "orgId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "phoneE164",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Successful handler response. Response fields vary by operation; a complete response schema is not yet documented."
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "500": {
            "$ref": "#/components/responses/ServerError"
          }
        },
        "x-documentation-detail": "route-and-authentication",
        "operationId": "putApiV1OrgidMembersByPhonePhonee164Prefs",
        "tags": [
          "Identity and members"
        ],
        "security": [
          {
            "OrganizationKey": []
          }
        ],
        "x-required-scope": "members:write",
        "requestBody": {
          "description": "Fields referenced by the handler. Types, conditional requirements, and nested structures are not yet fully documented.",
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "additionalProperties": true,
                "properties": {
                  "email": {},
                  "firstName": {},
                  "lastName": {},
                  "topics": {}
                }
              }
            }
          }
        }
      }
    },
    "/api/v1/{orgId}/weather": {
      "get": {
        "summary": "GET /api/v1/{orgId}/weather",
        "description": "Route and authentication reference. Detailed payload contracts for this operation are still being documented; do not infer fields or retry guarantees from its path.\n\n**Authentication:** Public; no API credential required. Deployment CORS restrictions can still apply.",
        "parameters": [
          {
            "name": "orgId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Successful handler response. Response fields vary by operation; a complete response schema is not yet documented."
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "500": {
            "$ref": "#/components/responses/ServerError"
          }
        },
        "x-documentation-detail": "route-and-authentication",
        "operationId": "getApiV1OrgidWeather",
        "tags": [
          "Weather"
        ],
        "security": []
      }
    },
    "/api/v1/{orgId}/widget-data": {
      "get": {
        "summary": "GET /api/v1/{orgId}/widget-data",
        "description": "Route and authentication reference. Detailed payload contracts for this operation are still being documented; do not infer fields or retry guarantees from its path.\n\n**Authentication:** Public; no API credential required. Deployment CORS restrictions can still apply.",
        "parameters": [
          {
            "name": "orgId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Successful handler response. Response fields vary by operation; a complete response schema is not yet documented."
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "500": {
            "$ref": "#/components/responses/ServerError"
          }
        },
        "x-documentation-detail": "route-and-authentication",
        "operationId": "getApiV1OrgidWidgetData",
        "tags": [
          "Widgets"
        ],
        "security": []
      }
    }
  },
  "components": {
    "securitySchemes": {
      "OrganizationKey": {
        "type": "apiKey",
        "in": "header",
        "name": "x-org-api-key",
        "description": "Server-side organization key. Required scope is listed per operation."
      }
    },
    "responses": {
      "BadRequest": {
        "description": "Invalid request",
        "content": {
          "application/json": {
            "schema": {
              "type": "object",
              "properties": {
                "error": {
                  "type": "string"
                }
              },
              "additionalProperties": true
            }
          }
        }
      },
      "Unauthorized": {
        "description": "Missing or invalid credential",
        "content": {
          "application/json": {
            "schema": {
              "type": "object",
              "properties": {
                "error": {
                  "type": "string"
                }
              },
              "additionalProperties": true
            }
          }
        }
      },
      "Forbidden": {
        "description": "Insufficient permission or scope",
        "content": {
          "application/json": {
            "schema": {
              "type": "object",
              "properties": {
                "error": {
                  "type": "string"
                }
              },
              "additionalProperties": true
            }
          }
        }
      },
      "ServerError": {
        "description": "Internal failure; mutations may have partially committed",
        "content": {
          "application/json": {
            "schema": {
              "type": "object",
              "properties": {
                "error": {
                  "type": "string"
                }
              },
              "additionalProperties": true
            }
          }
        }
      }
    }
  },
  "tags": [
    {
      "name": "Administration"
    },
    {
      "name": "Identity and members"
    },
    {
      "name": "Weather"
    },
    {
      "name": "Public status"
    },
    {
      "name": "Webhooks"
    },
    {
      "name": "Widgets"
    }
  ]
}
