---
title: "Disconnect Git Provider"
method: POST
path: "/api/v1/git-providers/{provider_id}/disconnect"
tags: ["git-integration", "Git Integration"]
---

# Disconnect Git Provider

`POST /api/v1/git-providers/{provider_id}/disconnect`

## Request

- Base URL: `http://localhost:8000`
- URL: `http://localhost:8000/api/v1/git-providers/{provider_id}/disconnect`
- Auth: none declared

Disconnect a git provider by revoking its OAuth token and deleting credentials.

For OAuth App providers: revokes the GitHub OAuth token (best-effort),
deletes the credential record, and clears credential_id on the provider.
For GitHub App providers: clears the installation_id (user can reinstall).

The provider record is kept so users can reconnect without losing repo configs.

Args:
    provider_id: Provider public ID (UUID)
    ctx: Application context with session, user, and company info

Returns:
    StandardResponse with success message

## Path parameters

- `provider_id` string, required

## Headers

- `Authorization` string

## Response `200`

Successful Response

- StandardResponse: Standard API response wrapper.
  - `success` boolean, required
  - `data` unknown
  - `message` string, nullable
  - `error` string, nullable
  - `meta` object, nullable

## Other responses

- `422`: Validation Error

---

[API](https://skmtc.dev/anomalyarmor/apis/anomalyarmor-api.md) · [All operations](https://skmtc.dev/anomalyarmor/apis/anomalyarmor-api/llms.txt) · [OpenAPI document](https://skmtc.dev/anomalyarmor/apis/anomalyarmor-api/revisions/51c755fb5d0b?raw)
