Fetch Artifacts
Knowledge & Search
Fetch Artifacts
Retrieve full content for artifacts by their identifiers
POST
Fetch Artifacts
Overview
The Fetch Artifacts endpoint retrieves the full content for specific artifacts identified by their unique identifiers. This is designed to be used after the Search endpoint to fetch content only for the results you need.Workflow
Search
Use
GET /api/search with IncludeContent=false to find relevant artifacts. Each result includes an identifier, description, and contentByteSize.Review
Examine the descriptions and file paths to decide which artifacts you need the full content for.
Request
Body Parameters
Array of artifact identifiers from search results. Maximum 20 identifiers per request.
Response
Array of artifact objects
Code Examples
Example Response
Constraints
| Constraint | Value |
|---|---|
| Max identifiers per request | 20 |
| Identifier format | owner/repo::path::symbol (from search results) |
Error Responses
400 Bad Request
401 Unauthorized
404 Not Found
Best Practices
Batch Requests Efficiently
Batch Requests Efficiently
- Group related artifact fetches into a single request (up to 20)
- Use
contentByteSizefrom search results to estimate response size - Only fetch artifacts you actually need — review descriptions first
Complete Workflow Example
Complete Workflow Example
- Call
GET /api/search?Query=authentication&DescriptionDetail=Fullto find relevant code - Review descriptions to identify the most relevant results
- Call
POST /api/search/artifactswith selected identifiers to get full content - This is more efficient than using
IncludeContent=trueon the search endpoint