hosting

POST /v1/sites/{siteId}/databases

Create a database on a site.

Tous les points de terminaison hosting

Authentification

Envoyez une clé API en tant que jeton du porteur. La clé doit posséder l'autorisation sites.manage ; une clé qui ne l'a pas est refusée avec le code 403, et non 404.

Cet endpoint ne prend aucun identifiant d'organisation. Votre clé identifie déjà l'organisation à laquelle elle appartient, et la réponse y est limitée.

Essayer

Remplacez tout ce qui se trouve entre crochets par vos propres valeurs, et le espace réservé à la clé par une clé de votre tableau de bord.

curl -X POST https://api.zinndigital.com/v1/sites/{siteId}/databases \
  -H "Authorization: Bearer zdk_live_…" \
  -H "Content-Type: application/json" \
  -d '{ "name": <string> }'

Connecté ? La console d'API de votre tableau de bord saisit votre véritable ID d'organisation ainsi que votre propre clé, et exécute la requête sur l'API de production afin que vous puissiez voir la réponse réelle. Ouvrir ce point de terminaison dans la console API

Détails

Creates a database and its user, and returns the generated password **exactly once**. The password is generated by this platform rather than chosen by the caller, because it is a machine-to-machine credential that nobody types and a human-chosen one is the weakest link in a stack the customer cannot patch. It is not stored in our records, not logged, and cannot be read back by any endpoint — a customer who loses it creates another database. The effective ceiling is applied before the vendor is called: a package type that does not permit databases, and an allowance that is already spent, are both `422` with a sentence the customer can act on. A name the package already carries is `409`. The vendor prefixes names per package, so the returned `name` is rarely the name that was asked for and the client must show the returned value. `404` for a site with no vendor hosting package. Requires `sites.manage`.

Paramètres

NomTypeObligatoireQu'est-ce que c'est
siteId (path)UuidOuiSite ID (UUIDv7).

Corps de la requête

NomTypeObligatoireQu'est-ce que c'est
namestringOuiThe name to ask for. The server's own name is returned in `SiteHostingDatabase.name` and may differ; there is deliberately no password field here, because the platform generates…

Réponse

NomTypeObligatoireQu'est-ce que c'est
databaseSiteHostingDatabaseOuiThe created database, exactly as `listSiteDatabases` will report it.
passwordstringOuiThe generated password, shown once. Deliberately carries no example — a documented example of a credential field is the shape people copy.

Erreurs que cet point de terminaison peut renvoyer

401 · 403 · 404 · 409 · 422 · 429 · 503