401/api-keys, /subscription, /usage, /checkout/session, /subscription/change/preview, /subscription/change, /billing/portal, /playground/*

Missing authorization

How to fix the Scrnpix API 401 error when the session cookie is missing from requests to dashboard endpoints.

When Does This Happen?

This error occurs when you send a request to any JWT-protected endpoint without a valid session cookie. This includes dashboard endpoints (/api-keys, /subscription, /usage), billing endpoints (/checkout/session, /subscription/change, /billing/portal), and playground endpoints (/playground/screenshot, /playground/animate). All require JWT-based authentication set via the login flow.

Reproduce This Error

curl "https://api.scrnpix.com/api-keys"
{"error": "Missing authorization"}

How to Fix

  1. 1Log in through the Scrnpix dashboard to obtain a session cookie
  2. 2Include the session cookie in your request headers
  3. 3Check that cookies are enabled in your browser or HTTP client

Correct Request

curl -H "Cookie: session=your-jwt-token" \
  "https://api.scrnpix.com/api-keys"
{"keys": [{"id": "...", "name": "Default", "keyPrefix": "sk_...", "isActive": true}]}

Related Errors

Frequently Asked Questions

What is the difference between X-KEY and session cookie authentication?

X-KEY header authentication is used for the /screenshot and /animate capture endpoints. Session cookie (JWT) authentication is used for all other protected endpoints: dashboard management (/api-keys, /subscription, /usage), billing (/checkout/session, /subscription/change, /billing/portal), and playground (/playground/screenshot, /playground/animate). They serve different purposes and are not interchangeable.

Still Having Issues?

Check your API key and subscription status in the dashboard, or explore our language guides for integration examples.

Go to Dashboard