Skip to main content

Search

Perform semantic search across all documents in your workspace.

POST /api/v1/search

Authentication

Requires an API key with the search permission.

HeaderValue
X-API-Keyink_live_abc123...
Content-Typeapplication/json

Request Body

FieldTypeRequiredDefaultDescription
querystringYes--The search query. Must be between 1 and 1000 characters.
limitintegerNo10Maximum number of results to return. Range: 1--100.
min_scorefloatNo0.0Minimum similarity score threshold. Range: 0.0--1.0. Results below this score are excluded.
document_idsstring[]NonullRestrict search to specific documents by their IDs.

Code Examples

curl -X POST https://api.inherent.systems/api/v1/search \
-H "X-API-Key: $INHERENT_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"query": "How do I authenticate API requests?",
"limit": 5,
"min_score": 0.7
}'

Response

Status: 200 OK

{
"results": [
{
"chunk_id": "a1b2c3d4-0001-4000-8000-000000000001",
"document_id": "a1b2c3d4-0001-4000-8000-000000000010",
"document_name": "API Authentication Guide.md",
"content": "All API requests require authentication using a Bearer token or X-API-Key header. Include your API key in the request header to access any protected endpoint...",
"score": 0.94,
"metadata": {
"category": "documentation"
}
},
{
"chunk_id": "a1b2c3d4-0001-4000-8000-000000000002",
"document_id": "a1b2c3d4-0001-4000-8000-000000000010",
"document_name": "API Authentication Guide.md",
"content": "To create an API key, navigate to Settings > API Keys in the dashboard. Each key can be scoped with specific permissions...",
"score": 0.87,
"metadata": {
"category": "documentation"
}
}
],
"query": "How do I authenticate API requests?",
"total_results": 2,
"processing_time_ms": 45.2
}

Response Fields

FieldTypeDescription
resultsarrayArray of matching search results, ordered by score descending
results[].chunk_idstringUnique identifier for the matched chunk
results[].document_idstringID of the parent document
results[].document_namestringName of the parent document
results[].contentstringText content of the matched chunk
results[].scorefloatSimilarity score between 0 and 1 (higher is more relevant)
results[].metadataobject | nullDocument-level metadata, if any was set during upload
querystringThe original search query (echoed back)
total_resultsintegerNumber of results returned
processing_time_msfloatServer-side query processing time in milliseconds

Errors

StatusError TypeDescription
400bad-requestEmpty or missing query field
401unauthorizedMissing or invalid API key
403forbiddenAPI key does not have search permission
422validation-errorRequest body failed validation (e.g., limit out of range)
429rate-limit-exceededRate limit exceeded

Example Error Response

{
"type": "https://api.inherent.systems/errors/bad-request",
"title": "Bad Request",
"status": 400,
"detail": "The 'query' field is required and must be between 1 and 1000 characters.",
"instance": "/api/v1/search",
"trace_id": "f47ac10b-58cc-4372-a567-0e02b2c3d479",
"timestamp": "2026-04-03T12:34:56.789Z"
}