CorefinityCorefinityDocs
Open the Control PanelControl Panel
Agencies and clients · 5 of 6

Detach a client from your agency

Ends the link at once: your people lose access to the client's sites, tickets and billing, and what the preview counts goes with it. It cannot be undone. Only your agency's owners may detach, and confirm_client must be the client's id.

DELETE/api/company/clients/{client}

Path parameters

clientintegerRequired

The id of one of your agency's clients, as GET /company/clients lists it. Digits only. At least 1.

Body

confirm_clientintegerRequired

The id of the client, the same number as in the path.

Returns

200 The link was removed. effects is what ended.

Fields of the 200 answer
detachedobjectRequired

The link that was removed.

Fields
agency_idintegerRequired

At least 1.

client_idintegerRequired

At least 1.

effectsobjectRequired

What detaching a link ends. A client reads the names of its own sites and environments; an agency reads counts only.

Fields
firewallobjectRequired
Fields
stay_for_reviewintegerRequired

Allowances the agency's people added that belong to the client. They stay; review them.

stop_applyingintegerRequired

The agency's own firewall allowances that stop applying to the client's sites.

managed_sitesobjectRequired

The client's sites the agency manages. They go back to the client.

Fields
countintegerRequired
namesarray of strings

Their names. Only for the client.

repositoriesobjectRequired

The client's environments that deploy through one of the agency's deployment connections. Each needs a new connection before its next deployment.

Fields
countintegerRequired
environmentsarray of objects

The environments, by name. Only for the client.

Fields of each item
idintegerRequired

At least 1.

namestringRequired
other_environmentsinteger

Environments that are counted but not named. Only for the client.

sidestringRequired

Who is asking, the client or the agency.

clientagency
ssh_keysobjectRequired

SSH keys the agency's people added, which are removed.

Fields
countintegerRequired
summaryarray of stringsRequired

The same effects as sentences.

ticket_subscriptionsobjectRequired

Subscriptions of the agency's people to the client's tickets, which end.

Fields
countintegerRequired

If it is refused

StatusReasonWhat to do
401noneSend a valid token as Authorization: Bearer <token>.
403forbiddenThe person is not allowed to do this.
403company_unavailableYour company is unavailable.
403two_factor_requiredTurn on two-factor on your account, then send again.
403scope_requiredUse a token with the scope named in scope.
404noneCheck the id. You see only what your account can reach.
422confirm_mismatchSend the confirmation exactly as the field named in field asks for it.
429rate_limitedWait for the seconds in Retry-After.

Reasons are listed by name in Errors and refusals.

The same task elsewhere

curl -X DELETE https://manage.corefinity.com/api/company/clients/1204 \
  -H "Authorization: Bearer $COREFINITY_TOKEN" \
  -H "Accept: application/json" \
  -H "Content-Type: application/json" \
  -d '{
    "confirm_client": 1204
  }'
{
  "detached": {
    "agency_id": 1180,
    "client_id": 1204
  },
  "effects": {
    "firewall": {
      "stay_for_review": 0,
      "stop_applying": 0
    },
    "managed_sites": {
      "count": 0
    },
    "repositories": {
      "count": 1
    },
    "side": "agency",
    "ssh_keys": {
      "count": 0
    },
    "summary": [
      "Your people lose access to this client's sites, tickets and billing at once.",
      "1 environment deploys through the agency's deployment connections. It will need a new deployment connection before its next deployment.",
      "Linking the agency again later does not bring back removed keys, repositories or subscriptions."
    ],
    "ticket_subscriptions": {
      "count": 0
    }
  }
}
Try it

Try it is off for this endpointIt deletes data that cannot be brought back. Copy the request and run it yourself when you are sure.

Was this helpful?
Open in ClaudeOpen in ChatGPT