Management apiEndpointsConnections
Create connection
Creates a new connection for the specified database.
POST
/v1/connectionsAuthorizationBearer <token>
OAuth2 authentication
In: header
Scope: workspace:admin, offline_access
Request Body
application/json
databaseId*string
Match
^(db_)?([cC][^\s-]{8,}|[a-z0-9]+)$name*string
Length
1 <= lengthResponse Body
application/json
application/json
application/json
curl -X POST "https://api.prisma.io/v1/connections" \ -H "Content-Type: application/json" \ -d '{ "databaseId": "string", "name": "string" }'{
"data": {
"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
}
},
"connectionString": "string",
"directConnection": {
"host": "string",
"pass": "string",
"user": "string"
},
"database": {
"id": "string",
"url": "http://example.com",
"name": "string"
},
"host": "string",
"pass": "string",
"user": "string"
}
}{
"error": {
"code": "string",
"message": "string",
"hint": "string"
}
}{
"error": {
"code": "string",
"message": "string",
"hint": "string"
}
}