Create database binding API Reference
const url = 'https://api.kupe.cloud/api/v1/tenants/acme/databases/orders-db/bindings';const options = { method: 'POST', headers: {Authorization: '<Authorization>', 'Content-Type': 'application/json'}, body: '{"cluster":"prod","name":"orders-db-prod-readwrite","namespaces":["orders-api","orders-worker"],"role":"owner","secretName":"orders-db-readwrite"}'};
try { const response = await fetch(url, options); const data = await response.json(); console.log(data);} catch (error) { console.error(error);}curl --request POST \ --url https://api.kupe.cloud/api/v1/tenants/acme/databases/orders-db/bindings \ --header 'Authorization: <Authorization>' \ --header 'Content-Type: application/json' \ --data '{ "cluster": "prod", "name": "orders-db-prod-readwrite", "namespaces": [ "orders-api", "orders-worker" ], "role": "owner", "secretName": "orders-db-readwrite" }'Authorizations
Section titled “ Authorizations ”Parameters
Section titled “ Parameters ”Path Parameters
Section titled “ Path Parameters ”Tenant name
Database name
Request Body
Section titled “ Request Body ”Binding configuration
object
Cluster to bind into. It may not exist yet; the binding stays Pending until it does.
Example
prodBinding name (DNS-safe, 1-63 characters)
Example
orders-db-prod-readwriteNamespaces inside the cluster that receive the Service and credentials Secret: 1 to 10, each listed once, none kube-* or argocd. PATCH the binding to add or remove namespaces.
Example
[ "orders-api", "orders-worker"]Role granted: owner (changes the schema), readwrite (reads and writes data) or readonly (reads data).
Example
readwriteName of the credentials Secret in every listed namespace. Defaults to “{database}-{role}”, e.g. “orders-db-readwrite”.
Example
orders-db-readwriteResponses
Section titled “ Responses ”Binding created
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 ”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"}Database not found, or databases are not enabled (code databases_unavailable)
object
Example generated
{ "code": "example", "error": "example", "field": "example", "message": "example", "severity": "example"}Binding name already exists, or the database is being deleted (code terminating)
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"}