Update database binding API Reference
const url = 'https://api.kupe.cloud/api/v1/tenants/acme/databases/orders-db/bindings/orders-db-prod-readwrite';const options = { method: 'PATCH', headers: { 'If-Match': '582020', Authorization: '<Authorization>', 'Content-Type': 'application/json' }, body: '{"namespaces":["orders-api","orders-worker"]}'};
try { const response = await fetch(url, options); const data = await response.json(); console.log(data);} catch (error) { console.error(error);}curl --request PATCH \ --url https://api.kupe.cloud/api/v1/tenants/acme/databases/orders-db/bindings/orders-db-prod-readwrite \ --header 'Authorization: <Authorization>' \ --header 'Content-Type: application/json' \ --header 'If-Match: 582020' \ --data '{ "namespaces": [ "orders-api", "orders-worker" ] }'Replace the namespaces a binding delivers into (JSON merge-patch semantics: the list sent is the
new list). A namespace added gets the Service and credentials Secret; a namespace left out loses its
Secret, and its Service and network path unless another binding of the database lists it. The other
namespaces keep working. namespaces is the only field that can change: the
cluster, role and secretName are fixed, and sending any of them is a 400.
Authorizations
Section titled “ Authorizations ”Parameters
Section titled “ Parameters ”Path Parameters
Section titled “ Path Parameters ”Tenant name
Database name
Binding name
Header Parameters
Section titled “ Header Parameters ”ETag for optimistic locking
Request Body
Section titled “ Request Body ”The new namespace list
object
Namespaces replaces the binding’s namespace list, with the same rules as on create: 1 to 10, each listed once, none kube-* or argocd. A namespace added is delivered into; a namespace left out loses its Secret, and its Service and network path unless another binding of the database lists it. The others keep theirs. To add or remove one, read the binding, edit its list and send it back with If-Match set to the ETag read.
Example
[ "orders-api", "orders-worker"]Responses
Section titled “ Responses ”Updated binding
object
Namespaces are the namespaces the binding delivers into (1 to 10).
SecretName as requested; empty means the default “{database}-{role}”.
object
object
Namespaces reports what was delivered into each namespace. A namespace removed from namespaces stays here until what was delivered there is withdrawn.
object
DeliveredRotation is the rotate-credentials token of the password the credentials Secret in this namespace carries; empty if the role was never rotated.
Host is the in-cluster DNS name applications in this namespace connect to; empty while nothing is delivered.
Message gives detail while the namespace is not Ready.
Name is the namespace inside the cluster.
Phase is Ready only when every listed namespace is Ready.
SecretName is the effective credentials Secret name in every listed namespace.
Example
{ "cluster": "prod", "createdAt": "2026-10-09T10:05:00Z", "database": "orders-db", "name": "orders-db-prod-readwrite", "namespaces": [ "orders-api", "orders-worker" ], "resourceVersion": "582020", "role": "owner", "secretName": "orders-db-readwrite", "status": { "message": "", "namespaces": [ { "deliveredRotation": "2026-10-09T12:00:00.123456789Z", "host": "orders-db.orders-api.svc.cluster.local", "message": "", "name": "orders-api", "phase": "Pending" } ], "phase": "Pending", "secretName": "orders-db-readwrite" }}Headers
Section titled “ Headers ”New resource version
Validation error
object
Example generated
{ "code": "example", "error": "example", "field": "example", "message": "example", "severity": "example"}Missing or invalid authentication
object
Example generated
{ "code": "example", "error": "example", "field": "example", "message": "example", "severity": "example"}Admin access required
object
Example generated
{ "code": "example", "error": "example", "field": "example", "message": "example", "severity": "example"}Binding not found for this database, or databases are switched off and the change adds a namespace (code databases_unavailable)
object
Example generated
{ "code": "example", "error": "example", "field": "example", "message": "example", "severity": "example"}The binding or its database is being deleted (code terminating), or the binding kept changing while it was being updated
object
Example generated
{ "code": "example", "error": "example", "field": "example", "message": "example", "severity": "example"}ETag mismatch
object
Example generated
{ "code": "example", "error": "example", "field": "example", "message": "example", "severity": "example"}Rate limit exceeded
object
Example generated
{ "code": "example", "error": "example", "field": "example", "message": "example", "severity": "example"}