Errors
Exchange and gateway return JSON error plus error_code. SDKs throw with err.code (JS) or ComprehendlyError.http (Swift).
| Status | error_code |
Typical cause |
|---|---|---|
| 400 | invalid_key / invalid_params |
Key format, missing page_id, non-UUID page id |
| 401 | invalid_credentials / credential_expired |
Wrong or revoked key; token expired — exchange again |
| 403 | origin_not_allowed |
Allowlist must match the request Origin exactly |
| 403 | scope_denied |
Requested scopes not granted on the key |
Checklist for origin_not_allowed
- No trailing slash or path on the allowlist entry.
- JS demo:
http://localhost:4173not127.0.0.1unless that is what you allowlisted. - Swift: header
OriginequalsComprehendlyClient.origin(defaulthttps://ios-demo.comprehendly.nz). - file:// pages have no usable origin — serve over http(s).
Method contract: API reference.