Download OpenAPI specification:
Contract-first OpenAPI spec for an AI-agent optimized CRM surface.
This API is not a raw mirror of the existing CRM routes. It exposes a small tool layer that an agent can call with explicit workspace scope, predictable inputs, audit context, and bounded outputs.
The CRM Agent API has only two HTTP operations:
GET /crm/agent/capabilities.POST /crm/agent/tools/{toolName}.All endpoints require a super-admin Bearer token. Non-super-admin tokens are rejected even if the user belongs to the target organization.
All workspace-scoped v1 tools require the outbound CRM module to be
enabled on the target organization. If the module is disabled the tool
returns 403. crm_resolve_workspace is the only unscoped discovery tool and
can be called before the technical organization ID is known.
Workspace-scoped tool calls require organizationId. Agents that only have
a human name, slug, owner email, or ambiguous operator input must first call
crm_resolve_workspace, then use the returned technical organizationId
for subsequent scoped tools.
GET /crm/agent/capabilities lists available tools and their JSON schemas.
POST /crm/agent/tools/{toolName} executes one tool with a single scoped
input payload.
| Family | Tools |
|---|---|
| Workspace resolution | crm_resolve_workspace |
| Outbound Operations | get_crm_workspace_overview, list_outbound_agents, bulk_get_agent_workloads, list_campaigns, get_campaign, create_outbound_campaign, update_outbound_campaign, attach_campaign_templates, bulk_add_contacts_to_campaign_by_filter, bulk_remove_contacts_from_campaign, find_contacts_in_multiple_campaigns, get_campaign_contact_overlap, bulk_get_campaign_contact_counts, analyze_import_contact_deduplication, bulk_assign_campaign_contacts, list_outbound_contacts |
| Script Templates | list_script_templates, get_script_template, create_script_template, update_script_template, delete_script_template, import_script_templates, export_script_template |
| Qualification Templates | list_qualification_templates, get_qualification_template, create_qualification_template, update_qualification_template, import_qualification_templates, export_qualification_template |
| Script Executions | get_script_execution, upsert_script_execution |
| Qualifications | get_qualification_schema, get_qualification, create_qualification, update_qualification, list_qualifications |
Outbound operation tools let an AI agent inspect workspace state, create or
update campaigns, attach script/qualification templates, add contacts from
a CRM/import-folder filter, analyze import deduplication, compare campaign
overlaps, and assign campaign contacts in bulk. Use
find_contacts_in_multiple_campaigns, get_campaign_contact_overlap, and
bulk_get_campaign_contact_counts instead of paginating
list_outbound_contacts for multi-campaign comparisons. Mutating bulk
tools expose dryRun; campaign assignment and campaign contact removal
require confirm: true when applying the preview. Removing contacts deletes
the campaign-specific outbound state, can target contacts also present in
other campaigns, cancels pending/overdue campaign follow-ups by default, and
preserves call history unless the caller explicitly asks to detach call logs.
Script templates are interactive call paths, not internal CRM notes. Use
instruction for text the agent should read, then question only for a
free-form captured answer. Use yesno for binary choices with branches
labelled Oui and Non; use select for multi-choice decisions and make
each branch label match one of the declared options values.
Auto-qualify sends only the branch path selected by recorded agent responses to the AI server. Unmatched branch labels hide downstream context. Keep admin-only reminders such as "Reporter dans le CRM" out of agent-facing script text; represent captured data in the qualification template instead.
Returns the list of available tools with their input/output schemas,
risk levels, and usage examples. Pass organizationId to verify the
organization exists and the CRM app is enabled before fetching the
full catalog.
| organizationId | string Optional workspace filter for capability checks. |
{- "success": true,
- "data": {
- "version": "1.0.0",
- "auth": {
- "requiredRole": "super_admin",
- "requiresOrganizationId": true,
- "tokenTypes": [
- "jwt"
]
}, - "defaults": {
- "maxPageSize": 100,
- "defaultPageSize": 20,
- "dryRunDefault": false
}, - "tools": [
- {
- "name": "crm_resolve_workspace",
- "title": "string",
- "description": "string",
- "riskLevel": "read",
- "requiresOrganizationId": true,
- "supportsDryRun": true,
- "crmModule": "outbound",
- "inputSchema": { },
- "outputSchema": { },
- "examples": [
- {
- "description": "string",
- "input": { }
}
]
}
]
}, - "error": "string",
- "meta": {
- "page": 0,
- "perPage": 0,
- "total": 0,
- "totalPages": 0,
- "requestId": "string"
}
}Executes the named tool with the provided workspace scope and input.
The reason field is logged in the audit trail. The requestId can be
used for idempotency or trace correlation.
Tools that support dryRun accept input.dryRun: true to validate and
preview the operation without persisting any changes.
Risky delete/bulk tools additionally require input.confirm: true
when input.dryRun: false.
| toolName required | string (CrmAgentToolName) Enum: "crm_resolve_workspace" "get_crm_workspace_overview" "list_outbound_agents" "bulk_get_agent_workloads" "list_campaigns" "get_campaign" "create_outbound_campaign" "update_outbound_campaign" "attach_campaign_templates" "bulk_add_contacts_to_campaign_by_filter" "bulk_remove_contacts_from_campaign" "find_contacts_in_multiple_campaigns" "get_campaign_contact_overlap" "bulk_get_campaign_contact_counts" "analyze_import_contact_deduplication" "bulk_assign_campaign_contacts" "list_outbound_contacts" "list_script_templates" "get_script_template" "create_script_template" "update_script_template" "delete_script_template" "import_script_templates" "export_script_template" "list_qualification_templates" "get_qualification_template" "create_qualification_template" "update_qualification_template" "import_qualification_templates" "export_qualification_template" "get_script_execution" "upsert_script_execution" "get_qualification_schema" "get_qualification" "create_qualification" "update_qualification" "list_qualifications" |
| organizationId | string Explicit target CRM organization ID. Required for every scoped tool; omitted only for unscoped tools such as crm_resolve_workspace. |
required | object Tool-specific input payload (see capabilities for per-tool schema). |
| reason | string <= 500 characters Human-readable reason stored in audit logs. |
| requestId | string <= 120 characters Optional caller idempotency or trace identifier. |
{- "organizationId": "string",
- "input": { },
- "reason": "string",
- "requestId": "string"
}{- "success": true,
- "data": {
- "toolName": "crm_resolve_workspace",
- "organizationId": "string",
- "status": "success",
- "summary": "string",
- "data": { },
- "warnings": [
- {
- "code": "string",
- "message": "string",
- "resourceId": "string"
}
], - "nextActions": [
- {
- "toolName": "crm_resolve_workspace",
- "reason": "string",
- "suggestedInput": { }
}
], - "durationMs": 0,
- "dryRun": true
}, - "error": "string",
- "meta": {
- "page": 0,
- "perPage": 0,
- "total": 0,
- "totalPages": 0,
- "requestId": "string"
}
}