Skip to content

Templates

API endpoints for managing agent templates

The Templates API allows you to browse, activate, and manage pre-built agent templates.

List Templates

Retrieve available templates from the Smart Agents template library.

GET /v1/templates

Query Parameters

ParameterTypeDefaultDescription
limitinteger20Number of templates per page (max 100)
cursorstringPagination cursor
categorystringFilter by category: finance, sales, inventory, purchasing, hr
statusstringFilter by activation status: available, activated
searchstringSearch templates by name or description

Example Request

curl -X GET "https://api.agent.net.ai/v1/templates?category=finance&limit=10" \
  -H "Authorization: Bearer <token>"

Example Response

{
  "data": [
    {
      "id": "tmpl_fin_aged_recv",
      "name": "Aged Receivables Analyzer",
      "description": "Analyzes customer receivables by aging bucket with drill-down capability",
      "category": "finance",
      "version": "1.2.0",
      "model": "Smart",
      "credit_cost_estimate": "3-5 per query",
      "status": "available",
      "required_tables": ["Customer Ledger Entry", "Customer", "Detailed Cust. Ledg. Entry"],
      "created_at": "2026-02-01T00:00:00Z",
      "updated_at": "2026-03-15T00:00:00Z"
    },
    {
      "id": "tmpl_fin_cashflow",
      "name": "Cash Flow Forecaster",
      "description": "Projects cash flow based on receivables, payables, and recurring transactions",
      "category": "finance",
      "version": "1.0.0",
      "model": "Expert",
      "credit_cost_estimate": "5-8 per query",
      "status": "activated",
      "required_tables": ["Cash Flow Forecast Entry", "G/L Entry", "Bank Account"],
      "created_at": "2026-02-01T00:00:00Z",
      "updated_at": "2026-02-01T00:00:00Z"
    }
  ],
  "meta": {
    "total": 8,
    "next_cursor": null
  }
}

Get Template

Retrieve details for a specific template.

GET /v1/templates/{template_id}

Path Parameters

ParameterTypeDescription
template_idstringThe unique template identifier

Example Request

curl -X GET "https://api.agent.net.ai/v1/templates/tmpl_fin_aged_recv" \
  -H "Authorization: Bearer <token>"

Example Response

{
  "data": {
    "id": "tmpl_fin_aged_recv",
    "name": "Aged Receivables Analyzer",
    "description": "Analyzes customer receivables by aging bucket with drill-down capability",
    "long_description": "This template creates an agent that specializes in accounts receivable analysis. It can break down receivables by aging bucket (current, 30, 60, 90+ days), identify high-risk customers, and track collection trends over time.",
    "category": "finance",
    "version": "1.2.0",
    "model": "Smart",
    "credit_cost_estimate": "3-5 per query",
    "status": "available",
    "required_tables": ["Customer Ledger Entry", "Customer", "Detailed Cust. Ledg. Entry"],
    "required_permissions": ["SMART AGENTS USER"],
    "suggested_prompts": [
      "Show aged receivables by customer",
      "Which customers have balances over 90 days?",
      "What is the total outstanding receivables by aging bucket?"
    ],
    "changelog": [
      {
        "version": "1.2.0",
        "date": "2026-03-15",
        "changes": "Added drill-down to individual ledger entries"
      },
      {
        "version": "1.1.0",
        "date": "2026-02-20",
        "changes": "Added chart output for aging distribution"
      }
    ],
    "created_at": "2026-02-01T00:00:00Z",
    "updated_at": "2026-03-15T00:00:00Z"
  }
}

Activate Template

Activate a template to make it available as an agent in your organization.

POST /v1/templates/{template_id}/activate

Required scope: templates:write

Request Body

FieldTypeRequiredDescription
name_overridestringNoCustom name for the activated agent
model_overridestringNoOverride the template's default model tier

Example Request

curl -X POST "https://api.agent.net.ai/v1/templates/tmpl_fin_aged_recv/activate" \
  -H "Authorization: Bearer <token>" \
  -H "Content-Type: application/json" \
  -d '{
    "name_override": "AR Aging Report"
  }'

Example Response

{
  "data": {
    "template_id": "tmpl_fin_aged_recv",
    "agent_id": "agent_01H8X3Y4Z9",
    "name": "AR Aging Report",
    "status": "active",
    "activated_at": "2026-04-12T10:30:00Z"
  }
}

Status code: 201 Created

Deactivate Template

Deactivate a previously activated template. The associated agent becomes inactive but is not deleted.

POST /v1/templates/{template_id}/deactivate

Required scope: templates:write

Example Request

curl -X POST "https://api.agent.net.ai/v1/templates/tmpl_fin_aged_recv/deactivate" \
  -H "Authorization: Bearer <token>"

Example Response

{
  "data": {
    "template_id": "tmpl_fin_aged_recv",
    "agent_id": "agent_01H8X3Y4Z9",
    "status": "inactive",
    "deactivated_at": "2026-04-12T10:45:00Z"
  }
}

Duplicate Template

Create a custom agent based on a template. The new agent can be modified independently.

POST /v1/templates/{template_id}/duplicate

Required scope: agents:write

Request Body

FieldTypeRequiredDescription
namestringYesName for the new custom agent
descriptionstringNoCustom description

Example Request

curl -X POST "https://api.agent.net.ai/v1/templates/tmpl_fin_aged_recv/duplicate" \
  -H "Authorization: Bearer <token>" \
  -H "Content-Type: application/json" \
  -d '{
    "name": "Custom AR Agent",
    "description": "Modified AR analyzer with custom thresholds"
  }'

Example Response

{
  "data": {
    "id": "agent_01H8X3Y4ZA",
    "name": "Custom AR Agent",
    "description": "Modified AR analyzer with custom thresholds",
    "status": "draft",
    "source_template_id": "tmpl_fin_aged_recv",
    "created_at": "2026-04-12T11:00:00Z"
  }
}

Status code: 201 Created