View all methods

repoGroups.removeRepos

Remove repositories from an existing repo group.

The repoGroups API endpoints need to be manually enabled on your DX account. Reach out to your DX account manager to get started.

Facts

Method POST https://yourinstance.getdx.net/api/repoGroups.removeRepos

Arguments

Name Type Description
token Token Auth token passed as an HTTP header.
repos Array<Object> Array of repository objects to remove from the group. Each object should contain source and external_id.

external_id is the repo id assigned by the source. For example, if the source is github, the external_id should be the id assigned by Github. source and external_id can be retrieved with a query of the repos table on the Data Studio page of the DX dashboard.

Example:
[{"source": "github", "external_id": "12345"}]
id Number The ID of the repo group. Either id or reference_id must be provided.
reference_id Text The unique reference ID for the repo group. Either id or reference_id must be provided.

Example:
frontend-team

Note: You must provide either id or reference_id to identify the repo group.

Usage info

This endpoint removes repositories from a repo group. The repositories themselves are not deleted, only their association with the repo group is removed. All specified repositories must currently be assigned to the target repo group - attempting to remove a repository that’s not in the group will return an error.

Example request

This is a typical request:

curl -X POST https://yourinstance.getdx.net/api/repoGroups.removeRepos \
  -H 'Accept: application/json' \
  -H 'Authorization: Bearer xxxx-xxxxxxxxx-xxxx' \
  -H 'Content-Type: application/json' \
  --data '{
  "reference_id": "frontend-team",
  "repos": [
    {
      "source": "github",
      "external_id": "12345"
    },
    {
      "source": "github",
      "external_id": "67890"
    }
  ]
}'

Or by ID:

curl -X POST https://yourinstance.getdx.net/api/repoGroups.removeRepos \
  -H 'Accept: application/json' \
  -H 'Authorization: Bearer xxxx-xxxxxxxxx-xxxx' \
  -H 'Content-Type: application/json' \
  --data '{
  "id": 123,
  "repos": [
    {
      "source": "github",
      "external_id": "12345"
    }
  ]
}'

Example response

{
  "ok": true,
  "data": {
    "id": 123,
    "reference_id": "frontend-team",
    "name": "Frontend Team",
    "parent_id": 456,
    "row_created_at": "2024-01-01T10:00:00Z",
    "row_updated_at": "2024-01-01T10:00:00Z",
    "repos": [
      {
        "source": "github",
        "external_id": "98765"
      }
    ]
  }
}