Repositories
Repositories represent git repositories connected to IntelliRag. Each repository belongs to a workspace and is identified by its remote URL, which must be unique within a tenant.
The repository object
Section titled “The repository object”{ "id": "r_xxxx", "workspace_id": "w_xxxx", "name": "api-server", "remote_url": "https://github.com/org/api-server", "default_branch": "main", "last_indexed_at": "2024-01-01T00:00:00Z", "index_status": "completed", "symbol_count": 1234, "created_at": "2024-01-01T00:00:00Z"}| Field | Type | Description |
|---|---|---|
id |
string | Unique repository identifier |
workspace_id |
string | ID of the parent workspace |
name |
string | Display name of the repository |
remote_url |
string | Git remote URL (normalized: trimmed .git suffix, lowercased, SSH converted to HTTPS) |
default_branch |
string | Default branch name |
last_indexed_at |
string | ISO 8601 timestamp of the last completed index run, or null if never indexed |
index_status |
string | Current indexing status: idle, running, completed, or failed |
symbol_count |
integer | Total number of symbols extracted from this repository |
created_at |
string | ISO 8601 creation timestamp |
Create a repository
Section titled “Create a repository”POST /v1/workspaces/{workspace_id}/reposCreates a new repository within a workspace. The remote_url is required and must be unique within your tenant.
Path parameters
Section titled “Path parameters”| Parameter | Type | Description |
|---|---|---|
workspace_id |
string | The workspace ID |
Request body
Section titled “Request body”{ "name": "api-server", "remote_url": "https://github.com/org/api-server"}| Field | Type | Required | Description |
|---|---|---|---|
name |
string | Yes | Display name of the repository |
remote_url |
string | Yes | Git remote URL. Must be unique per tenant. |
Response
Section titled “Response”Returns 201 Created with the repository object.
curl -X POST https://api.intellirag.io/v1/workspaces/w_xxxx/repos \ -H "Authorization: Bearer rag_xxxx" \ -H "Content-Type: application/json" \ -d '{"name": "api-server", "remote_url": "https://github.com/org/api-server"}'List repositories
Section titled “List repositories”GET /v1/workspaces/{workspace_id}/reposReturns a paginated list of repositories in a workspace.
Path parameters
Section titled “Path parameters”| Parameter | Type | Description |
|---|---|---|
workspace_id |
string | The workspace ID |
Query parameters
Section titled “Query parameters”| Parameter | Type | Default | Description |
|---|---|---|---|
cursor |
string | - | Pagination cursor from a previous response |
limit |
integer | 50 | Number of items per page (max 100) |
Response
Section titled “Response”Returns a paginated list of repository objects.
curl https://api.intellirag.io/v1/workspaces/w_xxxx/repos \ -H "Authorization: Bearer rag_xxxx"Get a repository
Section titled “Get a repository”GET /v1/repos/{repo_id}Returns a single repository by ID.
Path parameters
Section titled “Path parameters”| Parameter | Type | Description |
|---|---|---|
repo_id |
string | The repository ID |
Response
Section titled “Response”Returns 200 OK with the repository object.
curl https://api.intellirag.io/v1/repos/r_xxxx \ -H "Authorization: Bearer rag_xxxx"Update a repository
Section titled “Update a repository”PATCH /v1/repos/{repo_id}Updates an existing repository. Only include the fields you want to change.
Path parameters
Section titled “Path parameters”| Parameter | Type | Description |
|---|---|---|
repo_id |
string | The repository ID |
Request body
Section titled “Request body”| Field | Type | Required | Description |
|---|---|---|---|
name |
string | No | New display name |
Response
Section titled “Response”Returns 200 OK with the updated repository object.
curl -X PATCH https://api.intellirag.io/v1/repos/r_xxxx \ -H "Authorization: Bearer rag_xxxx" \ -H "Content-Type: application/json" \ -d '{"name": "new-name"}'Delete a repository
Section titled “Delete a repository”DELETE /v1/repos/{repo_id}Deletes a repository and all its indexed data across all datastores. This action is irreversible.
Path parameters
Section titled “Path parameters”| Parameter | Type | Description |
|---|---|---|
repo_id |
string | The repository ID |
Response
Section titled “Response”Returns 204 No Content on success.
curl -X DELETE https://api.intellirag.io/v1/repos/r_xxxx \ -H "Authorization: Bearer rag_xxxx"Index management
Section titled “Index management”These endpoints control the indexing lifecycle for a repository. While the indexer CLI handles indexing automatically, these endpoints let you trigger and monitor index runs programmatically.
Get indexing status
Section titled “Get indexing status”GET /v1/repos/{repo_id}/index/statusReturns the current indexing status of a repository.
Path parameters
Section titled “Path parameters”| Parameter | Type | Description |
|---|---|---|
repo_id |
string | The repository ID |
Response
Section titled “Response”Returns 200 OK with the index status.
curl https://api.intellirag.io/v1/repos/r_xxxx/index/status \ -H "Authorization: Bearer rag_xxxx"Trigger full reindex
Section titled “Trigger full reindex”POST /v1/repos/{repo_id}/index/fullTriggers a full reindex of the repository. This re-processes all files regardless of whether they have changed.
Path parameters
Section titled “Path parameters”| Parameter | Type | Description |
|---|---|---|
repo_id |
string | The repository ID |
Response
Section titled “Response”Returns 202 Accepted.
curl -X POST https://api.intellirag.io/v1/repos/r_xxxx/index/full \ -H "Authorization: Bearer rag_xxxx"Trigger incremental index
Section titled “Trigger incremental index”POST /v1/repos/{repo_id}/index/incrementalTriggers an incremental index that only processes files changed since the last index run.
Path parameters
Section titled “Path parameters”| Parameter | Type | Description |
|---|---|---|
repo_id |
string | The repository ID |
Response
Section titled “Response”Returns 202 Accepted.
curl -X POST https://api.intellirag.io/v1/repos/r_xxxx/index/incremental \ -H "Authorization: Bearer rag_xxxx"Lock indexing
Section titled “Lock indexing”POST /v1/repos/{repo_id}/index/lockLocks the repository to prevent concurrent index runs. A lock is automatically acquired when an index run starts, but you can also lock manually to prevent any indexing during maintenance windows.
Path parameters
Section titled “Path parameters”| Parameter | Type | Description |
|---|---|---|
repo_id |
string | The repository ID |
Response
Section titled “Response”Returns 200 OK.
curl -X POST https://api.intellirag.io/v1/repos/r_xxxx/index/lock \ -H "Authorization: Bearer rag_xxxx"Unlock indexing
Section titled “Unlock indexing”DELETE /v1/repos/{repo_id}/index/lockReleases the index lock, allowing new index runs to proceed.
Path parameters
Section titled “Path parameters”| Parameter | Type | Description |
|---|---|---|
repo_id |
string | The repository ID |
Response
Section titled “Response”Returns 204 No Content.
curl -X DELETE https://api.intellirag.io/v1/repos/r_xxxx/index/lock \ -H "Authorization: Bearer rag_xxxx"