Detach an agency from your company
Ends the link at once: the agency's people lose access to your sites, tickets and billing, and what the preview lists goes with it. It cannot be undone; linking the agency again does not bring back removed keys, repositories or subscriptions. Only your company's owners may detach, and confirm_agency must be the agency's id.
Path parameters
The id of an agency your company is a client of, as GET /company/agencies lists it. Digits only. At least 1.
Body
The id of the agency, the same number as in the path.
Returns
200 The link was removed. effects is what ended.
Fields of the 200 answer
The link that was removed.
Fields
At least 1.
At least 1.
What detaching a link ends. A client reads the names of its own sites and environments; an agency reads counts only.
Fields
Fields
Allowances the agency's people added that belong to the client. They stay; review them.
The agency's own firewall allowances that stop applying to the client's sites.
The client's sites the agency manages. They go back to the client.
Fields
Their names. Only for the client.
The client's environments that deploy through one of the agency's deployment connections. Each needs a new connection before its next deployment.
Fields
The environments, by name. Only for the client.
Fields of each item
At least 1.
Environments that are counted but not named. Only for the client.
Who is asking, the client or the agency.
clientagencySSH keys the agency's people added, which are removed.
Fields
The same effects as sentences.
Subscriptions of the agency's people to the client's tickets, which end.
Fields
If it is refused
| Status | Reason | What to do |
|---|---|---|
401 | none | Send a valid token as Authorization: Bearer <token>. |
403 | forbidden | The person is not allowed to do this. |
403 | company_unavailable | Your company is unavailable. |
403 | two_factor_required | Turn on two-factor on your account, then send again. |
403 | scope_required | Use a token with the scope named in scope. |
404 | none | Check the id. You see only what your account can reach. |
422 | confirm_mismatch | Send the confirmation exactly as the field named in field asks for it. |
429 | rate_limited | Wait 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/agencies/1180 \
-H "Authorization: Bearer $COREFINITY_TOKEN" \
-H "Accept: application/json" \
-H "Content-Type: application/json" \
-d '{
"confirm_agency": 1180
}'use Illuminate\Support\Facades\Http;
$response = Http::withToken(env('COREFINITY_TOKEN'))
->acceptJson()
->delete('https://manage.corefinity.com/api/company/agencies/1180', [
'confirm_agency' => 1180,
]);
$data = $response->json();const res = await fetch('https://manage.corefinity.com/api/company/agencies/1180', {
method: 'DELETE',
headers: {
Authorization: `Bearer ${process.env.COREFINITY_TOKEN}`,
Accept: 'application/json',
'Content-Type': 'application/json',
},
body: JSON.stringify({
confirm_agency: 1180,
}),
});
// An answer with no body (204) has nothing to parse.
const text = await res.text();
const data = text && JSON.parse(text);import os
import requests
res = requests.delete(
"https://manage.corefinity.com/api/company/agencies/1180",
headers={
"Authorization": f"Bearer {os.environ['COREFINITY_TOKEN']}",
"Accept": "application/json",
},
json={
"confirm_agency": 1180,
},
)
data = res.json() if res.content else None{
"detached": {
"agency_id": 1180,
"client_id": 1204
},
"effects": {
"firewall": {
"stay_for_review": 0,
"stop_applying": 0
},
"managed_sites": {
"count": 0,
"names": []
},
"repositories": {
"count": 1,
"environments": [
{
"id": 1311,
"name": "Production"
}
],
"other_environments": 0
},
"side": "client",
"ssh_keys": {
"count": 0
},
"summary": [
"The agency's people lose access to your 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
}
}
}{
"message": "Unauthenticated."
}{
"code": "forbidden",
"message": "An archived company cannot change its agency links. Contact Corefinity support.",
"reason": "forbidden"
}{
"message": "Not found."
}{
"code": "confirm_mismatch",
"effects": {
"firewall": {
"stay_for_review": 0,
"stop_applying": 0
},
"managed_sites": {
"count": 0,
"names": []
},
"repositories": {
"count": 1,
"environments": [
{
"id": 1311,
"name": "Production"
}
],
"other_environments": 0
},
"side": "client",
"ssh_keys": {
"count": 0
},
"summary": [
"The agency's people lose access to your 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
}
},
"errors": {
"confirm_agency": [
"Detaching this agency ends its access at once and cannot be undone. To detach it, send confirm_agency set to its id, 1180. Nothing was changed."
]
},
"field": "confirm_agency",
"message": "Detaching this agency ends its access at once and cannot be undone. To detach it, send confirm_agency set to its id, 1180. Nothing was changed.",
"reason": "confirm_mismatch"
}{
"code": "rate_limited",
"message": "Too many requests. Try again in 60 seconds.",
"reason": "rate_limited",
"retry_after_seconds": 60
}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.