Move the code of a site back to Modulify

move_site_code_to_modulify

Copies the code of a site that lives in your GitHub back into a repository Modulify manages.

POST /v1/move_site_code_to_modulifyScopecode:writeMakes changes

This is the Move back to Modulify row of the site's Repository section, covered in Move the code back to Modulify. Modulify edits and publishes from its own repository again once the copy is confirmed. It works on every plan, including Free, and needs the Transfer projects permission.

It brings back the preview branch, the publish branch, which comes back as production if it was renamed, and Modulify's own modulify/ backup branches, except the modulify/chat- branches of its chats. Branches and tags you created yourself stay only in your GitHub. A repository Modulify created in your organisation is archived once the copy is confirmed, and one you picked as an existing repository is left as it is.

It is refused while an AI edit or a publish is running, while the code is still being copied into your GitHub or is already moving back, and while Modulify cannot reach the repository. The response only says the copy started, with the repository in returning. Editing and publishing pause until it finishes, so read get_site_repository until CustomerOwned is false.

Request

Call it with a POST to https://api.modulify.ai/v1/move_site_code_to_modulify, sending the inputs below as a JSON object. The token needs the code:write scope.

It makes changes, so send an Idempotency-Key header whenever you might retry it. A retry with the same key gets the first answer back instead of running again.

curl -X POST https://api.modulify.ai/v1/move_site_code_to_modulify \
  -H "Authorization: Bearer YOUR_TOKEN" \
  -H "Content-Type: application/json" \
  -d '{"projectId":"PROJECT_ID"}'

Over MCP, the same method is the move_site_code_to_modulify tool.

Inputs

Input Type Required Description
projectId string Yes The site id.

Response

Every call answers with the JSON envelope of success, message, data, code and version. data holds the result described above, and on a method that returns a total, count carries it. The response headers carry the call's X-Request-Id and what is left of your per-minute budget in X-RateLimit-Limit, X-RateLimit-Remaining and X-RateLimit-Reset. Errors explains every status code a call can answer with.