---
title: "Update GitHub CI Visibility status"
method: PATCH
path: "/api/v2/ci/github/accounts"
tags: ["CI Visibility GitHub Accounts"]
---

# Update GitHub CI Visibility status

`PATCH /api/v2/ci/github/accounts`

## Request

- Base URL: `https://api.datadoghq.com`
- URL: `https://api.datadoghq.com/api/v2/ci/github/accounts`
- Auth: one of:
  - API key in header `DD-API-KEY` and API key in header `DD-APPLICATION-KEY`
  - OAuth 2
    - Authorization code: `/oauth2/v1/authorize`
    - Token URL: `/oauth2/v1/token` scopes: `ci_provider_settings_write`
- TypeScript: <https://skmtc.dev/datadog/apis/datadog-api-v2-collection/docs/api/v2/ci/github/accounts/patch.ts> (a function with typed inputs; its response is checked against the schema)

Enable or disable CI Visibility for a GitHub account, one of its repositories, or both in the same request.
The account (and, optionally, repository) are identified by name. Account-level and repository-level
changes are independent and may both be supplied in the same request. At least one of `enabled` or
`repository.enabled` must be provided. If the account name matches installations on more than one host,
`host` must be supplied to disambiguate, otherwise a 409 is returned. Returns a 404 if the CI Visibility
GitHub integration is not enabled for this organization, or if the given account or repository cannot be
found by name.

## Request body

- CIAppGitHubAccountUpdateRequest: Request object for updating a GitHub account's CI Visibility opt-in status.
  - `data` CIAppGitHubAccountUpdateRequestData, required: Data object for updating a GitHub account's CI Visibility opt-in status.
    - `attributes` CIAppGitHubAccountUpdateRequestAttributes, required: Attributes for updating a GitHub account's CI Visibility opt-in status. At least one of `enabled` or `repository.enabled` must be provided.
      - `account` string, required: The GitHub account (organization or user) name to update, identified by name.
      - `enabled` boolean: Whether to enable or disable CI Visibility at the account level.
      - `host` string: The GitHub host (`github.com` or a GHES hostname) the account belongs to. Required to disambiguate when the same account name exists on more than one host.
      - `repository` CIAppGitHubAccountUpdateRequestRepository: Repository-level opt-in change to apply, identified by name.
        - `enabled` boolean, required: Whether to enable or disable CI Visibility for this repository.
        - `name` string, required: The repository name to update.
    - `type` 'ci_github_account', required: JSON:API type for the GitHub account resource. The value must always be `ci_github_account`.

## Response `200`

OK

- CIAppGitHubAccountResponse: Response object containing a single GitHub account's CI Visibility opt-in status.
  - `data` CIAppGitHubAccountData, required: Data object for a GitHub account.
    - `attributes` CIAppGitHubAccountAttributes, required: Attributes describing a GitHub account's CI Visibility opt-in status.
      - `account` string: The GitHub account (organization or user) name.
      - `enabled` boolean: Whether CI Visibility is enabled at the account level.
      - `host` string: The GitHub host (`github.com` or a GitHub Enterprise Server (GHES) hostname) this account belongs to.
      - `repo_count` integer: The number of repositories known for this account.
      - `repositories` CIAppGitHubAccountRepository[]: The repositories belonging to this account, with their individual opt-in status.
        - `enabled` boolean: Whether CI Visibility is enabled for this repository.
        - `name` string: The repository name.
    - `id` string, required: The account's unique identifier, in the form `<host>/<account name>` (for example `github.com/datadog`).
    - `type` 'ci_github_account', required: JSON:API type for the GitHub account resource. The value must always be `ci_github_account`.

## Other responses

- `400`: Bad Request
- `403`: Not Authorized
- `404`: Not Found
- `409`: Conflict
- `429`: Too many requests

---

[API](https://skmtc.dev/datadog/apis/datadog-api-v2-collection.md) - [All operations](https://skmtc.dev/datadog/apis/datadog-api-v2-collection/llms.txt) - [OpenAPI document](https://skmtc.dev/datadog/apis/datadog-api-v2-collection/revisions/3f70db624329?raw)
