Sources API
API endpoints for managing tool sources in the Kubiya platform
Sources API
Sources in Kubiya are collections of tools that can be attached to teammates. Sources can be Git repositories, directories, or other tool collections. The Sources API allows you to create, discover, synchronize, and manage sources.
List all sources
Get source details
Create a new source
Source Discovery
Discover and load a source based on a URL (like a Git repository) or configuration.
Query Parameters
Name | Type | Required | Description |
---|---|---|---|
url | string | No | URL of the source to load (e.g., Git repository) |
runner | string | No | Name of the runner to use for loading the source |
Headers
Name | Required | Description |
---|---|---|
Authorization | Yes | UserKey YOUR_API_KEY |
Content-Type | Yes (for POST) | application/json |
Request Body (POST only)
Response
Get Source Metadata
Retrieve metadata about a specific source.
Path Parameters
Name | Type | Required | Description |
---|---|---|---|
source_id | string | Yes | ID of the source |
Headers
Name | Required | Description |
---|---|---|
Authorization | Yes | UserKey YOUR_API_KEY |
Response
Sync Source
Synchronize a source to update its tools and configuration.
Path Parameters
Name | Type | Required | Description |
---|---|---|---|
source_id | string | Yes | ID of the source to sync |
Query Parameters
Name | Type | Required | Description |
---|---|---|---|
runner | string | No | Name of the runner to use for syncing |
Headers
Name | Required | Description |
---|---|---|
Authorization | Yes | UserKey YOUR_API_KEY |
Content-Type | Yes | application/json |
Request Body
Parameters Explanation
mode
: Sync mode, typically "pull" to get latest changesbranch
: Git branch to sync fromforce
: Whether to force sync even if there are conflictsauto_commit
: Whether to automatically commit changesno_diff
: Whether to skip diff generation
Response
List Source Tools
Retrieve a list of all tools in a specific source.
Path Parameters
Name | Type | Required | Description |
---|---|---|---|
source_id | string | Yes | ID of the source |
Headers
Name | Required | Description |
---|---|---|
Authorization | Yes | UserKey YOUR_API_KEY |
Response
Bind Source to Teammate
Connect a source to a teammate, making all tools in the source available to the teammate.
Path Parameters
Name | Type | Required | Description |
---|---|---|---|
source_id | string | Yes | ID of the source |
teammate_id | string | Yes | ID of the teammate |
Headers
Name | Required | Description |
---|---|---|
Authorization | Yes | UserKey YOUR_API_KEY |
Response
A successful bind operation returns an HTTP 200 status with no response body.
Get Source Teammates
Retrieve all teammates connected to a specific source.
Path Parameters
Name | Type | Required | Description |
---|---|---|---|
source_id | string | Yes | ID of the source |
Headers
Name | Required | Description |
---|---|---|
Authorization | Yes | UserKey YOUR_API_KEY |
Response
Example Usage
Discover a Source
Sync a Source
Bind a Source to a Teammate
Sources can be Git repositories, local directories, or other collections of tools. When using Git repositories, the source will automatically detect and load tool definitions from the repository.
Common Errors
HTTP Status | Description |
---|---|
400 | Bad Request - The request was invalid or malformed |
401 | Unauthorized - API key is missing or invalid |
403 | Forbidden - The API key doesn't have permission to perform this action |
404 | Not Found - The specified source or teammate was not found |
500 | Internal Server Error - An unexpected error occurred on the server |
Next Steps
After setting up sources, you can: