/api_keysCreate API keyCreates an API key. The key_name is a user-specified name for the key. Returns an id and key; the key is a randomly generated, 64-bit token required to access the Neon API. Store the key securely — it is only returned once. API keys can also be managed in the Neon Console. See Manage API keys.
Request body
requiredapplication/json
key_namestringrequiredA user-specified API key name. This value is required when creating an API key.
{
"key_name": "mykey"
}Responses
created_atstring · date-timerequiredA timestamp indicating when the API key was created
created_bystring · uuidrequiredID of the user who created this API key
idinteger · int64requiredThe API key's unique numeric ID. Distinct from the API key token (`key`).
keystringrequiredThe generated 64-bit token required to access the Neon API
namestringrequiredThe user-specified API key name
{
"created_at": "2022-11-15T20:13:35Z",
"created_by": "629982cc-de05-43db-ae16-28f2399c4910",
"id": 165434,
"key": "9v1faketcjbl4sn1013keyd43n2a8qlfakeog8yvp40hx16keyjo1bpds4y2dfms3",
"name": "mykey"
}codestringrequiredmessagestringrequiredError message
request_idstringUnique identifier for the request, useful for debugging. You can set this value manually by including an `X-Request-ID` header in the request. If not provided, the value will be generated automatically.
{
"code": "",
"message": "string",
"request_id": "string"
}