Skip to Content
SeyloDocs
API referenceDatabases

Expose a database

POST
/api/v1/databases.setExposure

Turns TLS exposure on or off. On: the agent listens on a node port with the database's own TLS for a separate user, optionally limited to source CIDRs. The internal URL does not change. Fields left out keep their value.

Needs databases.expose on the service (a grant on its project covers it). Available to MCP clients and the assistant.

Authorization

cookieseylo_session<token>

Request Body

application/json
  1. body
serviceId*string

Panel-issued id.

Match^[a-z0-9]{16}$
enabled*boolean
port?integer
Range1024 <= value <= 65535
allowedCidrs?array<>
Itemsitems <= 200
tlsHostname?|null

Response Body

Success.

application/json
  1. response
serviceId*string

Panel-issued id.

Match^[a-z0-9]{16}$
projectId*string

Panel-issued id.

Match^[a-z0-9]{16}$
name*string

DNS-safe; the service's host name on the project network. Unique in its project.

Match^[a-z0-9]([a-z0-9-]*[a-z0-9])?$
Length1 <= length <= 40
engine*string|string|string|string|string
version*string
nodeId*string

Panel-issued id.

Match^[a-z0-9]{16}$
nodeName*string
internal*
exposure*
webUi*
createdAt*string
Formatdate-time
Example Request
curl -X POST 'https://example.com/api/v1/databases.setExposure' \  -H 'Content-Type: application/json' \  -d '{  "serviceId": "string",  "enabled": true}'
Example Response
{  "serviceId": "string",  "projectId": "string",  "name": "string",  "engine": "postgres",  "version": "string",  "nodeId": "string",  "nodeName": "string",  "internal": {    "host": "string",    "port": 1,    "database": "string",    "user": "string"  },  "exposure": {    "enabled": true,    "host": "string",    "port": 1024,    "user": "string",    "allowedCidrs": [      "string"    ],    "tlsHostname": "string",    "certificate": "none",    "certificateIssuer": "string",    "certificateExpiresAt": "2019-08-24T14:15:22Z"  },  "webUi": {    "tool": "string",    "idleMinutes": 1,    "running": true,    "lastActiveAt": "2019-08-24T14:15:22Z"  },  "createdAt": "2019-08-24T14:15:22Z"}