Skip to main content
PUT
/
organizations
/
{organization}
/
databases
/
{database_name}
/
cidrs
/
{id}
Update an IP restriction entry
curl --request PUT \
  --url https://api.planetscale.com/v1/organizations/{organization}/databases/{database_name}/cidrs/{id} \
  --header 'Authorization: <api-key>' \
  --header 'Content-Type: application/json' \
  --data '{
  "schema": "<string>",
  "role": "<string>",
  "cidrs": [
    "<string>"
  ]
}'
{
  "id": "<string>",
  "schema": "<string>",
  "role": "<string>",
  "cidrs": [
    "<string>"
  ],
  "created_at": "<string>",
  "updated_at": "<string>",
  "deleted_at": "<string>",
  "actor": {
    "id": "<string>",
    "display_name": "<string>",
    "avatar_url": "<string>"
  }
}

Authorizations

Authorization
string
header
required

Path Parameters

organization
string
required

The name of the organization the database belongs to

database_name
string
required

The name of the database

id
string
required

The ID of the IP restriction entry

Body

application/json
schema
string

The PostgreSQL schema to restrict access to. Leave empty to allow access to all schemas.

role
string

The PostgreSQL role to restrict access to. Leave empty to allow access for all roles.

cidrs
string[]

List of IPv4 CIDR ranges (e.g., ['192.168.1.0/24', '192.168.1.1/32']). Only provided fields will be updated.

Response

Returns the updated IP restriction entry

id
string
required

The ID of the IP allowlist entry

schema
string
required

The schema name to restrict access to (optional)

role
string
required

The role to restrict access to (optional)

cidrs
string[]
required

List of CIDR ranges

created_at
string
required

When the entry was created

updated_at
string
required

When the entry was updated

deleted_at
string
required

When the entry was deleted

actor
object
required