API Reference
Agents API AI-powered agents for data extraction, content generation, and decision making
Agents are AI-powered execution units that can be used in workflow steps. The platform provides both core agents (available to all companies) and the ability to create custom agents .
Four universal core agents are available to all companies:
ID Name Type Description agent_extractionUniversal Extraction Agent extractionExtract structured data from documents with confidence scoring agent_contentContent Generation Agent contentGenerate professional emails, messages, and notifications agent_transformData Transformation Agent transformTransform data between formats and schemas agent_decisionDecision & Routing Agent decisionMake business decisions and route based on criteria
Scope Description globalAvailable to all companies (core agents) companyRestricted to the creating company
Retrieve all agents available to your company, including core agents and custom agents.
Parameter Type Default Description typestring - Filter by type: extraction, content, transform, decision, code, classification, custom statusstring - Filter by status: active, deprecated searchstring - Search by agent name includeBuiltInboolean true Include core agents in results limitnumber 50 Number of results (1-100) cursorstring - Cursor for pagination
curl -X GET "http://localhost:3000/api/v1/agents?type=extraction" \
-H "x-api-key: YOUR_API_KEY"
Create a new custom agent for your company.
Field Type Required Description namestring Yes Agent display name descriptionstring No Agent description typestring Yes Agent type (see below) providerstring No AI provider: openai (default), anthropic modelstring No Model ID (defaults to gpt-4o) systemPromptstring Yes System prompt defining agent behavior outputSchemaobject No JSON Schema for structured output temperaturenumber No Temperature (0.0-2.0), defaults to 0.7 maxTokensnumber No Max tokens in response, defaults to 4096
Type Description extractionExtract structured data from documents/text contentGenerate text content (emails, messages, etc.) transformTransform data between formats decisionMake decisions and classify items codeGenerate or analyze code classificationClassify inputs into categories customCustom agent with user-defined behavior
Provider Models OpenAI gpt-4o, gpt-4o-mini, gpt-4-turbo, gpt-4, gpt-3.5-turbo, o1, o3-miniAnthropic claude-3-5-sonnet-latest, claude-3-5-haiku-latest, claude-3-opus-latest
Retrieve details of a specific agent, including core agents.
Parameter Type Description idstring Agent ID or core agent ID (e.g., agent_extraction)
Update a custom agent. Each update increments the version number.
Only company-owned agents can be updated. Core agents and agents from other companies cannot be modified.
Soft delete an agent. The agent is marked as deprecated and will no longer appear in listings.
DELETE /api/v1/agents/:id
Core agents cannot be deleted. Only company-owned agents can be removed.
Test an agent with sample input to verify configuration and output.
POST /api/v1/agents/:id/test
Field Type Required Description inputobject Yes Input variables for the agent userMessagestring No Optional user message override
Core agents cannot be directly tested via API. Create a workflow with an agent step to test built-in agents.
Execute an agent standalone (outside of a workflow context).
POST /api/v1/agents/:id/execute
Field Type Required Description inputobject Yes Input variables for the agent userMessagestring No User message for the agent workflowRunIdstring No Optional workflow run ID for tracking overridesobject No Runtime parameter overrides
Field Type Description temperaturenumber Override temperature for this execution maxTokensnumber Override max tokens modelstring Override model for this execution
Retrieve execution history for an agent.
GET /api/v1/agents/:id/executions
Parameter Type Default Description limitnumber 50 Number of results (1-100) cursorstring - Cursor for pagination
Variable Type Description documentstring Document content to extract from schemaobject JSON Schema defining fields to extract fieldsarray List of field definitions (alternative to schema) documentTypestring Document type hint (invoice, receipt, contract) customInstructionsstring Additional extraction instructions
Variable Type Description contentTypestring email, message, summary, notification tonestring professional, friendly, formal, casual, urgent formatstring text, html, markdown recipientstring Who the content is for subjectstring Subject or topic contextstring Background context keyPointsarray Key points to include customInstructionsstring Additional instructions
Variable Type Description dataany Data to transform sourceSchemaobject Schema of input data targetSchemaobject Desired output schema mappingRulesarray Field mapping rules defaultValuesobject Default values for missing fields customInstructionsstring Additional instructions
Variable Type Description dataany Data to evaluate decisionTypestring approval_routing, classification, priority optionsarray Available decision options criteriaarray Evaluation criteria thresholdsobject Threshold values contextstring Additional context customInstructionsstring Additional instructions
{
"success" : false ,
"error" : {
"code" : "NOT_FOUND" ,
"message" : "Agent not found"
}
}
{
"success" : false ,
"error" : {
"code" : "BAD_REQUEST" ,
"message" : "Cannot modify built-in agents"
}
}
{
"success" : false ,
"error" : {
"code" : "BAD_REQUEST" ,
"message" : "An agent with the name \" Invoice Extractor \" already exists"
}
}