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)curl --request POST \
--url https://api.13-215-85-171.sslip.io/v1/keys/default \
--header 'Authorization: Bearer <token>'{
"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"
}{
"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"
}{
"error": "Missing or invalid bearer credential",
"code": "unauthorized",
"request_id": "req_123"
}{
"error": "Verify your email before using self-serve API routes",
"code": "email_not_verified",
"request_id": "req_123"
}{
"error": "<string>",
"code": "invalid_request",
"error_detail": {
"code": "unauthorized",
"message": "<string>",
"phase": "auth",
"retryable": true,
"suggested_action": "<string>",
"step_index": 123,
"attempt": 123,
"max_attempts": 123,
"cache_subject": "<string>",
"build_id": "<string>",
"request_id": "<string>",
"details": {}
},
"request_id": "<string>",
"build_id": "<string>"
}API Keys
Idempotently create the first runtime API key
Dormant during the private-beta key-only e2e. This route returns
feature_unavailable unless NULLSPACE_SELF_SERVE_AUTH_ENABLED=true
is set. When enabled, it creates a default self-serve runtime API key
for a verified user when none exists yet. The plaintext key is returned
only when this request creates the row; retries or existing-key calls
return metadata without a secret.
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)curl --request POST \
--url https://api.13-215-85-171.sslip.io/v1/keys/default \
--header 'Authorization: Bearer <token>'{
"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"
}{
"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"
}{
"error": "Missing or invalid bearer credential",
"code": "unauthorized",
"request_id": "req_123"
}{
"error": "Verify your email before using self-serve API routes",
"code": "email_not_verified",
"request_id": "req_123"
}{
"error": "<string>",
"code": "invalid_request",
"error_detail": {
"code": "unauthorized",
"message": "<string>",
"phase": "auth",
"retryable": true,
"suggested_action": "<string>",
"step_index": 123,
"attempt": 123,
"max_attempts": 123,
"cache_subject": "<string>",
"build_id": "<string>",
"request_id": "<string>",
"details": {}
},
"request_id": "<string>",
"build_id": "<string>"
}Authorizations
Supabase Auth access token passed as Bearer token
Response
Default key already existed
True only when this request created and returned a new plaintext key.
Stored display prefix for identifying the key.
Example:
"ns_live_a1b2"
Plaintext default key returned exactly once when created is true.
Example:
"ns_live_a1b2c3d4e5f67890a1b2c3d4e5f67890"
Default runtime-key scope label.