ai
PUT /v1/ai/site-builds/{siteBuildId}/files
Replace one generated file's contents.
Autenticazione
Invia una chiave API come token di tipo bearer. La chiave deve disporre dell'autorizzazione sites.create; una chiave sprovvista di tale autorizzazione viene rifiutata con 403 anziché 404.
Questo endpoint non richiede alcun ID organizzazione. La tua chiave identifica già l'organizzazione a cui appartiene e la risposta è limitata ad essa.
Provalo
Sostituisci qualsiasi elemento tra parentesi angolari con i tuoi valori e il segnaposto key con una chiave dalla tua dashboard.
curl -X PUT https://api.zinndigital.com/v1/ai/site-builds/{siteBuildId}/files \
-H "Authorization: Bearer zdk_live_…" \
-H "Content-Type: application/json" \
-d '{ "path": <string>, "content": <string> }'Hai effettuato l'accesso? La console API nella tua dashboard inserisce il tuo ID organizzazione reale e la tua chiave personale, ed esegue la richiesta sull'API live in modo da poter vedere la risposta effettiva. Apri questo endpoint nella console API
Dettagli
Writes `content` to `path` in this draft, creating the file if it does not exist. Adding `robots.txt` to a generated site is the same act as correcting `index.html`, so both are allowed; the size and file-count caps are what bound it. The path goes through the same validator the builder's own output does — relative, no traversal, and a suffix a static host will serve and that cannot execute on our side. Images cannot be edited here because they are not text. **Refused on a published build** (`published`). A published draft's files are what visitors are seeing; editing them here would make the record disagree with the live site silently, until somebody republished for an unrelated reason. Requires `sites.create`.
Parametri
| Nome | Tipo | Obbligatorio | Che cos'è |
|---|---|---|---|
siteBuildId (path) | Uuid | Sì | — |
Corpo della richiesta
| Nome | Tipo | Obbligatorio | Che cos'è |
|---|---|---|---|
path | string | Sì | Relative path inside the generated site, e.g. `index.html`. |
content | string | Sì | The file's complete new contents. May be empty. |
Risposta
| Nome | Tipo | Obbligatorio | Che cos'è |
|---|---|---|---|
build | SiteBuild | Sì | One "describe a site and we build it" run. `files` is present on the **detail** and create responses and absent from the **list**, deliberately: a generated tree can be a hundre… |
trial | SiteBuilderTrial | No | The **one-time** free allowance for the AI site builder. One grant per organization, for ever — not monthly, and not per site. `granted` is true because the credit was actually… |
Errori che questo endpoint può restituire
401 · 403 · 404 · 422 · 429