Copy into your AI assistant to get an API key and make your first API call.

The Neon API uses API keys and Bearer authentication. This page shows the shortest REST API path: create a key, set it as an environment variable, and call the /projects endpoint.

Get an API key

Create an API key in the Neon Console under Account settings > API keys. For detailed instructions and security best practices, see Manage API keys.

Neon supports three API key types:

Key typeScopeBest for
Personal API keyAll organization projects where the user is a memberPersonal development, scripts
Organization API keyAll projects within an organizationTeam automation, CI/CD
Project-scoped API keySingle project onlyLimited access integrations

important

API key tokens are shown only once at creation. Store them securely because you can't retrieve them later.

Base URL and authentication

All API requests use this base URL:

https://console.neon.tech/api/v2/

Include your API key in the Authorization header using Bearer authentication:

-H "Authorization: Bearer $NEON_API_KEY"

Make your first request

Set your API key as an environment variable, then list your projects:

export NEON_API_KEY="your-api-key-here"

curl 'https://console.neon.tech/api/v2/projects' \
  -H 'Accept: application/json' \
  -H "Authorization: Bearer $NEON_API_KEY" | jq

The response includes your projects with their IDs, regions, and other details:

{
  "projects": [
    {
      "id": "spring-example-302709",
      "name": "my-project",
      "region_id": "aws-us-east-2",
      "pg_version": 17,
      "created_at": "2024-01-15T10:30:00Z"
    }
  ],
  "pagination": { "cursor": "eyJsaW1pdCI6MX0" }
}

Next steps