Organizations
An organization groups projects under shared billing, access control, and API keys. Organizations have two roles: Admin (full control over the org and its projects) and Member (access to all projects, but cannot modify org settings).
Use these endpoints from automation that manages team membership, handles invitations, or configures org-level infrastructure. Direct project operations (creating branches, querying databases) use the project-level endpoints regardless of whether the project belongs to an org.
Some endpoints require the admin role. Member-level tokens can read org state but cannot modify members or billing settings.
You can also list your organizations from the CLI with neon orgs.
See Organizations for full role permissions and plan limits.
API Reference / Organizations / Assign or update VPC endpoint
POST /organizations//vpc/region//vpc_endpoints/
Section titled “POST /organizations//vpc/region//vpc_endpoints/”Assigns a VPC endpoint to a Neon organization or updates its existing assignment.
Parameters
Section titled “Parameters”-
org_id(string, path, required) The Neon organization ID -
region_id(string, path, required) The Neon region ID. Azure regions are currently not supported. -
vpc_endpoint_id(string, path, required) The VPC endpoint ID
Request body
Section titled “Request body”label(string, required) Human-readable name for the VPC endpoint assignment, used to identify it within the organization.
Response (200)
Section titled “Response (200)”Assigned the VPC endpoint to the specified Neon organization
Code examples
Section titled “Code examples”curl "https://console.neon.tech/api/v2/organizations/$ORG_ID/vpc/region/$REGION_ID/vpc_endpoints/$VPC_ENDPOINT_ID" \
-X POST \
-H "Authorization: Bearer $NEON_API_KEY"import { createNeonClient, raw } from '@neon/sdk';
const neon = createNeonClient({ apiKey: process.env.NEON_API_KEY });
const { data } = await raw.assignOrganizationVpcEndpoint({
client: neon.client,
path: {
org_id: process.env.ORG_ID,
region_id: process.env.REGION_ID,
vpc_endpoint_id: process.env.VPC_ENDPOINT_ID
}
});# neonctl
neon vpc endpoint assign <vpc_endpoint_id> --org-id <id> --region-id <region_id>Errors
Section titled “Errors”default General Error.
The request may or may not be safe to retry, depending on the HTTP method, response status code, and whether a response was received.
- If no response is returned from the API, a network error or timeout likely occurred.
- In some cases, the request may have reached the server and been successfully processed, but the response failed to reach the client. As a result, retrying non-idempotent requests can lead to unintended results.
The following HTTP methods are considered non-idempotent: POST, PATCH, DELETE, and PUT. Retrying these methods is generally not safe.
The following methods are considered idempotent: GET, HEAD, and OPTIONS. Retrying these methods is safe in the event of a network error or timeout.
Any request that returns a 503 Service Unavailable response is always safe to retry.
Any request that returns a 423 Locked response is safe to retry. 423 Locked indicates that the resource is temporarily locked, for example, due to another operation in progress.
-
request_id(string, optional) Unique identifier for the request, useful for debugging. You can set this value manually by including anX-Request-IDheader in the request. If not provided, the value will be generated automatically. -
code(string, required) Machine-readable code classifying the error type. Seemessagefor a human-readable explanation. Default: `` -
message(string, required) Error message
API Reference / Organizations / Create organization API key
POST /organizations//api_keys
Section titled “POST /organizations//api_keys”Creates an API key for the specified organization.
The key_name is a user-specified name for the key.
Returns an id and key; the key is a randomly generated, 64-bit token required to access the Neon API.
Store the key securely — it is only returned once.
API keys can also be managed in the Neon Console.
See Manage API keys.
Parameters
Section titled “Parameters”org_id(string, path, required) The Neon organization ID
Request body
Section titled “Request body”key_name(string, required) A user-specified API key name. This value is required when creating an API key.project_id(string, optional) If set, the API key can access only this project
{
"key_name": "orgkey"
}Response (200)
Section titled “Response (200)”{
"id": 1000000,
"key": "napi_examplekey000000000000000000000000000000000000000000000000",
"name": "service-key-55",
"created_at": "2025-01-15T10:30:00Z",
"created_by": "00000000-0000-0000-0000-000000000000"
}Code examples
Section titled “Code examples”curl "https://console.neon.tech/api/v2/organizations/$ORG_ID/api_keys" \
-X POST \
-H "Authorization: Bearer $NEON_API_KEY" \
-H "Content-Type: application/json" \
-d '{"key_name":"orgkey"}'import { createNeonClient, raw } from '@neon/sdk';
const neon = createNeonClient({ apiKey: process.env.NEON_API_KEY });
const { data } = await raw.createOrgApiKey({
client: neon.client,
path: {
org_id: process.env.ORG_ID
},
body: {
key_name: "orgkey"
}
});# neonctl
neon api-keys createConsole
Section titled “Console”Console path: Organization → Settings → API keys
Errors
Section titled “Errors”default General Error.
The request may or may not be safe to retry, depending on the HTTP method, response status code, and whether a response was received.
- If no response is returned from the API, a network error or timeout likely occurred.
- In some cases, the request may have reached the server and been successfully processed, but the response failed to reach the client. As a result, retrying non-idempotent requests can lead to unintended results.
The following HTTP methods are considered non-idempotent: POST, PATCH, DELETE, and PUT. Retrying these methods is generally not safe.
The following methods are considered idempotent: GET, HEAD, and OPTIONS. Retrying these methods is safe in the event of a network error or timeout.
Any request that returns a 503 Service Unavailable response is always safe to retry.
Any request that returns a 423 Locked response is safe to retry. 423 Locked indicates that the resource is temporarily locked, for example, due to another operation in progress.
-
request_id(string, optional) Unique identifier for the request, useful for debugging. You can set this value manually by including anX-Request-IDheader in the request. If not provided, the value will be generated automatically. -
code(string, required) Machine-readable code classifying the error type. Seemessagefor a human-readable explanation. Default: `` -
message(string, required) Error message
API Reference / Organizations / Create organization invitations
POST /organizations//invitations
Section titled “POST /organizations//invitations”Creates invitations for a specific organization. If the invited user has an existing account, they automatically join as a member. If they don't yet have an account, they are invited to create one, after which they become a member. Each invited user receives an email notification.
Parameters
Section titled “Parameters”org_id(string, path, required) The Neon organization ID
Request body
Section titled “Request body”invitations(array, required) Invitations to create for the organization.email(string, required, format: email) Email address of the person to invite to the organization.role(string, required) Organization member's role.admin: full administrative access.editor(and its legacy aliasmember): standard access governed by project permissions.viewerandcollaborator: additional scoped project roles. Some values may not be available for all organizations. Possible values:admin,member,editor,viewer,collaborator
{
"invitations": [
{
"email": "invited-user@email.com",
"role": "member"
}
]
}Response (200)
Section titled “Response (200)”invitations(array, optional) List of pending invitations for the organization.id(string, required, format: uuid) The invitation ID.email(string, required, format: email) Email of the invited userorg_id(string, required) Organization id as it is stored in Neoninvited_by(string, required, format: uuid) UUID for the user_id who extended the invitationinvited_at(string, required, format: date-time) Timestamp when the invitation was createdrole(string, required) Organization member's role.admin: full administrative access.editor(and its legacy aliasmember): standard access governed by project permissions.viewerandcollaborator: additional scoped project roles. Some values may not be available for all organizations. Possible values:admin,member,editor,viewer,collaborator
Code examples
Section titled “Code examples”curl "https://console.neon.tech/api/v2/organizations/$ORG_ID/invitations" \
-X POST \
-H "Authorization: Bearer $NEON_API_KEY" \
-H "Content-Type: application/json" \
-d '{"invitations":[{"email":"invited-user@email.com","role":"member"}]}'import { createNeonClient, raw } from '@neon/sdk';
const neon = createNeonClient({ apiKey: process.env.NEON_API_KEY });
const { data } = await raw.createOrganizationInvitations({
client: neon.client,
path: {
org_id: process.env.ORG_ID
},
body: {
invitations: [
{
email: "invited-user@email.com",
role: "member"
}
]
}
});Console
Section titled “Console”Console path: Organization → People
Errors
Section titled “Errors”default General Error.
The request may or may not be safe to retry, depending on the HTTP method, response status code, and whether a response was received.
- If no response is returned from the API, a network error or timeout likely occurred.
- In some cases, the request may have reached the server and been successfully processed, but the response failed to reach the client. As a result, retrying non-idempotent requests can lead to unintended results.
The following HTTP methods are considered non-idempotent: POST, PATCH, DELETE, and PUT. Retrying these methods is generally not safe.
The following methods are considered idempotent: GET, HEAD, and OPTIONS. Retrying these methods is safe in the event of a network error or timeout.
Any request that returns a 503 Service Unavailable response is always safe to retry.
Any request that returns a 423 Locked response is safe to retry. 423 Locked indicates that the resource is temporarily locked, for example, due to another operation in progress.
-
request_id(string, optional) Unique identifier for the request, useful for debugging. You can set this value manually by including anX-Request-IDheader in the request. If not provided, the value will be generated automatically. -
code(string, required) Machine-readable code classifying the error type. Seemessagefor a human-readable explanation. Default: `` -
message(string, required) Error message
API Reference / Organizations / Delete VPC endpoint
DELETE /organizations//vpc/region//vpc_endpoints/
Section titled “DELETE /organizations//vpc/region//vpc_endpoints/”Deletes the VPC endpoint from the specified Neon organization. If you delete a VPC endpoint from a Neon organization, that VPC endpoint cannot be added back to the Neon organization.
Parameters
Section titled “Parameters”-
org_id(string, path, required) The Neon organization ID -
region_id(string, path, required) The Neon region ID. Azure regions are currently not supported. -
vpc_endpoint_id(string, path, required) The VPC endpoint ID
Response (200)
Section titled “Response (200)”Deleted the VPC endpoint from the specified Neon organization
Code examples
Section titled “Code examples”curl "https://console.neon.tech/api/v2/organizations/$ORG_ID/vpc/region/$REGION_ID/vpc_endpoints/$VPC_ENDPOINT_ID" \
-X DELETE \
-H "Authorization: Bearer $NEON_API_KEY"import { createNeonClient, raw } from '@neon/sdk';
const neon = createNeonClient({ apiKey: process.env.NEON_API_KEY });
const { data } = await raw.deleteOrganizationVpcEndpoint({
client: neon.client,
path: {
org_id: process.env.ORG_ID,
region_id: process.env.REGION_ID,
vpc_endpoint_id: process.env.VPC_ENDPOINT_ID
}
});# neonctl
neon vpc endpoint remove <vpc_endpoint_id> --org-id <id> --region-id <region_id>Errors
Section titled “Errors”default General Error.
The request may or may not be safe to retry, depending on the HTTP method, response status code, and whether a response was received.
- If no response is returned from the API, a network error or timeout likely occurred.
- In some cases, the request may have reached the server and been successfully processed, but the response failed to reach the client. As a result, retrying non-idempotent requests can lead to unintended results.
The following HTTP methods are considered non-idempotent: POST, PATCH, DELETE, and PUT. Retrying these methods is generally not safe.
The following methods are considered idempotent: GET, HEAD, and OPTIONS. Retrying these methods is safe in the event of a network error or timeout.
Any request that returns a 503 Service Unavailable response is always safe to retry.
Any request that returns a 423 Locked response is safe to retry. 423 Locked indicates that the resource is temporarily locked, for example, due to another operation in progress.
-
request_id(string, optional) Unique identifier for the request, useful for debugging. You can set this value manually by including anX-Request-IDheader in the request. If not provided, the value will be generated automatically. -
code(string, required) Machine-readable code classifying the error type. Seemessagefor a human-readable explanation. Default: `` -
message(string, required) Error message
API Reference / Organizations / List organization API keys
GET /organizations//api_keys
Section titled “GET /organizations//api_keys”Retrieves the API keys for the specified organization. The response does not include API key tokens. A token is only provided when creating an API key. API keys can also be managed in the Neon Console. For more information, see Manage API keys.
Parameters
Section titled “Parameters”org_id(string, path, required) The Neon organization ID
Response (200)
Section titled “Response (200)”[
{
"id": 1000000,
"name": "production-backend",
"created_at": "2025-01-15T10:30:00Z",
"created_by": {
"id": "00000000-0000-0000-0000-000000000000",
"name": "Jane Doe",
"image": "https://example.com/avatar.png"
},
"last_used_at": null,
"last_used_from_addr": ""
},
{
"id": 1000001,
"name": "ci-cd-pipeline",
"created_at": "2025-01-15T10:30:00Z",
"created_by": {
"id": "00000000-0000-0000-0000-000000000000",
"name": "Jane Doe",
"image": "https://example.com/avatar.png"
},
"last_used_at": null,
"last_used_from_addr": ""
},
{
"id": 1000002,
"name": "local-development",
"created_at": "2025-01-15T11:00:00Z",
"created_by": {
"id": "00000000-0000-0000-0000-000000000000",
"name": "Jane Doe",
"image": "https://example.com/avatar.png"
},
"last_used_at": null,
"last_used_from_addr": ""
}
]Code examples
Section titled “Code examples”curl "https://console.neon.tech/api/v2/organizations/$ORG_ID/api_keys" \
-H "Authorization: Bearer $NEON_API_KEY"import { createNeonClient, raw } from '@neon/sdk';
const neon = createNeonClient({ apiKey: process.env.NEON_API_KEY });
const { data } = await raw.listOrgApiKeys({
client: neon.client,
path: {
org_id: process.env.ORG_ID
}
});# neonctl
neon api-keys listConsole
Section titled “Console”Console path: Organization → Settings → API keys
Errors
Section titled “Errors”default General Error.
The request may or may not be safe to retry, depending on the HTTP method, response status code, and whether a response was received.
- If no response is returned from the API, a network error or timeout likely occurred.
- In some cases, the request may have reached the server and been successfully processed, but the response failed to reach the client. As a result, retrying non-idempotent requests can lead to unintended results.
The following HTTP methods are considered non-idempotent: POST, PATCH, DELETE, and PUT. Retrying these methods is generally not safe.
The following methods are considered idempotent: GET, HEAD, and OPTIONS. Retrying these methods is safe in the event of a network error or timeout.
Any request that returns a 503 Service Unavailable response is always safe to retry.
Any request that returns a 423 Locked response is safe to retry. 423 Locked indicates that the resource is temporarily locked, for example, due to another operation in progress.
-
request_id(string, optional) Unique identifier for the request, useful for debugging. You can set this value manually by including anX-Request-IDheader in the request. If not provided, the value will be generated automatically. -
code(string, required) Machine-readable code classifying the error type. Seemessagefor a human-readable explanation. Default: `` -
message(string, required) Error message
API Reference / Organizations / List organization invitations
GET /organizations//invitations
Section titled “GET /organizations//invitations”Retrieves pending and accepted invitations for the specified organization.
Parameters
Section titled “Parameters”org_id(string, path, required) The Neon organization ID
Response (200)
Section titled “Response (200)”{
"invitations": []
}Code examples
Section titled “Code examples”curl "https://console.neon.tech/api/v2/organizations/$ORG_ID/invitations" \
-H "Authorization: Bearer $NEON_API_KEY"import { createNeonClient, raw } from '@neon/sdk';
const neon = createNeonClient({ apiKey: process.env.NEON_API_KEY });
const { data } = await raw.getOrganizationInvitations({
client: neon.client,
path: {
org_id: process.env.ORG_ID
}
});Console
Section titled “Console”Console path: Organization → People → Pending invites
Errors
Section titled “Errors”default General Error.
The request may or may not be safe to retry, depending on the HTTP method, response status code, and whether a response was received.
- If no response is returned from the API, a network error or timeout likely occurred.
- In some cases, the request may have reached the server and been successfully processed, but the response failed to reach the client. As a result, retrying non-idempotent requests can lead to unintended results.
The following HTTP methods are considered non-idempotent: POST, PATCH, DELETE, and PUT. Retrying these methods is generally not safe.
The following methods are considered idempotent: GET, HEAD, and OPTIONS. Retrying these methods is safe in the event of a network error or timeout.
Any request that returns a 503 Service Unavailable response is always safe to retry.
Any request that returns a 423 Locked response is safe to retry. 423 Locked indicates that the resource is temporarily locked, for example, due to another operation in progress.
-
request_id(string, optional) Unique identifier for the request, useful for debugging. You can set this value manually by including anX-Request-IDheader in the request. If not provided, the value will be generated automatically. -
code(string, required) Machine-readable code classifying the error type. Seemessagefor a human-readable explanation. Default: `` -
message(string, required) Error message
API Reference / Organizations / List organization members
GET /organizations//members
Section titled “GET /organizations//members”Retrieves a paginated list of members for the specified organization.
Parameters
Section titled “Parameters”org_id(string, path, required) The Neon organization IDsort_by(string, query, optional) Sort the members by the specified field. Defaults tojoined_at. Default:joined_atcursor(string, query, optional) A cursor to use in pagination. A cursor defines your place in the data list. Includeresponse.pagination.nextin subsequent API calls to fetch next page of the list.sort_order(string, query, optional) Defines the sorting order of entities. Default:desclimit(integer, query, optional) The maximum number of members to return in the response
Response (200)
Section titled “Response (200)”{
"members": [
{
"member": {
"id": "00000000-0000-0000-0000-000000000000",
"user_id": "00000000-0000-0000-0000-000000000000",
"org_id": "org-spring-garden-12345",
"role": "member",
"joined_at": "2025-01-15T10:30:00Z"
},
"user": {
"email": "alex@example.com",
"has_mfa": false
}
},
{
"member": {
"id": "00000000-0000-0000-0000-000000000000",
"user_id": "00000000-0000-0000-0000-000000000000",
"org_id": "org-spring-garden-12345",
"role": "admin",
"joined_at": "2025-01-15T11:00:00Z"
},
"user": {
"email": "jane.doe@example.com",
"has_mfa": false
}
}
],
"pagination": {
"sort_by": "joined_at",
"sort_order": "desc"
}
}Code examples
Section titled “Code examples”curl "https://console.neon.tech/api/v2/organizations/$ORG_ID/members" \
-H "Authorization: Bearer $NEON_API_KEY"import { createNeonClient, raw } from '@neon/sdk';
const neon = createNeonClient({ apiKey: process.env.NEON_API_KEY });
const { data } = await raw.getOrganizationMembers({
client: neon.client,
path: {
org_id: process.env.ORG_ID
}
});Console
Section titled “Console”Console path: Organization → People → Members
Errors
Section titled “Errors”default General Error.
The request may or may not be safe to retry, depending on the HTTP method, response status code, and whether a response was received.
- If no response is returned from the API, a network error or timeout likely occurred.
- In some cases, the request may have reached the server and been successfully processed, but the response failed to reach the client. As a result, retrying non-idempotent requests can lead to unintended results.
The following HTTP methods are considered non-idempotent: POST, PATCH, DELETE, and PUT. Retrying these methods is generally not safe.
The following methods are considered idempotent: GET, HEAD, and OPTIONS. Retrying these methods is safe in the event of a network error or timeout.
Any request that returns a 503 Service Unavailable response is always safe to retry.
Any request that returns a 423 Locked response is safe to retry. 423 Locked indicates that the resource is temporarily locked, for example, due to another operation in progress.
-
request_id(string, optional) Unique identifier for the request, useful for debugging. You can set this value manually by including anX-Request-IDheader in the request. If not provided, the value will be generated automatically. -
code(string, required) Machine-readable code classifying the error type. Seemessagefor a human-readable explanation. Default: `` -
message(string, required) Error message
API Reference / Organizations / List VPC endpoints
GET /organizations//vpc/region//vpc_endpoints
Section titled “GET /organizations//vpc/region//vpc_endpoints”Retrieves the list of VPC endpoints for the specified Neon organization.
Parameters
Section titled “Parameters”org_id(string, path, required) The Neon organization IDregion_id(string, path, required) The Neon region ID
Response (200)
Section titled “Response (200)”{
"endpoints": []
}Code examples
Section titled “Code examples”curl "https://console.neon.tech/api/v2/organizations/$ORG_ID/vpc/region/$REGION_ID/vpc_endpoints" \
-H "Authorization: Bearer $NEON_API_KEY"import { createNeonClient, raw } from '@neon/sdk';
const neon = createNeonClient({ apiKey: process.env.NEON_API_KEY });
const { data } = await raw.listOrganizationVpcEndpoints({
client: neon.client,
path: {
org_id: process.env.ORG_ID,
region_id: process.env.REGION_ID
}
});# neonctl
neon vpc endpoint list --org-id <id> --region-id <region_id>Console
Section titled “Console”Console path: Organization → Settings → Private Networking
Errors
Section titled “Errors”default General Error.
The request may or may not be safe to retry, depending on the HTTP method, response status code, and whether a response was received.
- If no response is returned from the API, a network error or timeout likely occurred.
- In some cases, the request may have reached the server and been successfully processed, but the response failed to reach the client. As a result, retrying non-idempotent requests can lead to unintended results.
The following HTTP methods are considered non-idempotent: POST, PATCH, DELETE, and PUT. Retrying these methods is generally not safe.
The following methods are considered idempotent: GET, HEAD, and OPTIONS. Retrying these methods is safe in the event of a network error or timeout.
Any request that returns a 503 Service Unavailable response is always safe to retry.
Any request that returns a 423 Locked response is safe to retry. 423 Locked indicates that the resource is temporarily locked, for example, due to another operation in progress.
-
request_id(string, optional) Unique identifier for the request, useful for debugging. You can set this value manually by including anX-Request-IDheader in the request. If not provided, the value will be generated automatically. -
code(string, required) Machine-readable code classifying the error type. Seemessagefor a human-readable explanation. Default: `` -
message(string, required) Error message
API Reference / Organizations / List VPC endpoints across all regions
GET /organizations//vpc/vpc_endpoints
Section titled “GET /organizations//vpc/vpc_endpoints”Retrieves the list of VPC endpoints for the specified Neon organization across all regions.
Parameters
Section titled “Parameters”org_id(string, path, required) The Neon organization ID
Response (200)
Section titled “Response (200)”{
"endpoints": []
}Code examples
Section titled “Code examples”curl "https://console.neon.tech/api/v2/organizations/$ORG_ID/vpc/vpc_endpoints" \
-H "Authorization: Bearer $NEON_API_KEY"import { createNeonClient, raw } from '@neon/sdk';
const neon = createNeonClient({ apiKey: process.env.NEON_API_KEY });
const { data } = await raw.listOrganizationVpcEndpointsAllRegions({
client: neon.client,
path: {
org_id: process.env.ORG_ID
}
});Console
Section titled “Console”Console path: Organization → Settings → Private Networking
Errors
Section titled “Errors”default General Error.
The request may or may not be safe to retry, depending on the HTTP method, response status code, and whether a response was received.
- If no response is returned from the API, a network error or timeout likely occurred.
- In some cases, the request may have reached the server and been successfully processed, but the response failed to reach the client. As a result, retrying non-idempotent requests can lead to unintended results.
The following HTTP methods are considered non-idempotent: POST, PATCH, DELETE, and PUT. Retrying these methods is generally not safe.
The following methods are considered idempotent: GET, HEAD, and OPTIONS. Retrying these methods is safe in the event of a network error or timeout.
Any request that returns a 503 Service Unavailable response is always safe to retry.
Any request that returns a 423 Locked response is safe to retry. 423 Locked indicates that the resource is temporarily locked, for example, due to another operation in progress.
-
request_id(string, optional) Unique identifier for the request, useful for debugging. You can set this value manually by including anX-Request-IDheader in the request. If not provided, the value will be generated automatically. -
code(string, required) Machine-readable code classifying the error type. Seemessagefor a human-readable explanation. Default: `` -
message(string, required) Error message
API Reference / Organizations / Remove organization member
DELETE /organizations//members/
Section titled “DELETE /organizations//members/”Removes the specified member from the organization. Only organization admins can perform this action. The last admin in an organization cannot be removed.
Parameters
Section titled “Parameters”org_id(string, path, required) The Neon organization IDmember_id(string, path, required) The Neon organization member ID
Response (200)
Section titled “Response (200)”Code examples
Section titled “Code examples”curl "https://console.neon.tech/api/v2/organizations/$ORG_ID/members/$MEMBER_ID" \
-X DELETE \
-H "Authorization: Bearer $NEON_API_KEY"import { createNeonClient, raw } from '@neon/sdk';
const neon = createNeonClient({ apiKey: process.env.NEON_API_KEY });
const { data } = await raw.removeOrganizationMember({
client: neon.client,
path: {
org_id: process.env.ORG_ID,
member_id: process.env.MEMBER_ID
}
});Console
Section titled “Console”Console path: Organization → People → Members
Errors
Section titled “Errors”default General Error.
The request may or may not be safe to retry, depending on the HTTP method, response status code, and whether a response was received.
- If no response is returned from the API, a network error or timeout likely occurred.
- In some cases, the request may have reached the server and been successfully processed, but the response failed to reach the client. As a result, retrying non-idempotent requests can lead to unintended results.
The following HTTP methods are considered non-idempotent: POST, PATCH, DELETE, and PUT. Retrying these methods is generally not safe.
The following methods are considered idempotent: GET, HEAD, and OPTIONS. Retrying these methods is safe in the event of a network error or timeout.
Any request that returns a 503 Service Unavailable response is always safe to retry.
Any request that returns a 423 Locked response is safe to retry. 423 Locked indicates that the resource is temporarily locked, for example, due to another operation in progress.
-
request_id(string, optional) Unique identifier for the request, useful for debugging. You can set this value manually by including anX-Request-IDheader in the request. If not provided, the value will be generated automatically. -
code(string, required) Machine-readable code classifying the error type. Seemessagefor a human-readable explanation. Default: `` -
message(string, required) Error message
API Reference / Organizations / Remove organization spending limit
DELETE /organizations//billing/spending_limit
Section titled “DELETE /organizations//billing/spending_limit”Removes the configured monthly spending limit for the specified organization. Idempotent — removing an already-unset limit still succeeds. Available to organization admins on Launch and Scale plans only.
Parameters
Section titled “Parameters”org_id(string, path, required) The Neon organization ID
Response (200)
Section titled “Response (200)”Code examples
Section titled “Code examples”curl "https://console.neon.tech/api/v2/organizations/$ORG_ID/billing/spending_limit" \
-X DELETE \
-H "Authorization: Bearer $NEON_API_KEY"import { createNeonClient, raw } from '@neon/sdk';
const neon = createNeonClient({ apiKey: process.env.NEON_API_KEY });
const { data } = await raw.deleteOrganizationSpendingLimit({
client: neon.client,
path: {
org_id: process.env.ORG_ID
}
});Console
Section titled “Console”Console path: Organization → Billing → Spending limit
Errors
Section titled “Errors”default General Error.
The request may or may not be safe to retry, depending on the HTTP method, response status code, and whether a response was received.
- If no response is returned from the API, a network error or timeout likely occurred.
- In some cases, the request may have reached the server and been successfully processed, but the response failed to reach the client. As a result, retrying non-idempotent requests can lead to unintended results.
The following HTTP methods are considered non-idempotent: POST, PATCH, DELETE, and PUT. Retrying these methods is generally not safe.
The following methods are considered idempotent: GET, HEAD, and OPTIONS. Retrying these methods is safe in the event of a network error or timeout.
Any request that returns a 503 Service Unavailable response is always safe to retry.
Any request that returns a 423 Locked response is safe to retry. 423 Locked indicates that the resource is temporarily locked, for example, due to another operation in progress.
-
request_id(string, optional) Unique identifier for the request, useful for debugging. You can set this value manually by including anX-Request-IDheader in the request. If not provided, the value will be generated automatically. -
code(string, required) Machine-readable code classifying the error type. Seemessagefor a human-readable explanation. Default: `` -
message(string, required) Error message
API Reference / Organizations / Retrieve organization details
GET /organizations/
Section titled “GET /organizations/”Retrieves details for the specified organization, including its name, plan, and configuration.
Parameters
Section titled “Parameters”org_id(string, path, required) The Neon organization ID
Response (200)
Section titled “Response (200)”{
"id": "org-spring-garden-12345",
"name": "My Org",
"handle": "my-org-org-spring-garden-12345",
"plan": "scale",
"created_at": "2025-01-15T10:30:00Z",
"managed_by": "console",
"updated_at": "2025-01-15T11:00:00Z",
"require_mfa": false
}Code examples
Section titled “Code examples”curl "https://console.neon.tech/api/v2/organizations/$ORG_ID" \
-H "Authorization: Bearer $NEON_API_KEY"import { createNeonClient, raw } from '@neon/sdk';
const neon = createNeonClient({ apiKey: process.env.NEON_API_KEY });
const { data } = await raw.getOrganization({
client: neon.client,
path: {
org_id: process.env.ORG_ID
}
});Tool: list_organizations
List all organizations the current user belongs to. Supports optional search parameter to filter by name or ID.
search(string, optional) Search organizations by name or ID. You can specify partial name or ID values to filter results.
Errors
Section titled “Errors”default General Error.
The request may or may not be safe to retry, depending on the HTTP method, response status code, and whether a response was received.
- If no response is returned from the API, a network error or timeout likely occurred.
- In some cases, the request may have reached the server and been successfully processed, but the response failed to reach the client. As a result, retrying non-idempotent requests can lead to unintended results.
The following HTTP methods are considered non-idempotent: POST, PATCH, DELETE, and PUT. Retrying these methods is generally not safe.
The following methods are considered idempotent: GET, HEAD, and OPTIONS. Retrying these methods is safe in the event of a network error or timeout.
Any request that returns a 503 Service Unavailable response is always safe to retry.
Any request that returns a 423 Locked response is safe to retry. 423 Locked indicates that the resource is temporarily locked, for example, due to another operation in progress.
-
request_id(string, optional) Unique identifier for the request, useful for debugging. You can set this value manually by including anX-Request-IDheader in the request. If not provided, the value will be generated automatically. -
code(string, required) Machine-readable code classifying the error type. Seemessagefor a human-readable explanation. Default: `` -
message(string, required) Error message
API Reference / Organizations / Retrieve organization member details
GET /organizations//members/
Section titled “GET /organizations//members/”Retrieves information about the specified organization member.
Parameters
Section titled “Parameters”org_id(string, path, required) The Neon organization IDmember_id(string, path, required) The Neon organization member ID
Response (200)
Section titled “Response (200)”{
"id": "d57833f2-d308-4ede-9d2e-468d9d013d1b",
"user_id": "b107d689-6dd2-4c9a-8b9e-0b25e457cf56",
"org_id": "my-organization-morning-bread-81040908",
"role": "admin",
"joined_at": "2024-02-23T17:42:25Z"
}Code examples
Section titled “Code examples”curl "https://console.neon.tech/api/v2/organizations/$ORG_ID/members/$MEMBER_ID" \
-H "Authorization: Bearer $NEON_API_KEY"import { createNeonClient, raw } from '@neon/sdk';
const neon = createNeonClient({ apiKey: process.env.NEON_API_KEY });
const { data } = await raw.getOrganizationMember({
client: neon.client,
path: {
org_id: process.env.ORG_ID,
member_id: process.env.MEMBER_ID
}
});Errors
Section titled “Errors”default General Error.
The request may or may not be safe to retry, depending on the HTTP method, response status code, and whether a response was received.
- If no response is returned from the API, a network error or timeout likely occurred.
- In some cases, the request may have reached the server and been successfully processed, but the response failed to reach the client. As a result, retrying non-idempotent requests can lead to unintended results.
The following HTTP methods are considered non-idempotent: POST, PATCH, DELETE, and PUT. Retrying these methods is generally not safe.
The following methods are considered idempotent: GET, HEAD, and OPTIONS. Retrying these methods is safe in the event of a network error or timeout.
Any request that returns a 503 Service Unavailable response is always safe to retry.
Any request that returns a 423 Locked response is safe to retry. 423 Locked indicates that the resource is temporarily locked, for example, due to another operation in progress.
-
request_id(string, optional) Unique identifier for the request, useful for debugging. You can set this value manually by including anX-Request-IDheader in the request. If not provided, the value will be generated automatically. -
code(string, required) Machine-readable code classifying the error type. Seemessagefor a human-readable explanation. Default: `` -
message(string, required) Error message
API Reference / Organizations / Retrieve organization spending limit
GET /organizations//billing/spending_limit
Section titled “GET /organizations//billing/spending_limit”Returns the configured monthly spending limit for the specified organization.
spending_limit_cents: null indicates that no limit is currently set.
Available to organization members with read access on Launch and Scale plans only.
Parameters
Section titled “Parameters”org_id(string, path, required) The Neon organization ID
Response (200)
Section titled “Response (200)”{
"spending_limit_cents": null
}Code examples
Section titled “Code examples”curl "https://console.neon.tech/api/v2/organizations/$ORG_ID/billing/spending_limit" \
-H "Authorization: Bearer $NEON_API_KEY"import { createNeonClient, raw } from '@neon/sdk';
const neon = createNeonClient({ apiKey: process.env.NEON_API_KEY });
const { data } = await raw.getOrganizationSpendingLimit({
client: neon.client,
path: {
org_id: process.env.ORG_ID
}
});Errors
Section titled “Errors”default General Error.
The request may or may not be safe to retry, depending on the HTTP method, response status code, and whether a response was received.
- If no response is returned from the API, a network error or timeout likely occurred.
- In some cases, the request may have reached the server and been successfully processed, but the response failed to reach the client. As a result, retrying non-idempotent requests can lead to unintended results.
The following HTTP methods are considered non-idempotent: POST, PATCH, DELETE, and PUT. Retrying these methods is generally not safe.
The following methods are considered idempotent: GET, HEAD, and OPTIONS. Retrying these methods is safe in the event of a network error or timeout.
Any request that returns a 503 Service Unavailable response is always safe to retry.
Any request that returns a 423 Locked response is safe to retry. 423 Locked indicates that the resource is temporarily locked, for example, due to another operation in progress.
-
request_id(string, optional) Unique identifier for the request, useful for debugging. You can set this value manually by including anX-Request-IDheader in the request. If not provided, the value will be generated automatically. -
code(string, required) Machine-readable code classifying the error type. Seemessagefor a human-readable explanation. Default: `` -
message(string, required) Error message
API Reference / Organizations / Retrieve VPC endpoint details
GET /organizations//vpc/region//vpc_endpoints/
Section titled “GET /organizations//vpc/region//vpc_endpoints/”Retrieves the current state and configuration details of a specified VPC endpoint.
Parameters
Section titled “Parameters”-
org_id(string, path, required) The Neon organization ID -
region_id(string, path, required) The Neon region ID. Azure regions are currently not supported. -
vpc_endpoint_id(string, path, required) The VPC endpoint ID
Response (200)
Section titled “Response (200)”-
vpc_endpoint_id(string, optional) Cloud provider identifier for the VPC endpoint. -
label(string, optional) A descriptive label for the VPC endpoint -
state(string, optional) The current state of the VPC endpoint.newmeans the endpoint has just been configured and is pending acceptance by Neon.acceptedmeans the VPC connection has been accepted by Neon. -
num_restricted_projects(integer, optional) The number of projects that are restricted to use this VPC endpoint. -
example_restricted_projects(array, optional) A list of example projects that are restricted to use this VPC endpoint. There are at most 3 projects in the list, even if more projects are restricted.
Code examples
Section titled “Code examples”curl "https://console.neon.tech/api/v2/organizations/$ORG_ID/vpc/region/$REGION_ID/vpc_endpoints/$VPC_ENDPOINT_ID" \
-H "Authorization: Bearer $NEON_API_KEY"import { createNeonClient, raw } from '@neon/sdk';
const neon = createNeonClient({ apiKey: process.env.NEON_API_KEY });
const { data } = await raw.getOrganizationVpcEndpointDetails({
client: neon.client,
path: {
org_id: process.env.ORG_ID,
region_id: process.env.REGION_ID,
vpc_endpoint_id: process.env.VPC_ENDPOINT_ID
}
});# neonctl
neon vpc endpoint status <vpc_endpoint_id> --org-id <id> --region-id <region_id>Console
Section titled “Console”Console path: Organization → Settings → Private Networking
Errors
Section titled “Errors”default General Error.
The request may or may not be safe to retry, depending on the HTTP method, response status code, and whether a response was received.
- If no response is returned from the API, a network error or timeout likely occurred.
- In some cases, the request may have reached the server and been successfully processed, but the response failed to reach the client. As a result, retrying non-idempotent requests can lead to unintended results.
The following HTTP methods are considered non-idempotent: POST, PATCH, DELETE, and PUT. Retrying these methods is generally not safe.
The following methods are considered idempotent: GET, HEAD, and OPTIONS. Retrying these methods is safe in the event of a network error or timeout.
Any request that returns a 503 Service Unavailable response is always safe to retry.
Any request that returns a 423 Locked response is safe to retry. 423 Locked indicates that the resource is temporarily locked, for example, due to another operation in progress.
-
request_id(string, optional) Unique identifier for the request, useful for debugging. You can set this value manually by including anX-Request-IDheader in the request. If not provided, the value will be generated automatically. -
code(string, required) Machine-readable code classifying the error type. Seemessagefor a human-readable explanation. Default: `` -
message(string, required) Error message
API Reference / Organizations / Revoke organization API key
DELETE /organizations//api_keys/
Section titled “DELETE /organizations//api_keys/”Revokes the specified organization API key. An API key that is no longer needed can be revoked. This action cannot be reversed. API keys can also be managed in the Neon Console. See Manage API keys.
Parameters
Section titled “Parameters”org_id(string, path, required) The Neon organization IDkey_id(integer, path, required) The API key ID
Response (200)
Section titled “Response (200)”{
"id": 1000000,
"name": "service-key-58",
"created_at": "2025-01-15T10:30:00Z",
"created_by": "00000000-0000-0000-0000-000000000000",
"last_used_at": null,
"last_used_from_addr": "",
"revoked": true
}Code examples
Section titled “Code examples”curl "https://console.neon.tech/api/v2/organizations/$ORG_ID/api_keys/$KEY_ID" \
-X DELETE \
-H "Authorization: Bearer $NEON_API_KEY"import { createNeonClient, raw } from '@neon/sdk';
const neon = createNeonClient({ apiKey: process.env.NEON_API_KEY });
const { data } = await raw.revokeOrgApiKey({
client: neon.client,
path: {
org_id: process.env.ORG_ID,
key_id: process.env.KEY_ID
}
});# neonctl
neon api-keys revoke <id>Console
Section titled “Console”Console path: Organization → Settings → API keys
Errors
Section titled “Errors”default General Error.
The request may or may not be safe to retry, depending on the HTTP method, response status code, and whether a response was received.
- If no response is returned from the API, a network error or timeout likely occurred.
- In some cases, the request may have reached the server and been successfully processed, but the response failed to reach the client. As a result, retrying non-idempotent requests can lead to unintended results.
The following HTTP methods are considered non-idempotent: POST, PATCH, DELETE, and PUT. Retrying these methods is generally not safe.
The following methods are considered idempotent: GET, HEAD, and OPTIONS. Retrying these methods is safe in the event of a network error or timeout.
Any request that returns a 503 Service Unavailable response is always safe to retry.
Any request that returns a 423 Locked response is safe to retry. 423 Locked indicates that the resource is temporarily locked, for example, due to another operation in progress.
-
request_id(string, optional) Unique identifier for the request, useful for debugging. You can set this value manually by including anX-Request-IDheader in the request. If not provided, the value will be generated automatically. -
code(string, required) Machine-readable code classifying the error type. Seemessagefor a human-readable explanation. Default: `` -
message(string, required) Error message
API Reference / Organizations / Set organization spending limit
PUT /organizations//billing/spending_limit
Section titled “PUT /organizations//billing/spending_limit”Sets the monthly spending limit for the specified organization. To remove a previously configured limit, send a DELETE request to this endpoint. When a limit is configured, email notifications are sent at 80% and 100% of the limit. Computes are not suspended when the limit is reached. Available to organization admins on Launch and Scale plans only.
Parameters
Section titled “Parameters”org_id(string, path, required) The Neon organization ID
Request body
Section titled “Request body”spending_limit_cents(integer, required, format: int64) Monthly spending cap in cents. Must be positive. To remove a previously configured limit, send a DELETE request to the spending_limit endpoint —0andnullare 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.
Response (200)
Section titled “Response (200)”spending_limit_cents(integer, optional, format: int64) Monthly spending cap in cents.nullindicates that no limit is currently configured.
Code examples
Section titled “Code examples”curl "https://console.neon.tech/api/v2/organizations/$ORG_ID/billing/spending_limit" \
-X PUT \
-H "Authorization: Bearer $NEON_API_KEY"import { createNeonClient, raw } from '@neon/sdk';
const neon = createNeonClient({ apiKey: process.env.NEON_API_KEY });
const { data } = await raw.setOrganizationSpendingLimit({
client: neon.client,
path: {
org_id: process.env.ORG_ID
}
});Console
Section titled “Console”Console path: Organization → Billing → Spending limit
Errors
Section titled “Errors”default General Error.
The request may or may not be safe to retry, depending on the HTTP method, response status code, and whether a response was received.
- If no response is returned from the API, a network error or timeout likely occurred.
- In some cases, the request may have reached the server and been successfully processed, but the response failed to reach the client. As a result, retrying non-idempotent requests can lead to unintended results.
The following HTTP methods are considered non-idempotent: POST, PATCH, DELETE, and PUT. Retrying these methods is generally not safe.
The following methods are considered idempotent: GET, HEAD, and OPTIONS. Retrying these methods is safe in the event of a network error or timeout.
Any request that returns a 503 Service Unavailable response is always safe to retry.
Any request that returns a 423 Locked response is safe to retry. 423 Locked indicates that the resource is temporarily locked, for example, due to another operation in progress.
-
request_id(string, optional) Unique identifier for the request, useful for debugging. You can set this value manually by including anX-Request-IDheader in the request. If not provided, the value will be generated automatically. -
code(string, required) Machine-readable code classifying the error type. Seemessagefor a human-readable explanation. Default: `` -
message(string, required) Error message
API Reference / Organizations / Transfer projects between organizations
POST /organizations//projects/transfer
Section titled “POST /organizations//projects/transfer”Transfers selected projects, identified by their IDs, from your organization to another specified organization.
Parameters
Section titled “Parameters”source_org_id(string, path, required) The Neon organization ID (source org, which currently owns the project)
Request body
Section titled “Request body”destination_org_id(string, required) The destination organization identifierproject_ids(array, required) The list of projects ids to transfer. Maximum of 400 project ids
Response (200)
Section titled “Response (200)”Code examples
Section titled “Code examples”curl "https://console.neon.tech/api/v2/organizations/$SOURCE_ORG_ID/projects/transfer" \
-X POST \
-H "Authorization: Bearer $NEON_API_KEY"import { createNeonClient, raw } from '@neon/sdk';
const neon = createNeonClient({ apiKey: process.env.NEON_API_KEY });
const { data } = await raw.transferProjectsFromOrgToOrg({
client: neon.client,
path: {
source_org_id: process.env.SOURCE_ORG_ID
}
});Console
Section titled “Console”Console path: Organization → Settings → Transfer projects
Errors
Section titled “Errors”406 Transfer failed. The target organization has too many projects or an incompatible plan. Reduce projects or upgrade the target organization.
limits(array, required) Plan limits that were not satisfied by the request.-
name(string, required) Identifier of the unsatisfied limit. Possible values are:- subscription_type
- projects_count
- project_region
-
expected(string, required) Required value for the limit named byname. Compare withactualto determine the shortfall. -
actual(string, required) Current value of the named limit, which does not satisfy the requiredexpectedvalue.
-
422 Transfer failed. Projects with active integrations (for example, GitHub or Vercel) cannot be transferred.
projects(array, required) Projects that have the requested integration, each including the project details and associated integration metadata.id(string, required) The Neon project ID. Use as theproject_idpath parameter in other endpoints.integration(string, required) Name of the external integration associated with the project.
default General Error.
The request may or may not be safe to retry, depending on the HTTP method, response status code, and whether a response was received.
- If no response is returned from the API, a network error or timeout likely occurred.
- In some cases, the request may have reached the server and been successfully processed, but the response failed to reach the client. As a result, retrying non-idempotent requests can lead to unintended results.
The following HTTP methods are considered non-idempotent: POST, PATCH, DELETE, and PUT. Retrying these methods is generally not safe.
The following methods are considered idempotent: GET, HEAD, and OPTIONS. Retrying these methods is safe in the event of a network error or timeout.
Any request that returns a 503 Service Unavailable response is always safe to retry.
Any request that returns a 423 Locked response is safe to retry. 423 Locked indicates that the resource is temporarily locked, for example, due to another operation in progress.
-
request_id(string, optional) Unique identifier for the request, useful for debugging. You can set this value manually by including anX-Request-IDheader in the request. If not provided, the value will be generated automatically. -
code(string, required) Machine-readable code classifying the error type. Seemessagefor a human-readable explanation. Default: `` -
message(string, required) Error message
API Reference / Organizations / Update role for organization member
PATCH /organizations//members/
Section titled “PATCH /organizations//members/”Updates the role of an existing member in the specified organization. The requested role must be valid for the organization. Only organization admins can call this endpoint.
Parameters
Section titled “Parameters”org_id(string, path, required) The Neon organization IDmember_id(string, path, required) The Neon organization member ID
Request body
Section titled “Request body”role(string, required) Organization member's role.admin: full administrative access.editor(and its legacy aliasmember): standard access governed by project permissions.viewerandcollaborator: additional scoped project roles. Some values may not be available for all organizations. Possible values:admin,member,editor,viewer,collaborator
{
"role": "member"
}Response (200)
Section titled “Response (200)”id(string, optional, format: uuid) The organization member's ID.user_id(string, optional, format: uuid) The Neon user ID.org_id(string, optional) The Neon organization ID. Returned asidfromGET /users/me/organizations.role(string, optional) Organization member's role.admin: full administrative access.editor(and its legacy aliasmember): standard access governed by project permissions.viewerandcollaborator: additional scoped project roles. Some values may not be available for all organizations. Possible values:admin,member,editor,viewer,collaboratorjoined_at(string, optional, format: date-time) Timestamp when the user joined the organization.
Code examples
Section titled “Code examples”curl "https://console.neon.tech/api/v2/organizations/$ORG_ID/members/$MEMBER_ID" \
-X PATCH \
-H "Authorization: Bearer $NEON_API_KEY" \
-H "Content-Type: application/json" \
-d '{"role":"member"}'import { createNeonClient, raw } from '@neon/sdk';
const neon = createNeonClient({ apiKey: process.env.NEON_API_KEY });
const { data } = await raw.updateOrganizationMember({
client: neon.client,
path: {
org_id: process.env.ORG_ID,
member_id: process.env.MEMBER_ID
},
body: {
role: "member"
}
});Console
Section titled “Console”Console path: Organization → People → Members
Errors
Section titled “Errors”default General Error.
The request may or may not be safe to retry, depending on the HTTP method, response status code, and whether a response was received.
- If no response is returned from the API, a network error or timeout likely occurred.
- In some cases, the request may have reached the server and been successfully processed, but the response failed to reach the client. As a result, retrying non-idempotent requests can lead to unintended results.
The following HTTP methods are considered non-idempotent: POST, PATCH, DELETE, and PUT. Retrying these methods is generally not safe.
The following methods are considered idempotent: GET, HEAD, and OPTIONS. Retrying these methods is safe in the event of a network error or timeout.
Any request that returns a 503 Service Unavailable response is always safe to retry.
Any request that returns a 423 Locked response is safe to retry. 423 Locked indicates that the resource is temporarily locked, for example, due to another operation in progress.
-
request_id(string, optional) Unique identifier for the request, useful for debugging. You can set this value manually by including anX-Request-IDheader in the request. If not provided, the value will be generated automatically. -
code(string, required) Machine-readable code classifying the error type. Seemessagefor a human-readable explanation. Default: `` -
message(string, required) Error message