Turn sign-in on or off for a site
set_site_protectionTurns sign-in on or off for one site's previews or its live site, as the switches in the project's "Who can see it" settings do. With sign-in on, only people in the workspace can open it, after they sign in; with it off, anyone with the address can. Only owners and admins. Previews, and turning sign-in on for the live site, change at once. Turning sign-in off for the live site only asks: Nothing happens until you approve it in CodeGene: the answer gives a link to the request, which waits there for 15 minutes. Send the person that link; you cannot approve it. Then call get_approval with the requestId to learn how it ended. Without address, a live change applies to every part of the live site that can be switched.
Tool call template
Replace each placeholder with a value matching the input schema. Only required parameters are included; add optional parameters as needed.
{
"id": 1,
"jsonrpc": "2.0",
"method": "tools/call",
"params": {
"arguments": {
"project_id": "<project_id>",
"target": "<target>",
"sign_in": "<sign_in>",
"reason": "<reason>"
},
"name": "set_site_protection"
}
}Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| reason | Yes | Why, in a sentence: kept in the workspace's activity. | |
| target | Yes | previews: every preview of the site. live: the live site visitors see. | |
| address | No | For live only: the one address to change, as get_site_protection lists it, such as www.acme.com. | |
| sign_in | Yes | true: only people in the workspace, after they sign in. false: anyone with the address. | |
| project_id | Yes | The site (list_projects gives ids). | |
| workspace_id | No | Workspace id from whoami; omit when there is one. |