Copies a Postgres or MySQL database into one of the team's: a new one
(newDatabase), or an empty one (databaseId). From url (the source
must be reachable from the cluster) or uploadId (a dump uploaded
first). It's checked first, as checkDatabaseImport. Then the
database's import shows how it goes ("pending", "running", "succeeded"
or "failed", with a phase), and its logs have the import's output.
Writes made to the source during the import aren't copied. Owners and
admins.
API key access: full.
apiKeyAuthorizationBearer <pyo_…>An API key from the dashboard's API keys page: Authorization: Bearer pyo_…. Keys can expire, and an expired one gets a 401.
application/jsonAn import: where to (databaseId, or newDatabase), and from where
(url, or uploadId).
teamId*stringengine*string"postgres" or "mysql".
databaseId?|An existing, empty database of the team's to import into.
newDatabase?null|url?|The database to copy, as a URL the cluster can reach: postgres://user:password@host:5432/database or mysql://user:password@host:3306/database, with ?sslmode=require (or ssl-mode=REQUIRED), verify-ca or verify-full for TLS.
uploadId?|Or a dump uploaded first (createDatabaseDumpUpload, then its file sent).
Started: importId, databaseId, clusterId, and what the check found (source, extensions).
application/jsoncurl -X POST 'https://your-pyo.example.com/api/v1/database-imports' \
-H 'Content-Type: application/json' \
-d '{
"teamId": "string",
"engine": "string"
}'{}