Create a database
Create a PostgreSQL database in your project.
POST /projects/:projectid/databases
Authentication
Send the project API key in the Authorization header, without a Bearer prefix. Requires databases.admin on all databases, because the new database does not have an ID yet.
Request
| Field | Type | Description |
|---|---|---|
name | string, required | Display name for the database. |
Example
Use the environment variables from the database overview. Replace example IDs with your own.
curl --include --request POST \
--header "Authorization: ${INTELLECTIBLE_PROJECT_API_KEY}" \
--header "Content-Type: application/json" \
--data '{
"name": "Customer data"
}' \
"${INTELLECTIBLE_PUBLIC_API_URL}/projects/${INTELLECTIBLE_PROJECT_ID}/databases"
Response
201 Created
{
"dbid": "database_id"
}
Save dbid for subsequent requests, then create a table. Creating a database is subject to project quota.
Repeating this request can create another database; a display name is not an idempotency key. If a request times out, check the database list before retrying.
See Errors and safe retries for shared failure handling.