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
id
surfaceId
Request
This endpoint expects an object.
environment
Allowed values:
expiresAt
name
rateLimitPerDay
rateLimitPerMinute
scopes
Capability restrictions. Prefer IDs from get_surface.scopeTargets; linked surface-item/capability IDs and unique names shown in that catalog are accepted and resolved to immutable authorization targets. Use * for unrestricted access.
Response
Surface key created
createdAt
environment
expiresAt
id
isActive
key
keyHint
keyPrefix
name
rateLimitPerDay
rateLimitPerMinute
scopeTargetIds
scopes
surfaceId
Errors
400
Bad Request Error
401
Unauthorized Error
403
Forbidden Error
404
Not Found Error
500
Internal Server Error