Delete a forge connection and its unreferenced credential (ADR-0060)
DELETE
/v1/connections/{id}
const url = 'https://example.com/v1/connections/example';const options = {method: 'DELETE'};
try { const response = await fetch(url, options); const data = await response.json(); console.log(data);} catch (error) { console.error(error);}curl --request DELETE \ --url https://example.com/v1/connections/exampleTwo deliberate safeties:
- Bound repos block the delete unless
unbind_repos=true. A Project is a repo binding (ADR-0046), so deleting a connection deletes governance — the same reasoning that stopsresyncfrom ever unbinding. A one-word query parameter is cheap; a silently deleted Environment is not recoverable from the UI. - A shared credential survives. Every GitHub App installation points at
the one
github-apphandle, so deleting one installation must not pull the material out from under the others. The secret is removed only when no remaining connection references that handle.
Parameters
Section titled “Parameters”Path Parameters
Section titled “Path Parameters”id
required
string
Connection id
Query Parameters
Section titled “Query Parameters”unbind_repos
boolean
Acknowledge that the connection’s Projects go with it
Responses
Section titled “Responses”Connection deleted
Requires Administer on the org
No such connection, or no registry wired
The connection still has bound repos (Projects)