CorefinityCorefinityDocs
Open the Control PanelControl Panel
Organisation · 4 of 6

corestack_company_agency_detach

Detach an agency.

Scope writeAsks you to confirmNo secrets returned
On this page

When to use it

Detach one of your company's agencies, for example one you no longer work with. The agency's people lose access to your sites, tickets and billing at once. Only your company's owners may detach an agency. Needs the write scope. The same as Detach agency on your organisation page in the Control Panel and DELETE /api/company/agencies/{agency}.

What ends with the link: the sites the agency manages come back to you, its people's SSH keys on your environments are removed, its firewall allowances stop applying to your sites, its people stop following your tickets, and your environments that deploy through its deployment connections lose that repository and need a new deployment connection before their next deployment (corestack_company_agencies_list lists them under repository_gaps). Linking the agency again later does not bring back removed keys, repositories or subscriptions.

Detaching cannot be undone. First call without confirm_agency: nothing changes, and the confirm_mismatch refusal lists what would end in details.effects. Show that to the person, ask them, and only once they have agreed call again with confirm_agency set to the agency's id.

Ask for it

Prompt
Using the Corefinity MCP server, call corestack_company_agency_detach with agency_id 87. (Detach an agency.) Tell me what it returned.

Inputs

agency_idintegerRequired

The agency to detach, an id from corestack_company_agencies_list. At least 1.

confirm_agencyintegerConfirmation

The same id again, sent only after the person agreed. Without it, or with another id, nothing changes. At least 1.

The answer is detached (agency_id, client_id) and effects: what ended, in the preview's shape.

Your assistant fills in a confirmation only after you agree.

Example call

tools/call
{
  "name": "corestack_company_agency_detach",
  "arguments": {
    "agency_id": 87,
    "confirm_agency": 87
  }
}

If it is refused

ReasonWhat to do
confirm_mismatchconfirm_agency is missing or is not the agency's id; field names it. Nothing changed. details.effects is what the detach would end: managed_sites (count, names), repositories (count, environments, other_environments), ssh_keys, firewall (stop_applying, stay_for_review: allowances the agency's people added that belong to you, which stay for you to review), ticket_subscriptions, and summary, the same in plain sentences.
forbiddenYou are not one of your company's owners, your company is archived, or the agency is Corefinity itself (contact Corefinity support to change that link). Nothing changed.
tenant_mismatchYour company has no such agency, or it was already detached.
pin_refusedA token limited to some sites cannot change company-wide links.
invalid_argumentsThe arguments do not match the tool's input schema, or the Control Panel refused a field. Fix the fields named in the answer and call again.
scope_requiredThe token lacks a scope this call needs. Open the link in the answer to add it, then call again.
rate_limitedToo many calls. Wait for the number of seconds the answer names.
temporarily_unavailableThe Control Panel could not answer just now. Nothing was started; try again shortly.
internal_errorSomething went wrong on our side. Quote the trace id to support.

The same task elsewhere

Was this helpful?
Open in ClaudeOpen in ChatGPT