Delete your company's repository connection
Removes a connection of your own company. Only an owner of the company can remove one, and only while no environment deploys through it. Removing cannot be undone, so send the connection's id as confirm_connection.
DELETE/ api/ company/ deployment-connections/ {connection}
Path parameters
connectionintegerRequired
The id of a connection, as the list answers it. Digits only. At least 1.
Body
confirm_connectioninteger or stringRequired
The id of the connection being removed, as a number or a string of digits.
Returns
200 The connection that was removed. Nothing else is deleted.
Fields of the 200 answer
removedobjectRequired
Fields
idintegerRequired
At least 1.
providerstringRequired
The git provider.
githubgitlabbitbucketgitlab_self_hostedusernamestringRequired
If it is refused
| Status | Reason | What to do |
|---|---|---|
401 | none | Send a valid token as Authorization: Bearer <token>. |
403 | company_unavailable | Your company is unavailable. |
403 | forbidden | The person is not allowed to do this. |
403 | scope_required | Use a token with the scope named in scope. |
403 | two_factor_required | Turn on two-factor on your account, then send again. |
404 | none | Check the id. You see only what your account can reach. |
409 | connection_in_use | This connection is still used by 1 environment: Harbour & Finch trade / production (environment 1311). Choose another connection in its deployment settings first; nothing was removed. |
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/deployment-connections/4217 \
-H "Authorization: Bearer $COREFINITY_TOKEN" \
-H "Accept: application/json" \
-H "Content-Type: application/json" \
-d '{
"confirm_connection": 4217
}'use Illuminate\Support\Facades\Http;
$response = Http::withToken(env('COREFINITY_TOKEN'))
->acceptJson()
->delete('https://manage.corefinity.com/api/company/deployment-connections/4217', [
'confirm_connection' => 4217,
]);
$data = $response->json();const res = await fetch('https://manage.corefinity.com/api/company/deployment-connections/4217', {
method: 'DELETE',
headers: {
Authorization: `Bearer ${process.env.COREFINITY_TOKEN}`,
Accept: 'application/json',
'Content-Type': 'application/json',
},
body: JSON.stringify({
confirm_connection: 4217,
}),
});
// 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/deployment-connections/4217",
headers={
"Authorization": f"Bearer {os.environ['COREFINITY_TOKEN']}",
"Accept": "application/json",
},
json={
"confirm_connection": 4217,
},
)
data = res.json() if res.content else None{
"removed": {
"id": 4217,
"provider": "gitlab",
"username": "daniel-reyes"
}
}{
"message": "Unauthenticated."
}{
"code": "company_unavailable",
"message": "Your company is unavailable.",
"reason": "company_unavailable"
}{
"message": "Not found."
}{
"code": "connection_in_use",
"environments": [
{
"environment_id": 1311,
"name": "production",
"site_id": null,
"website": "Harbour & Finch trade",
"website_id": 1310
}
],
"message": "This connection is still used by 1 environment: Harbour & Finch trade / production (environment 1311). Choose another connection in its deployment settings first; nothing was removed.",
"other_environments": 0,
"reason": "connection_in_use"
}{
"code": "confirm_mismatch",
"errors": {
"confirm_connection": [
"Removing the GitLab connection for daniel-reyes cannot be undone. To remove it, send confirm_connection set to its id, 4217. Nothing was removed."
]
},
"field": "confirm_connection",
"message": "Removing the GitLab connection for daniel-reyes cannot be undone. To remove it, send confirm_connection set to its id, 4217. Nothing was removed.",
"reason": "confirm_mismatch"
}{
"code": "rate_limited",
"message": "Too many requests. Try again in 60 seconds.",
"reason": "rate_limited",
"retry_after_seconds": 60
}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?