CRMCRM Intelligence

CRM Intelligence

Retrieve conversation intelligence summaries, initiate outbound calls programmatically, and list outbound-enabled assistants with assigned phone numbers through the Talkturo API.

curl "https://api.talkturo.com/api/crm/intelligence?from=2026-01-01&to=2026-01-31&account=acme-support&campaign_id=cmp_8f31a2&assistant_id=ast_4d92c1" \
  -H "Authorization: Bearer eyJhbGciOiJIUzI1NiIs..."
{
  "success": true,
  "data": {
    "total_conversations": 248,
    "average_sentiment": 0.74,
    "resolution_rate": 0.81
  },
  "filters": {
    "campaigns": [
      {
        "id": "cmp_8f31a2",
        "name": "Renewal outreach"
      }
    ],
    "assistants": [
      {
        "id": "ast_4d92c1",
        "name": "Maya"
      }
    ]
  }
}
curl https://api.talkturo.com/api/crm/calls \
  -X POST \
  -H "Authorization: Bearer tk_live_example_9xmk7q2r" \
  -H "Content-Type: application/json" \
  -d '{
    "assistant_id": "4d92c1a8-7b63-4e5f-9a21-6c84d0b2f731",
    "to_number": "+14155550184",
    "from_number": "+14155550100",
    "metadata": {
      "contact_id": "cnt_7b42e9",
      "campaign": "renewal-outreach"
    }
  }'
{
  "success": true,
  "call": {
    "room_name": "call_4d92c1a8_20260115_143012",
    "sip_call_id": "sip_01JH7K2M9R4Q",
    "from_number": "+14155550100",
    "to_number": "+14155550184"
  }
}
curl "https://api.talkturo.com/api/crm/outbound-assistants?teamId=7b42e9d1-2f63-4a80-b5c1-9e27d4f86103" \
  -H "Authorization: Bearer eyJhbGciOiJIUzI1NiIs..."
{
  "success": true,
  "assistants": [
    {
      "id": "4d92c1a8-7b63-4e5f-9a21-6c84d0b2f731",
      "name": "Maya",
      "outbound_enabled": true,
      "group_id": "grp_2c81f4",
      "group_name": "Renewals",
      "assigned_numbers": [
        {
          "id": "num_91a6d2",
          "phone_number": "+14155550100",
          "assistant_id": "4d92c1a8-7b63-4e5f-9a21-6c84d0b2f731",
          "status": "active"
        }
      ]
    }
  ]
}

CRM endpoints

Use these endpoints to retrieve conversation intelligence, start outbound calls, and discover assistants configured for outbound calling.

CRM intelligence and outbound assistant endpoints use a Supabase web session. The outbound calls endpoint also accepts Talkturo API keys.

Authentication

Send a Supabase session token in the Authorization header:

curl https://api.talkturo.com/api/crm/intelligence \
  -H "Authorization: Bearer eyJhbGciOiJIUzI1NiIs... "

The intelligence and outbound assistant endpoints require the authenticated user to have access to the requested account or team. Cookie-based sessions are also supported where noted.

Get conversation intelligence

GET /api/crm/intelligence

Retrieve a conversation intelligence summary for an account and date range. The response also includes campaign and assistant lists that you can use to populate filters.

Query parameters

query
fromstring
Required

Start date in YYYY-MM-DD format. The route passes this value to the conversation intelligence summary query unchanged.

query
tostring
Required

End date in YYYY-MM-DD format. The route passes this value to the conversation intelligence summary query unchanged.

query
accountstring
Required

Account slug used to resolve the account and verify the authenticated user's membership.

query
campaign_idstring

Filter the summary by campaign. If omitted, the endpoint passes null to the summary query.

query
assistant_idstring

Filter the summary by assistant. If omitted, the endpoint passes null to the summary query.

Request

Response

The data object contains the raw fields returned by the conversation_intelligence_summary database RPC. The route defaults data to an empty object when the RPC returns no value.

successboolean
Required

Indicates whether the request succeeded.

dataobject
Required

Conversation intelligence summary returned by the conversation_intelligence_summary RPC. The exact fields depend on the RPC result.

filtersobject
Required

Filter data for campaigns and assistants associated with the account.

filters.campaignsarray
Required

Up to 100 non-deleted campaigns. Each item contains an id and name.

filters.assistantsarray
Required

Up to 100 assistants. Each item contains an id and name.

The authenticated user must have an accounts_memberships row for the account resolved from the account slug. Account ownership alone does not satisfy this route's membership check unless it is represented by a membership row.

Initiate an outbound call

POST /api/crm/calls

Start an outbound call with an assistant. The endpoint accepts a Talkturo API key or Supabase session authentication and requires an account in the authentication context.

Request body

body
assistant_idstring
Required

UUID of the assistant that will place the call.

body
to_numberstring
Required

Destination phone number. The value must contain at least four characters and is normalized as an E.164 number by the call service.

body
from_numberstring

Optional active phone number assigned to the assistant. If provided, the number must be assigned to the selected assistant.

body
metadataobject

Optional nested metadata passed to the outbound call service.

Request

Use the following equivalent JavaScript request when integrating the endpoint into an application:

const response = await fetch("https://api.talkturo.com/api/crm/calls", {
  method: "POST",
  headers: {
    Authorization: "Bearer tk_live_example_9xmk7q2r",
    "Content-Type": "application/json"
  },
  body: JSON.stringify({
    assistant_id: "4d92c1a8-7b63-4e5f-9a21-6c84d0b2f731",
    to_number: "+14155550184",
    from_number: "+14155550100",
    metadata: {
      contact_id: "cnt_7b42e9",
      campaign: "renewal-outreach"
    }
  })
});

const result = await response.json();
console.log(result.call.room_name);

Response

successboolean
Required

Indicates whether the call was created.

callobject
Required

Identifiers and phone numbers for the newly initiated call.

call.room_namestring
Required

LiveKit room name created for the call.

call.sip_call_idstring or null

SIP call identifier returned by the telephony provider.

call.from_numberstring
Required

Phone number used to place the call.

call.to_numberstring
Required

Normalized destination phone number.

API-key requests must include the calls:create scope. The endpoint returns 401 when authentication or account context is missing, 403 when the scope is missing, and 402 when the account has insufficient credits.

List outbound assistants

GET /api/crm/outbound-assistants

List assistants enabled for outbound calling and their assigned active phone numbers.

Query parameters

query
teamIdstring
Required

Account or team identifier used to find outbound assistants and assigned phone numbers.

Request

Response

The endpoint returns only assistants with outbound_enabled set to true. Assigned numbers must belong to the team, have an active status, and not be deleted. Assistants and phone numbers are sorted by name and phone number respectively.

successboolean
Required

Indicates whether the request succeeded.

assistantsarray
Required

Outbound-enabled assistants associated with the requested team.

assistants.idstring
Required

Assistant identifier.

assistants.namestring
Required

Assistant display name.

assistants.outbound_enabledboolean
Required

Always true for assistants returned by this endpoint.

assistants.group_idstring or null

Assistant group identifier.

assistants.group_namestring or null

Assistant group name.

assistants.assigned_numbersarray
Required

Active, non-deleted phone numbers assigned to the assistant.

assistants.assigned_numbers.idstring
Required

Assigned phone number identifier.

assistants.assigned_numbers.phone_numberstring
Required

Assigned phone number.

assistants.assigned_numbers.assistant_idstring or null

Identifier of the assistant assigned to the number.

assistants.assigned_numbers.statusstring or null

Phone number status. Returned numbers have an active status.

This route requires a valid Supabase web session. The handler verifies that a user is authenticated, but it does not perform a separate membership check before querying with the service-role client. Validate that your integration supplies a team identifier appropriate for the authenticated user.

Error responses

The endpoints use the following status codes for common failures:

StatusMeaning
400Missing or invalid query parameters, JSON, or request fields.
401Authentication is missing or invalid.
402The account has insufficient credits for an outbound call.
403The user lacks account access or an API key lacks the required scope.
404The account, assistant, or related resource was not found.
500An unexpected database, telephony, or server error occurred.