> For the complete documentation index, see [llms.txt](https://docs.octoxlabs.com/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.octoxlabs.com/adapters/c/codebase.md).

# Codebase

Codebase is a hosted source code and project management service. OctoXLabs uses its API to add repositories, with their branches and last commit details, and optionally users to the inventory.

## Use cases

* List the repositories that Codebase reports, with branches and last commit details.

```
Adapters = codebase
```

* Review Codebase users when Fetch Users is on.

```
Adapters = codebase
```

## Before you begin

### Network

| Source              | Destination                                | Port | Protocol |
| ------------------- | ------------------------------------------ | ---- | -------- |
| OctoXLabs connector | Codebase API (default api3.codebasehq.com) | 443  | HTTPS    |

### Required permissions

| Scope or role                      | Permission | Needed for                                                       |
| ---------------------------------- | ---------- | ---------------------------------------------------------------- |
| API key of a user with read access | Read       | Projects, repositories, branches, commits, merge requests, users |

## Create credentials in Codebase

{% stepper %}
{% step %}

### Open your profile

Log in to your Codebase account and navigate to **Settings > My Profile**.
{% endstep %}

{% step %}

### Get the API key

Generate or copy your personal API key. It is used as the password for Basic authentication.
{% endstep %}
{% endstepper %}

## Connection parameters

| Parameter          | Required | Type     | Default             | Description                                             |
| ------------------ | -------- | -------- | ------------------- | ------------------------------------------------------- |
| Domain             | Yes      | Text     | api3.codebasehq.com | Codebase API host.                                      |
| Account            | Yes      | Text     |                     | Codebase account name. Used together with the username. |
| Username           | Yes      | Text     |                     | Codebase username.                                      |
| API Key            | Yes      | Password |                     | Personal API key.                                       |
| Proxy              | No       | Text     |                     | Proxy URL.                                              |
| Timeout            | No       | Number   | 30                  | Seconds to wait for API responses.                      |
| Is Secure          | No       | Boolean  | True                | Use HTTPS.                                              |
| Fetch Source Codes | No       | Boolean  | True                | Fetch repository information.                           |
| Fetch Users        | No       | Boolean  | False               | Fetch Codebase users.                                   |

## Troubleshooting

No adapter-specific error messages are documented for this adapter.

## Change history

{% hint style="info" %}
Available starting from version 6.3.0.
{% endhint %}
