Use a domain for previews
add_preview_domainAsks to put the person's own domain on a project's previews. With git_branch, the domain always shows that one preview's latest version (staging.acme.com shows staging); without it, every preview gets its own address under the domain (fix-header.preview.acme.com), which needs a subdomain, not the bare domain. Owners and admins of the project only. It needs the workspace's preview domains add-on: when the answer says so, start_add_on gives its price and where the person turns it on. 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. Once approved, the answer of get_approval lists the two records to add where the domain is managed, in that provider's own field names; CodeGene then checks for them, issues certificates and adds preview addresses by itself.
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>",
"domain": "<domain>",
"reason": "<reason>"
},
"name": "add_preview_domain"
}
}Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| domain | Yes | The domain for previews, such as preview.acme.com or staging.acme.com. | |
| reason | Yes | Why, in a sentence: kept in the workspace's activity. | |
| git_branch | No | The one preview the domain always shows, by its git branch name (such as staging). Leave it out to give every preview its own address. | |
| project_id | Yes | The project (list_projects gives ids). | |
| component_id | No | Which part of the project, when it has more than one that can take an address. | |
| workspace_id | No | Workspace id from whoami; omit when there is one. |