Create surface API key

Create a new API key for a surface. The plaintext key is only returned on creation.

Authentication

AuthorizationBearer
API key or Clerk session token

Path parameters

idstringRequired
surfaceIdstringRequired

Request

This endpoint expects an object.
environmentenumOptionalDefaults to test
Allowed values:
expiresAtdatetimeOptional
namestringOptional<=255 characters
rateLimitPerDayintegerOptional>=1
rateLimitPerMinuteintegerOptional>=1
scopeslist of stringsOptional

Response

Surface key created
createdAtstring
environmentstring
expiresAtstring or null
idstring
isActiveboolean
keystring
keyHintstring or null
keyPrefixstring
namestring or null
rateLimitPerDayinteger or null
rateLimitPerMinuteinteger or null
scopeslist of strings
surfaceIdstring

Errors

400
Bad Request Error
401
Unauthorized Error
403
Forbidden Error
404
Not Found Error
500
Internal Server Error