Change a text wherever it is written
Finds find in the site's sources (content files and code, under src/), replaces it with replace, commits ONE history entry and starts the build. Refused with 404 when the text is not written as such, and with 409 when it appears more than once unless path narrows it or all is true. JSON content keeps its escaping and stays valid. Costs no credits; changes the draft only.
POST/v1/sites/{site_id}/text:replace
Requires sites:write. Costs no credits. The path ends in /text:replace. Changes the draft only. Visitors see nothing until you publish.
The quickest way to change a visible text when you do not know where it is written. Send find, the text as it reads on the page, and replace, the new text. Atelier201 searches the site’s sources under src/ (content files and page code), replaces the passage, commits one history entry and starts the build: the response carries build with its id.
- Not found (
404). The text is not written as such. A passage split by markup, such as a link or a bold word in the middle, is not one text: send a shorter passage. - Found several times (
409). Narrow it withpath(a file or a glob), send a longer passage, or setall: trueto change every occurrence, for example a new phone number used on several pages. - Content stays valid. In a JSON content file the text is matched and written with JSON escaping, and the file is parsed back before anything is saved.
For a field whose address you know, such as business:/tagline, Change one field does the same with validation against the content model.
Authorizations
Authorizationbearerin headerrequiredPath parameters
site_idstringrequiredThe site's id, or its slug (the address before .atelier201.page).
Body
application/jsonrequiredfindstringrequiredlength: 1–2000 charsThe text to change, exactly as it reads on the page or in the file (case and punctuation included).
replacestringrequiredlength: ≤ 5000 charsThe new text. Empty removes the passage.
pathstringlength: ≤ 300 charsOnly in this file (or glob, e.g. src/pages/*.astro), when the text appears in several.
allbooleanChange every occurrence (a renamed product, a new phone number). Default: refuse when the text appears more than once.
summarystringlength: ≤ 200 charsOne sentence for the history. Default: Change "
Response
Change a text wherever it is written
dataobjectrequiredrequest_idstringrequiredPossible codes: invalid_request, unknown_field, invalid_parameter, invalid_cursor
errorobjectrequiredrequest_idstringrequiredPossible codes: authentication_required, invalid_api_key, api_key_expired, api_key_revoked
errorobjectrequiredrequest_idstringrequiredPossible codes: insufficient_credits
errorobjectrequiredrequest_idstringrequiredPossible codes: insufficient_scope, feature_not_available, admin_required
errorobjectrequiredrequest_idstringrequiredPossible codes: resource_not_found
errorobjectrequiredrequest_idstringrequiredPossible codes: conflict, result_not_ready, idempotency_key_reused
errorobjectrequiredrequest_idstringrequiredPossible codes: result_expired
errorobjectrequiredrequest_idstringrequiredPossible codes: request_too_large
errorobjectrequiredrequest_idstringrequiredPossible codes: request_too_large_for_plan
errorobjectrequiredrequest_idstringrequiredPossible codes: rate_limited
errorobjectrequiredrequest_idstringrequiredPossible codes: internal_error
errorobjectrequiredrequest_idstringrequiredPossible codes: service_unavailable
errorobjectrequiredrequest_idstringrequired