Authentication

Learn how to authenticate Neon API requests

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'

For example:

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 request 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.

Neon API keys

Most actions performed in the Neon Console can also be performed using the Neon API. You'll need an API key to validate your requests. Each key is a randomly-generated 64-bit token that you must include when calling Neon API methods. All keys remain valid until deliberately revoked.

Neon supports these types of API keys:

  • Personal API key — These keys are tied to your individual Neon account. They can access your personal projects by default, and organization projects if you specify the organization ID in your API requests.
  • Organization API key — These keys are scoped to a specific organization. They allow full admin-level access to all projects within that organization.
  • Project-scoped organization API key — These keys are scoped to a specific project within an organization. They provide member-level access to the specified project, and only that project. They cannot perform organization-related actions or destructive project operations like project deletion.

For information about creating Neon API keys, refer to Manage API keys in the Neon documentation.