API Keys

Create Api Key

Create a new API key for the authenticated user.

The full API key is ONLY returned in this response - store it securely! You won't be able to retrieve the full key again.

Args: key_data: API key creation parameters user_id: Authenticated user ID (from JWT) db: Database client

Returns: APIKeyResponse with the full API key (only shown once!)

post/api/v1/keys

Request

  • Base URL: https://api.seoproai.co
  • URL: https://api.seoproai.co/api/v1/keys
  • Auth: one of:
    • HTTP bearer
    • OAuth 2 (authorization code, authorization URL https://dajosjnaalanhqksxrpe.supabase.co/auth/v1/authorize, token URL https://dajosjnaalanhqksxrpe.supabase.co/auth/v1/token)

Headers

X-User-Idstring nullable
X-Organization-Idstring nullable
Authorizationstring nullable

Request body

namestring required

Friendly name for the API key

environmentstring

Environment: 'live' or 'test'

expires_in_daysinteger nullable

Optional expiration in days

scopesstring[] nullable

Optional list of permission scopes

website_idinteger nullable

Optional website ID to mark as API-managed when generating the key

Response

Successful Response

idstring required
namestring required
key_prefixstring required
full_keystring required
created_atstring required
expires_atstring nullable required
scopesstring[] required

Changes

No recorded changes to this operation across all 1 revision of this API.