Skip to main content

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 agents
  • POST /agents - Create a new agent
  • GET /agents/{agentId} - Get agent details
  • PUT /agents/{agentId} - Update agent
  • DELETE /agents/{agentId} - Delete agent
  • POST /agents/{agentId}/converse - Converse with agent

Knowledge Sources

  • GET /knowledge-sources - List all knowledge sources
  • POST /knowledge-sources - Create a new knowledge source
  • GET /knowledge-sources/{sourceId} - Get knowledge source details
  • PUT /knowledge-sources/{sourceId} - Update knowledge source
  • DELETE /knowledge-sources/{sourceId} - Delete knowledge source
  • POST /knowledge-sources/{sourceId}/connect - Connect to agent

Workflows

  • GET /workflows - List all workflows
  • POST /workflows - Create a new workflow
  • GET /workflows/{workflowId} - Get workflow details
  • PUT /workflows/{workflowId} - Update workflow
  • DELETE /workflows/{workflowId} - Delete workflow
  • POST /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