Write files of a website

Up to 50 files written into the folder of a website of a web hosting package, all or none.

WWriteNot idempotentbetaNeeds service_webhosting
Tool
manitu_webhosting_web_file_writeon https://mcp.manitu.de/mcp
POST
/v1/webhosting/web/file/writeon https://api.manitu.de
Try it
Changes the account. Agents say what will happen and wait for an explicit yes before calling it.
readOnlyHint falsedestructiveHint falseidempotentHint falseopenWorldHint false

Writes files into the folder of a website of a web hosting package of the manitu customer account this connection works in, by site_id and fqdn: file_list with up to 50 files, 512 KB together - all written, or none. Before the first write in a conversation, call manitu_webhosting_web_file_guide_get and follow it. mode create (default) for a new file; mode replace for an existing one, with if_match = its sha256 from manitu_webhosting_web_file_get or manitu_webhosting_web_file_list - never guess it; a file changed since is refused (if_match_failed), read it again. mode overwrite replaces whatever is there without a check and cannot be undone - only when the customer explicitly asks to replace the existing files. Folders that are not there are created (create_parents, default true). PHP, .htaccess and .user.ini may be written (is_active_content) - they run on the website. dry_run checks everything and writes nothing. Refused with E2002 per item (/file_list/<n>/path: exists, not_found, path_invalid ...) - then nothing is written - or a conflict (quota_almost_exceeded, quota_exceeded, permission_denied, limit_reached, not_configurable). Tell the customer which files of which website change, and ask for an explicit yes first.

site_idinteger | stringrequired

The site_id from manitu_webhosting_list - never guess one.

pattern ^[1-9][0-9]*$min 1
fqdnstringrequired

The website from manitu_webhosting_web_vhost_list, e.g. www.example.de - the paths are relative to its folder. Never guess one.

min length 3max length 253
file_listarray of objectrequired

The files.

min items 1max items 50
file_list[].pathstringrequired

The file. Below the website's folder, as the answers write it: a file "/index.php" or "/css/style.css", a folder "/css/" ("/" the website's folder). Names: letters, digits and . _ - + = @, no leading dot - except .htaccess, .user.ini and the folder .well-known.

min length 1max length 1024
file_list[].contentstringrequired

The whole content - as text, or base64 with encoding base64.

file_list[].encodingstring

text (default; UTF-8, written as given) or base64 (any bytes, e.g. an image).

One of text base64
file_list[].modestring

create (default): a new file; replace: an existing one, with if_match; overwrite: created or replaced without a check - only when the customer asks for it.

One of create replace overwrite
file_list[].if_matchstring

For replace (only): the sha256 of the file as it was read.

pattern ^[0-9a-f]{64}$
create_parentsboolean

Create folders that are not there (default true).

dry_runboolean

Check everything, write nothing (default false).

fqdnstringrequired
dry_runbooleanrequired
is_completebooleanrequired

Every file was written (false for a dry run) - false otherwise: see status.

result_listarray of objectrequired
result_list[].pathstringrequired
result_list[].statusstringrequired

would_*: a dry run.

One of created replaced would_create would_replace not_written
result_list[].sha256_beforestring | nullrequired

Of the file replaced - null for a new one, or one overwrite could not read.

result_list[].sha256_afterstringrequired

Of the content written - if_match for the next replace.

result_list[].sizeintegerrequired

Bytes.

result_list[].is_active_contentbooleanrequired

Run by the web server (PHP, CGI) or changing how it runs (.htaccess, .user.ini).

One of X-API-Key, Authorization: Bearer … - never more than one in a request. More

site_idinteger | stringrequired

The site_id from manitu_webhosting_list - never guess one.

pattern ^[1-9][0-9]*$min 1
fqdnstringrequired

The website from manitu_webhosting_web_vhost_list, e.g. www.example.de - the paths are relative to its folder. Never guess one.

min length 3max length 253
file_listarray of objectrequired

The files.

min items 1max items 50
file_list[].pathstringrequired

The file. Below the website's folder, as the answers write it: a file "/index.php" or "/css/style.css", a folder "/css/" ("/" the website's folder). Names: letters, digits and . _ - + = @, no leading dot - except .htaccess, .user.ini and the folder .well-known.

min length 1max length 1024
file_list[].contentstringrequired

The whole content - as text, or base64 with encoding base64.

file_list[].encodingstring

text (default; UTF-8, written as given) or base64 (any bytes, e.g. an image).

One of text base64
file_list[].modestring

create (default): a new file; replace: an existing one, with if_match; overwrite: created or replaced without a check - only when the customer asks for it.

One of create replace overwrite
file_list[].if_matchstring

For replace (only): the sha256 of the file as it was read.

pattern ^[0-9a-f]{64}$
create_parentsboolean

Create folders that are not there (default true).

dry_runboolean

Check everything, write nothing (default false).

fqdnstringrequired
dry_runbooleanrequired
is_completebooleanrequired

Every file was written (false for a dry run) - false otherwise: see status.

result_listarray of objectrequired
result_list[].pathstringrequired
result_list[].statusstringrequired

would_*: a dry run.

One of created replaced would_create would_replace not_written
result_list[].sha256_beforestring | nullrequired

Of the file replaced - null for a new one, or one overwrite could not read.

result_list[].sha256_afterstringrequired

Of the content written - if_match for the next replace.

result_list[].sizeintegerrequired

Bytes.

result_list[].is_active_contentbooleanrequired

Run by the web server (PHP, CGI) or changing how it runs (.htaccess, .user.ini).

200Success.400The request does not match the declared input schema.401No credential was presented, or it was not recognised.403The credential is not permitted to use this operation.500The server failed. Nothing about the request was wrong. Whether a change took effect is not known - check before trying it again.503The channel this operation forwards through is unavailable.