Skip to main content
POST
/
v1
/
keys
/
default
Idempotently create the first runtime API key
import requests

url = "https://api.13-215-85-171.sslip.io/v1/keys/default"

headers = {"Authorization": "Bearer <token>"}

response = requests.post(url, headers=headers)

print(response.text)
{
  "created": true,
  "id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
  "prefix": "ns_live_a1b2",
  "key": "ns_live_a1b2c3d4e5f67890a1b2c3d4e5f67890",
  "name": "<string>",
  "scope": "<string>",
  "expires_at": "2023-11-07T05:31:56Z"
}

Authorizations

Authorization
string
header
required

Supabase Auth access token passed as Bearer token

Response

Default key already existed

created
boolean
required

True only when this request created and returned a new plaintext key.

id
string<uuid>
required
prefix
string
required

Stored display prefix for identifying the key.

Example:

"ns_live_a1b2"

key
string | null

Plaintext default key returned exactly once when created is true.

Example:

"ns_live_a1b2c3d4e5f67890a1b2c3d4e5f67890"

name
string | null
scope
string | null

Default runtime-key scope label.

expires_at
string<date-time> | null