POST
/
workspaces
/
{workspaceSlug}
/
databases
curl --request POST \
  --url https://global.thenile.dev/workspaces/{workspaceSlug}/databases \
  --header 'Authorization: Bearer <token>' \
  --header 'Content-Type: application/json' \
  --data '{
  "databaseName": "my_spectacular_db",
  "region": "AWS_US_WEST_2"
}'
{
  "id": "<string>",
  "name": "<string>",
  "workspace": {
    "id": "<string>",
    "name": "<string>",
    "slug": "<string>",
    "stripe_customer_id": "<string>",
    "created": "2023-11-07T05:31:56Z"
  },
  "status": "PENDING",
  "region": "AWS_US_WEST_2",
  "created": "2023-11-07T05:31:56Z",
  "apiHost": "<string>",
  "dbHost": "<string>"
}

Authorizations

Authorization
string
header
required

Bearer authentication header of the form Bearer <token>, where <token> is your auth token.

Path Parameters

workspaceSlug
string
required

Body

application/json
The name and region for the new database

Parameters for creating a new database, including the name and region.

databaseName
string
required

The name of the database to be created. Database names must be less than 64 characters, and unique within a workspace. Names may contain letters (lower or uppercase), numbers, and underscores, and must begin with a letter or underscore.

Example:

"my_spectacular_db"

region
enum<string>
required

The region where the database will be hosted. Nile currently supports the following values:

  • AWS_US_WEST_2 - AWS in US West (Oregon)
  • AWS_EU_CENTRAL_1 - AWS in Europe (Frankfurt)
Available options:
AWS_US_WEST_2,
AWS_EU_CENTRAL_1
Example:

"AWS_US_WEST_2"

Response

201
application/json
Database created.
id
string
required
name
string
required
workspace
object
required
status
enum<string>
required
Available options:
PENDING,
REQUESTED,
BUILT,
READY
region
enum<string>
required
Available options:
AWS_US_WEST_2,
AWS_EU_CENTRAL_1,
AZURE_EASTUS
apiHost
string
required
created
string
dbHost
string

Was this page helpful?