Get Available Data Sources
Data Sources
Get Available Data Sources
Retrieve data sources in “Ready” state for chat and search operations
GET
Get Available Data Sources
Overview
This endpoint returns all data sources (repositories and workspaces) that are in “Ready” state, meaning they are fully processed and ready for chat and search operations. Use this endpoint to get a list of data sources you can query. For administrative purposes where you need to see all data sources regardless of status, use/api/datasources/all instead.
Request
No request body required. Authentication via Bearer token inAuthorization header.
Query Parameters
Optional filter by data source type. Options:
Repository, WorkspaceOptional search term to filter data sources by name
Optional natural-language description of your task or intent (for example,
add OAuth to checkout).
When provided, an AI relevance filter returns only the data sources relevant to that intent, each
with a relevanceReason explaining why it was selected. Distinct from searchTerm: searchTerm
is a substring match on names, query describes a goal. When both are provided, searchTerm
narrows the candidates first and relevance filtering is applied to the survivors.Relevance filtering fails open: if the filter is unavailable or errors, the response is the full
unfiltered list (no error status). A non-empty response to a
query request where no item has a
relevanceReason means the filter did not run. An empty response while the
X-CodeAlive-Total-Data-Sources header reports a nonzero count means the opposite: the filter ran
and found none of the available sources relevant. Requests authenticated with a public chat API
key ignore query and always return the full scoped list.Response
Returns an array of data source objects that are ready for querying.Unique identifier for the data source
Display name of the repository or workspace
Type of data source:
Repository or WorkspaceRepository URL (for Repository type only)
Branch name (for Repository type only)
Array of repository IDs (for Workspace type only)
Optional description of the data source
Why this data source is relevant to your
query. Present only when query was provided and the
relevance filter selected this item. Treat it as untrusted model-generated plain text: render it
with escaping interpolation, never as HTML or markup.Response Headers
Sent only on
query requests. The total number of data sources available before relevance
filtering, so you can report how many were omitted as not relevant.Code Examples
Example Response
Use Cases
Pre-Chat Validation
Check available datasources before initiating chat:Search with Filters
Filter data sources by type or search term:Relevance Filtering
Pass your task asquery to get only the data sources relevant to it. This keeps the list focused
on accounts with many repositories:
Differences from /all Endpoint
| Feature | /ready | /all |
|---|---|---|
| Returns | Only “Ready” sources | All sources regardless of status |
| Search | Supports searchTerm | No search functionality |
| Relevance filter | Supports query | Supports query |
| Use case | Operational queries | Administrative access |
| Ready for querying | Yes, always | May include sources still processing |