The first step of uploading a dump to import: say what it is and get
where to send it. Then PUT the file to uploadUrl as it is, before
expiresAt, with exactly the headers given and nothing else. Send no
cookies or API key, since the URL may be on another host. Then call
startDatabaseImport with uploadId. Postgres takes .sql, .sql.gz
or a custom-format .dump (pg_dump -Fc). MySQL takes .sql or
.sql.gz (mysqldump). The dump stays in the team's storage in Pyo until
its import succeeds, or for PYO_DATABASE_IMPORT_RETENTION_HOURS (24 by
default) when unused. At most PYO_DATABASE_IMPORT_MAX_BYTES (10 GiB by
default). 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/jsonA dump about to be uploaded.
teamId*stringThe team's id.
engine?|"postgres" or "mysql", when known: the file's type is checked for it up front. Else the import says which.
filename*stringThe file's name: .sql, .sql.gz, or (Postgres) .dump.
size*integerIts size in bytes: the file sent must be exactly this.
int640 <= valuecontentType?|Its media type, if any. It comes back in headers.
uploadId (for startDatabaseImport), and where to send the file: uploadUrl (relative to your Pyo's address when it starts with /), method ("PUT"), headers (send exactly these) and expiresAt (start sending before it).
application/jsoncurl -X POST 'https://your-pyo.example.com/api/v1/database-imports/uploads' \
-H 'Content-Type: application/json' \
-d '{
"teamId": "string",
"filename": "string",
"size": 0
}'{}