Create an API key for the authenticated user
import requests
url = "https://api.13-215-85-171.sslip.io/v1/keys"
payload = {
"name": "<string>",
"scope": "<string>"
}
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)curl --request POST \
--url https://api.13-215-85-171.sslip.io/v1/keys \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"name": "<string>",
"scope": "<string>"
}
'{
"id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"key": "ns_live_a1b2c3d4e5f67890a1b2c3d4e5f67890",
"prefix": "ns_live_a1b2",
"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
Create an API key for the authenticated user
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 new API key and returns the
plaintext key exactly once. The server stores only the SHA-256 hash and
later list responses expose only display metadata.
POST
/
v1
/
keys
Create an API key for the authenticated user
import requests
url = "https://api.13-215-85-171.sslip.io/v1/keys"
payload = {
"name": "<string>",
"scope": "<string>"
}
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)curl --request POST \
--url https://api.13-215-85-171.sslip.io/v1/keys \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"name": "<string>",
"scope": "<string>"
}
'{
"id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"key": "ns_live_a1b2c3d4e5f67890a1b2c3d4e5f67890",
"prefix": "ns_live_a1b2",
"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
Body
application/json
Response
API key created
Plaintext API key returned only at creation time.
Example:
"ns_live_a1b2c3d4e5f67890a1b2c3d4e5f67890"
Stored display prefix for identifying the key.
Example:
"ns_live_a1b2"
Echo of the advisory scope label provided at creation, if any.
Expiration time when returned from a rotation flow; null for normal keys.