Shared databases
A shared database is a PostgreSQL database of its own, with its own user, on a server it shares with other databases. Only its user can reach it: connecting to the database, and using its `public` schema, are revoked from every other user on the server. **No new shared databases can be created.** Existing ones keep working and stay manageable. For a new database, create a dedicated PostgreSQL database instead; see the [Databases guide](/docs/guides/databases). **Connecting.** Use any PostgreSQL client or ORM. TLS is required: `postgresql://<dbUser>:<password>@<host>:<port>/<dbName>?sslmode=require`. A database with a connection pooler — `poolName` and `poolPort` are set — can also be reached through it, which lets more clients share the database's few connections: `postgresql://<dbUser>:<password>@<host>:<poolPort>/<poolName>?sslmode=require`. `poolMode` says when the pooler takes a server connection back: `TRANSACTION` at the end of each transaction, so session state such as `SET` and advisory locks does not carry over from one transaction to the next; `SESSION` when the client disconnects; `STATEMENT` after every statement, so a transaction spanning several statements is refused. **Tiers.** A database's tier — `MICRO`, `STARTER`, `GROWTH` or `SCALE` — sets `maxConnections`, the most connections its user can hold open on the server at once. The pooler's own connections to the server count towards it, so going through the pooler is how to serve more clients than that. **Password.** The password is returned once — when the database was created, and each time its password is rotated — and only a hash of it is kept, so it cannot be read back. Rotating it is done in the control panel for now. New connections need the new password at once; connections already open are not closed. Listing the project's shared databases (`GET /v1/projects/{projectId}/databases/shared`) and reading one (`GET /v1/projects/{projectId}/databases/shared/{tenantId}`) work with an API key and `databases:read`, but are not described operation by operation yet: alongside the connection details, their responses describe the server the database is placed on, which is not a stable contract. The `id` they return is the `tenantId` below. A deleted database is no longer listed.
Deletes the shared database: open connections to it are closed, its user can no longer log in, its connection pooler is removed and billing for it stops. It is no longer listed afterwards, and access to it cannot be restored through the API.
If billing could not be stopped, the database is still deleted and the call answers 502;
call it again to finish. Calling it on a database that is already deleted is safe.
Members with the viewer role are refused, as is a project blocked over an unpaid invoice (403 ACCOUNT_BLOCKED).
Auth: a project API key carrying all of databases:read and databases:write.
Authorization
apiKey A project API key. X-API-Key: <key> is accepted as an alternative to the Authorization header.
In: header
Path Parameters
1 <= lengthThe shared database's id, as listing the project's shared databases returns it.
1 <= lengthResponse Body
application/json
application/json
application/json
application/json
application/json
application/json
application/json
application/json
curl -X DELETE "https://example.com/v1/projects/string/databases/shared/string"{ "success": true, "data": {}}{ "success": false, "error": { "code": "string", "message": "string", "details": { "property1": null, "property2": null }, "issues": null, "docsUrl": "http://example.com" }}{ "success": false, "error": { "code": "string", "message": "string", "details": { "property1": null, "property2": null }, "issues": null, "docsUrl": "http://example.com" }}{ "success": false, "error": { "code": "string", "message": "string", "details": { "property1": null, "property2": null }, "issues": null, "docsUrl": "http://example.com" }}{ "success": false, "error": { "code": "string", "message": "string", "details": { "property1": null, "property2": null }, "issues": null, "docsUrl": "http://example.com" }}{ "success": false, "error": { "code": "string", "message": "string", "details": { "property1": null, "property2": null }, "issues": null, "docsUrl": "http://example.com" }}{ "success": false, "error": { "code": "string", "message": "string", "details": { "property1": null, "property2": null }, "issues": null, "docsUrl": "http://example.com" }}{ "success": false, "error": { "code": "string", "message": "string", "details": { "property1": null, "property2": null }, "issues": null, "docsUrl": "http://example.com" }}Web hosting
PHP websites on Apache. Each site runs in its own container, with its own disk, and answers on its own address under `cosmoner.com` as well as on the domains attached to it. The [Web Hosting guide](/docs/guides/web-hosting) explains the folder layout, SFTP and how PHP runs. A site's tier — `STARTER`, `GROWTH` or `SCALE` — sets its PHP workers, memory, CPU, disk, and how many domains and databases it can have. The limits are recorded on the site when it is created, so List sites shows what each one was given, and retuning a tier later does not change an existing site. Extra disk is bought in blocks on top of the tier when the site is created. Creating a site charges the project's payment method straight away; there is no checkout step. **Files.** A site's files are reached over SFTP, or over SSH where the site gives a shell, at the host, port and username Get connection details returns. The file calls here act on the same folder an SFTP login lands in and run as the site's own user, so what they create is owned by that login. Paths are relative to the home folder, with no leading slash, and an empty path is the home folder itself. They list folders, write text files of up to 1 MB, and create, move and delete files and folders; reading a file's contents, uploading and downloading are done in the control panel or over SFTP. **Domains.** Each domain attached to a site, other than its own address, is a domain you own or a subdomain of one, and it serves a folder, redirects, or is parked. The site's own address takes no subdomains. Attaching a domain is done in the control panel for now; the calls here list a site's domains, change what one does and detach it. **Databases.** A site can have MySQL databases, reached from the site only — not from outside, and not from other resources in the project. How many it can have, and how many connections each gets, depend on its tier. The SFTP password and each database's password are shown in the control panel, and changing a site's tier is done there too. Every call that changes a site, its domains, files or databases is refused to members with the viewer role, and to a project blocked over an unpaid invoice (`403 ACCOUNT_BLOCKED`).
Redis
Managed Redis databases. A database's password is returned only by the single-database read, never by the list, so enumerating databases does not hand out credentials for all of them.