Skip to main content
Prisma Documentation Docs

Search documentation

Type to search this documentation.

Create project with a postgres database

POST/v1/projectsCreate project with a postgres database

Creates a new project with a postgres database.

Request body

application/json
object
createDatabaseboolean

default true

logicalIdstring

pattern ^[a-z0-9][-_a-z0-9]*$

namestring

minLength 1

regionstring

one of "us-east-1", "us-west-1", "eu-west-3", "eu-central-1", "ap-northeast-1", "ap-southeast-1"

workspaceIdstring

pattern ^(wksp_)?([cC][^\s-]{8,}|[a-z0-9]+)$

Example request
{
  "createDatabase": true,
  "logicalId": "string",
  "name": "string",
  "region": "ap-northeast-1",
  "workspaceId": "string"
}

Responses

201New project created.application/json
object
dataobjectrequired
Show child attributes
createdAtstring · date-timerequired
databasenull | objectrequired
Show child attributes
apiKeysarray of objectrequired

Deprecated: use `connections[]` instead.

Show child attributes
Show array items
connectionStringstringrequired

Deprecated: use `endpoints.direct.connectionString` or `endpoints.pooled.connectionString` instead.

createdAtstring · date-timerequired
directConnectionnull | object

Deprecated: use `endpoints.direct` instead.

Show child attributes
hoststringrequired
passstringrequired
userstringrequired
endpointsobjectrequired
Show child attributes
accelerateobject
Show child attributes
hoststringrequired
portnumberrequired
directobject
Show child attributes
hoststringrequired
portnumberrequired
pooledobject
Show child attributes
hoststringrequired
portnumberrequired
idstringrequired

pattern ^(con_)([cC][^\s-]{8,}|[a-z0-9]+)$

kindstringrequired

one of "postgres", "accelerate"

namestringrequired
typestringrequired

const "connection"

urlstring · urirequired
branchIdnull | stringrequired
connectionStringnull | stringrequired

Deprecated: use `connections[].endpoints.direct.connectionString` or `connections[].endpoints.pooled.connectionString`.

connectionsarray of objectrequired
Show child attributes
Show array items
createdAtstring · date-timerequired
databaseobjectrequired
Show child attributes
idstringrequired
namestringrequired
urlstring · urirequired
directConnectionnull | object

Deprecated: use `endpoints.direct` instead.

Show child attributes
hoststringrequired
passstringrequired
userstringrequired
endpointsobjectrequired
Show child attributes
accelerateobject
Show child attributes
connectionStringstring
hoststringrequired
portnumberrequired
directobject
Show child attributes
connectionStringstring
hoststringrequired
portnumberrequired
pooledobject
Show child attributes
connectionStringstring
hoststringrequired
portnumberrequired
idstringrequired

pattern ^(con_)([cC][^\s-]{8,}|[a-z0-9]+)$

kindstringrequired

one of "postgres", "accelerate"

namestringrequired
typestringrequired

const "connection"

urlstring · urirequired
createdAtstring · date-timerequired
defaultConnectionIdnull | stringrequired

pattern ^(con_)([cC][^\s-]{8,}|[a-z0-9]+)$

directConnectionnull | objectrequired

Deprecated: use `connections[].endpoints.direct` instead.

Show child attributes
hoststringrequired
passstringrequired
userstringrequired
idstringrequired
isDefaultbooleanrequired
logicalIdnull | stringrequired
namestringrequired
regionobjectrequired
Show child attributes
idstringrequired
namestringrequired
sourcevaluerequired
Show child attributes
oneOf · 4 options
Option 1object
typestringrequired

const "empty"

Option 2object
backupIdstringrequired

ID of the backup to restore from

databaseIdstringrequired
typestringrequired

const "backup"

Option 3object
databaseIdstringrequired
typestringrequired

const "database"

Option 4nullnullable
statusstringrequired

one of "provisioning", "ready"

typestringrequired

const "database"

urlstring · urirequired
defaultRegionnull | stringrequired
idstringrequired
logicalIdnull | stringrequired
namestringrequired
typestringrequired

const "project"

urlstring · urirequired
workspaceobjectrequired
Show child attributes
idstringrequired
namestringrequired
urlstring · urirequired
Example response
{
  "data": {
    "createdAt": "2026-06-09T00:00:00Z",
    "database": {
      "apiKeys": [
        {
          "connectionString": "string",
          "createdAt": "2026-06-09T00:00:00Z",
          "directConnection": {
            "host": "string",
            "pass": "string",
            "user": "string"
          },
          "endpoints": {
            "accelerate": {
              "host": "string",
              "port": 0
            },
            "direct": {
              "host": "string",
              "port": 0
            },
            "pooled": {
              "host": "string",
              "port": 0
            }
          },
          "id": "string",
          "kind": "accelerate",
          "name": "string",
          "type": "connection",
          "url": "https://example.com"
        }
      ],
      "branchId": "string",
      "connectionString": "string",
      "connections": [
        {
          "createdAt": "2026-06-09T00:00:00Z",
          "database": {
            "id": "string",
            "name": "string",
            "url": "https://example.com"
          },
          "directConnection": {
            "host": "string",
            "pass": "string",
            "user": "string"
          },
          "endpoints": {
            "accelerate": {
              "connectionString": "string",
              "host": "string",
              "port": 0
            },
            "direct": {
              "connectionString": "string",
              "host": "string",
              "port": 0
            },
            "pooled": {
              "connectionString": "string",
              "host": "string",
              "port": 0
            }
          },
          "id": "string",
          "kind": "accelerate",
          "name": "string",
          "type": "connection",
          "url": "https://example.com"
        }
      ],
      "createdAt": "2026-06-09T00:00:00Z",
      "defaultConnectionId": "string",
      "directConnection": {
        "host": "string",
        "pass": "string",
        "user": "string"
      },
      "id": "string",
      "isDefault": true,
      "logicalId": "string",
      "name": "string",
      "region": {
        "id": "string",
        "name": "string"
      },
      "source": {
        "backupId": "string",
        "databaseId": "string",
        "type": "backup"
      },
      "status": "provisioning",
      "type": "database",
      "url": "https://example.com"
    },
    "defaultRegion": "string",
    "id": "string",
    "logicalId": "string",
    "name": "string",
    "type": "project",
    "url": "https://example.com",
    "workspace": {
      "id": "string",
      "name": "string",
      "url": "https://example.com"
    }
  }
}
401Missing or invalid authorization token.application/json
object
errorobjectrequired
Show child attributes
codestringrequired
hintstring
messagestringrequired
Example response
{
  "error": {
    "code": "string",
    "hint": "string",
    "message": "string"
  }
}
409A project with the same `logicalId` already exists in the workspace.application/json
object
errorobjectrequired
Show child attributes
codestringrequired
hintstring
messagestringrequired
Example response
{
  "error": {
    "code": "string",
    "hint": "string",
    "message": "string"
  }
}
413Request body exceeds this endpoint's size cap.application/json
object
errorobjectrequired
Show child attributes
codestringrequired
hintstring
messagestringrequired
Example response
{
  "error": {
    "code": "string",
    "hint": "string",
    "message": "string"
  }
}
Documentation menu