{
  "openapi": "3.1.0",
  "info": {
    "title": "AppPortal Client diagnostics, communication and Location",
    "version": "v1",
    "description": "Existing installed-app diagnostics, bound-user communication and Message Center, and app-side Location operations, including protected live inbox and versioned sync pages. SDK collection controls and server authoring remain separate."
  },
  "servers": [
    {
      "url": "https://api.appportal.io"
    }
  ],
  "paths": {
    "/v1/ingest/crashes/{crashId}/attachments/{attachmentId}": {
      "put": {
        "summary": "Upload a diagnostic for an acknowledged crash occurrence",
        "description": "Upload only after the owning crash receives Accepted or AlreadyAccepted, retaining its exact occurrenceFingerprint. The SDK credential selects one app/environment; the fingerprint is non-secret generation correlation, never authorization. The same attachment ID and sanitized bytes are idempotent. Text and display names receive fixed credential-safety processing before storage; application-specific PII filtering and consent remain developer/SDK responsibilities.",
        "security": [
          {
            "installedAppCredential": []
          }
        ],
        "x-appportal-permission": "TelemetryIngest",
        "x-appportal-max-request-body-bytes": 1048576,
        "x-appportal-default-max-attachments-per-occurrence": 5,
        "x-appportal-default-max-total-bytes-per-occurrence": 5242880,
        "x-appportal-retention-cleanup-armed-default": false,
        "parameters": [
          {
            "name": "crashId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            },
            "description": "Exact opaque crash ID, case-sensitive, non-whitespace, at most 512 UTF-16 code units."
          },
          {
            "name": "attachmentId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            },
            "description": "Exact opaque attachment ID, case-sensitive, non-whitespace. The compiled default limit is 200 UTF-16 code units; deployments can configure it."
          },
          {
            "name": "X-AppPortal-Diagnostic-Crash-Occurrence",
            "in": "header",
            "required": true,
            "schema": {
              "type": "string",
              "pattern": "^[0-9a-f]{64}$"
            },
            "description": "The exact lowercase fingerprint returned in the crash acknowledgement; persist it with this journal row."
          },
          {
            "name": "X-AppPortal-Diagnostic-File-Name",
            "in": "header",
            "required": false,
            "schema": {
              "type": "string"
            },
            "description": "Optional display metadata, never a storage key. The processed leaf name defaults to diagnostic.txt/diagnostic.json and is bounded to the configured display limit (compiled default 200 UTF-16 code units)."
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "text/plain": {
              "schema": {
                "type": "string"
              },
              "example": "Cache restored before screen navigation."
            },
            "application/json": {
              "schema": {},
              "example": {
                "phase": "startup",
                "cache": "ready"
              }
            }
          },
          "description": "A non-whitespace, strictly UTF-8 body. application/json accepts any valid JSON value, not only objects. Media type parameters do not choose a different decoder. Binary dumps and archives are not accepted. Limits apply to input bytes and processed bytes, not Unicode character count."
        },
        "responses": {
          "200": {
            "description": "The same sanitized attachment is already stored; retire only this acknowledged journal row.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/CrashDiagnosticAttachment"
                }
              }
            }
          },
          "201": {
            "description": "New sanitized attachment stored; retire only this acknowledged journal row.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/CrashDiagnosticAttachment"
                }
              }
            }
          },
          "400": {
            "description": "Invalid IDs or fingerprint, invalid UTF-8/JSON, empty content or unsafe normalization. Repair/quarantine the individual item; do not retry unchanged."
          },
          "401": {
            "description": "SDK credential missing, invalid, expired or revoked. Pause delivery and surface an authentication diagnostic."
          },
          "403": {
            "description": "The credential kind, permission or trusted app scope does not authorize telemetry ingestion."
          },
          "409": {
            "description": "Inspect the error code and optional Retry-After before deciding to retry. Missing durable crash/generation or changed storage generation uses Retry-After 2; an upload lease conflict uses 1. Fingerprint mismatch or retired storage generation returns retryable:false. Unsupported provider retention is permanent until configuration changes. Cleanup/schema prerequisites fail closed. A reused ID with different sanitized content conflicts without Retry-After.",
            "headers": {
              "Retry-After": {
                "description": "Present only for a retryable conflict; seconds (1 or 2). It is not present on every 409.",
                "schema": {
                  "type": "integer",
                  "enum": [
                    1,
                    2
                  ]
                }
              }
            },
            "x-appportal-known-error-codes": [
              "diagnostic_attachment_occurrence_mismatch",
              "diagnostic_attachment_storage_generation_retired",
              "diagnostic_attachment_storage_generation_changed",
              "diagnostic_attachments_retention_cleanup_required",
              "diagnostic_attachments_retention_schema_required",
              "diagnostic_attachments_provider_retention_unsupported"
            ]
          },
          "410": {
            "description": "The owning crash occurrence expired before the write. Retire this orphaned attachment; never rebind it to another occurrence."
          },
          "413": {
            "description": "Configured per-file/count/total-byte cap exceeded. Compiled defaults: 1048576 bytes per file, 5 files and 5242880 bytes per occurrence."
          },
          "415": {
            "description": "Media type must be text/plain or application/json, decoded as strict UTF-8."
          },
          "500": {
            "description": "Diagnostic storage failed; no successful attachment acknowledgement was issued."
          },
          "503": {
            "description": "Temporary unsigned v1 disposition when telemetry operational policy is denied or unavailable. Retain unacknowledged entries, honor the retry deadline and do not infer queue purge or collection disablement.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/TelemetryTemporaryFailureResponse"
                }
              }
            },
            "headers": {
              "Retry-After": {
                "schema": {
                  "type": "integer",
                  "minimum": 3600
                }
              },
              "Cache-Control": {
                "schema": {
                  "const": "no-store"
                }
              }
            }
          }
        }
      }
    },
    "/v1/consent/{userId}": {
      "get": {
        "summary": "Read one bound user's communication preferences",
        "description": "This is per-channel communication consent only, not local SDK telemetry collection, Reset/Denied or server erasure. Use a backend-issued user-installation binding matching the exact opaque user ID and requested operation. Percent-encode the user ID once as a path segment without changing its case or identity. No Message Center send/read/interact operation is included here.",
        "security": [
          {
            "installedAppCredential": [],
            "userInstallationBinding": []
          }
        ],
        "x-appportal-permission": "MessageCenter",
        "x-appportal-binding-operation": "ConsentRead",
        "parameters": [
          {
            "name": "userId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            },
            "description": "Exact opaque subject bound by the customer backend; it is not a selector granting access to another user."
          },
          {
            "name": "X-AppPortal-Installation-Id",
            "in": "header",
            "required": true,
            "schema": {
              "type": "string"
            },
            "description": "Exact installation authorized by the user binding."
          }
        ],
        "responses": {
          "200": {
            "description": "Channel preferences for the exact bound user. An empty list means none are stored for that subject/scope.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "array",
                  "items": {
                    "$ref": "#/components/schemas/ConsentPreference"
                  }
                }
              }
            }
          },
          "401": {
            "description": "Missing/invalid SDK credential or user-installation binding."
          },
          "403": {
            "description": "SDK permission missing, or binding scope/subject/operation mismatch."
          },
          "423": {
            "description": "Current organization policy denies communication-consent operations."
          },
          "503": {
            "description": "Binding or organization-policy authority unavailable; fail closed rather than returning an empty preference list."
          }
        }
      },
      "put": {
        "summary": "Update one bound user's communication preference",
        "description": "This is per-channel communication consent only, not local SDK telemetry collection, Reset/Denied or server erasure. Use a backend-issued user-installation binding matching the exact opaque user ID and requested operation. Percent-encode the user ID once as a path segment without changing its case or identity. No Message Center send/read/interact operation is included here.",
        "security": [
          {
            "installedAppCredential": [],
            "userInstallationBinding": []
          }
        ],
        "x-appportal-permission": "MessageCenter",
        "x-appportal-binding-operation": "ConsentWrite",
        "parameters": [
          {
            "name": "userId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            },
            "description": "Exact opaque subject bound by the customer backend; it is not a selector granting access to another user."
          },
          {
            "name": "X-AppPortal-Installation-Id",
            "in": "header",
            "required": true,
            "schema": {
              "type": "string"
            },
            "description": "Exact installation authorized by the user binding."
          }
        ],
        "responses": {
          "200": {
            "description": "Updated preference for the exact bound user and SDK app scope.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ConsentPreference"
                }
              }
            }
          },
          "400": {
            "description": "Malformed JSON or a channel, granted decision or source that fails validation."
          },
          "401": {
            "description": "Missing/invalid SDK credential or user-installation binding."
          },
          "403": {
            "description": "SDK permission missing, or binding scope/subject/operation mismatch."
          },
          "423": {
            "description": "Current organization policy denies communication-consent operations."
          },
          "503": {
            "description": "Binding or organization-policy authority unavailable; fail closed rather than returning an empty preference list."
          }
        },
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/ConsentUpdateRequest"
              },
              "example": {
                "channel": "Push",
                "granted": false,
                "source": "Account notification settings"
              }
            }
          }
        }
      }
    },
    "/v1/message-center/{userId}": {
      "get": {
        "summary": "List active Message Center items for the bound user",
        "security": [
          {
            "installedAppCredential": [],
            "userInstallationBinding": []
          }
        ],
        "x-appportal-permission": "MessageCenter",
        "responses": {
          "200": {
            "description": "Active items in the exact bound app/user scope; an empty array is valid.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/MessageCenterItems"
                }
              }
            }
          },
          "400": {
            "description": "Only the unscoped legacy fixture path requires explicit tenantId/appId query scope; persisted SDK scope supplies it.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ClientNativeError"
                }
              }
            }
          },
          "401": {
            "description": "Missing/invalid SDK credential is bodyless; a missing/invalid user-installation binding has native errorCode/error JSON.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/TenantOperationDeniedResponse"
                }
              }
            }
          },
          "403": {
            "description": "Wrong credential kind/permission is bodyless; a binding subject/scope/operation mismatch has native errorCode/error JSON.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/TenantOperationDeniedResponse"
                }
              }
            }
          },
          "409": {
            "description": "Active inbox exceeds the complete legacy bound; pagination_required. Use the user's /page route.",
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/ClientPageProblem"
                }
              }
            }
          },
          "423": {
            "description": "Current account operational policy denies this operation; native errorCode/error JSON.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/TenantOperationDeniedResponse"
                }
              }
            }
          },
          "429": {
            "description": "Technical admission rate limit. Honor the bounded Retry-After; this is not collection consent or an entitlement change.",
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/ClientRequestAdmissionProblem"
                }
              }
            },
            "headers": {
              "Retry-After": {
                "schema": {
                  "type": "integer",
                  "minimum": 1,
                  "maximum": 3600
                }
              },
              "Cache-Control": {
                "schema": {
                  "const": "no-store"
                }
              }
            }
          },
          "503": {
            "description": "Credential/policy/binding/Location authority or technical admission is unavailable; no empty success or grant is inferred. Native policy/binding errors may be JSON; technical admission uses problem JSON; Location gate can be bodyless.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/TenantOperationDeniedResponse"
                }
              },
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/ClientPageProblem"
                }
              }
            }
          }
        },
        "x-appportal-binding-operation": "MessageCenterRead",
        "parameters": [
          {
            "name": "userId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            },
            "description": "Exact opaque user ID from the backend-issued installation binding; case-sensitive, percent-encoded once as a path segment."
          },
          {
            "name": "X-AppPortal-Installation-Id",
            "in": "header",
            "required": true,
            "schema": {
              "type": "string"
            },
            "description": "Exact installation covered by the binding."
          },
          {
            "name": "tenantId",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string"
            },
            "description": "Explicit legacy account selector only for unscoped isolated fixtures; persisted SDK authority overrides it."
          },
          {
            "name": "appId",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string"
            },
            "description": "Explicit legacy app selector only for unscoped isolated fixtures; persisted SDK authority overrides it."
          }
        ],
        "description": "Requires the exact bound user/installation and current SDK app/account. Current source and authority are rechecked after reading. The complete active-inbox compatibility array is bounded at100 items; if another row exists,409 pagination_required directs callers to /page. It never silently returns a successful partial inbox. Current persisted SDK authority overrides legacy isolated-fixture tenantId/appId selectors. An empty array differs from unavailable authority."
      }
    },
    "/v1/message-center/{userId}/items/{itemId}/interactions": {
      "post": {
        "summary": "Record an interaction with one bound user's item",
        "security": [
          {
            "installedAppCredential": [],
            "userInstallationBinding": []
          }
        ],
        "x-appportal-permission": "MessageCenter",
        "responses": {
          "200": {
            "description": "The updated native MessageCenterItem when present. A null concurrent store result retains the framework's empty Ok response; do not fabricate an item.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/MessageCenterItem"
                }
              }
            }
          },
          "400": {
            "description": "Malformed/missing JSON or unsupported interaction kind. The native domain error has an error string; JSON binding may be bodyless.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ClientNativeError"
                }
              }
            }
          },
          "401": {
            "description": "Missing/invalid SDK credential is bodyless; a missing/invalid user-installation binding has native errorCode/error JSON.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/TenantOperationDeniedResponse"
                }
              }
            }
          },
          "403": {
            "description": "Wrong credential kind/permission is bodyless; a binding subject/scope/operation mismatch has native errorCode/error JSON.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/TenantOperationDeniedResponse"
                }
              }
            }
          },
          "404": {
            "description": "Item absent or exact user/account/app scope does not match; bodyless native NotFound."
          },
          "415": {
            "description": "Unsupported media type rejected by the existing JSON body binder; the response may be bodyless."
          },
          "423": {
            "description": "Current account operational policy denies this operation; native errorCode/error JSON.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/TenantOperationDeniedResponse"
                }
              }
            }
          },
          "429": {
            "description": "Technical admission rate limit. Honor the bounded Retry-After; this is not collection consent or an entitlement change.",
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/ClientRequestAdmissionProblem"
                }
              }
            },
            "headers": {
              "Retry-After": {
                "schema": {
                  "type": "integer",
                  "minimum": 1,
                  "maximum": 3600
                }
              },
              "Cache-Control": {
                "schema": {
                  "const": "no-store"
                }
              }
            }
          },
          "503": {
            "description": "Credential/policy/binding/Location authority or technical admission is unavailable; no empty success or grant is inferred. Native policy/binding errors may be JSON; technical admission uses problem JSON; Location gate can be bodyless.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/TenantOperationDeniedResponse"
                }
              },
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/ClientRequestAdmissionProblem"
                }
              }
            }
          }
        },
        "x-appportal-binding-operation": "MessageCenterInteract",
        "parameters": [
          {
            "name": "userId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            },
            "description": "Exact opaque user ID from the backend-issued installation binding; case-sensitive, percent-encoded once as a path segment."
          },
          {
            "name": "X-AppPortal-Installation-Id",
            "in": "header",
            "required": true,
            "schema": {
              "type": "string"
            },
            "description": "Exact installation covered by the binding."
          },
          {
            "name": "itemId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            },
            "description": "The exact stored Message Center item ID; another user's/app's item is not found."
          }
        ],
        "description": "Requires the MessageCenterInteract binding for this exact user and installation. The item must belong to that user and credential's current app/account scope. The handler maps read/clicked to Read, dismissed to Dismissed, archived to Archived, and updates any associated delivery before forwarding telemetry. This is not an atomic receipt across all those stores. A concurrently missing UpdateState result is passed to native Results.Ok, which may have no body. No Idempotency-Key protocol, automatic retry safety or send operation is authored here.",
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/MessageCenterInteractionRequest"
              }
            }
          }
        }
      }
    },
    "/v1/location/geofences": {
      "get": {
        "summary": "Sync active geofences and device-visible context",
        "security": [
          {
            "installedAppCredential": []
          }
        ],
        "x-appportal-permission": "Location",
        "responses": {
          "200": {
            "description": "Current configuration version, active geofences, linked Places and tag definitions using the actual GeofenceSyncResponse.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/GeofenceSyncResponse"
                }
              }
            }
          },
          "400": {
            "description": "Invalid scope in the unscoped fixture path, coordinates or geometry selection; malformed typed queries can be bodyless 400.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ClientNativeError"
                }
              }
            }
          },
          "401": {
            "description": "Missing/invalid SDK credential is bodyless; a missing/invalid user-installation binding has native errorCode/error JSON.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/TenantOperationDeniedResponse"
                }
              }
            }
          },
          "403": {
            "description": "Wrong credential kind/permission is bodyless; a binding subject/scope/operation mismatch has native errorCode/error JSON.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/TenantOperationDeniedResponse"
                }
              }
            }
          },
          "404": {
            "description": "Location entitlement is disabled, or an operation-specific resource is absent; no grant is inferred."
          },
          "423": {
            "description": "Current account operational policy denies this operation; native errorCode/error JSON.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/TenantOperationDeniedResponse"
                }
              }
            }
          },
          "429": {
            "description": "Technical admission rate limit. Honor the bounded Retry-After; this is not collection consent or an entitlement change.",
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/ClientRequestAdmissionProblem"
                }
              }
            },
            "headers": {
              "Retry-After": {
                "schema": {
                  "type": "integer",
                  "minimum": 1,
                  "maximum": 3600
                }
              },
              "Cache-Control": {
                "schema": {
                  "const": "no-store"
                }
              }
            }
          },
          "503": {
            "description": "Credential/policy/binding/Location authority or technical admission is unavailable; no empty success or grant is inferred. Native policy/binding errors may be JSON; technical admission uses problem JSON; Location gate can be bodyless.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/TenantOperationDeniedResponse"
                }
              },
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/ClientRequestAdmissionProblem"
                }
              }
            }
          }
        },
        "description": "The persisted SDK credential replaces tenantId/appId/environment selectors. Location must be currently entitled: disabled returns 404, unavailable authority returns 503. Geometry defaults to Radial; comma-separated defined names or numeric enum forms are parsed case-insensitively, trimmed and deduplicated. Polygon-aware clients must evaluate polygon vertices, not only the discovery envelope. Both coordinates enable distance ordering/filtering; one valid coordinate alone does not. Nonpositive/omitted radius uses the current 50km default when both coordinates exist. Active fences with a missing linked Place are excluded; inactive linked Places retain Active=false context. Only DeviceOnly/DeviceAndTelemetry attributes are returned. No device permission or OS geofence activation is performed.",
        "parameters": [
          {
            "name": "tenantId",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string"
            },
            "description": "Legacy fixture selector; overridden by persisted credential scope."
          },
          {
            "name": "appId",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string"
            },
            "description": "Legacy fixture selector; overridden by persisted credential scope."
          },
          {
            "name": "environment",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string"
            },
            "description": "Legacy fixture selector; overridden by persisted credential scope."
          },
          {
            "name": "latitude",
            "in": "query",
            "required": false,
            "schema": {
              "type": "number",
              "minimum": -90,
              "maximum": 90
            },
            "description": "Optional latitude; invalid present values return 400."
          },
          {
            "name": "longitude",
            "in": "query",
            "required": false,
            "schema": {
              "type": "number",
              "minimum": -180,
              "maximum": 180
            },
            "description": "Optional longitude; invalid present values return 400."
          },
          {
            "name": "radiusMeters",
            "in": "query",
            "required": false,
            "schema": {
              "type": "number"
            },
            "description": "Used only when both coordinates are present; nonpositive or omitted uses 50,000 m."
          },
          {
            "name": "geometryTypes",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string"
            },
            "description": "Comma-separated defined GeofenceShape values; blank defaults Radial. Empty pieces are removed; an empty resulting selection returns 400."
          },
          {
            "name": "limit",
            "in": "query",
            "required": false,
            "schema": {
              "type": "integer",
              "default": 100
            },
            "description": "Clamped to 1..1000, rather than rejected outside that range."
          }
        ]
      }
    },
    "/v1/location/events": {
      "post": {
        "summary": "Ingest app-side Location events",
        "security": [
          {
            "installedAppCredential": []
          }
        ],
        "x-appportal-permission": "Location",
        "responses": {
          "200": {
            "description": "Actual event-store accepted/duplicate/rejected counts plus validation errors. A successful HTTP status can contain rejections.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/TelemetryIngestionResult"
                }
              }
            }
          },
          "400": {
            "description": "Malformed or missing array body. No new telemetry-batch size or required-field validator is invented for this handler."
          },
          "401": {
            "description": "Missing/invalid SDK credential is bodyless; a missing/invalid user-installation binding has native errorCode/error JSON.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/TenantOperationDeniedResponse"
                }
              }
            }
          },
          "403": {
            "description": "Wrong credential kind/permission is bodyless; a binding subject/scope/operation mismatch has native errorCode/error JSON.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/TenantOperationDeniedResponse"
                }
              }
            }
          },
          "404": {
            "description": "Location entitlement is disabled, or an operation-specific resource is absent; no grant is inferred."
          },
          "415": {
            "description": "Unsupported media type rejected by the existing JSON body binder; the response may be bodyless."
          },
          "423": {
            "description": "Current account operational policy denies this operation; native errorCode/error JSON.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/TenantOperationDeniedResponse"
                }
              }
            }
          },
          "429": {
            "description": "Technical admission rate limit. Honor the bounded Retry-After; this is not collection consent or an entitlement change.",
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/ClientRequestAdmissionProblem"
                }
              }
            },
            "headers": {
              "Retry-After": {
                "schema": {
                  "type": "integer",
                  "minimum": 1,
                  "maximum": 3600
                }
              },
              "Cache-Control": {
                "schema": {
                  "const": "no-store"
                }
              }
            }
          },
          "503": {
            "description": "Credential/policy/binding/Location authority or technical admission is unavailable; no empty success or grant is inferred. Native policy/binding errors may be JSON; technical admission uses problem JSON; Location gate can be bodyless.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/TenantOperationDeniedResponse"
                }
              },
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/ClientRequestAdmissionProblem"
                }
              }
            }
          }
        },
        "description": "SDK scope replaces supplied event identity scope. Missing IDs/identity and undefined kinds are rejected per record. The server stamps receivedAt, classifies stale using configured Location:StaleEventMinutes (current default 30), substitutes Medium for undefined confidence and Low above 500 m accuracy. Event-store duplicates are counted. Only newly accepted Enter/Exit/Dwell records forward sanitized trigger context to telemetry. The legacy TelemetryIngestionResult has counts/errors, schemaVersion 1 and no invented per-record acknowledgements or durable receipt token. Empty batches retain the native count result. Authorization/entitlement are separate from event validation.",
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/LocationEventBatch"
              }
            }
          }
        }
      }
    },
    "/v1/location/subjects/{subjectId}/ping": {
      "post": {
        "summary": "Update the latest position of a trackable subject",
        "security": [
          {
            "installedAppCredential": []
          }
        ],
        "x-appportal-permission": "Location",
        "responses": {
          "200": {
            "description": "Latest stored subject state with current staleness calculation.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/SubjectLocationState"
                }
              }
            }
          },
          "400": {
            "description": "Missing scope on legacy path, missing/invalid coordinates or malformed body.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ClientNativeError"
                }
              }
            }
          },
          "401": {
            "description": "Missing/invalid SDK credential is bodyless; a missing/invalid user-installation binding has native errorCode/error JSON.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/TenantOperationDeniedResponse"
                }
              }
            }
          },
          "403": {
            "description": "Wrong credential kind/permission is bodyless; a binding subject/scope/operation mismatch has native errorCode/error JSON.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/TenantOperationDeniedResponse"
                }
              }
            }
          },
          "404": {
            "description": "Location entitlement is disabled, or an operation-specific resource is absent; no grant is inferred."
          },
          "409": {
            "description": "Subject is not trackable (off-duty); native error string.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ClientNativeError"
                }
              }
            }
          },
          "415": {
            "description": "Unsupported media type rejected by the existing JSON body binder; the response may be bodyless."
          },
          "423": {
            "description": "Current account operational policy denies this operation; native errorCode/error JSON.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/TenantOperationDeniedResponse"
                }
              }
            }
          },
          "429": {
            "description": "Technical admission rate limit. Honor the bounded Retry-After; this is not collection consent or an entitlement change.",
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/ClientRequestAdmissionProblem"
                }
              }
            },
            "headers": {
              "Retry-After": {
                "schema": {
                  "type": "integer",
                  "minimum": 1,
                  "maximum": 3600
                }
              },
              "Cache-Control": {
                "schema": {
                  "const": "no-store"
                }
              }
            }
          },
          "503": {
            "description": "Credential/policy/binding/Location authority or technical admission is unavailable; no empty success or grant is inferred. Native policy/binding errors may be JSON; technical admission uses problem JSON; Location gate can be bodyless.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/TenantOperationDeniedResponse"
                }
              },
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/ClientRequestAdmissionProblem"
                }
              }
            }
          }
        },
        "parameters": [
          {
            "name": "subjectId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            },
            "description": "The subject in the credential's current account/app scope."
          }
        ],
        "description": "SDK authority overrides request tenantId/appId/environment. Valid latitude and longitude are required. The subject must exist and be Trackable; off-duty returns 409. Existing active tracking session wins over the supplied trackingSessionId. Omitted occurredAt uses current UTC; source is sdk-ping. isStale uses configured Location:SubjectStaleMinutes (current default 60); this is observation freshness, not a retention or resume guarantee.",
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/SubjectPingRequest"
              }
            }
          }
        }
      }
    },
    "/v1/location/tracking-sessions": {
      "post": {
        "summary": "Start or end a subject tracking session",
        "security": [
          {
            "installedAppCredential": []
          }
        ],
        "x-appportal-permission": "Location",
        "responses": {
          "200": {
            "description": "The actual started/existing or ended tracking session; no separate replay flag is authored.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/TrackingSessionRecord"
                }
              }
            }
          },
          "400": {
            "description": "Missing subject/scope or unsupported action, or malformed body.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ClientNativeError"
                }
              }
            }
          },
          "401": {
            "description": "Missing/invalid SDK credential is bodyless; a missing/invalid user-installation binding has native errorCode/error JSON.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/TenantOperationDeniedResponse"
                }
              }
            }
          },
          "403": {
            "description": "Wrong credential kind/permission is bodyless; a binding subject/scope/operation mismatch has native errorCode/error JSON.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/TenantOperationDeniedResponse"
                }
              }
            }
          },
          "404": {
            "description": "Subject absent, no active session to end, or Location disabled. Only the no-active-session branch authors an error body.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ClientNativeError"
                }
              }
            }
          },
          "415": {
            "description": "Unsupported media type rejected by the existing JSON body binder; the response may be bodyless."
          },
          "423": {
            "description": "Current account operational policy denies this operation; native errorCode/error JSON.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/TenantOperationDeniedResponse"
                }
              }
            }
          },
          "429": {
            "description": "Technical admission rate limit. Honor the bounded Retry-After; this is not collection consent or an entitlement change.",
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/ClientRequestAdmissionProblem"
                }
              }
            },
            "headers": {
              "Retry-After": {
                "schema": {
                  "type": "integer",
                  "minimum": 1,
                  "maximum": 3600
                }
              },
              "Cache-Control": {
                "schema": {
                  "const": "no-store"
                }
              }
            }
          },
          "503": {
            "description": "Credential/policy/binding/Location authority or technical admission is unavailable; no empty success or grant is inferred. Native policy/binding errors may be JSON; technical admission uses problem JSON; Location gate can be bodyless.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/TenantOperationDeniedResponse"
                }
              },
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/ClientRequestAdmissionProblem"
                }
              }
            }
          }
        },
        "description": "Persisted SDK authority overrides tenantId/appId. The subject must exist. action is lowercased without trimming: start creates or returns the existing active session; end ends the active session or returns 404 with a native error. sessionId is ignored by this handler, not a selector or idempotency key. Subject absence and entitlement-disabled 404 may be bodyless.",
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/TrackingSessionRequest"
              }
            }
          }
        }
      }
    },
    "/v1/message-center/{userId}/page": {
      "get": {
        "summary": "Read a protected live Message Center page",
        "security": [
          {
            "installedAppCredential": [],
            "userInstallationBinding": []
          }
        ],
        "x-appportal-permission": "MessageCenter",
        "responses": {
          "200": {
            "description": "Actual bounded page; null continuation is terminal and count semantics remain native.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/MessageCenterPageResponse"
                }
              }
            },
            "headers": {
              "Cache-Control": {
                "schema": {
                  "const": "private, no-store"
                }
              }
            }
          },
          "400": {
            "description": "Invalid closed query or protected continuation; message_center_page_invalid.",
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/ClientPageProblem"
                }
              }
            }
          },
          "401": {
            "description": "Missing/invalid SDK credential is bodyless; a missing/invalid user-installation binding has native errorCode/error JSON.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/TenantOperationDeniedResponse"
                }
              }
            }
          },
          "403": {
            "description": "Wrong credential kind/permission is bodyless; a binding subject/scope/operation mismatch has native errorCode/error JSON.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/TenantOperationDeniedResponse"
                }
              }
            }
          },
          "423": {
            "description": "Current account operational policy denies this operation; native errorCode/error JSON.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/TenantOperationDeniedResponse"
                }
              }
            }
          },
          "429": {
            "description": "Technical admission rate limit. Honor the bounded Retry-After; this is not collection consent or an entitlement change.",
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/ClientRequestAdmissionProblem"
                }
              }
            },
            "headers": {
              "Retry-After": {
                "schema": {
                  "type": "integer",
                  "minimum": 1,
                  "maximum": 3600
                }
              },
              "Cache-Control": {
                "schema": {
                  "const": "no-store"
                }
              }
            }
          },
          "503": {
            "description": "Credential/policy/binding/Location authority or technical admission is unavailable; no empty success or grant is inferred. Native policy/binding errors may be JSON; technical admission uses problem JSON; Location gate can be bodyless.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/TenantOperationDeniedResponse"
                }
              },
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/ClientPageProblem"
                }
              }
            }
          }
        },
        "x-appportal-binding-operation": "MessageCenterRead",
        "parameters": [
          {
            "name": "userId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            },
            "description": "Exact user covered by the current installation binding."
          },
          {
            "name": "X-AppPortal-Installation-Id",
            "in": "header",
            "required": true,
            "schema": {
              "type": "string"
            },
            "description": "Exact installation covered by that binding."
          },
          {
            "name": "limit",
            "in": "query",
            "required": false,
            "schema": {
              "type": "integer",
              "default": 25,
              "minimum": 1,
              "maximum": 100
            },
            "description": "One decimal page size; invalid or repeated values are rejected."
          },
          {
            "name": "cursor",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string",
              "maxLength": 8192
            },
            "description": "Opaque protected continuation for the unchanged original selection."
          }
        ],
        "description": "Only one limit and cursor are accepted. Default limit25, range1–100. Supplied values must be nonblank, control-free and have no outer whitespace. The protected cursor binds persisted SDK credential, app/environment, user/installation binding, current source and selected limit. Current SDK and user-binding authority are checked again after reading. This is a live active inbox ordered by createdAt and itemId descending, not an immutable inbox snapshot. nextCursor=null is terminal; totalCount=null is unknown, never zero. No account/app query selector or send authority is introduced."
      }
    },
    "/v1/location/geofences/page": {
      "get": {
        "summary": "Read one bounded versioned geofence sync page",
        "security": [
          {
            "installedAppCredential": []
          }
        ],
        "x-appportal-permission": "Location",
        "responses": {
          "200": {
            "description": "Actual bounded page; null continuation is terminal and count semantics remain native.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/GeofenceSyncPageResponse"
                }
              }
            },
            "headers": {
              "Cache-Control": {
                "schema": {
                  "const": "private, no-store"
                }
              }
            }
          },
          "400": {
            "description": "Invalid selection or cursor/version pairing; location_sync_page_invalid.",
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/ClientPageProblem"
                }
              }
            }
          },
          "401": {
            "description": "Missing/invalid SDK credential is bodyless; a missing/invalid user-installation binding has native errorCode/error JSON.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/TenantOperationDeniedResponse"
                }
              }
            }
          },
          "403": {
            "description": "Wrong credential kind/permission is bodyless; a binding subject/scope/operation mismatch has native errorCode/error JSON.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/TenantOperationDeniedResponse"
                }
              }
            }
          },
          "404": {
            "description": "Location entitlement is disabled, or an operation-specific resource is absent; no grant is inferred."
          },
          "409": {
            "description": "Source/configuration changed; location_sync_restart_required. Restart the entire selection without cursor.",
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/ClientPageProblem"
                }
              }
            }
          },
          "423": {
            "description": "Current account operational policy denies this operation; native errorCode/error JSON.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/TenantOperationDeniedResponse"
                }
              }
            }
          },
          "429": {
            "description": "Technical admission rate limit. Honor the bounded Retry-After; this is not collection consent or an entitlement change.",
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/ClientRequestAdmissionProblem"
                }
              }
            },
            "headers": {
              "Retry-After": {
                "schema": {
                  "type": "integer",
                  "minimum": 1,
                  "maximum": 3600
                }
              },
              "Cache-Control": {
                "schema": {
                  "const": "no-store"
                }
              }
            }
          },
          "503": {
            "description": "Credential/policy/binding/Location authority or technical admission is unavailable; no empty success or grant is inferred. Native policy/binding errors may be JSON; technical admission uses problem JSON; Location gate can be bodyless.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/TenantOperationDeniedResponse"
                }
              },
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/ClientPageProblem"
                }
              }
            }
          }
        },
        "parameters": [
          {
            "name": "limit",
            "in": "query",
            "required": false,
            "schema": {
              "type": "integer",
              "default": 25,
              "minimum": 1,
              "maximum": 100
            },
            "description": "One decimal page size; invalid or repeated values are rejected."
          },
          {
            "name": "catalogLimit",
            "in": "query",
            "required": false,
            "schema": {
              "type": "integer",
              "default": 100,
              "minimum": 1,
              "maximum": 1000
            },
            "description": "Explicit catalog-selection bound, separate from page size."
          },
          {
            "name": "cursor",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string",
              "maxLength": 8192
            },
            "description": "Opaque protected continuation for the unchanged original selection."
          },
          {
            "name": "configurationVersion",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string",
              "maxLength": 64
            },
            "description": "Required with cursor and forbidden without it. Use the returned cfg-<nonnegative integer> version unchanged."
          },
          {
            "name": "latitude",
            "in": "query",
            "required": false,
            "schema": {
              "type": "number",
              "minimum": -90,
              "maximum": 90
            },
            "description": "Finite latitude; must be supplied together with longitude."
          },
          {
            "name": "longitude",
            "in": "query",
            "required": false,
            "schema": {
              "type": "number",
              "minimum": -180,
              "maximum": 180
            },
            "description": "Finite longitude; must be supplied together with latitude."
          },
          {
            "name": "radiusMeters",
            "in": "query",
            "required": false,
            "schema": {
              "type": "number"
            },
            "description": "Optional finite selection radius."
          },
          {
            "name": "geometryTypes",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string"
            },
            "description": "Comma-separated defined GeofenceShape values, case-insensitive and trimmed within the list. Duplicate shapes are invalid. Default Radial."
          }
        ],
        "description": "Closed, single-valued query; literals must be nonblank, control-free and have no outer whitespace. Persisted SDK identity supplies account/app/environment; query selectors cannot retarget them. Cursor binds current credential, source, configuration version, exact selection and permissions. Accumulate one unchanged version and finish every page before adopting configuration. A changed source/configuration returns409 location_sync_restart_required: discard accumulated pages and restart without cursor. totalCount describes the bounded selection; catalogLimit and selectionTruncated do not assert a complete account catalog. Current SDK authority and Location entitlement are rechecked after reads."
      }
    }
  },
  "components": {
    "schemas": {
      "CrashDiagnosticAttachment": {
        "type": [
          "object",
          "null"
        ],
        "properties": {
          "attachmentRef": {
            "type": "string"
          },
          "fileName": {
            "type": "string"
          },
          "contentType": {
            "type": "string"
          },
          "sizeBytes": {
            "type": "integer"
          },
          "uploadedAt": {
            "type": "string",
            "format": "date-time"
          },
          "sanitizationState": {
            "type": "string"
          }
        },
        "required": [
          "attachmentRef",
          "fileName",
          "contentType",
          "sizeBytes",
          "uploadedAt",
          "sanitizationState"
        ],
        "description": "Public credential-safety-processed metadata. attachmentRef is a server-derived opaque reference; the supplied attachment ID and Blob storage keys are not returned. This is not symbolication or proof of readable native frames."
      },
      "TelemetryTemporaryFailureResponse": {
        "type": [
          "object",
          "null"
        ],
        "properties": {
          "errorCode": {
            "type": "string"
          },
          "error": {
            "type": "string"
          },
          "retryAt": {
            "type": "string",
            "format": "date-time"
          },
          "retryAfterSeconds": {
            "type": "integer",
            "default": 3600
          },
          "retryable": {
            "type": "boolean",
            "default": true
          },
          "schemaVersion": {
            "type": "integer",
            "default": 1
          },
          "allowanceResetsAt": {
            "type": [
              "string",
              "null"
            ],
            "format": "date-time",
            "default": null
          }
        },
        "required": [
          "errorCode",
          "error",
          "retryAt"
        ]
      },
      "ConsentUpdateRequest": {
        "type": "object",
        "properties": {
          "channel": {
            "anyOf": [
              {
                "type": "string",
                "pattern": "^\\s*(?:(?:[mM][eE][sS][sS][aA][gG][eE][cC][eE][nN][tT][eE][rR]|[pP][uU][sS][hH]|[sS][mM][sS])(?:\\s*,\\s*(?:[mM][eE][sS][sS][aA][gG][eE][cC][eE][nN][tT][eE][rR]|[pP][uU][sS][hH]|[sS][mM][sS]))*|[+-]?[0-9]+)\\s*$"
              },
              {
                "type": "integer"
              },
              {
                "type": "null"
              }
            ],
            "x-appportal-canonical-enum-values": [
              "MessageCenter",
              "Push",
              "Sms"
            ],
            "description": "Canonical SDK enum names are listed above. HTTP deserialization also permits the converter's case-insensitive names and numeric forms; numeric values must fit the underlying enum type. Per-record validation remains separate."
          },
          "granted": {
            "type": [
              "boolean",
              "null"
            ]
          },
          "source": {
            "type": [
              "string",
              "null"
            ]
          }
        },
        "description": "DTO binding and domain acceptance are separate. An accepted update requires a defined channel, a non-null granted decision and a non-whitespace source. This is communication consent, not SDK telemetry collection, Reset, Denied or server erasure.",
        "x-appportal-acceptance-rules": {
          "channelMustBeDefined": true,
          "grantedRequired": true,
          "sourceNonWhitespace": true
        }
      },
      "ConsentPreference": {
        "type": [
          "object",
          "null"
        ],
        "properties": {
          "tenantId": {
            "type": "string"
          },
          "appId": {
            "type": "string"
          },
          "userId": {
            "type": "string"
          },
          "channel": {
            "enum": [
              "MessageCenter",
              "Push",
              "Sms"
            ]
          },
          "granted": {
            "type": "boolean"
          },
          "source": {
            "type": "string"
          },
          "updatedAt": {
            "type": "string",
            "format": "date-time"
          }
        },
        "required": [
          "tenantId",
          "appId",
          "userId",
          "channel",
          "granted",
          "source",
          "updatedAt"
        ]
      },
      "MessageCenterItem": {
        "type": [
          "object",
          "null"
        ],
        "properties": {
          "itemId": {
            "type": "string"
          },
          "tenantId": {
            "type": "string"
          },
          "appId": {
            "type": "string"
          },
          "userId": {
            "type": "string"
          },
          "title": {
            "type": "string"
          },
          "body": {
            "type": "string"
          },
          "deepLink": {
            "type": [
              "string",
              "null"
            ]
          },
          "campaignId": {
            "type": [
              "string",
              "null"
            ]
          },
          "priority": {
            "enum": [
              "Normal",
              "High",
              "Critical"
            ]
          },
          "state": {
            "enum": [
              "Unread",
              "Read",
              "Dismissed",
              "Archived",
              "Expired"
            ]
          },
          "createdAt": {
            "type": "string",
            "format": "date-time"
          },
          "expiresAt": {
            "type": [
              "string",
              "null"
            ],
            "format": "date-time",
            "default": null
          }
        },
        "required": [
          "itemId",
          "tenantId",
          "appId",
          "userId",
          "title",
          "body",
          "deepLink",
          "campaignId",
          "priority",
          "state",
          "createdAt"
        ]
      },
      "MessageCenterItems": {
        "type": [
          "array",
          "null"
        ],
        "items": {
          "type": [
            "object",
            "null"
          ],
          "properties": {
            "itemId": {
              "type": "string"
            },
            "tenantId": {
              "type": "string"
            },
            "appId": {
              "type": "string"
            },
            "userId": {
              "type": "string"
            },
            "title": {
              "type": "string"
            },
            "body": {
              "type": "string"
            },
            "deepLink": {
              "type": [
                "string",
                "null"
              ]
            },
            "campaignId": {
              "type": [
                "string",
                "null"
              ]
            },
            "priority": {
              "enum": [
                "Normal",
                "High",
                "Critical"
              ]
            },
            "state": {
              "enum": [
                "Unread",
                "Read",
                "Dismissed",
                "Archived",
                "Expired"
              ]
            },
            "createdAt": {
              "type": "string",
              "format": "date-time"
            },
            "expiresAt": {
              "type": [
                "string",
                "null"
              ],
              "format": "date-time",
              "default": null
            }
          },
          "required": [
            "itemId",
            "tenantId",
            "appId",
            "userId",
            "title",
            "body",
            "deepLink",
            "campaignId",
            "priority",
            "state",
            "createdAt"
          ]
        }
      },
      "MessageCenterInteractionRequest": {
        "type": "object",
        "properties": {
          "kind": {
            "type": [
              "string",
              "null"
            ]
          }
        },
        "description": "Binding allows omitted/null kind. Domain acceptance requires read, clicked, dismissed or archived after trimming and invariant lowercase normalization. Do not narrow the schema to case-sensitive untrimmed strings."
      },
      "GeofenceSyncResponse": {
        "type": [
          "object",
          "null"
        ],
        "properties": {
          "configurationVersion": {
            "type": "string"
          },
          "geofences": {
            "type": "array",
            "items": {
              "type": [
                "object",
                "null"
              ],
              "properties": {
                "geofenceId": {
                  "type": "string"
                },
                "placeId": {
                  "type": [
                    "string",
                    "null"
                  ]
                },
                "tenantId": {
                  "type": "string"
                },
                "appId": {
                  "type": "string"
                },
                "environmentName": {
                  "type": "string"
                },
                "name": {
                  "type": "string"
                },
                "latitude": {
                  "type": "number"
                },
                "longitude": {
                  "type": "number"
                },
                "radiusMeters": {
                  "type": "number"
                },
                "groupKey": {
                  "type": [
                    "string",
                    "null"
                  ]
                },
                "tags": {
                  "type": "array",
                  "items": {
                    "type": [
                      "string",
                      "null"
                    ]
                  }
                },
                "metadata": {
                  "type": [
                    "object",
                    "null"
                  ],
                  "additionalProperties": {
                    "type": [
                      "string",
                      "null"
                    ]
                  }
                },
                "active": {
                  "type": "boolean"
                },
                "createdAt": {
                  "type": "string",
                  "format": "date-time"
                },
                "updatedAt": {
                  "type": "string",
                  "format": "date-time"
                },
                "updatedBy": {
                  "type": "string"
                },
                "shape": {
                  "enum": [
                    "Radial",
                    "Polygon"
                  ],
                  "default": "Radial"
                },
                "polygonVertices": {
                  "type": [
                    "array",
                    "null"
                  ],
                  "items": {
                    "type": [
                      "object",
                      "null"
                    ],
                    "properties": {
                      "latitude": {
                        "type": "number"
                      },
                      "longitude": {
                        "type": "number"
                      }
                    },
                    "required": [
                      "latitude",
                      "longitude"
                    ]
                  },
                  "default": null
                },
                "activationMode": {
                  "enum": [
                    "Automatic",
                    "ApplicationManaged"
                  ],
                  "default": "Automatic"
                },
                "monitoredTransitions": {
                  "type": [
                    "array",
                    "null"
                  ],
                  "items": {
                    "enum": [
                      "Enter",
                      "Exit",
                      "Dwell",
                      "Silent",
                      "Diagnostic"
                    ]
                  },
                  "default": null
                },
                "cooldowns": {
                  "type": [
                    "array",
                    "null"
                  ],
                  "items": {
                    "type": [
                      "object",
                      "null"
                    ],
                    "properties": {
                      "transition": {
                        "enum": [
                          "Enter",
                          "Exit",
                          "Dwell",
                          "Silent",
                          "Diagnostic"
                        ]
                      },
                      "cooldownSeconds": {
                        "type": "integer"
                      }
                    },
                    "required": [
                      "transition",
                      "cooldownSeconds"
                    ]
                  },
                  "default": null
                },
                "effectiveCooldowns": {
                  "type": [
                    "array",
                    "null"
                  ],
                  "items": {
                    "type": [
                      "object",
                      "null"
                    ],
                    "properties": {
                      "transition": {
                        "enum": [
                          "Enter",
                          "Exit",
                          "Dwell",
                          "Silent",
                          "Diagnostic"
                        ]
                      },
                      "cooldownSeconds": {
                        "type": "integer"
                      },
                      "scope": {
                        "enum": [
                          "Geofence",
                          "Tag"
                        ]
                      },
                      "tag": {
                        "type": [
                          "string",
                          "null"
                        ],
                        "default": null
                      }
                    },
                    "required": [
                      "transition",
                      "cooldownSeconds",
                      "scope"
                    ]
                  },
                  "default": null
                },
                "revision": {
                  "type": "integer",
                  "default": 1
                },
                "bulkTemplateKey": {
                  "type": [
                    "string",
                    "null"
                  ],
                  "default": null
                }
              },
              "required": [
                "geofenceId",
                "placeId",
                "tenantId",
                "appId",
                "environmentName",
                "name",
                "latitude",
                "longitude",
                "radiusMeters",
                "groupKey",
                "tags",
                "metadata",
                "active",
                "createdAt",
                "updatedAt",
                "updatedBy"
              ]
            }
          },
          "locations": {
            "type": [
              "array",
              "null"
            ],
            "items": {
              "type": [
                "object",
                "null"
              ],
              "properties": {
                "placeId": {
                  "type": "string"
                },
                "tenantId": {
                  "type": "string"
                },
                "appId": {
                  "type": "string"
                },
                "environmentName": {
                  "type": "string"
                },
                "name": {
                  "type": "string"
                },
                "latitude": {
                  "type": "number"
                },
                "longitude": {
                  "type": "number"
                },
                "metadata": {
                  "type": [
                    "object",
                    "null"
                  ],
                  "additionalProperties": {
                    "type": [
                      "string",
                      "null"
                    ]
                  }
                },
                "active": {
                  "type": "boolean"
                },
                "createdAt": {
                  "type": "string",
                  "format": "date-time"
                },
                "updatedAt": {
                  "type": "string",
                  "format": "date-time"
                },
                "updatedBy": {
                  "type": "string"
                },
                "attributes": {
                  "type": [
                    "array",
                    "null"
                  ],
                  "items": {
                    "type": [
                      "object",
                      "null"
                    ],
                    "properties": {
                      "key": {
                        "type": "string"
                      },
                      "value": {
                        "type": "string"
                      },
                      "type": {
                        "enum": [
                          "Text",
                          "Number",
                          "Boolean",
                          "Date",
                          "TextList"
                        ],
                        "default": "Text"
                      },
                      "visibility": {
                        "enum": [
                          "DeviceAndTelemetry",
                          "DeviceOnly",
                          "PortalOnly"
                        ],
                        "default": "DeviceAndTelemetry"
                      }
                    },
                    "required": [
                      "key",
                      "value"
                    ]
                  },
                  "default": null
                },
                "revision": {
                  "type": "integer",
                  "default": 1
                }
              },
              "required": [
                "placeId",
                "tenantId",
                "appId",
                "environmentName",
                "name",
                "latitude",
                "longitude",
                "metadata",
                "active",
                "createdAt",
                "updatedAt",
                "updatedBy"
              ]
            },
            "default": null
          },
          "tagDefinitions": {
            "type": [
              "array",
              "null"
            ],
            "items": {
              "type": [
                "object",
                "null"
              ],
              "properties": {
                "tenantId": {
                  "type": "string"
                },
                "appId": {
                  "type": "string"
                },
                "environmentName": {
                  "type": "string"
                },
                "tag": {
                  "type": "string"
                },
                "cooldowns": {
                  "type": "array",
                  "items": {
                    "$ref": "#/components/schemas/GeofenceSyncResponse/properties/geofences/items/properties/cooldowns/items"
                  }
                },
                "createdAt": {
                  "type": "string",
                  "format": "date-time"
                },
                "updatedAt": {
                  "type": "string",
                  "format": "date-time"
                },
                "updatedBy": {
                  "type": "string"
                },
                "revision": {
                  "type": "integer",
                  "default": 1
                },
                "affectedGeofence": {
                  "type": [
                    "object",
                    "null"
                  ],
                  "properties": {
                    "geofenceId": {
                      "type": "string"
                    },
                    "previousRevision": {
                      "type": "integer"
                    },
                    "revision": {
                      "type": "integer"
                    }
                  },
                  "required": [
                    "geofenceId",
                    "previousRevision",
                    "revision"
                  ]
                }
              },
              "required": [
                "tenantId",
                "appId",
                "environmentName",
                "tag",
                "cooldowns",
                "createdAt",
                "updatedAt",
                "updatedBy"
              ]
            },
            "default": null
          }
        },
        "required": [
          "configurationVersion",
          "geofences"
        ]
      },
      "LocationEventBatch": {
        "type": "array",
        "items": {
          "type": [
            "object",
            "null"
          ],
          "properties": {
            "eventId": {
              "type": [
                "string",
                "null"
              ]
            },
            "identity": {
              "type": [
                "object",
                "null"
              ],
              "properties": {
                "tenantId": {
                  "type": [
                    "string",
                    "null"
                  ]
                },
                "appId": {
                  "type": [
                    "string",
                    "null"
                  ]
                },
                "environmentName": {
                  "type": [
                    "string",
                    "null"
                  ]
                },
                "deploymentTarget": {
                  "type": [
                    "string",
                    "null"
                  ]
                },
                "clientId": {
                  "type": [
                    "string",
                    "null"
                  ]
                },
                "appVersion": {
                  "type": [
                    "string",
                    "null"
                  ]
                },
                "buildNumber": {
                  "type": [
                    "string",
                    "null"
                  ]
                },
                "sessionId": {
                  "type": [
                    "string",
                    "null"
                  ]
                },
                "userId": {
                  "type": [
                    "string",
                    "null"
                  ]
                },
                "deviceId": {
                  "type": [
                    "string",
                    "null"
                  ]
                },
                "buildVariant": {
                  "type": [
                    "string",
                    "null"
                  ]
                },
                "sdkName": {
                  "type": [
                    "string",
                    "null"
                  ],
                  "default": null
                },
                "sdkVersion": {
                  "type": [
                    "string",
                    "null"
                  ],
                  "default": null
                },
                "platform": {
                  "anyOf": [
                    {
                      "type": "string",
                      "pattern": "^\\s*(?:(?:[uU][nN][aA][tT][tT][rR][iI][bB][uU][tT][eE][dD]|[iI][oO][sS]|[aA][nN][dD][rR][oO][iI][dD]|[wW][iI][nN][dD][oO][wW][sS]|[mM][aA][cC][cC][aA][tT][aA][lL][yY][sS][tT]|[wW][eE][bB]|[mM][aA][cC][oO][sS]|[wW][aA][tT][cC][hH][oO][sS]|[tT][vV][oO][sS]|[wW][iI][nN][uU][iI]|[wW][pP][fF]|[lL][iI][nN][uU][xX]|[iI][pP][aA][dD][oO][sS])(?:\\s*,\\s*(?:[uU][nN][aA][tT][tT][rR][iI][bB][uU][tT][eE][dD]|[iI][oO][sS]|[aA][nN][dD][rR][oO][iI][dD]|[wW][iI][nN][dD][oO][wW][sS]|[mM][aA][cC][cC][aA][tT][aA][lL][yY][sS][tT]|[wW][eE][bB]|[mM][aA][cC][oO][sS]|[wW][aA][tT][cC][hH][oO][sS]|[tT][vV][oO][sS]|[wW][iI][nN][uU][iI]|[wW][pP][fF]|[lL][iI][nN][uU][xX]|[iI][pP][aA][dD][oO][sS]))*|[+-]?[0-9]+)\\s*$"
                    },
                    {
                      "type": "integer"
                    },
                    {
                      "type": "null"
                    }
                  ],
                  "x-appportal-canonical-enum-values": [
                    "unattributed",
                    "iOS",
                    "Android",
                    "Windows",
                    "MacCatalyst",
                    "Web",
                    "macOS",
                    "watchOS",
                    "tvOS",
                    "WinUI",
                    "Wpf",
                    "Linux",
                    "iPadOS"
                  ],
                  "description": "Canonical SDK enum names are listed above. HTTP deserialization also permits the converter's case-insensitive names and numeric forms; numeric values must fit the underlying enum type. Per-record validation remains separate.",
                  "default": null
                },
                "contextSchemaVersion": {
                  "type": [
                    "string",
                    "integer",
                    "null"
                  ],
                  "pattern": "^-?(?:0|[1-9]\\d*)$"
                },
                "identityAssociation": {
                  "type": [
                    "object",
                    "null"
                  ],
                  "properties": {
                    "schemaVersion": {
                      "type": [
                        "string",
                        "integer"
                      ],
                      "pattern": "^-?(?:0|[1-9]\\d*)$"
                    },
                    "associationId": {
                      "type": [
                        "string",
                        "null"
                      ]
                    },
                    "deliveryGenerationId": {
                      "type": "string",
                      "format": "uuid"
                    },
                    "capturedAt": {
                      "type": "string",
                      "format": "date-time"
                    },
                    "resolvedState": {
                      "type": [
                        "string",
                        "null"
                      ]
                    }
                  }
                },
                "userProfile": {
                  "type": [
                    "object",
                    "null"
                  ],
                  "properties": {
                    "schemaVersion": {
                      "type": [
                        "string",
                        "integer"
                      ],
                      "pattern": "^-?(?:0|[1-9]\\d*)$"
                    },
                    "displayName": {
                      "type": [
                        "string",
                        "null"
                      ]
                    },
                    "traits": {
                      "type": [
                        "object",
                        "null"
                      ],
                      "additionalProperties": {
                        "type": [
                          "string",
                          "null"
                        ]
                      }
                    }
                  }
                },
                "effectiveTarget": {
                  "type": [
                    "string",
                    "null"
                  ],
                  "readOnly": true
                },
                "effectivePlatform": {
                  "type": [
                    "string",
                    "null"
                  ],
                  "readOnly": true
                },
                "effectiveSdkName": {
                  "type": [
                    "string",
                    "null"
                  ],
                  "readOnly": true
                },
                "effectiveSdkVersion": {
                  "type": [
                    "string",
                    "null"
                  ],
                  "readOnly": true
                }
              }
            },
            "kind": {
              "anyOf": [
                {
                  "type": "string",
                  "pattern": "^\\s*(?:(?:[eE][nN][tT][eE][rR]|[eE][xX][iI][tT]|[dD][wW][eE][lL][lL]|[sS][iI][lL][eE][nN][tT]|[dD][iI][aA][gG][nN][oO][sS][tT][iI][cC])(?:\\s*,\\s*(?:[eE][nN][tT][eE][rR]|[eE][xX][iI][tT]|[dD][wW][eE][lL][lL]|[sS][iI][lL][eE][nN][tT]|[dD][iI][aA][gG][nN][oO][sS][tT][iI][cC]))*|[+-]?[0-9]+)\\s*$"
                },
                {
                  "type": "integer"
                }
              ],
              "x-appportal-canonical-enum-values": [
                "Enter",
                "Exit",
                "Dwell",
                "Silent",
                "Diagnostic"
              ],
              "description": "Canonical SDK enum names are listed above. HTTP deserialization also permits the converter's case-insensitive names and numeric forms; numeric values must fit the underlying enum type. Per-record validation remains separate."
            },
            "geofenceId": {
              "type": [
                "string",
                "null"
              ]
            },
            "placeId": {
              "type": [
                "string",
                "null"
              ]
            },
            "latitude": {
              "type": [
                "string",
                "number",
                "null"
              ],
              "pattern": "^-?(?:0|[1-9]\\d*)(?:\\.\\d+)?(?:[eE][+-]?\\d+)?$"
            },
            "longitude": {
              "type": [
                "string",
                "number",
                "null"
              ],
              "pattern": "^-?(?:0|[1-9]\\d*)(?:\\.\\d+)?(?:[eE][+-]?\\d+)?$"
            },
            "accuracyMeters": {
              "type": [
                "string",
                "number",
                "null"
              ],
              "pattern": "^-?(?:0|[1-9]\\d*)(?:\\.\\d+)?(?:[eE][+-]?\\d+)?$"
            },
            "confidence": {
              "anyOf": [
                {
                  "type": "string",
                  "pattern": "^\\s*(?:(?:[hH][iI][gG][hH]|[mM][eE][dD][iI][uU][mM]|[lL][oO][wW])(?:\\s*,\\s*(?:[hH][iI][gG][hH]|[mM][eE][dD][iI][uU][mM]|[lL][oO][wW]))*|[+-]?[0-9]+)\\s*$"
                },
                {
                  "type": "integer"
                }
              ],
              "x-appportal-canonical-enum-values": [
                "High",
                "Medium",
                "Low"
              ],
              "description": "Canonical SDK enum names are listed above. HTTP deserialization also permits the converter's case-insensitive names and numeric forms; numeric values must fit the underlying enum type. Per-record validation remains separate."
            },
            "occurredAt": {
              "type": "string",
              "format": "date-time"
            },
            "receivedAt": {
              "type": "string",
              "format": "date-time"
            },
            "configurationVersion": {
              "type": [
                "string",
                "null"
              ]
            },
            "subjectId": {
              "type": [
                "string",
                "null"
              ]
            },
            "stale": {
              "type": "boolean"
            },
            "properties": {
              "type": [
                "object",
                "null"
              ],
              "additionalProperties": {
                "type": [
                  "string",
                  "null"
                ]
              },
              "default": null
            },
            "triggerContext": {
              "type": [
                "object",
                "null"
              ],
              "properties": {
                "geofenceId": {
                  "type": [
                    "string",
                    "null"
                  ]
                },
                "geofenceName": {
                  "type": [
                    "string",
                    "null"
                  ]
                },
                "geofenceRevision": {
                  "type": [
                    "string",
                    "integer"
                  ],
                  "pattern": "^-?(?:0|[1-9]\\d*)$"
                },
                "shape": {
                  "anyOf": [
                    {
                      "type": "string",
                      "pattern": "^\\s*(?:(?:[rR][aA][dD][iI][aA][lL]|[pP][oO][lL][yY][gG][oO][nN])(?:\\s*,\\s*(?:[rR][aA][dD][iI][aA][lL]|[pP][oO][lL][yY][gG][oO][nN]))*|[+-]?[0-9]+)\\s*$"
                    },
                    {
                      "type": "integer"
                    }
                  ],
                  "x-appportal-canonical-enum-values": [
                    "Radial",
                    "Polygon"
                  ],
                  "description": "Canonical SDK enum names are listed above. HTTP deserialization also permits the converter's case-insensitive names and numeric forms; numeric values must fit the underlying enum type. Per-record validation remains separate."
                },
                "activationMode": {
                  "anyOf": [
                    {
                      "type": "string",
                      "pattern": "^\\s*(?:(?:[aA][uU][tT][oO][mM][aA][tT][iI][cC]|[aA][pP][pP][lL][iI][cC][aA][tT][iI][oO][nN][mM][aA][nN][aA][gG][eE][dD])(?:\\s*,\\s*(?:[aA][uU][tT][oO][mM][aA][tT][iI][cC]|[aA][pP][pP][lL][iI][cC][aA][tT][iI][oO][nN][mM][aA][nN][aA][gG][eE][dD]))*|[+-]?[0-9]+)\\s*$"
                    },
                    {
                      "type": "integer"
                    }
                  ],
                  "x-appportal-canonical-enum-values": [
                    "Automatic",
                    "ApplicationManaged"
                  ],
                  "description": "Canonical SDK enum names are listed above. HTTP deserialization also permits the converter's case-insensitive names and numeric forms; numeric values must fit the underlying enum type. Per-record validation remains separate."
                },
                "tags": {
                  "type": [
                    "array",
                    "null"
                  ],
                  "items": {
                    "type": [
                      "string",
                      "null"
                    ]
                  }
                },
                "placeId": {
                  "type": [
                    "string",
                    "null"
                  ],
                  "default": null
                },
                "placeName": {
                  "type": [
                    "string",
                    "null"
                  ],
                  "default": null
                },
                "placeRevision": {
                  "type": [
                    "string",
                    "integer",
                    "null"
                  ],
                  "pattern": "^-?(?:0|[1-9]\\d*)$",
                  "default": null
                },
                "locationAttributes": {
                  "type": [
                    "array",
                    "null"
                  ],
                  "items": {
                    "type": [
                      "object",
                      "null"
                    ],
                    "properties": {
                      "key": {
                        "type": [
                          "string",
                          "null"
                        ]
                      },
                      "value": {
                        "type": [
                          "string",
                          "null"
                        ]
                      },
                      "type": {
                        "anyOf": [
                          {
                            "type": "string",
                            "pattern": "^\\s*(?:(?:[tT][eE][xX][tT]|[nN][uU][mM][bB][eE][rR]|[bB][oO][oO][lL][eE][aA][nN]|[dD][aA][tT][eE]|[tT][eE][xX][tT][lL][iI][sS][tT])(?:\\s*,\\s*(?:[tT][eE][xX][tT]|[nN][uU][mM][bB][eE][rR]|[bB][oO][oO][lL][eE][aA][nN]|[dD][aA][tT][eE]|[tT][eE][xX][tT][lL][iI][sS][tT]))*|[+-]?[0-9]+)\\s*$"
                          },
                          {
                            "type": "integer"
                          }
                        ],
                        "x-appportal-canonical-enum-values": [
                          "Text",
                          "Number",
                          "Boolean",
                          "Date",
                          "TextList"
                        ],
                        "description": "Canonical SDK enum names are listed above. HTTP deserialization also permits the converter's case-insensitive names and numeric forms; numeric values must fit the underlying enum type. Per-record validation remains separate.",
                        "default": "Text"
                      },
                      "visibility": {
                        "anyOf": [
                          {
                            "type": "string",
                            "pattern": "^\\s*(?:(?:[dD][eE][vV][iI][cC][eE][aA][nN][dD][tT][eE][lL][eE][mM][eE][tT][rR][yY]|[dD][eE][vV][iI][cC][eE][oO][nN][lL][yY]|[pP][oO][rR][tT][aA][lL][oO][nN][lL][yY])(?:\\s*,\\s*(?:[dD][eE][vV][iI][cC][eE][aA][nN][dD][tT][eE][lL][eE][mM][eE][tT][rR][yY]|[dD][eE][vV][iI][cC][eE][oO][nN][lL][yY]|[pP][oO][rR][tT][aA][lL][oO][nN][lL][yY]))*|[+-]?[0-9]+)\\s*$"
                          },
                          {
                            "type": "integer"
                          }
                        ],
                        "x-appportal-canonical-enum-values": [
                          "DeviceAndTelemetry",
                          "DeviceOnly",
                          "PortalOnly"
                        ],
                        "description": "Canonical SDK enum names are listed above. HTTP deserialization also permits the converter's case-insensitive names and numeric forms; numeric values must fit the underlying enum type. Per-record validation remains separate.",
                        "default": "DeviceAndTelemetry"
                      }
                    }
                  },
                  "default": null
                }
              },
              "default": null
            }
          }
        },
        "description": "Actual LocationEventRecord array binding, separate from telemetry batch schema rules. Authoritative SDK scope replaces each identity's account/app/environment. The handler validates event ID, scoped identity and defined kind per record; receivedAt/stale/confidence and trigger context are server-normalized. A null record element is not promised per-record rejection safety."
      },
      "TelemetryIngestionResult": {
        "type": [
          "object",
          "null"
        ],
        "properties": {
          "accepted": {
            "type": "integer"
          },
          "duplicates": {
            "type": "integer"
          },
          "rejected": {
            "type": "integer"
          },
          "errors": {
            "type": "array",
            "items": {
              "type": [
                "string",
                "null"
              ]
            }
          },
          "acknowledgements": {
            "type": [
              "array",
              "null"
            ],
            "items": {
              "type": [
                "object",
                "null"
              ],
              "properties": {
                "recordId": {
                  "type": [
                    "string",
                    "null"
                  ]
                },
                "status": {
                  "enum": [
                    "Accepted",
                    "AlreadyAccepted",
                    "Rejected"
                  ]
                },
                "index": {
                  "type": "integer"
                },
                "errorCode": {
                  "type": [
                    "string",
                    "null"
                  ],
                  "default": null
                },
                "message": {
                  "type": [
                    "string",
                    "null"
                  ],
                  "default": null
                },
                "retryable": {
                  "type": "boolean",
                  "default": false
                },
                "occurrenceFingerprint": {
                  "type": [
                    "string",
                    "null"
                  ],
                  "default": null
                }
              },
              "required": [
                "recordId",
                "status",
                "index"
              ]
            },
            "default": null
          },
          "schemaVersion": {
            "type": "integer",
            "default": 1
          }
        },
        "required": [
          "accepted",
          "duplicates",
          "rejected",
          "errors"
        ]
      },
      "SubjectPingRequest": {
        "type": "object",
        "properties": {
          "tenantId": {
            "type": [
              "string",
              "null"
            ]
          },
          "appId": {
            "type": [
              "string",
              "null"
            ]
          },
          "environment": {
            "type": [
              "string",
              "null"
            ]
          },
          "latitude": {
            "type": [
              "string",
              "number",
              "null"
            ],
            "pattern": "^-?(?:0|[1-9]\\d*)(?:\\.\\d+)?(?:[eE][+-]?\\d+)?$"
          },
          "longitude": {
            "type": [
              "string",
              "number",
              "null"
            ],
            "pattern": "^-?(?:0|[1-9]\\d*)(?:\\.\\d+)?(?:[eE][+-]?\\d+)?$"
          },
          "occurredAt": {
            "type": [
              "string",
              "null"
            ],
            "format": "date-time"
          },
          "accuracyMeters": {
            "type": [
              "string",
              "number",
              "null"
            ],
            "pattern": "^-?(?:0|[1-9]\\d*)(?:\\.\\d+)?(?:[eE][+-]?\\d+)?$",
            "default": null
          },
          "movementState": {
            "anyOf": [
              {
                "type": "string",
                "pattern": "^\\s*(?:(?:[uU][nN][kK][nN][oO][wW][nN]|[mM][oO][vV][iI][nN][gG]|[sS][tT][aA][tT][iI][oO][nN][aA][rR][yY])(?:\\s*,\\s*(?:[uU][nN][kK][nN][oO][wW][nN]|[mM][oO][vV][iI][nN][gG]|[sS][tT][aA][tT][iI][oO][nN][aA][rR][yY]))*|[+-]?[0-9]+)\\s*$"
              },
              {
                "type": "integer"
              },
              {
                "type": "null"
              }
            ],
            "x-appportal-canonical-enum-values": [
              "Unknown",
              "Moving",
              "Stationary"
            ],
            "description": "Canonical SDK enum names are listed above. HTTP deserialization also permits the converter's case-insensitive names and numeric forms; numeric values must fit the underlying enum type. Per-record validation remains separate.",
            "default": null
          },
          "trackingSessionId": {
            "type": [
              "string",
              "null"
            ],
            "default": null
          }
        },
        "description": "Actual source-linked request. Persisted SDK scope overrides tenantId, appId and environment. Latitude/longitude must be present and valid; omitted nullable constructor fields do not all become JSON-required. Active stored tracking session wins over trackingSessionId."
      },
      "SubjectLocationState": {
        "type": [
          "object",
          "null"
        ],
        "properties": {
          "subjectId": {
            "type": "string"
          },
          "latitude": {
            "type": "number"
          },
          "longitude": {
            "type": "number"
          },
          "accuracyMeters": {
            "type": [
              "number",
              "null"
            ]
          },
          "movementState": {
            "enum": [
              "Unknown",
              "Moving",
              "Stationary"
            ]
          },
          "lastSeenAt": {
            "type": "string",
            "format": "date-time"
          },
          "source": {
            "type": "string"
          },
          "isStale": {
            "type": "boolean"
          },
          "activeTrackingSessionId": {
            "type": [
              "string",
              "null"
            ]
          }
        },
        "required": [
          "subjectId",
          "latitude",
          "longitude",
          "accuracyMeters",
          "movementState",
          "lastSeenAt",
          "source",
          "isStale",
          "activeTrackingSessionId"
        ]
      },
      "TrackingSessionRequest": {
        "type": "object",
        "properties": {
          "tenantId": {
            "type": [
              "string",
              "null"
            ]
          },
          "appId": {
            "type": [
              "string",
              "null"
            ]
          },
          "subjectId": {
            "type": [
              "string",
              "null"
            ]
          },
          "action": {
            "type": [
              "string",
              "null"
            ]
          },
          "sessionId": {
            "type": [
              "string",
              "null"
            ],
            "default": null
          }
        },
        "description": "Actual source-linked request. SDK scope overrides tenantId/appId. A nonblank subjectId is required; action is start or end, case-insensitive but NOT whitespace-trimmed. sessionId is accepted by binding but not used by this handler."
      },
      "TrackingSessionRecord": {
        "type": [
          "object",
          "null"
        ],
        "properties": {
          "sessionId": {
            "type": "string"
          },
          "subjectId": {
            "type": "string"
          },
          "tenantId": {
            "type": "string"
          },
          "appId": {
            "type": "string"
          },
          "startedAt": {
            "type": "string",
            "format": "date-time"
          },
          "endedAt": {
            "type": [
              "string",
              "null"
            ],
            "format": "date-time"
          },
          "active": {
            "type": "boolean"
          }
        },
        "required": [
          "sessionId",
          "subjectId",
          "tenantId",
          "appId",
          "startedAt",
          "endedAt",
          "active"
        ]
      },
      "TenantOperationDeniedResponse": {
        "type": [
          "object",
          "null"
        ],
        "properties": {
          "errorCode": {
            "type": "string"
          },
          "error": {
            "type": "string"
          }
        },
        "required": [
          "errorCode",
          "error"
        ]
      },
      "ClientNativeError": {
        "type": "object",
        "properties": {
          "error": {
            "type": "string"
          }
        },
        "required": [
          "error"
        ]
      },
      "ClientRequestAdmissionProblem": {
        "type": "object",
        "description": "Actual RequestAdmissionProblem RFC9457 fields and compatibility aliases. Optional retry coordinates are technical admission evidence, not a saved policy or guaranteed future access.",
        "properties": {
          "type": {
            "type": "string"
          },
          "title": {
            "type": "string"
          },
          "status": {
            "type": "integer"
          },
          "detail": {
            "type": "string"
          },
          "instance": {
            "type": "string"
          },
          "code": {
            "type": "string"
          },
          "message": {
            "type": "string"
          },
          "error": {
            "type": "string"
          },
          "traceId": {
            "type": "string"
          },
          "retryAt": {
            "type": "string",
            "format": "date-time"
          },
          "retryAfterSeconds": {
            "type": "integer"
          }
        },
        "required": [
          "type",
          "title",
          "status",
          "detail",
          "instance",
          "code",
          "message",
          "error",
          "traceId"
        ]
      },
      "MessageCenterPageResponse": {
        "type": [
          "object",
          "null"
        ],
        "properties": {
          "items": {
            "type": "array",
            "items": {
              "type": [
                "object",
                "null"
              ],
              "properties": {
                "itemId": {
                  "type": "string"
                },
                "tenantId": {
                  "type": "string"
                },
                "appId": {
                  "type": "string"
                },
                "userId": {
                  "type": "string"
                },
                "title": {
                  "type": "string"
                },
                "body": {
                  "type": "string"
                },
                "deepLink": {
                  "type": [
                    "string",
                    "null"
                  ]
                },
                "campaignId": {
                  "type": [
                    "string",
                    "null"
                  ]
                },
                "priority": {
                  "enum": [
                    "Normal",
                    "High",
                    "Critical"
                  ]
                },
                "state": {
                  "enum": [
                    "Unread",
                    "Read",
                    "Dismissed",
                    "Archived",
                    "Expired"
                  ]
                },
                "createdAt": {
                  "type": "string",
                  "format": "date-time"
                },
                "expiresAt": {
                  "type": [
                    "string",
                    "null"
                  ],
                  "format": "date-time",
                  "default": null
                }
              },
              "required": [
                "itemId",
                "tenantId",
                "appId",
                "userId",
                "title",
                "body",
                "deepLink",
                "campaignId",
                "priority",
                "state",
                "createdAt"
              ]
            }
          },
          "nextCursor": {
            "type": [
              "string",
              "null"
            ]
          },
          "totalCount": {
            "type": [
              "integer",
              "null"
            ]
          }
        },
        "required": [
          "items",
          "nextCursor",
          "totalCount"
        ]
      },
      "GeofenceSyncPageResponse": {
        "type": [
          "object",
          "null"
        ],
        "properties": {
          "configurationVersion": {
            "type": "string"
          },
          "geofences": {
            "type": "array",
            "items": {
              "type": [
                "object",
                "null"
              ],
              "properties": {
                "geofenceId": {
                  "type": "string"
                },
                "placeId": {
                  "type": [
                    "string",
                    "null"
                  ]
                },
                "tenantId": {
                  "type": "string"
                },
                "appId": {
                  "type": "string"
                },
                "environmentName": {
                  "type": "string"
                },
                "name": {
                  "type": "string"
                },
                "latitude": {
                  "type": "number"
                },
                "longitude": {
                  "type": "number"
                },
                "radiusMeters": {
                  "type": "number"
                },
                "groupKey": {
                  "type": [
                    "string",
                    "null"
                  ]
                },
                "tags": {
                  "type": "array",
                  "items": {
                    "type": [
                      "string",
                      "null"
                    ]
                  }
                },
                "metadata": {
                  "type": [
                    "object",
                    "null"
                  ],
                  "additionalProperties": {
                    "type": [
                      "string",
                      "null"
                    ]
                  }
                },
                "active": {
                  "type": "boolean"
                },
                "createdAt": {
                  "type": "string",
                  "format": "date-time"
                },
                "updatedAt": {
                  "type": "string",
                  "format": "date-time"
                },
                "updatedBy": {
                  "type": "string"
                },
                "shape": {
                  "enum": [
                    "Radial",
                    "Polygon"
                  ],
                  "default": "Radial"
                },
                "polygonVertices": {
                  "type": [
                    "array",
                    "null"
                  ],
                  "items": {
                    "type": [
                      "object",
                      "null"
                    ],
                    "properties": {
                      "latitude": {
                        "type": "number"
                      },
                      "longitude": {
                        "type": "number"
                      }
                    },
                    "required": [
                      "latitude",
                      "longitude"
                    ]
                  },
                  "default": null
                },
                "activationMode": {
                  "enum": [
                    "Automatic",
                    "ApplicationManaged"
                  ],
                  "default": "Automatic"
                },
                "monitoredTransitions": {
                  "type": [
                    "array",
                    "null"
                  ],
                  "items": {
                    "enum": [
                      "Enter",
                      "Exit",
                      "Dwell",
                      "Silent",
                      "Diagnostic"
                    ]
                  },
                  "default": null
                },
                "cooldowns": {
                  "type": [
                    "array",
                    "null"
                  ],
                  "items": {
                    "type": [
                      "object",
                      "null"
                    ],
                    "properties": {
                      "transition": {
                        "enum": [
                          "Enter",
                          "Exit",
                          "Dwell",
                          "Silent",
                          "Diagnostic"
                        ]
                      },
                      "cooldownSeconds": {
                        "type": "integer"
                      }
                    },
                    "required": [
                      "transition",
                      "cooldownSeconds"
                    ]
                  },
                  "default": null
                },
                "effectiveCooldowns": {
                  "type": [
                    "array",
                    "null"
                  ],
                  "items": {
                    "type": [
                      "object",
                      "null"
                    ],
                    "properties": {
                      "transition": {
                        "enum": [
                          "Enter",
                          "Exit",
                          "Dwell",
                          "Silent",
                          "Diagnostic"
                        ]
                      },
                      "cooldownSeconds": {
                        "type": "integer"
                      },
                      "scope": {
                        "enum": [
                          "Geofence",
                          "Tag"
                        ]
                      },
                      "tag": {
                        "type": [
                          "string",
                          "null"
                        ],
                        "default": null
                      }
                    },
                    "required": [
                      "transition",
                      "cooldownSeconds",
                      "scope"
                    ]
                  },
                  "default": null
                },
                "revision": {
                  "type": "integer",
                  "default": 1
                },
                "bulkTemplateKey": {
                  "type": [
                    "string",
                    "null"
                  ],
                  "default": null
                }
              },
              "required": [
                "geofenceId",
                "placeId",
                "tenantId",
                "appId",
                "environmentName",
                "name",
                "latitude",
                "longitude",
                "radiusMeters",
                "groupKey",
                "tags",
                "metadata",
                "active",
                "createdAt",
                "updatedAt",
                "updatedBy"
              ]
            }
          },
          "locations": {
            "type": "array",
            "items": {
              "type": [
                "object",
                "null"
              ],
              "properties": {
                "placeId": {
                  "type": "string"
                },
                "tenantId": {
                  "type": "string"
                },
                "appId": {
                  "type": "string"
                },
                "environmentName": {
                  "type": "string"
                },
                "name": {
                  "type": "string"
                },
                "latitude": {
                  "type": "number"
                },
                "longitude": {
                  "type": "number"
                },
                "metadata": {
                  "type": [
                    "object",
                    "null"
                  ],
                  "additionalProperties": {
                    "type": [
                      "string",
                      "null"
                    ]
                  }
                },
                "active": {
                  "type": "boolean"
                },
                "createdAt": {
                  "type": "string",
                  "format": "date-time"
                },
                "updatedAt": {
                  "type": "string",
                  "format": "date-time"
                },
                "updatedBy": {
                  "type": "string"
                },
                "attributes": {
                  "type": [
                    "array",
                    "null"
                  ],
                  "items": {
                    "type": [
                      "object",
                      "null"
                    ],
                    "properties": {
                      "key": {
                        "type": "string"
                      },
                      "value": {
                        "type": "string"
                      },
                      "type": {
                        "enum": [
                          "Text",
                          "Number",
                          "Boolean",
                          "Date",
                          "TextList"
                        ],
                        "default": "Text"
                      },
                      "visibility": {
                        "enum": [
                          "DeviceAndTelemetry",
                          "DeviceOnly",
                          "PortalOnly"
                        ],
                        "default": "DeviceAndTelemetry"
                      }
                    },
                    "required": [
                      "key",
                      "value"
                    ]
                  },
                  "default": null
                },
                "revision": {
                  "type": "integer",
                  "default": 1
                }
              },
              "required": [
                "placeId",
                "tenantId",
                "appId",
                "environmentName",
                "name",
                "latitude",
                "longitude",
                "metadata",
                "active",
                "createdAt",
                "updatedAt",
                "updatedBy"
              ]
            }
          },
          "tagDefinitions": {
            "type": "array",
            "items": {
              "type": [
                "object",
                "null"
              ],
              "properties": {
                "tenantId": {
                  "type": "string"
                },
                "appId": {
                  "type": "string"
                },
                "environmentName": {
                  "type": "string"
                },
                "tag": {
                  "type": "string"
                },
                "cooldowns": {
                  "type": "array",
                  "items": {
                    "$ref": "#/components/schemas/GeofenceSyncPageResponse/properties/geofences/items/properties/cooldowns/items"
                  }
                },
                "createdAt": {
                  "type": "string",
                  "format": "date-time"
                },
                "updatedAt": {
                  "type": "string",
                  "format": "date-time"
                },
                "updatedBy": {
                  "type": "string"
                },
                "revision": {
                  "type": "integer",
                  "default": 1
                },
                "affectedGeofence": {
                  "type": [
                    "object",
                    "null"
                  ],
                  "properties": {
                    "geofenceId": {
                      "type": "string"
                    },
                    "previousRevision": {
                      "type": "integer"
                    },
                    "revision": {
                      "type": "integer"
                    }
                  },
                  "required": [
                    "geofenceId",
                    "previousRevision",
                    "revision"
                  ]
                }
              },
              "required": [
                "tenantId",
                "appId",
                "environmentName",
                "tag",
                "cooldowns",
                "createdAt",
                "updatedAt",
                "updatedBy"
              ]
            }
          },
          "nextCursor": {
            "type": [
              "string",
              "null"
            ]
          },
          "totalCount": {
            "type": "integer"
          },
          "catalogLimit": {
            "type": "integer"
          },
          "selectionTruncated": {
            "type": "boolean"
          }
        },
        "required": [
          "configurationVersion",
          "geofences",
          "locations",
          "tagDefinitions",
          "nextCursor",
          "totalCount",
          "catalogLimit",
          "selectionTruncated"
        ]
      },
      "ClientPageProblem": {
        "type": "object",
        "properties": {
          "type": {
            "type": "string"
          },
          "title": {
            "type": "string"
          },
          "status": {
            "type": "integer"
          },
          "detail": {
            "type": "string"
          },
          "instance": {
            "type": "string"
          },
          "code": {
            "type": "string"
          }
        },
        "required": [
          "type",
          "title",
          "status"
        ],
        "additionalProperties": true
      }
    },
    "securitySchemes": {
      "installedAppCredential": {
        "type": "apiKey",
        "in": "header",
        "name": "X-AppPortal-SDK-Key",
        "description": "Persisted SDK credential bound to one app/environment and the operation's exact permission. Caller headers/payloads cannot retarget its scope. Server/upload credentials do not replace it."
      },
      "userInstallationBinding": {
        "type": "apiKey",
        "in": "header",
        "name": "X-AppPortal-User-Binding",
        "description": "Short-lived user/installation binding issued by the authenticated customer backend through the separate Automation user-binding API. It must match the exact user, installation, app/environment and requested operation; an SDK key alone cannot authorize the user."
      }
    }
  },
  "x-appportal-source": "CrashDiagnosticAttachmentEndpoints; ClientEngagementEndpoints; ClientLocationEndpoints; actual Contracts DTOs; pure source-linked SubjectPingRequest and TrackingSessionRequest; PostgresMessageCenterStore; existing authority/admission and Location stores; ClientEngagementEndpoints.MessagePages; ClientLocationPageEndpoints; actual MessageCenterPageResponse/GeofenceSyncPageResponse and protected page stores",
  "x-appportal-scope": "Eleven existing client operations, including protected live Message Center pages and bounded versioned geofence sync pages. SDK identity, user binding and current entitlement remain authoritative. No remote configuration or message-send authority is introduced.",
  "x-appportal-privacy-boundary": "Fixed credential-safety processing is not a claim of automatic PII removal. SDK/developer collection consent and content filtering remain distinct. Local Reset pauses delivery and invalidates unfinished captures; local Denied clears the SDK queue. Neither is remote communication consent or server erasure.",
  "x-appportal-reference-source": "8bda8e8302d4ea5bd005ef1132f7267e82e6337c"
}
