OSAPI.os.tv
Guide

Errors

Successful responses carry success: true. The status codes and bodies below are what you should handle.

StatusWhenBody
200OK{ "success": true, … }
401Missing or invalid token on an operator endpoint{ "error": "Unauthorized" }
403Authenticated, but not a domain administrator{ "error": "Domain admin access required", "message": "…" }
404No origin for the given id or address{ "success": false, "error": "origin not found" }
500Unexpected server error{ "success": false, "error": "…" }
Note the shapes differ. The 401 body is { "error": "Unauthorized" } — it has no success field — while 404/500 use { "success": false, "error": … }. Branch on the HTTP status first, then read the body.

401 vs 403

A 401 means "authenticate (or refresh) and retry". A 403 means the identity is authenticated but is not a domain administrator — retrying with the same identity will not help. See Authentication.

Example: error-401.json.