Raff Apps

Link a database to an app

Changed on

Link a running managed database to an app. Raff creates a database user for this app, sets {PREFIX}_URL, _HOST, _PORT, _USER, _PASSWORD, _NAME and _CA_CERT (prefix DATABASE by default; the first link also fills a template's own settings) and redeploys the app. Connections go over Raff's private network and always use TLS; check the server with {PREFIX}_CA_CERT.

<Note> Before linking, you need the **database ID**: get it from [List Databases](/api-reference/databases/list-databases). </Note>
post/api/v1/apps/services/{service_id}/bindings

Request

  • Base URL
    https://api.rafftechnologies.com
  • URL
    https://api.rafftechnologies.com/api/v1/apps/services/{service_id}/bindings
  • Auth
    API key in header X-API-Key

Path parameters

service_idstring required

App service ID (UUID) or short id (the service_id field)

Request body

binding_type'database' required
resource_idstring uuid required

A running managed database of this account

env_prefixstring

Prefix for the variables, uppercase letters, digits and underscores (default DATABASE). Give a second database its own prefix.

Response

Linked; the app redeploys with the new settings

successboolean

Changes