# Vcs

This endpoint is used to create, update, search or delete vcs (version control system) information inside a Terrakube organization so you can connect to private git repositories to run modules and workspaces

{% hint style="warning" %}
To use this endpoint you should have "manageVcs" access at team level and a Terrakube Organization
{% endhint %}

### Entity fields:

| Path                         | Type   | Description                                                |
| ---------------------------- | ------ | ---------------------------------------------------------- |
| data.type                    | string | Should be "vcs"                                            |
| data.attributes.name         | string | Unique vcs name for an Terrakube organization              |
| data.attributes.description  | string | Free text for description                                  |
| data.attributes.vcsType      | string | Supported values: GITHUB, GITLAB, BITBUCKET, AZURE\_DEVOPS |
| data.attributes.clientID     | string | Client Application Id                                      |
| data.attributes.clientSecret | string | Client Application secret                                  |

### Example:

```
{
  "data": {
    "type": "vcs",
    "attributes": {
      "name": "GitHubConnection",
      "description": "Private repositories inside GitHub",
      "vcsType": "GITHUB",
      "clientId": "{{githubClientId}}",
      "clientSecret": "{{githubClientSecret}}"
    }
  }
}
```

### Supported Operations

{% openapi src="/files/BH6Ry2IWjwmj5pKh0u5a" path="/organization/{organizationId}/vcs/{vcsId}" method="get" %}
[v1\_4.yml](https://2194998553-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FR6VsmuTZWhfdwP7uD6e0%2Fuploads%2Fgit-blob-2824914a25a0c9dcaeb76f04beced4d42e3917dc%2Fv1_4.yml?alt=media)
{% endopenapi %}

{% openapi src="/files/BH6Ry2IWjwmj5pKh0u5a" path="/organization/{organizationId}/vcs" method="post" %}
[v1\_4.yml](https://2194998553-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FR6VsmuTZWhfdwP7uD6e0%2Fuploads%2Fgit-blob-2824914a25a0c9dcaeb76f04beced4d42e3917dc%2Fv1_4.yml?alt=media)
{% endopenapi %}

{% openapi src="/files/BH6Ry2IWjwmj5pKh0u5a" path="/organization/{organizationId}/vcs/{vcsId}" method="delete" %}
[v1\_4.yml](https://2194998553-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FR6VsmuTZWhfdwP7uD6e0%2Fuploads%2Fgit-blob-2824914a25a0c9dcaeb76f04beced4d42e3917dc%2Fv1_4.yml?alt=media)
{% endopenapi %}

{% openapi src="/files/BH6Ry2IWjwmj5pKh0u5a" path="/organization/{organizationId}/vcs/{vcsId}" method="patch" %}
[v1\_4.yml](https://2194998553-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FR6VsmuTZWhfdwP7uD6e0%2Fuploads%2Fgit-blob-2824914a25a0c9dcaeb76f04beced4d42e3917dc%2Fv1_4.yml?alt=media)
{% endopenapi %}

{% hint style="info" %}
For a complete list of organization operation please visit the [OpenAPI specification](https://github.com/AzBuilder/terrakube-server/tree/main/openapi-spec)
{% endhint %}


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://docs.terrakube.io/2.18.0/api/methods/vcs.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
