Skip to content

Authentication ​

Every data connection has two credentials. They read the same data. They differ in where they go and what they return.

API keyData link
Starts withhpk_hpl_
Goes inthe Authorization headerthe URL, as ?token=
ReturnsJSON by default, or CSVCSV only
Made foryour own codeGoogle Sheets, Excel, Power BI

API key ​

Send the key as a bearer token:

http
GET /functions/v1/data-api/v1/bookings HTTP/1.1
Host: ntnzabbhtivotmfhwdnm.supabase.co
Authorization: Bearer hpk_your_key_here

Never put the key in a URL

URLs end up in logs, browser history and analytics. A key sent in the URL is refused with a 404, and the attempt is logged so you can be told to rotate it.

The link carries its token in the URL, because spreadsheets can't send headers:

https://ntnzabbhtivotmfhwdnm.supabase.co/functions/v1/data-api/v1/bookings?token=hpl_your_token_here

A data link only serves CSV. Asking it for format=json is a 400. Programs should use the API key.

A data link is a password

Anyone who has it can read everything that connection covers, without signing in. Share it only with the tool or person it's for. If it leaks, rotate it.

Wrong credential, wrong place ​

All of these return the same 404 with {"error": "not_found"}:

  • a credential that doesn't exist, or one that's been rotated or turned off
  • an API key in the URL
  • a data link in the header
  • a misspelt dataset name

The answer is deliberately the same each time, so a stranger can't tell a real credential from a made-up one.

Plan ​

If the account's Host Port subscription has lapsed, calls return 402 with subscription_lapsed. They work again as soon as it's renewed.