Creates a new PostgreSQL database with one login (its own user and password)
and a PgBouncer pool entry. This is the original single-login creation route.
For separate owner, runtime and read-only roles, use
managed database creation.
Database names must match ^[a-z][a-z0-9-]{1,48}[a-z0-9]$ — lowercase letters, numbers, and hyphens, 3-50 characters.
Request body
Field
Type
Required
Description
name
string
Yes
Database identifier (becomes DB name and username)
displayName
string
Yes
Human-friendly label
environment
string
No
production (default), staging, development, or other
scheduledBackup
string
Conditional
daily (default for production/staging) or none; development/other require an explicit choice. Production requires daily.
{ "name": "my-app", "displayName": "My Application"}
Request body is missing fields or the name is invalid
400
POLICY_VALIDATION
Environment/backup choice is incomplete or unsafe
401
UNAUTHORIZED
Missing or invalid API key
403
KEY_SCOPE_DENIED
The API key is valid but does not have full account access
403
PLAN_API_ACCESS_REQUIRED
API access requires a Pro or Business plan
403
PLAN_LIMIT
Your plan does not allow more databases
500
AGENT_ERROR
The VPS agent failed to create the database
{"docsConfig":{"theme":"palm","$schema":"https://mintlify.com/docs.json","name":"DBHost","description":"Managed PostgreSQL hosting for developers: PgBouncer pooling, verify-full TLS, separate SQL roles, backups with 30-day retention, and API and CLI automation on paid plans.","colors":{"primary":"#6366f1","light":"#818cf8","dark":"#4f46e5"},"logo":{"light":"https://mintcdn.com/stianlarsen-ef7289da/SvPvaAf6yywKnLbd/images/logo-light.svg?fit=max\u0026auto=format\u0026n=SvPvaAf6yywKnLbd\u0026q=85\u0026s=04b5e34c4fa58314f697056f22b10346","dark":"https://mintcdn.com/stianlarsen-ef7289da/SvPvaAf6yywKnLbd/images/logo-dark.svg?fit=max\u0026auto=format\u0026n=SvPvaAf6yywKnLbd\u0026q=85\u0026s=05b305d5fbc0371088ab5477fc5bcc6e"},"favicon":"https://mintcdn.com/stianlarsen-ef7289da/SvPvaAf6yywKnLbd/images/favicon.svg?fit=max\u0026auto=format\u0026n=SvPvaAf6yywKnLbd\u0026q=85\u0026s=a3559c65dd709716d3a5acfaeffe09cc","appearance":{"default":"system"},"background":{"color":{"light":"#ffffff","dark":"#09090b"}},"seo":{"metatags":{"og:image":"https://dbhost.app/media/og/dbhost-managed-core-1200x630.png","og:image:width":"1200","og:image:height":"630","og:image:type":"image/png","og:image:alt":"DBHost — Postgres. Handled. Managed PostgreSQL hosting.","twitter:card":"summary_large_image","twitter:image":"https://dbhost.app/media/og/dbhost-managed-core-1200x630.png","twitter:image:width":"1200","twitter:image:height":"630","twitter:image:alt":"DBHost — Postgres. Handled. Managed PostgreSQL hosting."}},"styling":{"latex":false},"navigation":{"pages":[]}},"deployment":{"deploymentMetadataValue":{"subdomain":"stianlarsen-ef7289da","hasAudioNarration":false,"actualSubdomain":"stianlarsen-ef7289da","customDomains":["docs.dbhost.app"],"gitSource":{"type":"github","owner":"stianlars1","repo":"dbhost","deployBranch":"main","contentDirectory":"docs","isPrivate":true,"mountPath":"","label":""},"entitlements":{},"buildId":"6af31afd1661757f0de2775c","clientVersion":"0.0.4271","searchFilterCounts":[{"language":"default","tag":"API Reference","count":35},{"language":"default","tag":"Documentation","count":29},{"language":"default","tag":"Databases","count":21},{"language":"default","tag":"Operate your database","count":9},{"language":"default","tag":"Backups","count":7},{"language":"default","tag":"Dashboard","count":7},{"language":"default","tag":"Connect your app","count":6},{"language":"default","tag":"Getting Started","count":5},{"language":"default","tag":"Overview","count":2},{"language":"default","tag":"Collaboration","count":2}]},"assistantConfig":{"enableAskAiButton":false,"enableStarterQuestions":false,"enableContextualStarterQuestions":false,"enableAskAiSearchBar":true},"basePath":"","hasChatPermissions":false,"hasWebMcpPermissions":false,"toggles":[{"name":"kill-isr","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"custom-rbac-roles","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"agent-mintlify-slack","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"agent-integrations-settings","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"rbac-expansion","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"automations-pr-grouping","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"custom-prefix","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"analytics-v7","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"user-flows-analytics","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"no-publish-flow","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"workos-onboarding","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"snapshot-serving-live","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"stripTemperatureMiddleware","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"support-platform-pylon-zendesk","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"snapshot-serving","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"instant-rollback","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"granular-notifications-server","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"granular-notifications","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"automations-fable","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"fixed-ai-action-pricing","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"site-roles","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"automation-resolve-merge-conflict","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"scoped-publishing","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"mintql","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"page-level-analytics","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"editor-version-history-v2","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"billing-page-v2","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"full-page-search","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"workspace-projects","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"assistant-v5","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"fork-pr-previews","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"revalidation-jwt","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"workos-sso-scim","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"hobby-abuse-scan","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"dashboard-inbox","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"workos-signup","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"turbopuffer-dual-write","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"workos-enabled","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"approve-review-flow","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"editor-metadata","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"sso-setup-deadline-banner","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"turbopuffer-serve","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"live-agents","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"starter-pricing","enabled":true,"variant":{"name":"control","enabled":true,"payload":{"type":"string","value":"control"},"feature_enabled":true},"impressionData":false},{"name":"llms-txt-v2","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"wildcard-email-auth","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false}],"googleFontsInlined":false},"customCss":[]}
{"page":{"pagePath":"api-reference/databases/create","slug":"/api-reference/databases/create","pageMetadata":{"title":"Create a single-login database","sidebarTitle":"Create database","description":"Create a single-login DBHost PostgreSQL database through the API. For separate owner, runtime and read-only roles use managed-create.","api":"POST /api/v1/databases","href":"/api-reference/databases/create"},"description":{"compiledSource":"\"use strict\";\nconst {jsx: _jsx} = arguments[0];\nconst {useMDXComponents: _provideComponents} = arguments[0];\nfunction _createMdxContent(props) {\n const _components = {\n p: \"p\",\n ..._provideComponents(),\n ...props.components\n };\n return _jsx(_components.p, {\n children: \"Create a single-login DBHost PostgreSQL database through the API. For separate owner, runtime and read-only roles use managed-create.\"\n });\n}\nfunction MDXContent(props = {}) {\n const {wrapper: MDXLayout} = {\n ..._provideComponents(),\n ...props.components\n };\n return MDXLayout ? _jsx(MDXLayout, {\n ...props,\n children: _jsx(_createMdxContent, {\n ...props\n })\n }) : _createMdxContent(props);\n}\nreturn {\n default: MDXContent\n};\n","frontmatter":{},"scope":{}},"pageType":"default","mdx":{"mdxSource":{"compiledSource":"\"use strict\";const{Fragment:_Fragment,jsx:_jsx,jsxs:_jsxs}=arguments[0];const{useMDXComponents:_provideComponents}=arguments[0];function _createMdxContent(props){const _components={a:`a`,code:`code`,p:`p`,pre:`pre`,span:`span`,tbody:`tbody`,td:`td`,th:`th`,thead:`thead`,tr:`tr`,..._provideComponents(),...props.components},{CodeBlock,Heading,Table,Tip}=_components;if(!CodeBlock)_missingMdxReference(`CodeBlock`,true);if(!Heading)_missingMdxReference(`Heading`,true);if(!Table)_missingMdxReference(`Table`,true);if(!Tip)_missingMdxReference(`Tip`,true);return _jsxs(_Fragment,{children:[_jsxs(_components.p,{children:[`Creates a new PostgreSQL database with one login (its own user and password)\nand a PgBouncer pool entry. This is the original single-login creation route.\nFor separate owner, runtime and read-only roles, use\n`,_jsx(_components.a,{href:`/api-reference/databases/managed-create`,children:`managed database creation`}),`.`]}),`\n`,_jsx(Tip,{children:_jsxs(_components.p,{children:[`Database names must match `,_jsx(_components.code,{children:`^[a-z][a-z0-9-]{1,48}[a-z0-9]$`}),` — lowercase letters, numbers, and hyphens, 3-50 characters.`]})}),`\n`,_jsx(Heading,{level:`2`,id:`request-body`,children:`Request body`}),`\n`,_jsxs(Table,{children:[_jsx(_components.thead,{children:_jsxs(_components.tr,{children:[_jsx(_components.th,{children:`Field`}),_jsx(_components.th,{children:`Type`}),_jsx(_components.th,{children:`Required`}),_jsx(_components.th,{children:`Description`})]})}),_jsxs(_components.tbody,{children:[_jsxs(_components.tr,{children:[_jsx(_components.td,{children:_jsx(_components.code,{children:`name`})}),_jsx(_components.td,{children:`string`}),_jsx(_components.td,{children:`Yes`}),_jsx(_components.td,{children:`Database identifier (becomes DB name and username)`})]}),_jsxs(_components.tr,{children:[_jsx(_components.td,{children:_jsx(_components.code,{children:`displayName`})}),_jsx(_components.td,{children:`string`}),_jsx(_components.td,{children:`Yes`}),_jsx(_components.td,{children:`Human-friendly label`})]}),_jsxs(_components.tr,{children:[_jsx(_components.td,{children:_jsx(_components.code,{children:`environment`})}),_jsx(_components.td,{children:`string`}),_jsx(_components.td,{children:`No`}),_jsxs(_components.td,{children:[_jsx(_components.code,{children:`production`}),` (default), `,_jsx(_components.code,{children:`staging`}),`, `,_jsx(_components.code,{children:`development`}),`, or `,_jsx(_components.code,{children:`other`})]})]}),_jsxs(_components.tr,{children:[_jsx(_components.td,{children:_jsx(_components.code,{children:`scheduledBackup`})}),_jsx(_components.td,{children:`string`}),_jsx(_components.td,{children:`Conditional`}),_jsxs(_components.td,{children:[_jsx(_components.code,{children:`daily`}),` (default for production/staging) or `,_jsx(_components.code,{children:`none`}),`; development/other require an explicit choice. Production requires `,_jsx(_components.code,{children:`daily`}),`.`]})]})]})]}),`\n`,_jsx(CodeBlock,{filename:``,numberOfLines:`4`,language:`json`,children:_jsx(_components.pre,{className:`shiki shiki-themes github-light-default dark-plus`,style:{backgroundColor:`#ffffff`,\"--shiki-dark-bg\":`#0B0C0E`,color:`#1f2328`,\"--shiki-dark\":`#D4D4D4`},language:`json`,children:_jsxs(_components.code,{language:`json`,numberOfLines:`4`,children:[_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`{`})}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#116329`,\"--shiki-dark\":`#9CDCFE`},children:` \"name\"`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`: `}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:`\"my-app\"`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`,`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#116329`,\"--shiki-dark\":`#9CDCFE`},children:` \"displayName\"`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`: `}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:`\"My Application\"`})]}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`}`})}),`\n`]})})}),`\n`,_jsx(Heading,{level:`2`,id:`example`,children:`Example`}),`\n`,_jsx(CodeBlock,{filename:``,numberOfLines:`4`,language:`shellscript`,children:_jsx(_components.pre,{className:`shiki shiki-themes github-light-default dark-plus`,style:{backgroundColor:`#ffffff`,\"--shiki-dark-bg\":`#0B0C0E`,color:`#1f2328`,\"--shiki-dark\":`#D4D4D4`},language:`shellscript`,children:_jsxs(_components.code,{language:`shellscript`,numberOfLines:`4`,children:[_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#953800`,\"--shiki-dark\":`#DCDCAA`},children:`curl`}),_jsx(_components.span,{style:{color:`#0550AE`,\"--shiki-dark\":`#569CD6`},children:` -X`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:` POST`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:` https://dbhost.app/api/v1/databases`}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#D7BA7D`},children:` \\\\`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#0550AE`,\"--shiki-dark\":`#569CD6`},children:` -H`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:` \"Authorization: Bearer dbh_your_api_key_here\"`}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#D7BA7D`},children:` \\\\`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#0550AE`,\"--shiki-dark\":`#569CD6`},children:` -H`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:` \"Content-Type: application/json\"`}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#D7BA7D`},children:` \\\\`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#0550AE`,\"--shiki-dark\":`#569CD6`},children:` -d`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:` '{\"name\":\"my-app\",\"displayName\":\"My Application\"}'`})]}),`\n`]})})}),`\n`,_jsx(Heading,{level:`2`,id:`response`,children:`Response`}),`\n`,_jsx(CodeBlock,{filename:`201 Created`,numberOfLines:`12`,language:`json`,children:_jsx(_components.pre,{className:`shiki shiki-themes github-light-default dark-plus`,style:{backgroundColor:`#ffffff`,\"--shiki-dark-bg\":`#0B0C0E`,color:`#1f2328`,\"--shiki-dark\":`#D4D4D4`},language:`json`,children:_jsxs(_components.code,{language:`json`,numberOfLines:`12`,children:[_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`{`})}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#116329`,\"--shiki-dark\":`#9CDCFE`},children:` \"id\"`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`: `}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:`\"550e8400-e29b-41d4-a716-446655440000\"`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`,`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#116329`,\"--shiki-dark\":`#9CDCFE`},children:` \"name\"`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`: `}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:`\"my-app\"`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`,`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#116329`,\"--shiki-dark\":`#9CDCFE`},children:` \"displayName\"`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`: `}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:`\"My Application\"`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`,`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#116329`,\"--shiki-dark\":`#9CDCFE`},children:` \"host\"`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`: `}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:`\"db.dbhost.app\"`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`,`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#116329`,\"--shiki-dark\":`#9CDCFE`},children:` \"port\"`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`: `}),_jsx(_components.span,{style:{color:`#0550AE`,\"--shiki-dark\":`#B5CEA8`},children:`6432`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`,`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#116329`,\"--shiki-dark\":`#9CDCFE`},children:` \"database\"`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`: `}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:`\"my-app\"`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`,`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#116329`,\"--shiki-dark\":`#9CDCFE`},children:` \"username\"`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`: `}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:`\"my-app\"`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`,`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#116329`,\"--shiki-dark\":`#9CDCFE`},children:` \"password\"`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`: `}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:`\"generated-secret-token\"`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`,`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#116329`,\"--shiki-dark\":`#9CDCFE`},children:` \"status\"`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`: `}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:`\"active\"`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`,`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#116329`,\"--shiki-dark\":`#9CDCFE`},children:` \"connectionString\"`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`: `}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:`\"postgresql://my-app:generated-secret-token@db.dbhost.app:6432/my-app?sslmode=verify-full\"`})]}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`}`})}),`\n`]})})}),`\n`,_jsx(Heading,{level:`2`,id:`errors`,children:`Errors`}),`\n`,_jsxs(Table,{children:[_jsx(_components.thead,{children:_jsxs(_components.tr,{children:[_jsx(_components.th,{children:`Status`}),_jsx(_components.th,{children:`Code`}),_jsx(_components.th,{children:`Description`})]})}),_jsxs(_components.tbody,{children:[_jsxs(_components.tr,{children:[_jsx(_components.td,{\"data-numeric\":`true`,children:`400`}),_jsx(_components.td,{children:_jsx(_components.code,{children:`VALIDATION_ERROR`})}),_jsx(_components.td,{children:`Request body is missing fields or the name is invalid`})]}),_jsxs(_components.tr,{children:[_jsx(_components.td,{\"data-numeric\":`true`,children:`400`}),_jsx(_components.td,{children:_jsx(_components.code,{children:`POLICY_VALIDATION`})}),_jsx(_components.td,{children:`Environment/backup choice is incomplete or unsafe`})]}),_jsxs(_components.tr,{children:[_jsx(_components.td,{\"data-numeric\":`true`,children:`401`}),_jsx(_components.td,{children:_jsx(_components.code,{children:`UNAUTHORIZED`})}),_jsx(_components.td,{children:`Missing or invalid API key`})]}),_jsxs(_components.tr,{children:[_jsx(_components.td,{\"data-numeric\":`true`,children:`403`}),_jsx(_components.td,{children:_jsx(_components.code,{children:`KEY_SCOPE_DENIED`})}),_jsx(_components.td,{children:`The API key is valid but does not have full account access`})]}),_jsxs(_components.tr,{children:[_jsx(_components.td,{\"data-numeric\":`true`,children:`403`}),_jsx(_components.td,{children:_jsx(_components.code,{children:`PLAN_API_ACCESS_REQUIRED`})}),_jsx(_components.td,{children:`API access requires a Pro or Business plan`})]}),_jsxs(_components.tr,{children:[_jsx(_components.td,{\"data-numeric\":`true`,children:`403`}),_jsx(_components.td,{children:_jsx(_components.code,{children:`PLAN_LIMIT`})}),_jsx(_components.td,{children:`Your plan does not allow more databases`})]}),_jsxs(_components.tr,{children:[_jsx(_components.td,{\"data-numeric\":`true`,children:`500`}),_jsx(_components.td,{children:_jsx(_components.code,{children:`AGENT_ERROR`})}),_jsx(_components.td,{children:`The VPS agent failed to create the database`})]})]})]})]})}function MDXContent(props={}){const{wrapper:MDXLayout}={..._provideComponents(),...props.components};return MDXLayout?_jsx(MDXLayout,{...props,children:_jsx(_createMdxContent,{...props})}):_createMdxContent(props)}return{default:MDXContent};function _missingMdxReference(id,component){throw new Error(`Expected `+(component?`component`:`object`)+\" `\"+id+\"` to be defined: you likely forgot to import, pass, or provide it.\")}","frontmatter":{},"scope":{"config":{},"pageMetadata":{"title":"Create a single-login database","sidebarTitle":"Create database","description":"Create a single-login DBHost PostgreSQL database through the API. For separate owner, runtime and read-only roles use managed-create.","api":"POST /api/v1/databases","href":"/api-reference/databases/create"}}},"mdxSourceWithNoJs":null},"mdxExtracts":{"tableOfContents":[{"title":"Request body","slug":"request-body","depth":2,"children":[]},{"title":"Example","slug":"example","depth":2,"children":[]},{"title":"Response","slug":"response","depth":2,"children":[]},{"title":"Errors","slug":"errors","depth":2,"children":[]}],"codeExamples":{},"endpoint":{"title":"Create a single-login database","path":"/api/v1/databases","method":"post","request":{"security":[],"parameters":{"query":{},"header":{},"cookie":{},"path":{}},"body":{}},"response":{},"deprecated":false}},"jsLinks":["/_mintlify/custom/stianlarsen-ef7289da/58171d9ca8b5b73b/marketing-tracking.js"],"subdomain":"stianlarsen-ef7289da","siteName":"DBHost","title":"Create a single-login database - DBHost","navMaps":{"firstHrefInVersion":{},"firstHrefInLanguage":{}},"lastModified":"2026-10-14T12:34:22.546Z","originalFileLocation":"api-reference/databases/create.mdx"},"headHtml":"\u003cscript data-mint-head>(function(){var d=document.documentElement,p=null;if(!p){try{p=localStorage.getItem(\"isDarkMode\")}catch(e){}if(p==='true')p='dark';else if(p==='false')p='light';if(p!=='light'\u0026\u0026p!=='dark'\u0026\u0026p!=='system')p=\"system\"}var r=p==='system'?(matchMedia(\"(prefers-color-scheme: dark)\").matches?'dark':'light'):p;d.classList.remove(r==='dark'?'light':'dark');d.classList.add(r);d.setAttribute(\"data-theme-preference\",p)})();\u003c/script>\u003cmeta data-mint-head name=\"description\" content=\"Create a single-login DBHost PostgreSQL database through the API. For separate owner, runtime and read-only roles use managed-create.\">\u003cmeta data-mint-head name=\"application-name\" content=\"DBHost\">\u003cmeta data-mint-head name=\"generator\" content=\"Mintlify\">\u003clink data-mint-head rel=\"icon\" type=\"image/png\" sizes=\"192x192\" href=\"/mintlify-assets/_mintlify/favicons/stianlarsen-ef7289da/ivJJevrtmwvlIcQ2/_generated/favicon/android-chrome-192x192.png\" media=\"(prefers-color-scheme: light)\">\u003clink data-mint-head rel=\"apple-touch-icon\" type=\"image/png\" sizes=\"180x180\" href=\"/mintlify-assets/_mintlify/favicons/stianlarsen-ef7289da/ivJJevrtmwvlIcQ2/_generated/favicon/apple-touch-icon.png\">\u003clink data-mint-head rel=\"icon\" type=\"image/png\" sizes=\"16x16\" href=\"/mintlify-assets/_mintlify/favicons/stianlarsen-ef7289da/ivJJevrtmwvlIcQ2/_generated/favicon/favicon-16x16.png\" media=\"(prefers-color-scheme: light)\">\u003clink data-mint-head rel=\"icon\" type=\"image/png\" sizes=\"32x32\" href=\"/mintlify-assets/_mintlify/favicons/stianlarsen-ef7289da/ivJJevrtmwvlIcQ2/_generated/favicon/favicon-32x32.png\" media=\"(prefers-color-scheme: light)\">\u003clink data-mint-head rel=\"shortcut icon\" type=\"image/x-icon\" href=\"/mintlify-assets/_mintlify/favicons/stianlarsen-ef7289da/ivJJevrtmwvlIcQ2/_generated/favicon/favicon.ico\" media=\"(prefers-color-scheme: light)\">\u003clink data-mint-head rel=\"icon\" type=\"image/png\" sizes=\"192x192\" href=\"/mintlify-assets/_mintlify/favicons/stianlarsen-ef7289da/ivJJevrtmwvlIcQ2/_generated/favicon-dark/android-chrome-192x192.png\" media=\"(prefers-color-scheme: dark)\">\u003clink data-mint-head rel=\"icon\" type=\"image/png\" sizes=\"16x16\" href=\"/mintlify-assets/_mintlify/favicons/stianlarsen-ef7289da/ivJJevrtmwvlIcQ2/_generated/favicon-dark/favicon-16x16.png\" media=\"(prefers-color-scheme: dark)\">\u003clink data-mint-head rel=\"icon\" type=\"image/png\" sizes=\"32x32\" href=\"/mintlify-assets/_mintlify/favicons/stianlarsen-ef7289da/ivJJevrtmwvlIcQ2/_generated/favicon-dark/favicon-32x32.png\" media=\"(prefers-color-scheme: dark)\">\u003clink data-mint-head rel=\"shortcut icon\" type=\"image/x-icon\" href=\"/mintlify-assets/_mintlify/favicons/stianlarsen-ef7289da/ivJJevrtmwvlIcQ2/_generated/favicon-dark/favicon.ico\" media=\"(prefers-color-scheme: dark)\">\u003cmeta data-mint-head property=\"og:title\" content=\"Create a single-login database - DBHost\">\u003cmeta data-mint-head property=\"og:description\" content=\"Create a single-login DBHost PostgreSQL database through the API. For separate owner, runtime and read-only roles use managed-create.\">\u003cmeta data-mint-head property=\"og:site_name\" content=\"DBHost\">\u003cmeta data-mint-head property=\"og:url\" content=\"https://docs.dbhost.app/api-reference/databases/create\">\u003cmeta data-mint-head property=\"og:type\" content=\"website\">\u003cmeta data-mint-head property=\"og:image\" content=\"https://dbhost.app/media/og/dbhost-managed-core-1200x630.png\">\u003cmeta data-mint-head property=\"og:image:width\" content=\"1200\">\u003cmeta data-mint-head property=\"og:image:height\" content=\"630\">\u003cmeta data-mint-head name=\"twitter:card\" content=\"summary_large_image\">\u003cmeta data-mint-head name=\"twitter:title\" content=\"Create a single-login database - DBHost\">\u003cmeta data-mint-head name=\"twitter:description\" content=\"Create a single-login DBHost PostgreSQL database through the API. For separate owner, runtime and read-only roles use managed-create.\">\u003cmeta data-mint-head name=\"twitter:image\" content=\"https://dbhost.app/media/og/dbhost-managed-core-1200x630.png\">\u003cmeta data-mint-head name=\"twitter:image:width\" content=\"1200\">\u003cmeta data-mint-head name=\"twitter:image:height\" content=\"630\">\u003cmeta data-mint-head name=\"msapplication-config\" content=\"/mintlify-assets/_mintlify/favicons/stianlarsen-ef7289da/ivJJevrtmwvlIcQ2/_generated/favicon/browserconfig.xml\">\u003cmeta data-mint-head name=\"apple-mobile-web-app-title\" content=\"DBHost\">\u003cmeta data-mint-head name=\"msapplication-TileColor\" content=\"#6366f1\">\u003cmeta data-mint-head name=\"og:image:type\" content=\"image/png\">\u003cmeta data-mint-head name=\"og:image:alt\" content=\"DBHost — Postgres. Handled. Managed PostgreSQL hosting.\">\u003cmeta data-mint-head name=\"twitter:image:alt\" content=\"DBHost — Postgres. Handled. Managed PostgreSQL hosting.\">\u003clink data-mint-head rel=\"canonical\" href=\"https://docs.dbhost.app/api-reference/databases/create\">\u003clink data-mint-head rel=\"alternate\" type=\"application/xml\" href=\"/sitemap.xml\">\u003clink data-mint-head rel=\"alternate\" type=\"text/markdown\" href=\"/api-reference/databases/create.md\">\u003cscript data-mint-head type=\"application/ld+json\">{\"@context\":\"https://schema.org\",\"@graph\":[{\"@type\":\"Organization\",\"@id\":\"https://docs.dbhost.app/#organization\",\"name\":\"DBHost\",\"url\":\"https://docs.dbhost.app\",\"logo\":{\"@type\":\"ImageObject\",\"url\":\"https://mintcdn.com/stianlarsen-ef7289da/SvPvaAf6yywKnLbd/images/logo-light.svg?fit=max\u0026auto=format\u0026n=SvPvaAf6yywKnLbd\u0026q=85\u0026s=04b5e34c4fa58314f697056f22b10346\"}},{\"@type\":\"WebSite\",\"@id\":\"https://docs.dbhost.app#website\",\"name\":\"DBHost\",\"url\":\"https://docs.dbhost.app\",\"publisher\":{\"@id\":\"https://docs.dbhost.app/#organization\"}},{\"@type\":\"WebPage\",\"@id\":\"https://docs.dbhost.app/api-reference/databases/create#webpage\",\"url\":\"https://docs.dbhost.app/api-reference/databases/create\",\"name\":\"Create a single-login database\",\"description\":\"Create a single-login DBHost PostgreSQL database through the API. For separate owner, runtime and read-only roles use managed-create.\",\"dateModified\":\"2026-10-14T12:34:22.546Z\",\"isPartOf\":{\"@id\":\"https://docs.dbhost.app#website\"},\"breadcrumb\":{\"@id\":\"https://docs.dbhost.app/api-reference/databases/create#breadcrumb\"}},{\"@type\":\"BreadcrumbList\",\"@id\":\"https://docs.dbhost.app/api-reference/databases/create#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"DBHost\",\"item\":\"https://docs.dbhost.app\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"Create a single-login database\",\"item\":\"https://docs.dbhost.app/api-reference/databases/create\"}]},{\"@type\":[\"TechArticle\",\"APIReference\"],\"@id\":\"https://docs.dbhost.app/api-reference/databases/create#apireference\",\"headline\":\"Create a single-login database\",\"name\":\"Create a single-login database\",\"description\":\"Create a single-login DBHost PostgreSQL database through the API. For separate owner, runtime and read-only roles use managed-create.\",\"url\":\"https://docs.dbhost.app/api-reference/databases/create\",\"mainEntityOfPage\":{\"@id\":\"https://docs.dbhost.app/api-reference/databases/create#webpage\"},\"image\":\"https://dbhost.app/media/og/dbhost-managed-core-1200x630.png\",\"dateModified\":\"2026-10-14T12:34:22.546Z\",\"publisher\":{\"@id\":\"https://docs.dbhost.app/#organization\"},\"isPartOf\":{\"@id\":\"https://docs.dbhost.app#website\"}}]}\u003c/script>\u003cscript data-mint-head type=\"application/ld+json\">{\"@context\":\"https://schema.org\",\"@type\":\"WebSite\",\"name\":\"DBHost\",\"publisher\":{\"@type\":\"Organization\",\"name\":\"DBHost\"},\"provider\":{\"@type\":\"Organization\",\"name\":\"Mintlify\",\"url\":\"https://mintlify.com\"}}\u003c/script>","agentPointerHref":"/api-reference/databases/create.md","siteName":"DBHost","nav":{"global":null,"tabs":[{"tab":"Documentation","pages":[{"title":"Documentation","href":"/introduction"}]},{"tab":"API Reference","groups":[{"group":"Overview","public":true,"pages":[{"title":"DBHost REST API introduction","sidebarTitle":"Introduction","href":"/api-reference/introduction"},{"title":"DBHost API authentication with API keys","sidebarTitle":"Authentication","description":"Authenticate DBHost REST API and CLI requests with a Bearer API key. Choose selected-database or full-account scope on Pro and Business.","href":"/api-reference/authentication"}]},{"group":"Databases","public":true,"pages":[{"title":"Create a single-login database","sidebarTitle":"Create database","api":"POST /api/v1/databases","href":"/api-reference/databases/create"},{"title":"Create a database with managed SQL roles","sidebarTitle":"Managed database creation","description":"Create a DBHost database with separate owner, runtime and read-only roles through the API, with optional reservation before provisioning.","api":"POST /api/v1/databases/managed","href":"/api-reference/databases/managed-create"},{"title":"List databases","api":"GET /api/v1/databases","href":"/api-reference/databases/list"},{"title":"Get database","api":"GET /api/v1/databases/{id}","href":"/api-reference/databases/get"},{"title":"Start, stop or restart a database","sidebarTitle":"Lifecycle","api":"POST /api/v1/databases/{id}/lifecycle","href":"/api-reference/databases/lifecycle"},{"title":"Set database environment label","sidebarTitle":"Environment","api":"PATCH /api/v1/databases/{id}/environment","href":"/api-reference/databases/environment"},{"title":"Delete database","api":"DELETE /api/v1/databases/{id}","href":"/api-reference/databases/delete"},{"title":"Deleted databases: list, download, recover","sidebarTitle":"Deleted databases","href":"/api-reference/databases/deleted"},{"title":"Connection limits API: PgBouncer server cap","sidebarTitle":"Connection limits","href":"/api-reference/databases/connection-limits"},{"title":"Query timeout defaults API","sidebarTitle":"Query timeouts","href":"/api-reference/databases/query-timeouts"},{"title":"IP allowlist API: list, add and remove CIDRs","sidebarTitle":"IP allowlist","href":"/api-reference/databases/network-allowlist"},{"title":"Extensions API: list, install and upgrade","sidebarTitle":"Extensions","href":"/api-reference/databases/extensions"},{"title":"Direct migration connection API","sidebarTitle":"Direct migration connection","href":"/api-reference/databases/migration-connection"},{"title":"Connection events API: verified PgBouncer logins","sidebarTitle":"Connection events","href":"/api-reference/databases/connection-events"},{"title":"Access audit API: 90 days of access changes","sidebarTitle":"Access audit","href":"/api-reference/databases/access-audit"},{"title":"Reset password","api":"POST /api/v1/databases/{id}/reset-password","href":"/api-reference/databases/reset-password"},{"title":"Managed roles API: list roles and reveal a credential","sidebarTitle":"Managed roles","href":"/api-reference/databases/roles"},{"title":"Additional roles API for managed databases","sidebarTitle":"Additional roles (managed)","href":"/api-reference/databases/custom-roles"},{"title":"Rotate or revoke a managed database role","sidebarTitle":"Managed role changes","api":"POST /api/v1/databases/{id}/role-changes","href":"/api-reference/databases/role-changes"},{"title":"Additional roles API for existing databases","sidebarTitle":"Additional roles","href":"/api-reference/databases/additional-roles"},{"title":"Repair ownership","api":"POST /api/v1/databases/{id}/repair-ownership","href":"/api-reference/databases/repair-ownership"}]},{"group":"Backups","public":true,"pages":[{"title":"Trigger backup","api":"POST /api/v1/databases/{id}/backups","href":"/api-reference/backups/trigger"},{"title":"List backups","api":"GET /api/v1/databases/{id}/backups","href":"/api-reference/backups/list"},{"title":"Download backup","api":"GET /api/v1/databases/{id}/backups/{filename}","href":"/api-reference/backups/download"},{"title":"Delete backup","api":"DELETE /api/v1/databases/{id}/backups/{filename}","href":"/api-reference/backups/delete"},{"title":"Restore a single-login database from its backup","sidebarTitle":"Restore backup","api":"POST /api/v1/databases/{id}/backups/{filename}","href":"/api-reference/backups/restore"},{"title":"Restore a managed-roles database from its backup","sidebarTitle":"Managed restore","href":"/api-reference/databases/managed-restores"},{"title":"Uploaded dump restore is not available","sidebarTitle":"Upload restore (disabled)","href":"/api-reference/backups/restore-upload"}]},{"group":"Collaboration","public":true,"pages":[{"title":"Database members API: add, change role, remove","sidebarTitle":"Members","href":"/api-reference/collaboration/members"},{"title":"Database invitations API: list, resend, revoke","sidebarTitle":"Invitations","href":"/api-reference/collaboration/invitations"}]},{"group":"Webhooks","public":true,"pages":[{"title":"Webhooks API: operation events and signatures","sidebarTitle":"Webhooks","href":"/api-reference/webhooks"}]},{"group":"Previews","public":true,"pages":[{"title":"Preview CI lifecycle API","sidebarTitle":"Preview CI lifecycle","href":"/api-reference/previews/ci-lifecycle"}]},{"group":"Operations","public":true,"pages":[{"title":"Get operation","api":"GET /api/v1/operations/{id}","href":"/api-reference/operations/get"}]}]}]},"basePath":"","title":"Create a single-login database - DBHost","deploymentId":"dpl_Em2U4NQQ2N2DE3HPbPUJVZLnAtvc","buildId":"dpl_Em2U4NQQ2N2DE3HPbPUJVZLnAtvc","dynamics":["c2aa737661","2b790eda92","b0f84f53ff"],"chunks":["OpenApiReferenceProvider-_HcdDqS2.js","snippetPresets-CXnm-WO6.js","utils-Dg59J__o.js","style-to-object-BY3JEAdk.js","utils-D8TRpdk7.js","v4-DIgz8zy6.js","addUniqueKeysToSchema-B6QaxWc5.js","conditional-requirements-CFM0id0Q.js","cloneDeep-DeMZ-lcM.js","_Uint8Array-BjA2mcVW.js","isObject-FP1Yky1u.js","ApiExamples-cjPyMv63.js","usePlaygroundInputsStore-D7BWoaw4.js","shallow-Z1ceDNSG.js","isEqual-BObTuQrO.js","CodeSnippets-D1UZ1AE-.js","CodeSnippet-B373COAT.js","getApiPlaygroundDisplay-CfL-UuDS.js","Page-DuqezyvM.js","DynamicMarkdown-5yMTCLas.js","SectionHeading-BxT1HYfP.js","icon-DYJTTD3g.js","MethodPill-4AyycJeu.js","getPastedJson-Bp3WV6cN.js","Check2Icon-PhZu6Gry.js","axios-CsQoIw0U.js"]}