API Reference
The Gentic API provides a comprehensive set of endpoints for managing agents, knowledge sources, and workflows. This reference documents all available endpoints and their usage.
Authentication
All API requests require an API key, which should be included in the X-API-Key header:
curl -H "X-API-Key: your-api-key" https://api.gentic.in/v1/agents
Base URL
All API endpoints are relative to the base URL:
https://api.gentic.in/v1
Endpoints
Agents
GET /agents- List all agentsPOST /agents- Create a new agentGET /agents/{agentId}- Get agent detailsPUT /agents/{agentId}- Update agentDELETE /agents/{agentId}- Delete agentPOST /agents/{agentId}/converse- Converse with agent
Knowledge Sources
GET /knowledge-sources- List all knowledge sourcesPOST /knowledge-sources- Create a new knowledge sourceGET /knowledge-sources/{sourceId}- Get knowledge source detailsPUT /knowledge-sources/{sourceId}- Update knowledge sourceDELETE /knowledge-sources/{sourceId}- Delete knowledge sourcePOST /knowledge-sources/{sourceId}/connect- Connect to agent
Workflows
GET /workflows- List all workflowsPOST /workflows- Create a new workflowGET /workflows/{workflowId}- Get workflow detailsPUT /workflows/{workflowId}- Update workflowDELETE /workflows/{workflowId}- Delete workflowPOST /workflows/{workflowId}/execute- Execute workflow
Response Format
All API responses follow a standard format:
{
"data": {
// Response data
},
"meta": {
"timestamp": "2024-01-01T00:00:00Z",
"requestId": "req-123"
}
}
Error Handling
Errors are returned with appropriate HTTP status codes and error details:
{
"error": {
"code": "INVALID_REQUEST",
"message": "Invalid request parameters",
"details": {
"field": "name",
"reason": "required"
}
},
"meta": {
"timestamp": "2024-01-01T00:00:00Z",
"requestId": "req-123"
}
}
Rate Limiting
API requests are rate-limited based on your subscription plan. Rate limit headers are included in all responses:
X-RateLimit-Limit: 100
X-RateLimit-Remaining: 99
X-RateLimit-Reset: 1625097600
SDK Usage
The Gentic SDK provides a convenient way to interact with the API:
import { GenticClient } from '@gentic/sdk';
const client = new GenticClient('your-api-key');
// Create an agent
const agent = await client.createAgent({
name: 'My Agent',
description: 'A helpful assistant',
capabilities: ['chat', 'document-search']
});
// Create a knowledge source
const knowledgeSource = await client.createKnowledgeSource({
name: 'Documentation',
type: 'file-collection',
files: [
{
path: 'docs/intro.md',
content: '...'
}
]
});
// Create a workflow
const workflow = await client.createWorkflow({
name: 'Documentation Query',
steps: [
{
type: 'search',
query: '{{user_message}}',
knowledgeSourceId: knowledgeSource.id
}
]
});
Next Steps
- Explore Agent API Reference
- Learn about Knowledge Source API
- Check out Workflow API