Untrusted Origin

untrusted-origin · 403

A write signed in by the Ghaym session cookie came from a page the API doesn't trust, so the API refused it before reading the session.

A browser sends the cookie with any request, a hostile page's included, so a write that rides on it must come from Ghaym's own pages. Reads are never checked, and neither is a call with a bearer token that works.

This type adds no members to the ones every error carries.

Common causes

  • A page on another site sent a POST, PUT, PATCH or DELETE to the API, and the browser added the cookie.
  • A script or tool sent a write with the session cookie copied in, and no Origin or Sec-Fetch-Site header the API trusts.
  • A bearer token was sent but didn't work, so the API fell back to the cookie that came with it.

How to fix the call

  • From code, authenticate with a bearer token, such as an API key's, rather than the cookie.
  • From a browser, make the change in the console.
  • If a bearer token was sent, fix it first: the cookie is used only when the token fails.

Example response

json
{
  "type": "untrusted-origin",
  "title": "Untrusted Origin",
  "detail": "Cookie-authenticated requests that change state must come from an allowed origin. Send the request from the console, or authenticate with a bearer token.",
  "requestId": "req-1785231000000-4f7b2c9ae",
  "timestamp": "2026-07-28T09:30:00.000Z",
  "path": "/v1/projects",
  "method": "POST",
  "instance": "POST /v1/projects",
  "status": 403,
  "docs": "https://ghaym.me/docs/errors/untrusted-origin"
}