The Neon API requires that you include an API key token in an Authorization header in your API request.
The Neon API uses Bearer Token Authentication, which means that you must format your Authorization header like this:
-H 'Authorization: Bearer $NEON_API_KEY'
curl 'https://console.neon.tech/api/v2/projects' \
-H 'Accept: application/json' \
-H 'Authorization: Bearer $NEON_API_KEY' \
-H 'Content-Type: application/json' \
To try an API requests in your browser from this page, enter your token in the Bearer prompt after clicking the Try It button on any Neon API endpoint, which you can select from the sidebar.
Get a list of projects is an easy endpoint to try, as it only requires an API key token.
A Neon API key is a randomly-generated 64-bit token that remains valid until it is revoked.
To create an API key:
- Navigate to the Developer Settings page in the Neon Console.
- Enter a name for the API key.
- Click Create and copy the generated token.
Store your token in a safe location. You will not be able to view or copy the token again after leaving the Developer Settings page in the Neon Console.
For more information about managing Neon API keys, refer to Manage API keys in the Neon documentation.