Management apiEndpointsDatabases

Create database

Creates a new database in the specified project.

POST/v1/databases
AuthorizationBearer <token>

OAuth2 authentication

In: header

Scope: workspace:admin, offline_access

Request Body

application/json

projectId*string

ID of the project to create the database in

Match^(proj_)?([cC][^\s-]{8,}|[a-z0-9]+)$
region?string

Region for the database. Use "inherit" to use the project default database region.

Default"us-east-1"
Value in"us-east-1" | "us-west-1" | "eu-west-3" | "eu-central-1" | "ap-northeast-1" | "ap-southeast-1" | "inherit"
name?string

Display name for the database

Length1 <= length
isDefault?boolean

Whether this is the default database

Defaultfalse

Response Body

application/json

application/json

application/json

application/json

application/json

curl -X POST "https://api.prisma.io/v1/databases" \  -H "Content-Type: application/json" \  -d '{    "projectId": "string"  }'
{
  "data": {
    "id": "string",
    "type": "database",
    "url": "http://example.com",
    "name": "string",
    "status": "failure",
    "createdAt": "2019-08-24T14:15:22Z",
    "isDefault": true,
    "defaultConnectionId": "string",
    "connections": [
      {
        "id": "string",
        "type": "connection",
        "url": "http://example.com",
        "name": "string",
        "createdAt": "2019-08-24T14:15:22Z",
        "kind": "postgres",
        "endpoints": {
          "direct": {
            "host": "string",
            "port": 0
          },
          "pooled": {
            "host": "string",
            "port": 0
          },
          "accelerate": {
            "host": "string",
            "port": 0
          }
        },
        "directConnection": {
          "host": "string",
          "pass": "string",
          "user": "string"
        },
        "database": {
          "id": "string",
          "url": "http://example.com",
          "name": "string"
        }
      }
    ],
    "project": {
      "id": "string",
      "url": "http://example.com",
      "name": "string"
    },
    "region": {
      "id": "string",
      "name": "string"
    }
  }
}