Skip to main content

Documentation Index

Fetch the complete documentation index at: https://docs.animam.ai/llms.txt

Use this file to discover all available pages before exploring further.

Endpoints to manage tools — the actions your AI agent can perform during a conversation.

GET /tenants//tools

List all tools configured for a tenant. Required scope: tools:read

Request

curl https://api.animam.ai/tenants/my-company/tools \
  -H "Authorization: Bearer ak_your_token"

Response

[
  {
    "id": "tool_abc123",
    "name": "Contact Form",
    "description": "Collect visitor contact details",
    "type": "SUBMIT_FORM",
    "config": {
      "fields": [
        { "name": "name", "label": "Full Name", "type": "text", "required": true },
        { "name": "email", "label": "Email", "type": "email", "required": true }
      ]
    },
    "position": 1,
    "isActive": true,
    "segment": "contact",
    "createdAt": "2024-01-15T10:30:00Z",
    "updatedAt": "2024-01-20T14:00:00Z"
  }
]

POST /tenants//tools

Create a new tool. Required scope: tools:write

Request

curl -X POST https://api.animam.ai/tenants/my-company/tools \
  -H "Authorization: Bearer ak_your_token" \
  -H "Content-Type: application/json" \
  -d '{
    "name": "Contact Form",
    "description": "Collect visitor contact details",
    "type": "SUBMIT_FORM",
    "config": {
      "fields": [
        { "name": "name", "label": "Full Name", "type": "text", "required": true },
        { "name": "email", "label": "Email", "type": "email", "required": true },
        { "name": "message", "label": "Message", "type": "textarea", "required": false }
      ]
    },
    "segmentId": "seg_xyz789",
    "isActive": true,
    "position": 1
  }'

Body

FieldTypeRequiredDescription
namestringYesDisplay name of the tool
descriptionstringYesDescription shown to the agent to decide when to use the tool
typestringYesTool type (see valid types below)
configobjectNoType-specific configuration (see SUBMIT_FORM config format)
segmentIdstringNoAssociate with a specific segment
isActivebooleanNoWhether the tool is enabled (default: true)
positionnumberNoDisplay order (lower = higher priority)
webhookUrlstringNoWebhook endpoint for ESCALATE_TO_HUMAN
webhookSecretstringNoHMAC secret for webhook signature verification
Only user-configurable types can be created via API: SUBMIT_FORM, GENERATE_QUOTE, BOOK_MEETING, ESCALATE_TO_HUMAN, REMEMBER_FACT, RECOMMEND_PRODUCT. Synthetic types (injected automatically by connectors) cannot be created manually.

Response

{
  "id": "tool_xyz789",
  "name": "Contact Form",
  "description": "Collect visitor contact details",
  "type": "SUBMIT_FORM",
  "config": { "fields": [...] },
  "position": 1,
  "isActive": true,
  "segment": null,
  "createdAt": "2024-01-25T10:30:00Z",
  "updatedAt": "2024-01-25T10:30:00Z"
}

GET /tenants//tools/

Retrieve a specific tool. Required scope: tools:read
curl https://api.animam.ai/tenants/my-company/tools/tool_abc123 \
  -H "Authorization: Bearer ak_your_token"

PATCH /tenants//tools/

Update a tool. Only the provided fields are modified. Required scope: tools:write
curl -X PATCH https://api.animam.ai/tenants/my-company/tools/tool_abc123 \
  -H "Authorization: Bearer ak_your_token" \
  -H "Content-Type: application/json" \
  -d '{
    "isActive": false,
    "description": "Updated description"
  }'

DELETE /tenants//tools/

Delete a tool permanently. Required scope: tools:write
curl -X DELETE https://api.animam.ai/tenants/my-company/tools/tool_abc123 \
  -H "Authorization: Bearer ak_your_token"

Response

{
  "deleted": true,
  "id": "tool_abc123"
}

Tool Types Reference

Configurable Types (user-created)

TypeDescriptionTriggered by
SUBMIT_FORMCollects structured data from the visitor via a formAgent decision based on description
GENERATE_QUOTEGenerates a price estimate based on visitor inputsAgent decision based on description
BOOK_MEETINGBooks a meeting on the agent’s calendarAgent decision; requires Google Calendar connector
ESCALATE_TO_HUMANHands off the conversation to a human agent via webhookAgent decision or visitor request
REMEMBER_FACTStores a key-value fact on the visitor’s profile for future conversationsAgent decision based on conversation context
RECOMMEND_PRODUCTRecommends one or more products from the catalog to the visitorAgent decision based on description

Synthetic Types (auto-injected by enrichment chain)

Synthetic tools are automatically injected at chat time by the enrichment chain when the relevant connector or configuration is active. They cannot be created, updated, or deleted via API.
TypeDescriptionAuto-injected when
CHECK_AVAILABILITYChecks calendar availability for bookingGoogle Calendar connector is active
COLLECT_PAYMENTInitiates a Stripe payment sessionStripe connector is active
EXPLORE_CORPUSPerforms an on-demand full-text search of the knowledge baseCorpus summary mode is enabled (two-tier corpus)
SEND_VERIFICATION_CODESends an OTP code to the visitor’s emailvisitorAuthMode is otp or all
VERIFY_VISITOR_CODEVerifies the OTP code entered by the visitorvisitorAuthMode is otp or all
VERIFY_EXTERNAL_CHALLENGEDelegates verification to an external HMAC webhookContext webhook auth is configured
MCP_PROXYProxies a tool call to an external MCP serverMCP connector is configured (Pro+ plan)

Enrichment Chain

At chat time, before each agent response, Animam runs an enrichment chain that assembles the final tool list available to the agent:
dbTools → enrichCalendar → enrichStripe → enrichMCP → enrichProducts → enrichCorpus → enrichOTP
StepWhat it does
dbToolsLoads all active user-configured tools for the tenant and segment
enrichCalendarInjects CHECK_AVAILABILITY and activates BOOK_MEETING if Google Calendar is connected
enrichStripeInjects COLLECT_PAYMENT if Stripe connector is active
enrichMCPDiscovers and injects tools from an external MCP server (cached 5 min, Pro+ only)
enrichProductsActivates RECOMMEND_PRODUCT and loads the product catalog if products exist
enrichCorpusInjects EXPLORE_CORPUS if corpus summary mode is enabled
enrichOTPInjects SEND_VERIFICATION_CODE / VERIFY_VISITOR_CODE based on visitor auth mode
Synthetic tools are injected transparently — no manual configuration required. The agent receives the full assembled tool list and decides which tools to call based on their descriptions.

SUBMIT_FORM Config Format

The SUBMIT_FORM type uses a config.fields array to define the form structure:
{
  "config": {
    "fields": [
      { "name": "name",    "label": "Full Name",     "type": "text",     "required": true  },
      { "name": "email",   "label": "Email Address",  "type": "email",    "required": true  },
      { "name": "phone",   "label": "Phone Number",   "type": "phone",    "required": false },
      { "name": "message", "label": "Your Message",   "type": "textarea", "required": false }
    ]
  }
}

Field definition

FieldTypeRequiredDescription
namestringYesInternal field identifier (used as key in submissions)
labelstringYesLabel displayed to the visitor in the form widget
typestringYesField type: text, email, phone, or textarea
requiredbooleanYesWhether the visitor must fill in this field
Field name values must be unique within a form and should use snake_case. Changing field names after a tool has received submissions may break downstream integrations.
Submitted form data is stored as ToolSubmission records and transitions through statuses: NEWCONTACTEDRESOLVED. Submissions can be retrieved via the conversations API or viewed in the dashboard.