{"note":"OpenAPI conversion -- returning structured metadata","name":"neon","description":"Neon API","version":"v2","base_url":"https://console.neon.tech/api/v2","endpoints":179,"raw":"@lap v0.3\n# Machine-readable API spec. Each @endpoint block is one API call.\n@api Neon API\n@base https://console.neon.tech/api/v2\n@version v2\n@auth Bearer bearer | ApiKey zenith in cookie | ApiKey keycloak_token in cookie\n@endpoints 179\n@hint download_for_search\n@toc projects(149), api_keys(3), consumption_history(3), organizations(19), regions(1), users(3), auth(1)\n\n@group projects\n@endpoint GET /projects/{project_id}/advisors\n@desc Get advisor issues\n@optional {branch_id: str # Branch ID to analyze. If not specified, the project's default branch is used., database_name: str # Database name to analyze. Required if branch has multiple databases., category: str # Filter issues by category, min_severity: str(INFO/WARN/ERROR) # Minimum severity level to include. For example, WARN returns WARN and ERROR issues, excluding INFO.}\n@returns(200) {issues: [map]} # Successfully retrieved security advisor issues\n\n@endgroup\n\n@group api_keys\n@endpoint GET /api_keys\n@desc List API keys\n@returns(200) Returned the API keys for the Neon account\n\n@endpoint POST /api_keys\n@desc Create API key\n@required {key_name: str # A user-specified API key name. This value is required when creating an API key.}\n@returns(200) {id: int(int64), key: str, name: str, created_at: str(date-time), created_by: str(uuid)} # Created an API key\n@example_request {\"key_name\":\"mykey\"}\n\n@endpoint DELETE /api_keys/{key_id}\n@desc Revoke API key\n@required {key_id: int(int64) # The API key ID}\n@returns(200) {id: int(int64), name: str, created_at: str(date-time), created_by: str(uuid), last_used_at: str(date-time)?, last_used_from_addr: str, revoked: bool} # Revoked the specified API key\n\n@endgroup\n\n@group projects\n@endpoint GET /projects/{project_id}/operations/{operation_id}\n@desc Retrieve operation details\n@returns(200) {operation: map{id: str(uuid), project_id: str, branch_id: str, endpoint_id: str, action: str, status: str, error: str, failures_count: int(int32), retry_at: str(date-time), created_at: str(date-time), updated_at: str(date-time), total_duration_ms: int(int32)}} # Returned details for the specified operation\n\n@endpoint GET /projects\n@desc List projects\n@optional {cursor: str # Specify the cursor value from the previous response to retrieve the next batch of projects., limit: int=10 # Specify a value from 1 to 400 to limit number of projects in the response., search: str # Search by project `name` or `id`. You can specify partial `name` or `id` values to filter results., org_id: str # Search for projects by `org_id`., timeout: int # Specify an explicit timeout in milliseconds to limit response delay. After timing out, the incomplete list of project data fetched so far will be returned. Projects still being fetched when the timeout occurred are listed in the \"unavailable\" attribute of the response. If not specified, an implicit implementation defined timeout is chosen with the same behaviour as above, recoverable: bool=false # Show only deleted projects within the recovery window.}\n@returns(200) Returned a list of projects for the Neon account\n\n@endpoint POST /projects\n@desc Create project\n@required {project: map{settings: map, name: str, branch: map, autoscaling_limit_min_cu: num, autoscaling_limit_max_cu: num, provisioner: str, region_id: str, default_endpoint_settings: map, pg_version: int, store_passwords: bool, history_retention_seconds: int(int32), org_id: str} # Configuration for the new project, including name, region, and Postgres compute and storage settings.}\n@returns(201) Created a project. The project includes a connection URI with a database, password, and role. At least one non-protected role is created with a password. Wait until the operations are finished before attempting to connect to a project database.\n@example_request {\"project\":{\"name\":\"myproject\"}}\n\n@endpoint GET /projects/shared\n@desc List shared projects\n@optional {cursor: str # Specify the cursor value from the previous response to get the next batch of projects., limit: int=10 # Specify a value from 1 to 400 to limit number of projects in the response., search: str # Search query by name or id., timeout: int # Specify an explicit timeout in milliseconds to limit response delay. After timing out, the incomplete list of project data fetched so far will be returned. Projects still being fetched when the timeout occurred are listed in the \"unavailable\" attribute of the response. If not specified, an implicit implementation defined timeout is chosen with the same behaviour as above}\n@returns(200) Returned a list of shared projects for the Neon account\n\n@endpoint GET /projects/{project_id}\n@desc Retrieve project details\n@returns(200) {project: map{data_storage_bytes_hour: int(int64), data_transfer_bytes: int(int64), written_data_bytes: int(int64), compute_time_seconds: int(int64), active_time_seconds: int(int64), cpu_used_sec: int(int64), id: str, platform_id: str, region_id: str, name: str, provisioner: str, default_endpoint_settings: map{pg_settings: map, pgbouncer_settings: map, autoscaling_limit_min_cu: num, autoscaling_limit_max_cu: num, suspend_timeout_seconds: int(int64)}, settings: map{quota: map{active_time_seconds: int(int64), compute_time_seconds: int(int64), written_data_bytes: int(int64), data_transfer_bytes: int(int64), logical_size_bytes: int(int64)}, allowed_ips: map{ips: [str], protected_branches_only: bool}, enable_logical_replication: bool, maintenance_window: map{weekdays: [int], start_time: str, end_time: str}, block_public_connections: bool, block_vpc_connections: bool, audit_log_level: str, hipaa: bool, preload_libraries: map{use_defaults: bool, enabled_libraries: [str]}}, pg_version: int, proxy_host: str, branch_logical_size_limit: int(int64), branch_logical_size_limit_bytes: int(int64), store_passwords: bool, maintenance_starts_at: str(date-time), creation_source: str, history_retention_seconds: int(int32), created_at: str(date-time), updated_at: str(date-time), synthetic_storage_size: int(int64), consumption_period_start: str(date-time), consumption_period_end: str(date-time), quota_reset_at: str(date-time), owner_id: str, owner: map{email: str(email), name: str, branches_limit: int, subscription_type: str}, compute_last_active_at: str(date-time), org_id: str, maintenance_scheduled_for: str(date-time), hipaa_enabled_at: str(date-time), effective_project_permission: str?}} # Returned information about the specified project\n\n@endpoint PATCH /projects/{project_id}\n@desc Update project\n@required {project: map{settings: map, name: str, default_endpoint_settings: map, history_retention_seconds: int(int32)}}\n@returns(200) Updated the specified project\n@example_request {\"project\":{\"name\":\"myproject\"}}\n\n@endpoint DELETE /projects/{project_id}\n@desc Delete project\n@returns(200) {project: map{data_storage_bytes_hour: int(int64), data_transfer_bytes: int(int64), written_data_bytes: int(int64), compute_time_seconds: int(int64), active_time_seconds: int(int64), cpu_used_sec: int(int64), id: str, platform_id: str, region_id: str, name: str, provisioner: str, default_endpoint_settings: map{pg_settings: map, pgbouncer_settings: map, autoscaling_limit_min_cu: num, autoscaling_limit_max_cu: num, suspend_timeout_seconds: int(int64)}, settings: map{quota: map{active_time_seconds: int(int64), compute_time_seconds: int(int64), written_data_bytes: int(int64), data_transfer_bytes: int(int64), logical_size_bytes: int(int64)}, allowed_ips: map{ips: [str], protected_branches_only: bool}, enable_logical_replication: bool, maintenance_window: map{weekdays: [int], start_time: str, end_time: str}, block_public_connections: bool, block_vpc_connections: bool, audit_log_level: str, hipaa: bool, preload_libraries: map{use_defaults: bool, enabled_libraries: [str]}}, pg_version: int, proxy_host: str, branch_logical_size_limit: int(int64), branch_logical_size_limit_bytes: int(int64), store_passwords: bool, maintenance_starts_at: str(date-time), creation_source: str, history_retention_seconds: int(int32), created_at: str(date-time), updated_at: str(date-time), synthetic_storage_size: int(int64), consumption_period_start: str(date-time), consumption_period_end: str(date-time), quota_reset_at: str(date-time), owner_id: str, owner: map{email: str(email), name: str, branches_limit: int, subscription_type: str}, compute_last_active_at: str(date-time), org_id: str, maintenance_scheduled_for: str(date-time), hipaa_enabled_at: str(date-time), effective_project_permission: str?}} # Deleted the specified project\n\n@endpoint POST /projects/{project_id}/recover\n@desc Recover a deleted project\n@returns(200) Returned the recovered project\n\n@endpoint GET /projects/{project_id}/operations\n@desc List operations\n@required {project_id: str # The Neon project ID}\n@optional {cursor: str # Specify the cursor value from the previous response to get the next batch of operations, limit: int # Specify a value from 1 to 1000 to limit number of operations in the response}\n@returns(200) Returned a list of operations\n\n@endpoint GET /projects/{project_id}/permissions\n@desc List project access\n@returns(200) {project_permissions: [map]} # Returned project access details\n\n@endpoint POST /projects/{project_id}/permissions\n@desc Grant project access\n@required {email: str(email) # Email address of the user to grant project access to.}\n@returns(200) {id: str, granted_to_email: str(email), granted_at: str(date-time), revoked_at: str(date-time)} # Granted project access\n\n@endpoint GET /projects/{project_id}/members\n@desc List org members and their project roles\n@optional {cursor: str # A cursor to use in pagination. A cursor defines your place in the data list. Include `response.pagination.next` in subsequent API calls to fetch next page of the list., limit: int # The maximum number of members to return in the response}\n@returns(200) {project_members: [map], pagination: map{next: str, sort_by: str, sort_order: str}} # Returned the org members and their project roles\n\n@endpoint PUT /projects/{project_id}/members/{member_id}/role\n@desc Set an org member's role on a project\n@required {role: str(viewer/editor/admin) # Per-project role. `viewer` maps to `VIEWER`, `editor` maps to `EDITOR`, and `admin` maps to `ADMIN`.}\n@optional {confirm_self_demotion: bool}\n@returns(200) {project_id: str, member_id: str(uuid), user_id: str(uuid), email: str(email), name: str, org_role: str, project_role: str, org_default_project_permission: str, explicit_project_permission: str, effective_project_permission: str, credential_rotation_recommended: bool, org_api_key_rotation_recommended: bool} # Role set or updated\n\n@endpoint DELETE /projects/{project_id}/members/{member_id}/role\n@desc Remove an org member's role on a project\n@optional {confirm_self_lockout: bool}\n@returns(200) {project_id: str, member_id: str(uuid), user_id: str(uuid), email: str(email), name: str, org_role: str, project_role: str, org_default_project_permission: str, explicit_project_permission: str, effective_project_permission: str, credential_rotation_recommended: bool, org_api_key_rotation_recommended: bool} # Role removed, or no-op if no explicit row existed\n\n@endpoint DELETE /projects/{project_id}/permissions/{permission_id}\n@desc Revoke project access\n@returns(200) {id: str, granted_to_email: str(email), granted_at: str(date-time), revoked_at: str(date-time)} # Revoked project access\n\n@endpoint GET /projects/{project_id}/available_preload_libraries\n@desc List available shared preload libraries\n@required {project_id: str}\n@returns(200) {libraries: [map]} # Successfully returned available shared preload libraries\n\n@endpoint POST /projects/{project_id}/transfer_requests\n@desc Create a project transfer request\n@optional {ttl_seconds: int(int64)=86400 # Number of seconds the transfer request stays valid before it expires. Defaults to 86400 (24 hours).}\n@returns(201) {id: str(uuid), project_id: str, created_at: str(date-time), expires_at: str(date-time)} # Project transfer request created successfully\n\n@endpoint PUT /projects/{project_id}/transfer_requests/{request_id}\n@desc Accept a project transfer request\n@optional {org_id: str # The Neon organization ID to transfer the project to. If not provided, the project will be transferred to the current user or organization account.}\n@returns(204) Project transfer request accepted successfully\n@errors {406: Account doesn't satisfy the plan requirements to own the project}\n\n@endpoint GET /projects/{project_id}/jwks\n@desc List JWKS URLs\n@returns(200) {jwks: [map]} # The JWKS URLs available for the project\n\n@endpoint POST /projects/{project_id}/jwks\n@desc Add JWKS URL\n@required {jwks_url: str # URL of the provider's JWKS endpoint used to verify JWTs., provider_name: str # The name of the authentication provider (e.g., Clerk, Stytch, Auth0)}\n@optional {branch_id: str # The Neon branch ID. Returned as `id` from `GET /projects/{project_id}/branches`., jwt_audience: str # Expected `aud` claim in incoming JWTs. When set, tokens with a different audience are rejected; tokens with no audience are still accepted. Omit to skip audience validation., role_names: [str] # Deprecated. The roles the JWKS should be mapped to. By default, the JWKS is mapped to the `authenticator`, `authenticated`, and `anonymous` roles., skip_role_creation: bool=false # Deprecated. Only used with Neon RLS. If true, role creation is skipped.}\n@returns(201) The JWKS URL was added to the project's authentication connections\n\n@endpoint DELETE /projects/{project_id}/jwks/{jwks_id}\n@desc Delete JWKS URL\n@returns(200) {id: str, project_id: str, branch_id: str, jwks_url: str, provider_name: str, created_at: str(date-time), updated_at: str(date-time), jwt_audience: str, role_names: [str]} # Deleted a JWKS URL from the project\n\n@endpoint POST /projects/{project_id}/branches/{branch_id}/data-api/{database_name}\n@desc Create Neon Data API\n@optional {auth_provider: str(neon_auth/external) # Authentication provider for the Neon Data API. `neon_auth`: use Neon's built-in managed authentication (no JWKS configuration required). `external`: use an external JWT provider, which requires `jwks_url`. When omitted, no auth provider is configured (existing setup is kept)., jwks_url: str(uri) # URL of the JWKS endpoint used to verify JWTs for this Data API. Required when configuring JWT-based authentication; omit when using a non-JWT auth provider., provider_name: str # Display name for the authentication provider. Accepted values include \"Clerk\", \"Stytch\", and \"Auth0\", but any non-empty string is valid. Optional field., jwt_audience: str # Expected `aud` claim in incoming JWTs. When set, tokens with a different audience are rejected; tokens with no audience are still accepted. Omit to skip audience validation., add_default_grants: bool=false # Grant all permissions to the tables in the public schema to authenticated users, skip_auth_schema: bool=false # Skip creating the auth schema and RLS functions, settings: map{db_aggregates_enabled: bool, db_anon_role: str, db_extra_search_path: str, db_max_rows: int, db_schemas: [str], jwt_role_claim_key: str, jwt_cache_max_lifetime: int, openapi_mode: str, server_cors_allowed_origins: str, server_timing_enabled: bool} # Configuration settings for the Neon Data API}\n@returns(201) {url: str(uri)} # Creates a new app\n\n@endpoint PATCH /projects/{project_id}/branches/{branch_id}/data-api/{database_name}\n@desc Update Neon Data API\n@optional {settings: map{db_aggregates_enabled: bool, db_anon_role: str, db_extra_search_path: str, db_max_rows: int, db_schemas: [str], jwt_role_claim_key: str, jwt_cache_max_lifetime: int, openapi_mode: str, server_cors_allowed_origins: str, server_timing_enabled: bool} # Configuration settings for the Neon Data API}\n@returns(201) Updated the Neon Data API configuration and refreshed the schema cache\n\n@endpoint DELETE /projects/{project_id}/branches/{branch_id}/data-api/{database_name}\n@desc Delete Neon Data API\n@returns(200) Deleted the Neon Data API for the specified branch\n\n@endpoint GET /projects/{project_id}/branches/{branch_id}/data-api/{database_name}\n@desc Retrieve Neon Data API configuration\n@returns(200) {url: str(uri), status: str, settings: map?, available_schemas: [str]?} # Returns the Neon Data API for the specified branch\n\n@endpoint POST /projects/auth/create\n@desc Create Neon Auth integration\n@required {auth_provider: str(mock/stack/better_auth) # 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_id: str # The Neon project ID. Returned as `id` from `GET /projects`., branch_id: str # The Neon branch ID. Returned as `id` from `GET /projects/{project_id}/branches`.}\n@optional {database_name: str # Name of the database to associate with the Neon Auth integration. When omitted, the integration uses the project's default database., role_name: str # Deprecated. The database role for the auth integration. Omit this field; it is ignored.}\n@returns(201) {auth_provider: str, auth_provider_project_id: str, pub_client_key: str, secret_server_key: str, jwks_url: str, schema_name: str, table_name: str, base_url: str} # Creates Neon Auth integration\n\n@endpoint GET /projects/{project_id}/branches/{branch_id}/auth\n@desc Retrieve Neon Auth details for the branch\n@returns(200) {auth_provider: str, auth_provider_project_id: str, branch_id: str, db_name: str, created_at: str(date-time), owned_by: str, transfer_status: str, jwks_url: str, base_url: str, name: str} # Fetched the details of the Neon Auth integration for the specified branch\n\n@endpoint POST /projects/{project_id}/branches/{branch_id}/auth\n@desc Enable Neon Auth for the branch\n@required {auth_provider: str(mock/stack/better_auth) # 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.}\n@optional {database_name: str # Name of the database to enable Neon Auth on. When omitted, the integration uses the project's default database.}\n@returns(201) {auth_provider: str, auth_provider_project_id: str, pub_client_key: str, secret_server_key: str, jwks_url: str, schema_name: str, table_name: str, base_url: str} # Enables Neon Auth integration for the branch\n\n@endpoint DELETE /projects/{project_id}/branches/{branch_id}/auth\n@desc Disable Neon Auth for the branch\n@optional {delete_data: bool=false # If true, deletes the `neon_auth` schema from the database}\n@returns(200) Delete the integration with the authentication provider\n\n@endpoint GET /projects/{project_id}/auth/domains\n@desc List trusted redirect URI domains\n@returns(200) {domains: [map]} # Returned the domains in the redirect_uri whitelist\n\n@endpoint POST /projects/{project_id}/auth/domains\n@desc Add trusted redirect URI domain\n@required {domain: str(uri) # URI to add to the redirect URI allowlist for the auth provider., auth_provider: str(mock/stack/better_auth) # 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.}\n@returns(201) Added the domain to the redirect_uri whitelist\n\n@endpoint DELETE /projects/{project_id}/auth/domains\n@desc Delete trusted redirect URI domain\n@required {auth_provider: str(mock/stack/better_auth) # 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., domains: [map{domain!: str(uri)}] # Domain names to remove from the redirect URI whitelist for the specified auth provider.}\n@returns(200) Deleted the domain from the redirect_uri whitelist\n\n@endpoint GET /projects/{project_id}/branches/{branch_id}/auth/domains\n@desc List domains in redirect_uri whitelist\n@returns(200) {domains: [map]} # Returned the domains in the redirect_uri whitelist\n\n@endpoint POST /projects/{project_id}/branches/{branch_id}/auth/domains\n@desc Add domain to redirect_uri whitelist\n@required {domain: str(uri) # URI to add to the redirect URI allowlist for the auth provider., auth_provider: str(mock/stack/better_auth) # 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.}\n@returns(201) Added the domain to the redirect_uri whitelist\n\n@endpoint DELETE /projects/{project_id}/branches/{branch_id}/auth/domains\n@desc Delete domain from redirect_uri whitelist\n@required {auth_provider: str(mock/stack/better_auth) # 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., domains: [map{domain!: str(uri)}] # Domain names to remove from the redirect URI whitelist for the specified auth provider.}\n@returns(200) Deleted the domain from the redirect_uri whitelist\n\n@endpoint POST /projects/auth/keys\n@desc Create Auth Provider SDK keys\n@required {project_id: str # The Neon project ID. Returned as `id` from `GET /projects`., auth_provider: str(mock/stack/better_auth) # 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.}\n@returns(201) {auth_provider: str, auth_provider_project_id: str, pub_client_key: str, secret_server_key: str, jwks_url: str, schema_name: str, table_name: str, base_url: str} # Creates Auth Provider SDK keys\n\n@endpoint POST /projects/auth/user\n@desc Create new auth user\n@required {project_id: str # The Neon project ID. Returned as `id` from `GET /projects`., auth_provider: str(mock/stack/better_auth) # 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., email: str(email) # Email address of the new user.}\n@optional {name: str # Display name for the new user. When omitted, the created user has no display name.}\n@returns(201) {id: str} # Creates new user\n\n@endpoint POST /projects/{project_id}/branches/{branch_id}/auth/users\n@desc Create new auth user\n@required {email: str(email) # Email address of the new Neon Auth user to create.}\n@optional {name: str # Display name for the new user. Optional. Pair with the required email field when creating a new user.}\n@returns(201) {id: str} # Creates new user\n\n@endpoint DELETE /projects/{project_id}/branches/{branch_id}/auth/users/{auth_user_id}\n@desc Delete auth user\n@returns(204) Deleted the auth user\n\n@endpoint PUT /projects/{project_id}/branches/{branch_id}/auth/users/{auth_user_id}/role\n@desc Update auth user role\n@required {roles: [str] # Roles to assign to the user in the Neon Auth (Better Auth) directory. `user` and `admin` are the built-in roles; custom role strings are also supported.}\n@returns(200) {id: str} # Updated the auth user role\n\n@endpoint DELETE /projects/{project_id}/auth/users/{auth_user_id}\n@desc Delete auth user\n@required {project_id: str # The Neon project ID, auth_user_id: str # The Neon user ID}\n@returns(204) Deleted the auth user\n\n@endpoint POST /projects/auth/transfer_ownership\n@desc Transfer Neon-managed auth project to your own account\n@required {project_id: str # The Neon project ID. Returned as `id` from `GET /projects`., auth_provider: str(mock/stack/better_auth) # 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.}\n@returns(200) {url: str} # Transfer initiated. Follow the URL to complete the process in your auth provider's UI.\n\n@endpoint GET /projects/{project_id}/auth/integrations\n@desc List active integrations with auth providers\n@required {project_id: str # The Neon project ID}\n@returns(200) {data: [map]} # Return management API keys metadata\n\n@endpoint GET /projects/{project_id}/auth/oauth_providers\n@desc List OAuth providers\n@returns(200) {providers: [map]} # Returns the OAuth providers for the Neon Auth\n\n@endpoint POST /projects/{project_id}/auth/oauth_providers\n@desc Add an OAuth provider\n@required {id: str(google/github/microsoft/vercel)}\n@optional {client_id: str # The client ID issued by the OAuth provider for your application. Used to identify the application during the OAuth flow., client_secret: str # OAuth client secret for the provider., microsoft_tenant_id: str # Tenant ID for the Microsoft OAuth provider. Only relevant when the OAuth provider is Microsoft; omit or leave blank for other providers.}\n@returns(200) {id: str, type: str, client_id: str, client_secret: str} # The OAuth provider has been added to the project\n\n@endpoint GET /projects/{project_id}/branches/{branch_id}/auth/oauth_providers\n@desc List OAuth providers for the branch\n@returns(200) {providers: [map]} # Returns the OAuth providers for the Neon Auth\n\n@endpoint POST /projects/{project_id}/branches/{branch_id}/auth/oauth_providers\n@desc Add an OAuth provider\n@required {id: str(google/github/microsoft/vercel)}\n@optional {client_id: str # The client ID issued by the OAuth provider for your application. Used to identify the application during the OAuth flow., client_secret: str # OAuth client secret for the provider., microsoft_tenant_id: str # Tenant ID for the Microsoft OAuth provider. Only relevant when the OAuth provider is Microsoft; omit or leave blank for other providers.}\n@returns(200) {id: str, type: str, client_id: str, client_secret: str} # The OAuth provider has been added to the project\n\n@endpoint PATCH /projects/{project_id}/auth/oauth_providers/{oauth_provider_id}\n@desc Update OAuth provider\n@optional {client_id: str # The OAuth client ID registered with the provider. Omit to keep the currently configured value., client_secret: str # OAuth client secret for the provider. Omit to leave the existing secret unchanged., microsoft_tenant_id: str # The tenant ID scoping the Microsoft OAuth provider. Supply this field when the provider type is microsoft; it has no effect for other provider types.}\n@returns(200) {id: str, type: str, client_id: str, client_secret: str} # The OAuth provider has been added to the project\n\n@endpoint DELETE /projects/{project_id}/auth/oauth_providers/{oauth_provider_id}\n@desc Delete OAuth provider\n@returns(200) Deleted the OAuth provider from the project\n\n@endpoint PATCH /projects/{project_id}/branches/{branch_id}/auth/oauth_providers/{oauth_provider_id}\n@desc Update OAuth provider\n@optional {client_id: str # The OAuth client ID registered with the provider. Omit to keep the currently configured value., client_secret: str # OAuth client secret for the provider. Omit to leave the existing secret unchanged., microsoft_tenant_id: str # The tenant ID scoping the Microsoft OAuth provider. Supply this field when the provider type is microsoft; it has no effect for other provider types.}\n@returns(200) {id: str, type: str, client_id: str, client_secret: str} # The OAuth provider has been added to the project\n\n@endpoint DELETE /projects/{project_id}/branches/{branch_id}/auth/oauth_providers/{oauth_provider_id}\n@desc Delete OAuth provider\n@returns(200) Deleted the OAuth provider from the project\n\n@endpoint GET /projects/{project_id}/auth/email_server\n@desc Retrieve email server configuration\n@returns(200) Returns the email server configuration for the Neon Auth\n\n@endpoint PATCH /projects/{project_id}/auth/email_server\n@desc Update email server configuration\n@returns(200) The OAuth provider has been added to the project\n\n@endpoint POST /projects/{project_id}/branches/{branch_id}/auth/send_test_email\n@desc Send test email\n@required {host: str # Hostname of the email server., port: int # TCP port of the SMTP server. Common values: 25 (SMTP), 465 (SMTPS), 587 (submission)., username: str # Username for authenticating with the SMTP server., password: str # Password for authenticating with the SMTP server., sender_email: str # Email address used as the From address on outgoing auth emails., sender_name: str # Display name shown as the sender in outgoing emails., recipient_email: str(email) # The email address to send the test email to.}\n@returns(200) {success: bool, error_message: str} # Response with the result of the test email send\n\n@endpoint POST /projects/{project_id}/branches/{branch_id}/auth/email_provider/test\n@desc Send test email using the saved email provider\n@required {recipient_email: str(email) # The email address to send the test email to.}\n@returns(200) {success: bool, error_message: str} # Response with the result of the test email send\n\n@endpoint GET /projects/{project_id}/branches/{branch_id}/auth/email_and_password\n@desc Retrieve email and password configuration\n@returns(200) {enabled: bool, email_verification_method: str, require_email_verification: bool, auto_sign_in_after_verification: bool, send_verification_email_on_sign_up: bool, send_verification_email_on_sign_in: bool, disable_sign_up: bool} # Returns the email and password configuration for Neon Auth\n\n@endpoint PATCH /projects/{project_id}/branches/{branch_id}/auth/email_and_password\n@desc Update email and password configuration\n@optional {enabled: bool # Controls whether email and password authentication is enabled for this project. When omitted from an update request, the current value is unchanged., email_verification_method: str(link/otp) # The email verification method to use. - `link`: Sends a verification link via email - `otp`: Sends a one-time password (OTP) via email, require_email_verification: bool # When true, users must verify their email address before they can sign in. Omitting this field from an update request leaves the current value unchanged., auto_sign_in_after_verification: bool # Whether users are automatically signed in after verifying their email, send_verification_email_on_sign_up: bool # Whether to send a verification email when users sign up., send_verification_email_on_sign_in: bool # Whether to send a verification email when a user with an unverified email signs in., disable_sign_up: bool # Whether to disable new user sign ups. When omitted, the current setting is not changed.}\n@returns(200) {enabled: bool, email_verification_method: str, require_email_verification: bool, auto_sign_in_after_verification: bool, send_verification_email_on_sign_up: bool, send_verification_email_on_sign_in: bool, disable_sign_up: bool} # The email and password configuration has been updated\n\n@endpoint GET /projects/{project_id}/branches/{branch_id}/auth/email_provider\n@desc Retrieve email provider configuration\n@returns(200) Returns the email provider configuration for the Neon Auth\n\n@endpoint PATCH /projects/{project_id}/branches/{branch_id}/auth/email_provider\n@desc Update email provider configuration\n@returns(200) The email provider configuration has been updated\n\n@endpoint DELETE /projects/{project_id}/auth/integration/{auth_provider}\n@desc Delete integration with auth provider\n@required {project_id: str # The Neon project ID, auth_provider: str # The authentication provider name}\n@optional {delete_data: bool=false # If true, deletes the `neon_auth` schema from the database}\n@returns(200) Delete the integration with the authentication provider\n\n@endpoint GET /projects/{project_id}/connection_uri\n@desc Retrieve connection URI\n@required {project_id: str # The Neon project ID, database_name: str # The database name, role_name: str # The role name}\n@optional {branch_id: str # The branch ID. Defaults to your project's default `branch_id` if not specified., endpoint_id: str # The endpoint ID. Defaults to the read-write `endpoint_id` associated with the `branch_id` if not specified., pooled: bool # Adds the `-pooler` option to the connection URI when set to `true`, creating a pooled connection URI.}\n@returns(200) {uri: str} # Returned the connection URI\n\n@endpoint GET /projects/{project_id}/branches/{branch_id}/auth/allow_localhost\n@desc Retrieve localhost allow setting\n@returns(200) {allow_localhost: bool} # The allow localhost configuration\n\n@endpoint PATCH /projects/{project_id}/branches/{branch_id}/auth/allow_localhost\n@desc Update localhost allow setting\n@required {allow_localhost: bool # Whether to allow localhost connections}\n@returns(200) {allow_localhost: bool} # Updated the allow localhost configuration\n\n@endpoint GET /projects/{project_id}/branches/{branch_id}/auth/plugins\n@desc Retrieve Neon Auth plugin configurations\n@returns(200) {organization: map{enabled: bool, organization_limit: int(int32), membership_limit: int(int32), creator_role: str, send_invitation_email: bool}, magic_link: map{enabled: bool, expires_in: int(int32), disable_sign_up: bool}, phone_number: map{enabled: bool, otp_expires_in: int}, email_provider: map, email_and_password: map{enabled: bool, email_verification_method: str, require_email_verification: bool, auto_sign_in_after_verification: bool, send_verification_email_on_sign_up: bool, send_verification_email_on_sign_in: bool, disable_sign_up: bool}, oauth_providers: [map], allow_localhost: bool} # Returns all plugin configurations\n\n@endpoint PATCH /projects/{project_id}/branches/{branch_id}/auth/plugins/organization\n@desc Update organization plugin configuration\n@optional {enabled: bool # Controls whether the organization plugin is active for the organization., organization_limit: int(int32) # Maximum organizations a user can belong to (created or joined). At the limit, the user cannot create or join more., membership_limit: int(int32) # Maximum members per organization., creator_role: str(admin/owner) # Role of the organization's creator. `owner`: full control, including deleting the org and transferring ownership. `admin`: manage members and settings only., send_invitation_email: bool # When true, invited users receive an email containing an accept link. Requires that the invited user has a verified email address.}\n@returns(200) {enabled: bool, organization_limit: int(int32), membership_limit: int(int32), creator_role: str, send_invitation_email: bool} # The organization plugin configuration has been updated\n\n@endpoint PATCH /projects/{project_id}/branches/{branch_id}/auth/config\n@desc Update auth configuration\n@required {name: str # The application name used in auth emails and communications.}\n@returns(200) {name: str} # The auth configuration has been updated\n\n@endpoint PATCH /projects/{project_id}/branches/{branch_id}/auth/plugins/magic-link\n@desc Update magic link plugin configuration\n@optional {enabled: bool # Whether to enable the magic link plugin., expires_in: int(int32) # Minutes until the magic link expires., disable_sign_up: bool # When true, sign-up via magic link is disabled.}\n@returns(200) {enabled: bool, expires_in: int(int32), disable_sign_up: bool} # The magic link plugin configuration has been updated\n\n@endpoint GET /projects/{project_id}/branches/{branch_id}/auth/plugins/phone-number\n@desc Retrieve phone number plugin configuration\n@returns(200) {enabled: bool, otp_expires_in: int} # Returns the phone number plugin configuration\n\n@endpoint PATCH /projects/{project_id}/branches/{branch_id}/auth/plugins/phone-number\n@desc Update phone number plugin configuration\n@optional {enabled: bool # Whether the phone number plugin is enabled., otp_expires_in: int # Time in seconds before the OTP expires}\n@returns(200) {enabled: bool, otp_expires_in: int} # The phone number plugin configuration has been updated\n\n@endpoint GET /projects/{project_id}/branches/{branch_id}/auth/webhooks\n@desc Retrieve Neon Auth webhook configuration\n@returns(200) {enabled: bool, webhook_url: str, enabled_events: [str], timeout_seconds: int} # Returns webhook configuration for Neon Auth\n\n@endpoint PUT /projects/{project_id}/branches/{branch_id}/auth/webhooks\n@desc Update Neon Auth webhook configuration\n@required {enabled: bool # Whether the webhook is active.}\n@optional {webhook_url: str # Destination URL that receives webhook event payloads., enabled_events: [str] # Event types that trigger this webhook. Covers user lifecycle, email/OTP delivery, organization invitations, and phone verification events; see the enum for exact values., timeout_seconds: int=5 # Maximum time, in seconds, to wait for a response from the webhook endpoint.}\n@returns(200) {enabled: bool, webhook_url: str, enabled_events: [str], timeout_seconds: int} # Returns the updated webhook configuration\n\n@endpoint POST /projects/{project_id}/branches\n@desc Create branch\n@returns(201) Created a branch. An endpoint is only created if it was specified in the request.\n@example_request {\"branch\":{\"parent_id\":\"br-aged-salad-637688\",\"name\":\"mybranch\"}}\n\n@endpoint GET /projects/{project_id}/branches\n@desc List branches\n@optional {search: str # Search by branch `name` or `id`. You can specify partial `name` or `id` values to filter results., sort_by: str(name/created_at/updated_at)=updated_at # Sort the branches by sort_field. If not provided, branches will be sorted by updated_at descending order, cursor: str # A cursor to use in pagination. A cursor defines your place in the data list. Include `response.pagination.next` in subsequent API calls to fetch next page of the list., sort_order: str(asc/desc)=desc # Defines the sorting order of entities., limit: int # The maximum number of records to be returned in the response, include_deleted: bool=false # If true, return recoverable deleted branches too (soft-deleted within the recovery window). If false or not provided, return only active (non-deleted) branches.  This parameter is part of the Branch Recovery feature, which is in preview and not available to all users.}\n@returns(200) Returned a list of branches for the specified project\n\n@endpoint POST /projects/{project_id}/branch_anonymized\n@desc Create anonymized branch\n@returns(201) Created a branch. An endpoint is only created if it was specified in the request.\n\n@endpoint GET /projects/{project_id}/branches/count\n@desc Retrieve number of branches\n@optional {search: str # Count branches matching the `name` in search query}\n@returns(200) Returned a count of branches for the specified project\n\n@endpoint GET /projects/{project_id}/branches/{branch_id}\n@desc Retrieve branch details\n@returns(200) Returned information about the specified branch\n\n@endpoint DELETE /projects/{project_id}/branches/{branch_id}\n@desc Delete branch\n@returns(200) Deleted the specified branch\n@returns(204) Returned if the branch doesn't exist or has already been deleted\n\n@endpoint PATCH /projects/{project_id}/branches/{branch_id}\n@desc Update branch\n@required {branch: map{name: str, protected: bool, expires_at: str(date-time)} # Branch attributes to update. Supply only the fields you want to change, for example `name` or `protected`.}\n@returns(200) Updated the specified branch\n@example_request {\"branch\":{\"name\":\"mybranch\"}}\n\n@endpoint POST /projects/{project_id}/branches/{branch_id}/restore\n@desc Restore branch to a historical state\n@required {project_id: str # The Neon project ID, branch_id: str # The branch ID, source_branch_id: str # The `branch_id` of the restore source branch. If `source_timestamp` and `source_lsn` are omitted, the branch will be restored to head. If `source_branch_id` is equal to the branch's id, `source_timestamp` or `source_lsn` is required.}\n@optional {source_lsn: str # A Postgres LSN (for example, `0/1A2B3C4`) on the source branch to restore from. Mutually exclusive with `source_timestamp`. Omit both to restore to head., source_timestamp: str(date-time) # A point in time on the source branch to restore from, in RFC 3339 format. When omitted alongside `source_lsn`, the branch is restored to the latest available state of the source branch., preserve_under_name: str # Name under which to save the current branch state before restoring. Required when the branch has children or when `source_branch_id` equals the branch being restored; in those cases all existing child branches are moved to the newly created branch. If omitted and not required, the previous state is not preserved.}\n@returns(200) Updated the specified branch\n\n@endpoint GET /projects/{project_id}/branches/{branch_id}/schema\n@desc Retrieve database schema\n@required {project_id: str # The Neon project ID, branch_id: str # The branch ID, db_name: str # Name of the database for which the schema is retrieved}\n@optional {lsn: str # The Log Sequence Number (LSN) for which the schema is retrieved, timestamp: str(date-time) # The point in time for which the schema is retrieved, format: str # The format of the schema to retrieve. Possible values: - `sql` (default) - `json`}\n@returns(200) {sql: str, json: map{tables: [map]}} # Schema definition\n\n@endpoint GET /projects/{project_id}/branches/{branch_id}/compare_schema\n@desc Compare database schema\n@required {project_id: str # The Neon project ID, branch_id: str # The branch ID, db_name: str # Name of the database for which the schema is retrieved}\n@optional {base_branch_id: str # The branch ID to compare the schema with, lsn: str # The Log Sequence Number (LSN) for which the schema is retrieved, timestamp: str(date-time) # The point in time for which the schema is retrieved, base_lsn: str # The Log Sequence Number (LSN) for the base branch schema, base_timestamp: str(date-time) # The point in time for the base branch schema}\n@returns(200) {diff: str} # Difference between the schemas\n\n@endpoint GET /projects/{project_id}/branches/{branch_id}/masking_rules\n@desc Retrieve masking rules\n@returns(200) {masking_rules: [map]} # Masking rules retrieved successfully\n\n@endpoint PATCH /projects/{project_id}/branches/{branch_id}/masking_rules\n@desc Update masking rules\n@required {masking_rules: [map{database_name!: str, schema_name!: str, table_name!: str, column_name!: str, masking_function: str, masking_value: str}] # List of masking rules to apply to the branch. This will replace all existing masking rules for the branch.}\n@returns(200) {masking_rules: [map]} # Masking rules updated successfully\n\n@endpoint GET /projects/{project_id}/branches/{branch_id}/anonymized_status\n@desc Retrieve anonymized branch status\n@returns(200) {project_id: str, branch_id: str, state: str, status_message: str, created_at: str(date-time), updated_at: str(date-time), failed_at: str(date-time), last_run: map{started_at: str(date-time), completed_at: str(date-time), triggered_by: str(uuid), triggered_by_username: str, masked_columns: int}} # Anonymized branch status retrieved successfully\n\n@endpoint POST /projects/{project_id}/branches/{branch_id}/anonymize\n@desc Start anonymization\n@returns(200) {project_id: str, branch_id: str, state: str, status_message: str, created_at: str(date-time), updated_at: str(date-time), failed_at: str(date-time), last_run: map{started_at: str(date-time), completed_at: str(date-time), triggered_by: str(uuid), triggered_by_username: str, masked_columns: int}} # Anonymization started successfully\n\n@endpoint POST /projects/{project_id}/branches/{branch_id}/set_as_default\n@desc Set branch as default\n@returns(200) Updated the specified branch\n\n@endpoint POST /projects/{project_id}/branches/{branch_id}/finalize_restore\n@desc Finalize branch restore from snapshot\n@optional {name: str # Name for the replaced branch. If omitted, a unique name is generated.}\n@returns(200) {operations: [map]} # OK\n\n@endpoint GET /projects/{project_id}/branches/{branch_id}/endpoints\n@desc List branch endpoints\n@returns(200) {endpoints: [map]} # Returned a list of endpoints for the specified branch\n\n@endpoint GET /projects/{project_id}/branches/{branch_id}/databases\n@desc List databases\n@returns(200) {databases: [map]} # Returned a list of databases of the specified branch\n\n@endpoint POST /projects/{project_id}/branches/{branch_id}/databases\n@desc Create database\n@required {database: map{name!: str, owner_name!: str} # Configuration for the new Postgres database.}\n@returns(201) Created a database in the specified branch\n@example_request {\"database\":{\"name\":\"mydb\",\"owner_name\":\"casey\"}}\n\n@endpoint GET /projects/{project_id}/branches/{branch_id}/databases/{database_name}\n@desc Retrieve database details\n@returns(200) {database: map{id: int(int64), branch_id: str, name: str, owner_name: str, created_at: str(date-time), updated_at: str(date-time)}} # Returned the database details\n\n@endpoint PATCH /projects/{project_id}/branches/{branch_id}/databases/{database_name}\n@desc Update database\n@required {database: map{name: str, owner_name: str} # Properties to update on the database.}\n@returns(200) Updated the database\n@example_request {\"database\":{\"name\":\"mydb\",\"owner_name\":\"sally\"}}\n\n@endpoint DELETE /projects/{project_id}/branches/{branch_id}/databases/{database_name}\n@desc Delete database\n@returns(200) Deleted the specified database\n@returns(204) Returned if the database doesn't exist or has already been deleted\n\n@endpoint GET /projects/{project_id}/branches/{branch_id}/roles\n@desc List roles\n@returns(200) {roles: [map]} # Returned a list of roles from the specified branch.\n\n@endpoint POST /projects/{project_id}/branches/{branch_id}/roles\n@desc Create role\n@required {role: map{name!: str, no_login: bool} # Properties of the role to create.}\n@returns(201) Created a role in the specified branch\n@example_request {\"role\":{\"name\":\"sally\"}}\n\n@endpoint GET /projects/{project_id}/branches/{branch_id}/roles/{role_name}\n@desc Retrieve role details\n@returns(200) {role: map{branch_id: str, name: str, password: str, protected: bool, authentication_method: str, created_at: str(date-time), updated_at: str(date-time)}} # Returned details for the specified role\n\n@endpoint DELETE /projects/{project_id}/branches/{branch_id}/roles/{role_name}\n@desc Delete role\n@returns(200) Deleted the specified role from the branch\n@returns(204) Returned if the role doesn't exist or has already been deleted\n\n@endpoint GET /projects/{project_id}/branches/{branch_id}/roles/{role_name}/reveal_password\n@desc Retrieve role password\n@returns(200) {password: str} # Returned password for the specified role\n@errors {404: Role not found, 412: Storing passwords is disabled}\n\n@endpoint POST /projects/{project_id}/branches/{branch_id}/roles/{role_name}/reset_password\n@desc Reset role password\n@returns(200) Reset the password for the specified role\n\n@endpoint GET /projects/{project_id}/vpc_endpoints\n@desc List VPC endpoint restrictions\n@returns(200) {endpoints: [map]} # Returned VPC endpoint restrictions for the specified project\n\n@endpoint POST /projects/{project_id}/vpc_endpoints/{vpc_endpoint_id}\n@desc Set VPC endpoint restriction\n@required {label: str # Human-readable name for the VPC endpoint assignment, used to identify it within the organization.}\n@returns(200) Configured the specified VPC endpoint as a restriction for the specified project.\n\n@endpoint DELETE /projects/{project_id}/vpc_endpoints/{vpc_endpoint_id}\n@desc Delete VPC endpoint restriction\n@returns(200) Removed the VPC endpoint restriction from the specified Neon project\n\n@endpoint POST /projects/{project_id}/endpoints\n@desc Create compute endpoint\n@required {endpoint: map{branch_id!: str, region_id: str, type!: str, settings: map, autoscaling_limit_min_cu: num, autoscaling_limit_max_cu: num, provisioner: str, pooler_enabled: bool, pooler_mode: str, disabled: bool, passwordless_access: bool, suspend_timeout_seconds: int(int64), name: str} # Configuration for the compute endpoint to create.}\n@returns(201) Created a compute endpoint\n@example_request {\"endpoint\":{\"branch_id\":\"br-floral-mountain-251143\",\"type\":\"read_write\"}}\n\n@endpoint GET /projects/{project_id}/endpoints\n@desc List compute endpoints\n@returns(200) {endpoints: [map]} # Returned a list of endpoints for the specified project\n\n@endpoint GET /projects/{project_id}/endpoints/{endpoint_id}\n@desc Retrieve compute endpoint details\n@returns(200) {endpoint: map{host: str, id: str, name: str, project_id: str, branch_id: str, autoscaling_limit_min_cu: num, autoscaling_limit_max_cu: num, region_id: str, type: str, current_state: str, pending_state: str, settings: map{pg_settings: map, pgbouncer_settings: map, preload_libraries: map{use_defaults: bool, enabled_libraries: [str]}}, pooler_enabled: bool, pooler_mode: str, disabled: bool, passwordless_access: bool, last_active: str(date-time), creation_source: str, created_at: str(date-time), updated_at: str(date-time), started_at: str(date-time), suspended_at: str(date-time), proxy_host: str, suspend_timeout_seconds: int(int64), provisioner: str, compute_release_version: str}} # Returned information about the specified endpoint\n\n@endpoint DELETE /projects/{project_id}/endpoints/{endpoint_id}\n@desc Delete compute endpoint\n@returns(200) Deleted the specified compute endpoint\n@returns(204) Returned if the endpoint doesn't exist or has already been deleted\n\n@endpoint PATCH /projects/{project_id}/endpoints/{endpoint_id}\n@desc Update compute endpoint\n@required {endpoint: map{branch_id: str, autoscaling_limit_min_cu: num, autoscaling_limit_max_cu: num, provisioner: str, settings: map, pooler_enabled: bool, pooler_mode: str, disabled: bool, passwordless_access: bool, suspend_timeout_seconds: int(int64), name: str} # Parameters for the compute endpoint update.}\n@returns(200) Updated the specified compute endpoint\n@example_request {\"endpoint\":{\"suspend_timeout_seconds\":300}}\n\n@endpoint POST /projects/{project_id}/endpoints/{endpoint_id}/start\n@desc Start compute endpoint\n@required {project_id: str # The Neon project ID, endpoint_id: str # The endpoint ID}\n@returns(200) Started the specified compute endpoint\n\n@endpoint POST /projects/{project_id}/endpoints/{endpoint_id}/suspend\n@desc Suspend compute endpoint\n@returns(200) Suspended the specified endpoint\n\n@endpoint POST /projects/{project_id}/endpoints/{endpoint_id}/restart\n@desc Restart compute endpoint\n@returns(200) Restarted endpoint\n\n@endgroup\n\n@group consumption_history\n@endpoint GET /consumption_history/projects\n@desc Retrieve project consumption metrics (legacy plans)\n@required {from: str(date-time) # Specify the start `date-time` for the consumption period. The `date-time` value is rounded according to the specified `granularity`. For example, `2024-03-15T15:30:00Z` for `daily` granularity will be rounded to `2024-03-15T00:00:00Z`. The specified `date-time` value must respect the specified `granularity`: - For `hourly`, consumption metrics are limited to the last 168 hours. - For `daily`, consumption metrics are limited to the last 60 days. - For `monthly`, consumption metrics are limited to the last year.  The consumption history is available starting from `March 1, 2024, at 00:00:00 UTC`., to: str(date-time) # Specify the end `date-time` for the consumption period. The `date-time` value is rounded according to the specified granularity. For example, `2024-03-15T15:30:00Z` for `daily` granularity will be rounded to `2024-03-15T00:00:00Z`. The specified `date-time` value must respect the specified `granularity`: - For `hourly`, consumption metrics are limited to the last 168 hours. - For `daily`, consumption metrics are limited to the last 60 days. - For `monthly`, consumption metrics are limited to the last year., granularity: str # Specify the granularity of consumption metrics. Hourly, daily, and monthly metrics are available for the last 168 hours, 60 days, and 1 year, respectively.}\n@optional {cursor: str # Specify the cursor value from the previous response to get the next batch of projects., limit: int=10 # Specify a value from 1 to 100 to limit number of projects in the response., project_ids: [str] # Specify a list of project IDs to filter the response. If omitted, the response will contain all projects. A list of project IDs can be specified as an array of parameter values or as a comma-separated list in a single parameter value. - As an array of parameter values: `project_ids=cold-poetry-09157238%20&project_ids=quiet-snow-71788278` - As a comma-separated list in a single parameter value: `project_ids=cold-poetry-09157238,quiet-snow-71788278`, org_id: str # Specify the organization for which the project consumption metrics should be returned. If this parameter is not provided, the endpoint will return the metrics for the authenticated user's projects., include_v1_metrics: bool # The field is deprecated. Please use `metrics` instead. If `metrics` is specified, this field is ignored. Include metrics utilized in previous pricing models. - **data_storage_bytes_hour**: The sum of the maximum observed storage values for each hour,   which never decreases., metrics: [str] # Specify a list of metrics to include in the response. If omitted, active_time, compute_time, written_data, synthetic_storage_size are returned. Possible values: - `active_time_seconds` - `compute_time_seconds` - `written_data_bytes` - `synthetic_storage_size_bytes` - `data_storage_bytes_hour` - `logical_size_bytes` - `logical_size_bytes_hour`  A list of metrics can be specified as an array of parameter values or as a comma-separated list in a single parameter value. - As an array of parameter values: `metrics=cpu_seconds&metrics=ram_bytes` - As a comma-separated list in a single parameter value: `metrics=cpu_seconds,ram_bytes`}\n@returns(200) Returned project consumption metrics for the Neon account\n@errors {403: This endpoint is not available. It is only supported with Scale, Business, and Enterprise plan accounts., 404: Account is not a member of the organization specified by `org_id`., 406: The specified `date-time` range is outside the boundaries of the specified `granularity`. Adjust your `from` and `to` values or select a different `granularity`., 429: Too many requests}\n\n@endpoint GET /consumption_history/v2/projects\n@desc Retrieve project consumption metrics\n@required {from: str(date-time) # Specify the start `date-time` for the consumption period. The `date-time` value is rounded according to the specified `granularity`. For example, `2024-03-15T15:30:00Z` for `daily` granularity will be rounded to `2024-03-15T00:00:00Z`. The specified `date-time` value must respect the specified `granularity`: - For `hourly`, consumption metrics are limited to the last 168 hours. - For `daily`, consumption metrics are limited to the last 60 days. - For `monthly`, consumption metrics are limited to the last year.  The earliest allowed `from` value is `March 1, 2024, at 00:00:00 UTC`. Metrics are returned from when the account upgraded to an eligible plan, which may be later than that date., to: str(date-time) # Specify the end `date-time` for the consumption period. The `date-time` value is rounded according to the specified `granularity`. For example, `2024-03-15T15:30:00Z` for `daily` granularity will be rounded to `2024-03-15T00:00:00Z`. The specified `date-time` value must respect the specified `granularity`: - For `hourly`, consumption metrics are limited to the last 168 hours. - For `daily`, consumption metrics are limited to the last 60 days. - For `monthly`, consumption metrics are limited to the last year., granularity: str # Specify the granularity of consumption metrics. Hourly, daily, and monthly metrics are available for the last 168 hours, 60 days, and 1 year, respectively., org_id: str # Organization ID. Metrics are returned for projects in this organization., metrics: [str] # Required. List the metrics to return. Supported values: - `compute_unit_seconds` - `root_branch_bytes_month` - `child_branch_bytes_month` - `instant_restore_bytes_month` - `public_network_transfer_bytes` - `private_network_transfer_bytes` - `extra_branches_month` - `snapshot_storage_bytes_month`  Pass multiple values as repeated query parameters or a comma-separated list: - `metrics=compute_unit_seconds&metrics=extra_branches_month` - `metrics=compute_unit_seconds,extra_branches_month`}\n@optional {cursor: str # Cursor from the previous response (`pagination.cursor`). Pass it to fetch the next page of projects. Pages are ordered by project creation order (newest first)., limit: int=10 # Maximum number of projects per page. Allowed range: 1 to 100. Default: 10., project_ids: [str] # Optional project IDs to filter the response (up to 100). If omitted, projects in the organization are included across pages (use `cursor` and `limit`).  Pass multiple IDs as repeated query parameters or a comma-separated list: - `project_ids=cold-poetry-09157238&project_ids=quiet-snow-71788278` - `project_ids=cold-poetry-09157238,quiet-snow-71788278`}\n@returns(200) Project consumption metrics for the Neon account.\n@errors {403: Not available for this account. Project consumption history requires a Launch, Scale, Agent, Business, or Enterprise plan., 404: Account is not a member of the organization specified by `org_id`., 406: The `from` and `to` range is not valid for the selected `granularity`. Adjust the range or choose a different granularity., 429: Too many requests}\n\n@endpoint GET /consumption_history/v2/branches\n@desc Retrieve branch consumption metrics\n@required {project_ids: [str] # Project IDs to include (required, 1 to 100). Returns metrics for branches in these projects.  Pass multiple IDs as repeated query parameters or a comma-separated list: - `project_ids=cold-poetry-09157238&project_ids=quiet-snow-71788278` - `project_ids=cold-poetry-09157238,quiet-snow-71788278`, from: str(date-time) # Specify the start `date-time` for the consumption period. The `date-time` value is rounded according to the specified `granularity`. For example, `2024-03-15T15:30:00Z` for `daily` granularity will be rounded to `2024-03-15T00:00:00Z`. The specified `date-time` value must respect the specified `granularity`: - For `hourly`, consumption metrics are limited to the last 168 hours. - For `daily`, consumption metrics are limited to the last 60 days. - For `monthly`, consumption metrics are limited to the last year.  Branch-level metrics are returned from when the account first ingests branch-level consumption data. Periods before that time contain no branch metrics., to: str(date-time) # Specify the end `date-time` for the consumption period. The `date-time` value is rounded according to the specified `granularity`. For example, `2024-03-15T15:30:00Z` for `daily` granularity will be rounded to `2024-03-15T00:00:00Z`. The specified `date-time` value must respect the specified `granularity`: - For `hourly`, consumption metrics are limited to the last 168 hours. - For `daily`, consumption metrics are limited to the last 60 days. - For `monthly`, consumption metrics are limited to the last year., granularity: str # Specify the granularity of consumption metrics. Hourly, daily, and monthly metrics are available for the last 168 hours, 60 days, and 1 year, respectively., org_id: str # Organization ID. Metrics are returned for projects in this organization., metrics: [str] # Required. List the metrics to return. Only these values are supported: - `compute_unit_seconds` - `root_branch_bytes_month` - `child_branch_bytes_month` - `instant_restore_bytes_month` - `public_network_transfer_bytes` - `private_network_transfer_bytes`  Not supported on this endpoint: `extra_branches_month`, `snapshot_storage_bytes_month`. Use `GET /consumption_history/v2/projects` for those.  Pass multiple values as repeated query parameters or a comma-separated list: - `metrics=compute_unit_seconds&metrics=public_network_transfer_bytes` - `metrics=compute_unit_seconds,public_network_transfer_bytes`}\n@optional {cursor: str # Cursor from the previous response (`pagination.cursor`). Pass it to fetch the next page of branches. Pages are ordered by project ID, then branch ID., limit: int=100 # Maximum number of branches per page. Allowed range: 1 to 1000. Default: 100., branch_ids: [str] # Optional branch IDs to filter the response (up to 100). If omitted, all branches in the listed projects are included.  Pass multiple IDs as repeated query parameters or a comma-separated list: - `branch_ids=br-aged-salad-637688&branch_ids=br-sweet-breeze-497520` - `branch_ids=br-aged-salad-637688,br-sweet-breeze-497520`}\n@returns(200) Branch consumption metrics for the Neon account.\n@errors {403: Not available for this account. Branch consumption history requires a paid usage-based Launch, Scale, Agent, or Enterprise plan., 404: Account is not a member of the organization specified by `org_id`., 406: The `from` and `to` range is not valid for the selected `granularity`. Adjust the range or choose a different granularity., 429: Too many requests}\n\n@endgroup\n\n@group organizations\n@endpoint GET /organizations/{org_id}\n@desc Retrieve organization details\n@returns(200) {id: str, name: str, handle: str, plan: str, created_at: str(date-time), managed_by: str, updated_at: str(date-time), allow_hipaa_projects: bool, require_mfa: bool} # Returned information about the organization\n\n@endpoint GET /organizations/{org_id}/api_keys\n@desc List organization API keys\n@returns(200) Returned the API keys for the specified organization\n\n@endpoint POST /organizations/{org_id}/api_keys\n@desc Create organization API key\n@returns(200) Created an organization API key\n@example_request {\"key_name\":\"orgkey\"}\n\n@endpoint DELETE /organizations/{org_id}/api_keys/{key_id}\n@desc Revoke organization API key\n@required {key_id: int(int64) # The API key ID}\n@returns(200) Revoked the specified organization API key\n\n@endpoint GET /organizations/{org_id}/billing/spending_limit\n@desc Retrieve organization spending limit\n@returns(200) {spending_limit_cents: int(int64)?} # The organization's current spending limit.\n\n@endpoint PUT /organizations/{org_id}/billing/spending_limit\n@desc Set organization spending limit\n@required {spending_limit_cents: int(int64) # Monthly spending cap in cents. Must be positive. To remove a previously configured limit, send a DELETE request to the spending_limit endpoint — `0` and `null` are rejected here. The cap is alert-only: notifications fire at 80% and 100%, but computes are not suspended. Setting a cap below the period's already-accrued spend is permitted and will trigger the over-limit notification on the next worker run.}\n@returns(200) {spending_limit_cents: int(int64)?} # The updated spending limit value.\n\n@endpoint DELETE /organizations/{org_id}/billing/spending_limit\n@desc Remove organization spending limit\n@returns(200) The spending limit has been cleared.\n\n@endpoint GET /organizations/{org_id}/members\n@desc List organization members\n@optional {sort_by: str(email/role/joined_at)=joined_at # Sort the members by the specified field. Defaults to `joined_at`., cursor: str # A cursor to use in pagination. A cursor defines your place in the data list. Include `response.pagination.next` in subsequent API calls to fetch next page of the list., sort_order: str(asc/desc)=desc # Defines the sorting order of entities., limit: int # The maximum number of members to return in the response}\n@returns(200) Returned information about organization members\n\n@endpoint GET /organizations/{org_id}/members/{member_id}\n@desc Retrieve organization member details\n@returns(200) {id: str(uuid), user_id: str(uuid), org_id: str, role: str, joined_at: str(date-time)} # Returned information about the organization member\n\n@endpoint PATCH /organizations/{org_id}/members/{member_id}\n@desc Update role for organization member\n@required {role: str(admin/member/editor/viewer/collaborator) # Organization member's role. `admin`: full administrative access. `editor` (and its legacy alias `member`): standard access governed by project permissions. `viewer` and `collaborator`: additional scoped project roles. Some values may not be available for all organizations.}\n@returns(200) {id: str(uuid), user_id: str(uuid), org_id: str, role: str, joined_at: str(date-time)} # The updated organization member\n@example_request {\"role\":\"member\"}\n\n@endpoint DELETE /organizations/{org_id}/members/{member_id}\n@desc Remove organization member\n@returns(200) Removed organization member\n\n@endpoint GET /organizations/{org_id}/invitations\n@desc List organization invitations\n@returns(200) {invitations: [map]} # Returned information about the organization invitations\n\n@endpoint POST /organizations/{org_id}/invitations\n@desc Create organization invitations\n@required {invitations: [map{email!: str(email), role!: str}] # Invitations to create for the organization.}\n@returns(200) {invitations: [map]} # The created organization invitation\n@example_request {\"invitations\":[{\"email\":\"invited-user@email.com\",\"role\":\"member\"}]}\n\n@endpoint POST /organizations/{source_org_id}/projects/transfer\n@desc Transfer projects between organizations\n@required {destination_org_id: str # The destination organization identifier, project_ids: [str] # The list of projects ids to transfer. Maximum of 400 project ids}\n@returns(200) Projects successfully transferred from organization to organization\n@errors {406: Transfer failed. The target organization has too many projects or an incompatible plan. Reduce projects or upgrade the target organization., 422: Transfer failed. Projects with active integrations (for example, GitHub or Vercel) cannot be transferred.}\n\n@endpoint GET /organizations/{org_id}/vpc/vpc_endpoints\n@desc List VPC endpoints across all regions\n@returns(200) {endpoints: [any]} # The list of configured VPC endpoint IDs for the specified organization across all regions\n\n@endpoint GET /organizations/{org_id}/vpc/region/{region_id}/vpc_endpoints\n@desc List VPC endpoints\n@returns(200) {endpoints: [map]} # The list of configured VPC endpoint IDs for the specified organization\n\n@endpoint GET /organizations/{org_id}/vpc/region/{region_id}/vpc_endpoints/{vpc_endpoint_id}\n@desc Retrieve VPC endpoint details\n@returns(200) {vpc_endpoint_id: str, label: str, state: str, num_restricted_projects: int, example_restricted_projects: [str]} # Returned the current status and configuration details of the specified VPC endpoint.\n\n@endpoint POST /organizations/{org_id}/vpc/region/{region_id}/vpc_endpoints/{vpc_endpoint_id}\n@desc Assign or update VPC endpoint\n@required {label: str # Human-readable name for the VPC endpoint assignment, used to identify it within the organization.}\n@returns(200) Assigned the VPC endpoint to the specified Neon organization\n\n@endpoint DELETE /organizations/{org_id}/vpc/region/{region_id}/vpc_endpoints/{vpc_endpoint_id}\n@desc Delete VPC endpoint\n@returns(200) Deleted the VPC endpoint from the specified Neon organization\n\n@endgroup\n\n@group regions\n@endpoint GET /regions\n@desc List supported regions\n@optional {org_id: str # Organization ID. When provided, returns only regions available to this organization. Recommended for accurate region availability.}\n@returns(200) {regions: [map]} # The list of active regions\n\n@endgroup\n\n@group users\n@endpoint GET /users/me\n@desc Retrieve current user details\n@returns(200) {active_seconds_limit: int(int64), billing_account: map{state: str, payment_source: map{type: str, card: map{last4: str, brand: str, exp_month: int(int64), exp_year: int(int64)}}, subscription_type: str, payment_method: str, quota_reset_at_last: str(date-time), name: str, email: str(email), address_city: str, address_country: str, address_country_name: str, address_line1: str, address_line2: str, address_postal_code: str, address_state: str, orb_portal_url: str, tax_id: str, tax_id_type: str, plan_details: map{name: str, version: map{major: int, minor: int}}, spending_limit_cents: int(int64)?}, auth_accounts: [map], email: str(email), id: str, image: str, login: str, name: str, last_name: str, projects_limit: int(int64), branches_limit: int(int64), max_autoscaling_limit: num(double), compute_seconds_limit: int(int64), plan: str} # Returned information about the current user\n\n@endpoint GET /users/me/organizations\n@desc List organizations for the current user\n@returns(200) {organizations: [map]} # Returned information about the current user organizations\n\n@endpoint POST /users/me/projects/transfer\n@desc Transfer projects from personal account to organization\n@required {destination_org_id: str # The destination organization identifier, project_ids: [str] # The list of projects ids to transfer. Maximum of 400 project ids}\n@returns(200) Projects successfully transferred from personal account to organization\n@errors {406: Transfer failed. The target organization has too many projects or an incompatible plan. Reduce projects or upgrade the target organization., 422: Transfer failed. Projects with active integrations (for example, GitHub or Vercel) cannot be transferred.}\n\n@endgroup\n\n@group auth\n@endpoint GET /auth\n@desc Retrieve request authentication details\n@returns(200) {account_id: str, auth_method: str, auth_data: str} # Returned auth information about the current auth entity\n\n@endgroup\n\n@group projects\n@endpoint POST /projects/{project_id}/branches/{branch_id}/snapshot\n@desc Create snapshot\n@optional {lsn: str # The target Log Sequence Number (LSN) to take the snapshot from. Must fall within the restore window. Cannot be used with `timestamp`, timestamp: str # The target timestamp for the snapshot. Must fall within the restore window. RFC 3339 format. Cannot be used with `lsn`., name: str # A name for the snapshot., expires_at: str # The time at which the snapshot will be automatically deleted. RFC 3339 format.}\n@returns(200) {snapshot: map{id: str, name: str, lsn: str, timestamp: str, source_branch_id: str, created_at: str, expires_at: str, manual: bool, full_size: int(int64), diff_size: int(int64)}, operations: [map]} # Successfully created the snapshot\n\n@endpoint GET /projects/{project_id}/snapshots\n@desc List project snapshots\n@returns(200) {snapshots: [map]} # Projects snapshots\n\n@endpoint DELETE /projects/{project_id}/snapshots/{snapshot_id}\n@desc Delete snapshot\n@returns(202) {operations: [map]} # OK\n\n@endpoint PATCH /projects/{project_id}/snapshots/{snapshot_id}\n@desc Update snapshot\n@required {snapshot: map{name: str, expires_at: str(date-time)} # Fields to update on the snapshot. Updatable fields include `name` and `expires_at`.}\n@returns(200) {snapshot: map{id: str, name: str, lsn: str, timestamp: str, source_branch_id: str, created_at: str, expires_at: str, manual: bool, full_size: int(int64), diff_size: int(int64)}} # Successfully updated the snapshot\n\n@endpoint POST /projects/{project_id}/snapshots/{snapshot_id}/restore\n@desc Restore snapshot\n@optional {name: str # Deprecated. Use the `name` field in the request body instead. Removal scheduled for November 29, 2025. A name for the newly restored branch. If omitted, a default name will be generated., name: str # A name for the newly restored branch. If not provided, the server generates a unique name for the branch automatically., target_branch_id: str # ID of the branch to restore the snapshot into. Defaults to the snapshot's source branch (`snapshot.source_branch_id`); fails if that cannot be determined., finalize_restore: bool=false # Set to `true` to finalize the restore operation immediately. This will complete the restore and move any associated computes to the new branch, similar to the `finalizeRestoreBranch` operation. Defaults to `false` to allow previewing the restored snapshot data first.}\n@returns(200) Branch restored from snapshot and its operations.\n\n@endpoint GET /projects/{project_id}/branches/{branch_id}/backup_schedule\n@desc Retrieve backup schedule\n@returns(200) {schedule: [map]} # Schedule of frequencies to create snapshots\n\n@endpoint PUT /projects/{project_id}/branches/{branch_id}/backup_schedule\n@desc Update backup schedule\n@required {schedule: [map{frequency!: str, hour: int, day: int, month: int, retention_seconds: int}] # List of schedule entries defining the backup frequency. At least one entry is required.}\n@returns(200) Empty response\n\n@endpoint POST /projects/{project_id}/branches/{branch_id}/buckets\n@desc Create a bucket on the branch\n@required {name: str # The bucket name.}\n@optional {access_level: str(private/public_read)=private # Access level for the bucket. Defaults to `private`. Set to `public_read` to allow anonymous `GetObject`/`HeadObject` on objects in this bucket.}\n@returns(201) {bucket: map{name: str, access_level: str, created_at: str(date-time)}} # Bucket created\n@errors {410: The project has been deleted}\n\n@endpoint GET /projects/{project_id}/branches/{branch_id}/buckets\n@desc List buckets on the branch\n@returns(200) {buckets: [map]} # The list of buckets\n\n@endpoint DELETE /projects/{project_id}/branches/{branch_id}/buckets/{bucket_name}\n@desc Delete a bucket on the branch\n@returns(204) Bucket deleted\n@errors {404: Bucket not found}\n\n@endpoint GET /projects/{project_id}/branches/{branch_id}/storage\n@desc Get branch object storage state\n@returns(200) {enabled: bool, s3_endpoint: str(uri), region: str, force_path_style: bool} # Object storage is enabled for this branch\n@errors {404: Object storage is not enabled for this branch, or the project/branch was not found. The body is always `BranchStorageNotEnabled` — see `reason` for the exact cause.}\n\n@endpoint GET /projects/{project_id}/branches/{branch_id}/ai_gateway\n@desc Get branch AI Gateway endpoint\n@returns(200) {enabled: bool, base_url: str(uri)} # AI Gateway is enabled for this branch\n@errors {404: AI Gateway is not available for this branch, or the project/branch was not found. The body is always `BranchAiGatewayNotEnabled` — see `reason` for the exact cause.}\n\n@endpoint POST /projects/{project_id}/branches/{branch_id}/logs/query\n@desc Query branch logs\n@optional {since: any # Length of the query window, ending at `end_time` or at the current time when `end_time` is omitted. Mutually exclusive with `start_time`. Prefer this over computing absolute bounds when the caller only means \"the last hour\"., start_time: str(date-time) # Inclusive beginning of the query window. Mutually exclusive with `since`. Defaults to one hour before `end_time`, or one hour before the current time when both bounds are omitted., end_time: str(date-time) # Exclusive end of the query window. Defaults to the current time., limit: int=100 # Maximum number of log records to return per page., cursor: str # Opaque pagination cursor returned as `next_cursor` by a previous call. Resume the query after the last record of the previous page, repeating the time range and every filter unchanged., sort_order: str(asc/desc)=desc # Order matching records by timestamp. `desc`, the default, returns the newest records first., source: str(function/storage/pg_endpoint) # The Neon service that emitted the log record., service_name: str # Match the OpenTelemetry `service.name` resource attribute exactly., scope_name: str # Match the OpenTelemetry instrumentation scope name exactly., minimum_severity: str(trace/debug/info/warn/error/fatal) # An OpenTelemetry severity level. A minimum severity includes every higher level in this order: `trace`, `debug`, `info`, `warn`, `error`, `fatal`., severity_text: str # Match the OpenTelemetry severity text exactly., body_contains: str # Match records whose rendered `message` contains this case-sensitive substring.  Records with a structured body are matched against their JSON rendering, so the substring meets JSON syntax rather than prose: a bare key name such as `operation` matches every record carrying that key, and `http_status: 200` matches none, because the rendering contains `\"http_status\":200` with no space., trace_id: str # Match records associated with this OpenTelemetry trace ID. W3C Trace Context defines a trace ID as 32 lowercase hex digits, and that is what is stored, so an uppercase value is rejected rather than silently matching nothing., logql: str # Escape hatch for selections the structured filters cannot express: a raw LogQL expression, evaluated against this branch's log stream.  Only stream selectors and line filters are accepted — no aggregations and no parser stages. Supplying this alongside any structured filter is rejected with `conflicting_filters` rather than silently ignoring one of them. `limit`, `sort_order`, and the time window still apply.  This field passes the underlying query language through to the caller, so unlike the rest of this contract it may change as that backend changes. Prefer the structured filters where they suffice.}\n@returns(200) {logs: [map], next_cursor: str, is_truncated: bool} # Logs matching the supplied filters\n@errors {400: The query could not be served as written. The body is always `ProjectBranchLogsInvalidQuery` — see `reason` for the exact cause., 404: Logs are not available for this branch, or the project/branch was not found. The body is always `ProjectBranchLogsNotAvailable` — see `reason` for the exact cause.}\n\n@endpoint GET /projects/{project_id}/branches/{branch_id}/logs/fields\n@desc List branch log fields\n@returns(200) {fields: [str]} # Log fields available for value discovery on this branch\n@errors {404: Logs are not available for this branch, or the project/branch was not found. The body is always `ProjectBranchLogsNotAvailable` — see `reason` for the exact cause.}\n\n@endpoint GET /projects/{project_id}/branches/{branch_id}/logs/fields/{field_name}/values\n@desc List branch log field values\n@optional {since: str # Length of the lookup window, ending at `end_time` or at the current time when `end_time` is omitted. Mutually exclusive with `start_time`. Defaults to six hours., start_time: str(date-time) # Inclusive beginning of the lookup window. Mutually exclusive with `since`., end_time: str(date-time) # Exclusive end of the lookup window. Defaults to the current time., source: str # Only consider records emitted by this Neon service., limit: int=100 # Maximum number of distinct values to return. The response sets `is_truncated` when this bound, or the server's own scan cap, cut the list short.}\n@returns(200) {values: [str], is_truncated: bool} # Distinct values for the requested log field\n@errors {400: The lookup could not be served as written. The body is always `ProjectBranchLogsInvalidQuery` — see `reason` for the exact cause., 404: Logs are not available for this branch, or the project/branch was not found. The body is always `ProjectBranchLogsNotAvailable` — see `reason` for the exact cause.}\n\n@endpoint GET /projects/{project_id}/branches/{branch_id}/buckets/{bucket_name}/objects\n@desc List objects in a bucket\n@optional {prefix: str # Only list objects whose key starts with this prefix., delimiter: str # Collapse keys sharing a common prefix up to the first occurrence of this delimiter (typically `/`) into the `folders` array., cursor: str # Opaque pagination cursor returned as `next_cursor` by a previous call. Resume listing after the last item of the previous page., limit: int(int32)=1000 # Maximum number of items (objects + folders) to return.}\n@returns(200) {folders: [str], objects: [map], prefix: str, next_cursor: str, is_truncated: bool} # The list of objects and folders\n\n@endpoint DELETE /projects/{project_id}/branches/{branch_id}/buckets/{bucket_name}/objects/{object_key}\n@desc Delete an object in a bucket\n@returns(204) Object deleted\n@errors {404: Object not found}\n\n@endpoint GET /projects/{project_id}/branches/{branch_id}/buckets/{bucket_name}/objects/{object_key}/download\n@desc Download an object's bytes\n@returns(200) The object's raw bytes, streamed verbatim. `Content-Length` and `ETag` headers are set from the stored object metadata; `X-Content-Type-Options` and `Content-Disposition` harden the browser against the caller-controlled bytes.\n@errors {404: Object not found}\n\n@endpoint DELETE /projects/{project_id}/branches/{branch_id}/buckets/{bucket_name}/objects-by-prefix\n@desc Delete every object under a key prefix (folder) in a bucket\n@required {prefix: str # The key prefix (folder) to delete. Must be non-empty and end with `/`. Every object on this branch whose key starts with this prefix is soft-deleted.}\n@returns(200) {deleted: int(int64)} # The prefix was soft-deleted. `deleted` is the number of objects tombstoned (may be 0 when nothing live matched on this branch).\n@errors {404: Bucket not found}\n\n@endpoint POST /projects/{project_id}/branches/{branch_id}/buckets/{bucket_name}/objects/{object_key}/presign\n@desc Presign an upload or download for an object in a bucket\n@required {operation: str(upload/download) # The transfer direction. `upload` returns a presigned `PUT` URL; `download` returns a presigned `GET` URL.}\n@optional {content_type: str # The `Content-Type` to bind into the signed request. Only meaningful for `upload`: when set, the caller MUST send the same `Content-Type` header on the `PUT`, and the value is echoed back in the response `headers`. Ignored for `download`., expires_in_seconds: int(int64)=900 # How long the presigned URL stays valid, in seconds. Defaults to 900 (15 minutes); capped at 604800 (7 days).}\n@returns(200) {url: str, method: str, headers: map, expires_at: str(date-time)} # A presigned URL valid until `expires_at`. The caller transfers the object bytes by issuing `method url` with the returned `headers`.\n@errors {404: Bucket or branch not found}\n\n@endpoint POST /projects/{project_id}/branches/{branch_id}/credentials\n@desc Issue a scoped credential on the branch\n@required {scopes: [str], principal_type: str # Principal type for the credential. Only `user` is customer-managed and accepted here. `function` and `system` credentials are platform-internal (e.g. function-serve auto-mint, presign signer) and are never issued through the customer-facing API.}\n@optional {name: str # Free-form customer label for the credential.}\n@returns(201) {token_id: str, token_id_short: str, name: str, api_token: str, s3_secret_access_key: str, scopes: [str], branch_id: str, created_at: str(date-time), expires_at: str(date-time)} # Credential issued — secrets shown once.\n\n@endpoint GET /projects/{project_id}/branches/{branch_id}/credentials\n@desc List credentials on the branch\n@returns(200) {credentials: [map]} # The list of credentials\n\n@endpoint DELETE /projects/{project_id}/branches/{branch_id}/credentials/{token_id}\n@desc Revoke a credential\n@returns(204) Credential revoked\n@errors {404: Credential not found}\n\n@endpoint POST /projects/{project_id}/branches/{branch_id}/credentials/{token_id}/reveal\n@desc Reveal a credential's secrets\n@returns(200) {token_id: str, api_token: str, s3_secret_access_key: str} # The credential's live secrets.\n@errors {404: Credential not found, 409: The credential exists but has no recoverable secret because it was issued before secret retrieval was supported. Rotate the credential to obtain a recoverable secret.}\n\n@endpoint POST /projects/{project_id}/branches/{branch_id}/credentials/{token_id}/rotate\n@desc Rotate a credential's secrets\n@returns(200) {token_id: str, token_id_short: str, name: str, api_token: str, s3_secret_access_key: str, scopes: [str], branch_id: str, principal_type: str, created_at: str(date-time), expires_at: str(date-time)} # Credential rotated — new secrets shown once.\n\n@endpoint GET /projects/{project_id}/branches/{branch_id}/functions\n@desc List functions on the branch\n@optional {cursor: str # A cursor to use in pagination. A cursor defines your place in the data list. Include `response.pagination.next` in subsequent API calls to fetch next page of the list., limit: int # Specify a value from 1 to 1000 to limit number of functions in the response}\n@returns(200) The list of functions\n\n@endpoint GET /projects/{project_id}/branches/{branch_id}/functions/{slug}\n@desc Get function details\n@returns(200) {function: map{id: str, slug: str, name: str, invocation_url: str, current_deployment: any, active_deployment: any, created_at: str}} # The function details\n\n@endpoint PATCH /projects/{project_id}/branches/{branch_id}/functions/{slug}\n@desc Update a function\n@required {name: str # New display name for the function. `null` clears the display name; the function's `name` then falls back to its slug. Leading and trailing whitespace is trimmed; a whitespace-only name is rejected.}\n@returns(200) {function: map{id: str, slug: str, name: str, invocation_url: str, current_deployment: any, active_deployment: any, created_at: str}} # The updated function\n\n@endpoint DELETE /projects/{project_id}/branches/{branch_id}/functions/{slug}\n@desc Delete a function on the branch\n@returns(204) Function deleted\n\n@endpoint POST /projects/{project_id}/branches/{branch_id}/functions/{slug}/deployments\n@desc Deploy code to a function\n@returns(201) {deployment: map{id: int(int32), status: str, memory_mib: int(int32), runtime: str, created_at: str, environment: [str], error: str}} # The created deployment\n\n@endpoint GET /projects/{project_id}/branches/{branch_id}/triggers\n@desc List triggers on the branch\n@returns(200) {triggers: [map]} # The branch-effective trigger list\n\n@endpoint POST /projects/{project_id}/branches/{branch_id}/triggers\n@desc Create a trigger\n@returns(201) {trigger: map} # Trigger created\n\n@endpoint GET /projects/{project_id}/branches/{branch_id}/triggers/{trigger_id}\n@desc Get a trigger\n@returns(200) {trigger: map} # The trigger\n\n@endpoint PATCH /projects/{project_id}/branches/{branch_id}/triggers/{trigger_id}\n@desc Update a trigger\n@returns(200) {trigger: map} # The updated trigger\n\n@endpoint DELETE /projects/{project_id}/branches/{branch_id}/triggers/{trigger_id}\n@desc Delete a trigger\n@returns(204) Trigger deleted\n\n@endpoint POST /projects/{project_id}/branches/{branch_id}/custom-domains\n@desc Register a custom domain on a branch\n@required {domain: str # The custom domain to register (for example `dashboard.acme.com`). Case-insensitive; normalized to lowercase (a trailing root dot is stripped, so the 254-char bound admits a fully-qualified name whose normalized form is 253 chars). Neon-managed and internal hostnames are rejected., entity_type: str # The kind of branch entity to point the domain at. v1 supports only `function`; any other value is rejected with `invalid_entity_type`., entity_id: str # The target entity's identifier within the branch. For `function` this is the function slug (which must already exist on the branch).}\n@returns(201) {domain: str, entity_type: str, entity_id: str, cname_target: str, status: str, dns_status: str, binding_status: str, status_reason: str} # The registered custom domain\n\n@endpoint GET /projects/{project_id}/branches/{branch_id}/custom-domains\n@desc List the custom domains on a branch\n@optional {cursor: str # A cursor to use in pagination. A cursor defines your place in the data list. Include `response.pagination.next` in subsequent API calls to fetch next page of the list., limit: int # Specify a value from 1 to 1000 to limit number of domains in the response}\n@returns(200) The list of custom domains\n\n@endpoint DELETE /projects/{project_id}/branches/{branch_id}/custom-domains/{domain}\n@desc Delete a custom domain from a branch\n@returns(204) Custom domain deleted\n\n@endgroup\n\n@end\n"}