Developer Hub
Request Demo
Request Demo
Support
  1. Entitlements
  • Getting Started
    • Introduction
  • API Reference
    • Admins
      • Bulk Admins Download API (Early Access)
    • Apps
      • Bulk Apps Download API (Early Access)
    • Business Owners
      • Bulk Business Owners Download API (Early Access)
      • Bulk Business Owners Upload API (Early Access)
    • Campaigns
      • Bulk Campaigns Download API (Early Access)
      • Bulk Campaigns Upload API (Early Access)
    • Configuration
      • Bulk Applied Labels Upload API (Early Access)
      • Bulk Entity Finding Rules Download API (Early Access)
      • Bulk Custom Insights (Entity Rules) Download API (Early Access)
      • Bulk Filters Download API (Early Access)
      • Bulk Filters Upload API (Early Access)
      • Bulk Findings Download API (Early Access)
      • Bulk Findings Upload API (Early Access)
      • Bulk Labels Download API (Early Access)
      • Bulk Labels Upload API (Early Access)
      • Bulk Privileged Download API (Early Access)
      • Bulk Privileged Upload API (Early Access)
      • Bulk RBAC Download API (Early Access)
      • Bulk RBAC Upload API (Early Access)
      • Bulk RBAC2 Download API (Early Access)
      • Bulk RBAC2 Upload API (Early Access)
      • Bulk Rules Download API (Early Access)
      • Bulk Rules Upload API (Early Access)
    • Employees
      • Bulk Employees Download API (Early Access)
      • Bulk Employees Upload API (Early Access)
    • Entitlements
      • Bulk Entitlements Download API (Early Access)
        POST
      • Bulk Entitlements Upload API (Early Access)
        POST
    • Entities
      • Bulk Entities Download API (Early Access)
      • Bulk Entities Upload API (Early Access)
    • EntityInsights
      • Bulk Entity Insights Download API (Early Access)
      • Bulk Entity Insights Upload API (Early Access)
    • EntityRelations
      • Bulk Entity Relations Download API (Early Access)
      • Bulk Entity Relations Upload API (Early Access)
    • EntityRBAC
      • Bulk Entity RBAC Download API
      • Bulk Entity RBAC Upload API
    • Integrations
      • Bulk Integrations Download API (Early Access)
      • Bulk Integrations Upload API (Early Access)
    • Purposes
      • Bulk Purposes Download API (Early Access)
      • Bulk Purposes Upload API (Early Access)
    • Relations
      • Bulk Relations Download API (Early Access)
      • Bulk Relations Upload API (Early Access)
    • Requests
      • Bulk Requests Download API (Early Access)
      • Bulk Requests Upload API (Early Access)
    • Reviews
      • Bulk Reviews Download API (Early Access)
      • Bulk Reviews Upload API (Early Access)
    • Playbooks
      • Bulk Playbook Templates Download API (Early Access)
      • Bulk Playbook Templates API (Early Access)
    • Webhooks
      • Bulk Webhook Templates Download API (Early Access)
      • Bulk Webhook Templates API (Early Access)
  • Playbooks
    • Overview
  1. Entitlements

Bulk Entitlements Upload API (Early Access)

POST
https://app.balkan.id/api/rest/v0/entitlements/upload-url
Entitlements

BalkanID Entitlements Upload CSV Format#

In this section, we will explain the BalkanID Entitlements CSV format.

Sample CSV#

ProjectPrivilege Name*Privilege Value*EmailUser IDUsernameNameConnectionConnection TypeResourceResource Type
balkanidpulltrueayden@example.com01234567koch71Ayden Kochreadrespository-roleopsrepository
balkanidpushfalseayden@example.com01234567koch71Ayden Kochreadrespository-roleopsrepository
balkanidadminfalseayden@example.com01234567koch71Ayden Kochreadrespository-roleopsrepository
balkanidpulltrueayden@example.com01234567koch71Ayden Kochadminrespository-roleopsrepository
balkanidpushtrueayden@example.com01234567koch71Ayden Kochadminrespository-roleopsrepository
balkanidadmintrueayden@example.com01234567koch71Ayden Kochadminrespository-roleopsrepository
NOTE: Columns with * are required always.
NOTE: In this sample we are using Github example for familiarity. Please note that BalkanID offers a direct Github integration.
Column Definitions#
Column NameColumn Description
ProjectOptional - This is a “project”-level of organization in your application. This can be a Github organization, Slack organization, AWS account number, Azure directory, Google domain, Okta Site URL, etc. In the sample CSV, this is a Github organization “balkanid”. While optional, it is recommended that you provide Project value. If not provided, the Project value is set to “default”.
Privilege NameRequired - The name of the action/permission/entitlement. These are typically actions that can be taken on a resource. In the sample CSV, these are “pull”, “push”, and “admin”, which are actions associated with a repository.
Privilege ValueRequired - In many cases, these will be “true”. In some cases, it is useful to model an explicit deny by including entitlements where Privilege Value is “false”. In the sample CSV, we see both “true” and “false” privilege values.
EmailOne of Email, User ID, or Username required - The email associated with the identity to which this entitlement belongs to, if available. In the sample CSV, this is “ayden@example.com”.
User IDOne of Email, User ID, or Username required - Some applications have an ID that is separate from email or username. This is the place to include that ID.
UsernameOne of Email, User ID, or Username required - The username associated with the identity to which this entitlement belongs to. In the sample CSV, this is “koch71”.
NameOptional - The name of the identity to which this entitlement belongs to, if available. This can be the name of a person, a service account, or other names.
ConnectionOptional, required if Connection Type is present - Connection describes how the identity (identified by the Username) gains the privilege (identified by Privilege Name and Privilege Value) to the resource (identified by Resource and Resource Type). In the sample CSV, the connection is the repository role granted to the identity: “read” and “admin”.
Connection TypeOptional, required if Connection is present - Connection Type describes the type of the Connection. Typical connection types are “role”, “policy”, “group”, but can include others depending on your application authorization structure. In the sample CSV, this is “repository-role”.
Connection ProviderOptional - The provider of the Connection, used to represent a multilevel connection. If this is present, Connection and Connection Type must also be present.
Connection Provider TypeOptional - The type of the Connection Provider, If this is present, Connection Provider, Connection and Connection Type must not be empty.
ResourceOptional, required if Resource Type is present - The resource this entitlement references. In the sample CSV, the resource is the “ops” repository.
Resource TypeOptional, required if Resource is present - A useful resource type that groups resources in your application. This can be a Github repository/organization/application, AWS service, a Slack channel, etc. In the sample CSV, the resource type is “repository”.
Project AliasesOptional - This is a comma-separated list of aliases for the Project. This is useful when you have multiple names for the same Project.
Required Columns#
Privilege Name and Privilege Value are always required.
One of Email, User ID, or Username are required. You may provide one, two, or all three of Email, User ID, or Username.
If you provide Connection or Connection Type column, the other one Connection Type or Connection is required.
If Connection Provider and Connection Provider Type is present, then Connection and Connection Type column is required.
If you provide Resource or Resource Type column, the other one Resource Type or Resource is required.
All other columns are optional.

Restrictions#

When Email, User ID, and Username are provided together, instead of only one of them, they always have to correspond to the same triplet.
For example, the following is valid because the triplet of Email, User ID, and Username is the same in both rows:
EmailUser IDUsername
ayden@example.com01234567koch71
ayden@example.com01234567koch71
However, the following is not valid and will result in an error, because the same Email and User ID have two different Usernames associated with them:
EmailUser IDUsername
ayden@example.com01235467koch71
ayden@example.com01235467ayden71
Similarly, the following is not valid and will result in an error, because the Username and User ID have two different Emails associated with them:
EmailUser IDUsername
ayden@example.com01235467koch71
ayden.koch@example.com01235467koch71
Similarly, the following is not valid and will result in an error because the Username and Email have two different User IDs associated with them:
EmailUser IDUsername
ayden@example.com01235467koch71
ayden@example.com98765432koch71
In summary, you only need to provide one of: Email, User ID, Username. If you provide more than one, the combination of Email, User ID, and or Username must be the same on every row they appear on.

Upload the CSV file via the pre-signed URL#

After retrieving the pre-signed URL in the previous step, all that remains is to upload the CSV in BalkanID Canonical CSV format to the pre-signed URL.
Below is a summary of the request using curl:
The request URL is the pre-signed URL from previous step.
The request method is PUT.
Required request body is the CSV in BalkanID Entitlements CSV format.

Request

Header Params
X-Api-Key-ID
string 
optional
X-Api-Key-Secret
string 
optional
Content-Type
string 
optional
Default:
application/json
Body Params application/json
integrationID
string 
required
The integration ID to which the entitlements belong to.
Example
{
    "integrationID": "string"
}

Request samples

Shell
JavaScript
Java
Swift
Go
PHP
Python
HTTP
C
C#
Objective-C
Ruby
OCaml
Dart
R
Request Request Example
Shell
JavaScript
Java
Swift
curl --location --request POST 'https://app.balkan.id/api/rest/v0/entitlements/upload-url' \
--header 'X-Api-Key-ID;' \
--header 'X-Api-Key-Secret;' \
--header 'Content-Type: application/json' \
--data-raw '{
    "integrationID": "string"
}'

Responses

🟢200OK
application/json
upload url response
Body
Upload URL endpoint response
url
string 
required
The value is the pre-signed URL to which to upload your CSV file.
Example
{
    "url": "string"
}
🔴500Server Error
Previous
Bulk Entitlements Download API (Early Access)
Next
Bulk Entities Download API (Early Access)
Built with