Cosmoner Docs
API Reference

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.

GET
/v1/projects/{projectId}/redis

Every Redis database in the project, newest first. Terminated databases are omitted.

Passwords are never included here — read a single database to get its credential.

Auth: a project API key carrying redis:read.

AuthorizationBearer <token>

A project API key. X-API-Key: <key> is accepted as an alternative to the Authorization header.

In: header

Path Parameters

projectId*string
Length1 <= length

Response Body

application/json

application/json

application/json

application/json

application/json

curl -X GET "https://example.com/v1/projects/string/redis"
{  "success": true,  "data": [    {      "id": "string",      "name": "string",      "provider": "REDIS_CLOUD",      "engine": "REDIS",      "engineVersion": "string",      "planSlug": "string",      "planType": "RAM",      "memoryMb": -9007199254740991,      "throughputOps": -9007199254740991,      "cloudProvider": "string",      "region": "string",      "replication": true,      "dataPersistence": "NONE",      "status": "CREATING",      "host": "string",      "port": -9007199254740991,      "createdAt": "2019-08-24T14:15:22Z"    }  ]}
{  "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"  }}
POST
/v1/projects/{projectId}/redis

Provisions a managed Redis-compatible database and adds it to the project's subscription.

Every purchasable tier is Valkey, running on Cosmoner infrastructure. Valkey speaks the Redis protocol, so the connection string and any Redis client work unchanged.

No tier offers high availability, so replication: true is rejected with 400 rather than ignored — the plan list reports supportsReplication per tier.

region must be one the chosen plan is sold in; the regions endpoint lists them.

Billing is charged to the project's saved card. A project with no usable card returns 402.

Auth: a project API key carrying all of redis:read and redis:write.

AuthorizationBearer <token>

A project API key. X-API-Key: <key> is accepted as an alternative to the Authorization header.

In: header

Path Parameters

projectId*string
Length1 <= length

Request Body

application/json

TypeScript Definitions

Use the request body type in TypeScript.

Response Body

application/json

application/json

application/json

application/json

application/json

application/json

application/json

application/json

curl -X POST "https://example.com/v1/projects/string/redis" \  -H "Content-Type: application/json" \  -d '{    "name": "string",    "planSlug": "string",    "region": "string"  }'
{  "success": true,  "data": {    "deployed": true  }}
{  "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"  }}
GET
/v1/projects/{projectId}/redis/{redisId}

The database, together with the password for its default user — everything needed to connect.

This is the only endpoint that returns the password; the list deliberately omits it.

Auth: a project API key carrying redis:read.

AuthorizationBearer <token>

A project API key. X-API-Key: <key> is accepted as an alternative to the Authorization header.

In: header

Path Parameters

projectId*string
Length1 <= length
redisId*string
Length1 <= length

Response Body

application/json

application/json

application/json

application/json

application/json

application/json

curl -X GET "https://example.com/v1/projects/string/redis/string"
{  "success": true,  "data": {    "id": "string",    "name": "string",    "provider": "REDIS_CLOUD",    "engine": "REDIS",    "engineVersion": "string",    "planSlug": "string",    "planType": "RAM",    "memoryMb": -9007199254740991,    "throughputOps": -9007199254740991,    "cloudProvider": "string",    "region": "string",    "replication": true,    "dataPersistence": "NONE",    "status": "CREATING",    "host": "string",    "port": -9007199254740991,    "createdAt": "2019-08-24T14:15:22Z",    "password": "string"  }}
{  "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"  }}
DELETE
/v1/projects/{projectId}/redis/{redisId}

Deletes the database and stops billing for it. The data is not recoverable.

Auth: a project API key carrying all of redis:read and redis:write.

AuthorizationBearer <token>

A project API key. X-API-Key: <key> is accepted as an alternative to the Authorization header.

In: header

Path Parameters

projectId*string
Length1 <= length
redisId*string
Length1 <= length

Response Body

application/json

application/json

application/json

application/json

application/json

application/json

curl -X DELETE "https://example.com/v1/projects/string/redis/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"  }}
GET
/v1/projects/{projectId}/redis/{redisId}/usage

Memory and network usage for the database.

A database that is still provisioning reports zeroes rather than failing, so a caller can render the same view either way. Figures are cached briefly and may lag by up to a minute.

Auth: a project API key carrying redis:read.

AuthorizationBearer <token>

A project API key. X-API-Key: <key> is accepted as an alternative to the Authorization header.

In: header

Path Parameters

projectId*string
Length1 <= length
redisId*string
Length1 <= length

Response Body

application/json

application/json

application/json

application/json

application/json

application/json

curl -X GET "https://example.com/v1/projects/string/redis/string/usage"
{  "success": true,  "data": {    "memoryUsedMb": 0,    "memoryLimitMb": 0,    "networkUsedBytes": 0  }}
{  "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"  }}
GET
/v1/projects/{projectId}/redis/preview

What a given plan would be charged today and each month after, before committing to it.

Auth: a project API key carrying redis:read.

AuthorizationBearer <token>

A project API key. X-API-Key: <key> is accepted as an alternative to the Authorization header.

In: header

Path Parameters

projectId*string
Length1 <= length

Query Parameters

planSlug*string

The plan to price, as listed by the catalogue.

Match^[A-Za-z0-9][A-Za-z0-9._-]*$
Length1 <= length <= 64
replication?string

Price with high availability, which bills a second unit of the plan.

Value in

  • "true"
  • "false"

Response Body

application/json

application/json

application/json

application/json

application/json

curl -X GET "https://example.com/v1/projects/string/redis/preview?planSlug=string"
{  "success": true,  "data": {    "subtotal": -9007199254740991,    "tax": -9007199254740991,    "creditApplied": -9007199254740991,    "dueToday": -9007199254740991,    "monthly": -9007199254740991,    "currency": "string",    "nextBillingDate": "2019-08-24T14:15:22Z"  }}
{  "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"  }}
GET
/v1/redis/plans

Every purchasable tier, cheapest first.

slug is what createRedisDatabase takes as planSlug, and it chooses the size. Tiers a deployment cannot serve are not listed.

cpuMilli is the CPU reserved for the instance. throughputOps is a rated operation ceiling and is null on every tier currently sold — it belonged to a retired line that published one rather than the other. The two never convert into each other, so a caller that renders performance should read whichever is present rather than assuming a field.

Auth: any valid project API key — this endpoint enforces no scope.

AuthorizationBearer <token>

A project API key. X-API-Key: <key> is accepted as an alternative to the Authorization header.

In: header

Response Body

application/json

application/json

application/json

application/json

application/json

curl -X GET "https://example.com/v1/redis/plans"
{  "success": true,  "data": [    {      "slug": "string",      "name": "string",      "provider": "REDIS_CLOUD",      "engine": "REDIS",      "planType": "RAM",      "memoryMb": -9007199254740991,      "throughputOps": -9007199254740991,      "cpuMilli": -9007199254740991,      "supportsReplication": true,      "supportsPersistence": true,      "priceMonthly": 0    }  ]}
{  "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"  }}
GET
/v1/redis/regions

Every region a database can be created in.

One region is sold today, so this is a short list — but it is not a formality and should not be hard-coded past. Availability is reported per provider and per plan family: filter on providers and planTypes together before offering a region against a chosen plan. Creating a database in a region its plan is not sold in is rejected rather than quietly relocated.

Auth: any valid project API key — this endpoint enforces no scope.

AuthorizationBearer <token>

A project API key. X-API-Key: <key> is accepted as an alternative to the Authorization header.

In: header

Response Body

application/json

application/json

application/json

application/json

application/json

curl -X GET "https://example.com/v1/redis/regions"
{  "success": true,  "data": [    {      "slug": "string",      "name": "string",      "cloudProvider": "string",      "providers": [        "REDIS_CLOUD"      ],      "planTypes": [        "RAM"      ]    }  ]}
{  "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"  }}

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.

Secrets

Encrypted configuration. A secret's value is returned exactly once — by the call that sets it — and never again; reads describe the secret without handing the plaintext back. For values that do not need protecting, use variables instead.

On this page