Auth (legacy)

Create Neon Auth integration

Deprecated. Use /projects/{project_id}/branches/{branch_id}/auth instead. Removal scheduled for March 1, 2026. Use this endpoint if the frontend integration flow can't be used.

post/projects/auth/create

Request

  • Base URL: https://console.neon.tech/api/v2
  • URL: https://console.neon.tech/api/v2/projects/auth/create
  • Auth: one of:
    • HTTP bearer
    • API key in cookie zenith
    • API key in cookie keycloak_token

Request body

auth_provider'mock' | 'stack' | 'better_auth' required

Authentication provider integrated with this Neon Auth configuration. better_auth integrates with Better Auth (the current, recommended provider). stack integrates with Stack Auth (deprecated). mock is a simulated provider for local development and testing only.

project_idstring required

The Neon project ID. Returned as id from GET /projects.

branch_idstring required

The Neon branch ID. Returned as id from GET /projects/{project_id}/branches.

database_namestring

Name of the database to associate with the Neon Auth integration. When omitted, the integration uses the project's default database.

role_namestring

Deprecated. The database role for the auth integration. Omit this field; it is ignored.

Example request

{
  "project_id": "wispy-forest-12345678",
  "branch_id": "br-cool-darkness-12345678"
}

Response

Creates Neon Auth integration

auth_provider'mock' | 'stack' | 'better_auth' required

Authentication provider integrated with this Neon Auth configuration. better_auth integrates with Better Auth (the current, recommended provider). stack integrates with Stack Auth (deprecated). mock is a simulated provider for local development and testing only.

auth_provider_project_idstring required

Project ID assigned by the auth provider for this integration.

pub_client_keystring required

Publishable SDK key from the auth provider. Populated only for Stack Auth (deprecated); empty for Better Auth.

secret_server_keystring required

Secret server-side SDK key from the auth provider. Populated only for Stack Auth (deprecated); empty for Better Auth. Treat as a credential.

jwks_urlstring required

URL of the provider's JWKS endpoint used to verify JWTs.

schema_namestring required

Postgres schema containing the auth integration tables. Defaults to neon_auth.

table_namestring required

Postgres table in the integration schema where synced user records are stored.

base_urlstring

Base URL of the Neon Auth service for this integration. Set as the NEON_AUTH_BASE_URL environment variable in your application.

Changes

No recorded changes to this operation across all 15 revisions of this API.