Write one file of a code website
Creates or replaces the file at `path` as one new commit on `expectedHead`, up to 1 MiB, and builds it as a draft. A file that instructs AI tools or runs on a computer (AGENTS.md, CLAUDE.md, .claude/, .mcp.json, package.json and similar) asks the person first and must be UTF-8 text. 409 SITE_CODE_HEAD_MOVED (`details.head`: read again, then write on it), SITE_CODE_WRITE_PENDING (another write is on its way: retry after `Retry-After`), SITE_CODE_REPO_NOT_READY; 422 SITE_CODE_CHANGE_REFUSED for a path, size, encoding or file the rules don't allow (`details.path`, `details.reason`); 403 CONFIRMATION_REQUIRED when a change that needs the person's confirmation arrives without it; 403 OAUTH_SCOPE_REQUIRED for a connection without the `site_code` scope (reconnect Smileline). 202 `pending` when the change is stored and still being saved.
Loading the API reference…