Skip to content

Updates project's network restrictions by adding or removing CIDRs
experimental

patch/v1/projects/{ref}/network-restrictions

This is an experimental endpoint. It is subject to change or removal in future versions. Use it with caution, as it may not remain supported or stable.

This endpoint is currently in its Alpha stage.

OAuth scopes

  • projects:write

The fine-grained token must include the following permissions to access this endpoint:

  • database_network_restrictions_write

Path parameters

  • ref
    Required
    string

    Project ref

Body

  • add
    Optional
    object
  • remove
    Optional
    object

Response codes

  • 200
  • 401
  • 403
  • 429
  • 500

Response (200)

{
"entitlement": "disallowed",
"config": {
"dbAllowedCidrs": [
{
"address": "lorem",
"type": "v4"
}
]
},
"old_config": {
"dbAllowedCidrs": [
{
"address": "lorem",
"type": "v4"
}
]
},
"updated_at": "4404-02-29T04:24Z",
"applied_at": "4404-02-29T04:24Z",
"status": "stored"
}
{
"type": "object",
"properties": {
"entitlement": {
"type": "string",
"enum": [
"disallowed",
"allowed"
]
},
"config": {
"type": "object",
"properties": {
"dbAllowedCidrs": {
"type": "array",
"items": {
"type": "object",
"properties": {
"address": {
"type": "string"
},
"type": {
"type": "string",
"enum": [
"v4",
"v6"
]
}
},
"required": [
"address",
"type"
]
}
}
},
"description": "At any given point in time, this is the config that the user has requested be applied to their project. The `status` field indicates if it has been applied to the project, or is pending. When an updated config is received, the applied config is moved to `old_config`."
},
"old_config": {
"description": "Populated when a new config has been received, but not registered as successfully applied to a project.",
"type": "object",
"properties": {
"dbAllowedCidrs": {
"type": "array",
"items": {
"type": "object",
"properties": {
"address": {
"type": "string"
},
"type": {
"type": "string",
"enum": [
"v4",
"v6"
]
}
},
"required": [
"address",
"type"
]
}
}
}
},
"updated_at": {
"type": "string",
"format": "date-time",
"pattern": "^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d(?::[0-5]\\d(?:\\.\\d+)?)?(?:Z|([+-](?:[01]\\d|2[0-3]):[0-5]\\d)))$"
},
"applied_at": {
"type": "string",
"format": "date-time",
"pattern": "^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d(?::[0-5]\\d(?:\\.\\d+)?)?(?:Z|([+-](?:[01]\\d|2[0-3]):[0-5]\\d)))$"
},
"status": {
"type": "string",
"enum": [
"stored",
"applied"
]
}
},
"required": [
"entitlement",
"config",
"status"
]
}