> For the complete documentation index, see [llms.txt](https://docs.balkan.id/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.balkan.id/getting-started/balkanid-cli/balkanid-api-cli.md). Agents can also search and read this documentation through its [MCP server](https://docs.balkan.id/~gitbook/mcp).

# BalkanID API CLI

BalkanID API CLI is a command line interface that can be installed on any system and provides commands to interact with the BalkanID APIs, both downloading and uploading data.

{% hint style="info" %}
BalkanID API CLI is **NOT publicly available**, but can be requested on demand. Please work with your customer support representative to get access to the BalkanID API CLI. The BalkanID API CLI will require BalkanID API key and API Secret that can be downloaded from your BalkanID Web Application tenant. The data format supported by the CLI for upload and download are the same data formats as supported by the BalkanID API and can be found [here](https://developer.balkan.id).
{% endhint %}

### BalkanID Bulk Download CLI

The `bulk-download-cli` allows you to retrieve various datasets from your BalkanID tenant.

```bash
bulk-download-cli --help
Usage:
  bulk-download-cli [command]

Available Commands:
  admins                Download admins data
  applied-labels        Download applied labels data
  apps                  Download apps data
  business-owners       Download business owners data
  campaigns             Download campaigns data
  completion            Generate the autocompletion script for the specified shell
  custom-insights       Download custom insights data
  employees             Download employees data
  entities              Download entities data
  entity-finding-rules  Download entity finding rules data
  entity-insights       Download entity insights data
  entity-rbac           Download entity rbac data
  entity-relations      Download entity relations data
  entitlements          Download entitlements data for an integration
  filters               Download filters data
  findings              Download findings data
  help                  Help about any command
  integrations          Download integrations data
  labels                Download labels data
  playbook-templates    Download playbook-templates data
  privileged            Download privileged data
  purposes              Download purposes data
  relations             Download employees identities relations data
  requests              Download access requests data
  reviews               Download all reviews
  reviews-by-campaign   Download reviews for a campaign
  rules                 Download rules data
  webhook-templates     Download webhook-templates data

Flags:
  -h, --help   help for bulk-download-cli

Use "bulk-download-cli [command] --help" for more information about a command.
```

### BalkanID Bulk Upload CLI

The `bulk-upload-cli` allows you to upload various datasets to your BalkanID tenant.

```bash
bulk-upload-cli --help
Usage:
  bulk-upload-cli [command]
  
Available Commands:
  admins                Upload admins data
  applied-labels        Upload applied labels data
  apps                  Upload apps data
  business-owners       Upload business owners data
  campaigns             Upload campaigns data
  custom-insights       Upload custom insights data
  employees             Upload employees data
  entities              Upload entities data
  entity-finding-rules  Upload entity finding rules data
  entity-insights       Upload entity insights data
  entity-rbac           Upload entity rbac data
  entity-relations      Upload entity relations data
  entitlements          Upload entitlements data for an integration
  filters               Upload filters data
  findings              Upload findings data
  help                  Help about any command
  integrations          Upload integrations data
  labels                Upload labels data
  playbook-templates    Upload playbook-templates data
  privileged            Upload privileged data
  purposes              Upload purposes data
  relations             Upload employees identities relations data
  requests              Upload access requests data
  reviews               Upload all reviews
  reviews-by-campaign   Upload reviews for a campaign
  rules                 Upload rules data
  webhook-templates     Upload webhook-templates data

Flags:
  -h, --help   help for bulk-upload-cli

Use "bulk-upload-cli [command] --help" for more information about a command.
```

### CLI Usage Examples

Here are some examples demonstrating how to use the `bulk-download-cli` commands. Remember to replace `<SECRET>` and `<API_KEY>` with your actual credentials. The usage pattern for `bulk-upload-cli` follows a similar structure.

#### Example 1: Downloading Campaigns

To download campaigns data, you can specify whether to include completed and draft campaigns.

**Command Help:**

```bash
> bulk-download-cli campaigns --help
```

Output:

```bash
Download campaigns data

Usage:
  bulk-download-cli campaigns [flags]

Flags:
      --api-key string             API Key
  -h, --help                       help for campaigns
      --include-completed string   Include completed campaigns? (y/n)
      --include-draft string       Include draft campaigns? (y/n)
      --secret string              API Key Secret
```

**Running the Command:**

```bash
bulk-download-cli campaigns --secret <YOUR_API_SECRET> --api-key <YOUR_API_KEY>
```

The CLI will then prompt for further details:

```bash
Include completed campaigns? (y/n): y
Include draft campaigns? (y/n): y
Downloading campaigns data...
Download URL: https://<your_download_url>
```

You will receive a download URL where you can retrieve the campaign data.

#### Example 2: Downloading Reviews for a Specific Campaign

To download reviews for a particular campaign, you'll need its Campaign ID.

**Running the Command:**

```bash
bulk-download-cli reviews --secret <YOUR_API_SECRET> --api-key <YOUR_API_KEY>
```

The CLI will prompt for the Campaign ID:

```bash
Campaign ID: 01HBKKYMCTG5YBCF2F1FXC9YWV
Downloading reviews data...
File is not ready yet. Retrying in 5 seconds...
File is not ready yet. Retrying in 5 seconds...
...
File is not ready yet. Retrying in 5 seconds...
Download URL: <your_download_url>
```

The system will periodically check if the file is ready and provide a download URL once it's available.

***

### Need Assistance?

If you need any help or assistance with the BalkanID API CLI or any other part of the platform, don't hesitate to reach out to the **BalkanID team** at **<support@balkan.id>**.


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

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

Perform an HTTP GET request on the following URL with the `ask` and `goal` query parameters:

```
GET https://docs.balkan.id/getting-started/balkanid-cli/balkanid-api-cli.md?ask=<question>&goal=<user_goal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is what the user is ultimately trying to achieve, the reason they need the answer. Sharing it helps GitBook give you a better, more relevant answer. A goal is most helpful when it describes the outcome the user wants rather than restating the question. For example, with `ask=how do I create an API token`, a goal like `automate deployments from our CI pipeline` lets GitBook tailor the answer to that use case.

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.
