Create project API key
Creates a new API key for the specified project. API keys are used for authenticating requests to the API. This endpoint generates a new key with the provided name and returns the complete key details including the actual key value. Note that the full API key value is only returned once at creation time and cannot be retrieved later, so it should be securely stored immediately.
Path parameters
projectId
Unique identifier (Nano ID) of the project to create an API key for
Headers
x-api-key
Request
This endpoint expects an object.
name
A user-friendly name to identify the API key’s purpose (e.g., “Production Server”, “Test Environment”)
Response
API key created successfully. The response includes the full API key value that should be stored securely, as it cannot be retrieved again later.
id
Database record identifier for the API key
name
Descriptive name assigned to help identify the key's purpose
key
The API key string value that should be included in API requests. This value is only shown once at creation time.
created_at
UTC timestamp indicating when the API key was created
last_used_at
UTC timestamp indicating when the API key was last used for authentication. Will be null for newly created keys.