/projects/auth/createCreate Neon Auth integrationDeprecated. 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.
Request body
requiredapplication/json
auth_providerstringrequiredAuthentication 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.
branch_idstringrequiredThe Neon branch ID. Returned as `id` from `GET /projects/{project_id}/branches`.
database_namestringName of the database to associate with the Neon Auth integration. When omitted, the integration uses the project's default database.
project_idstringrequiredThe Neon project ID. Returned as `id` from `GET /projects`.
role_namestringDeprecated. The database role for the auth integration. Omit this field; it is ignored.
{
"auth_provider": "better_auth",
"branch_id": "br-cool-darkness-12345678",
"database_name": "string",
"project_id": "wispy-forest-12345678",
"role_name": "string"
}Responses
auth_providerstringrequiredAuthentication 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_idstringrequiredProject ID assigned by the auth provider for this integration.
base_urlstringBase URL of the Neon Auth service for this integration. Set as the NEON_AUTH_BASE_URL environment variable in your application.
jwks_urlstringrequiredURL of the provider's JWKS endpoint used to verify JWTs.
pub_client_keystringrequiredPublishable SDK key from the auth provider. Populated only for Stack Auth (deprecated); empty for Better Auth.
schema_namestringrequiredPostgres schema containing the auth integration tables. Defaults to `neon_auth`.
secret_server_keystringrequiredSecret server-side SDK key from the auth provider. Populated only for Stack Auth (deprecated); empty for Better Auth. Treat as a credential.
table_namestringrequiredPostgres table in the integration schema where synced user records are stored.
{
"auth_provider": "better_auth",
"auth_provider_project_id": "string",
"base_url": "string",
"jwks_url": "string",
"pub_client_key": "string",
"schema_name": "string",
"secret_server_key": "string",
"table_name": "string"
}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"
}