aanet_write_file
Overwrite a file's entire content, creating it if it doesn't exist — use aanet_append_file instead if you want to add one entry without replacing what's there. Fires a file_write webhook event on success (see aanet_register_webhook).
Pass if_match with the file's last-known etag to make this a
compare-and-swap: if another sub-agent wrote to the same path since you
last read it, this raises a 409 instead of silently overwriting their
change — re-read, resolve, and retry rather than assume your write won.
Returns {path, created, etag}.Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| path | Yes | Virtual file path within the workspace. | |
| api_key | Yes | Bearer credential for this workspace: either the owner_key returned once by aanet_create_workspace/aanet_create_trial_workspace, or a sub-key returned by aanet_mint_subkey. Sent under the hood as `Authorization: Bearer <api_key>`. Owner-only tools reject a sub-key with a 403. | |
| content | Yes | Full new content of the file — this replaces it entirely. | |
| if_match | No | The file's current etag (from aanet_read_file or a prior write's response), to detect a concurrent write from another sub-agent. Omit to overwrite unconditionally. | |
| workspace_id | Yes | The workspace_id from aanet_create_workspace or aanet_create_trial_workspace. |