Register a custom measure field mapping
Public beta
Conversation Insights, including the APIs, is currently available as a public beta release and the information contained in this document is subject to change. Some features are not yet implemented and others may be changed before the product is declared as generally available. Public beta products are not covered by the Twilio Support Terms or Twilio Service Level Agreement.
Conversation Insights is not PCI compliant or a HIPAA Eligible Service and should not be used in workflows that are subject to HIPAA or PCI.
Conversations products are only available in the new Twilio Console. If your account hasn't been migrated, you'll be redirected to the legacy Console where these products won't appear.
POST/v3/ControlPlane/ConversationInsights/CustomFieldMappings
Base url: https://insights.twilio.com (base url)
Registers a custom field for the account. entityMetadata.sourceType
selects where the field's value comes from, and the matching property on
entityMetadata (intelligenceOperator for INTELLIGENCE_OPERATOR)
carries its details. Only the MEASURE category is supported for now.
The request is validated before the mapping is created:
namecontains only letters, digits and_, and is not already registered for the account (otherwise409);description, when present, is at most 150 characters;- for
INTELLIGENCE_OPERATOR, the operator has an active version withoutputFormatJSON, andentityMetadata.intelligenceOperator.fieldis one or two.-separated segments that resolve to anumberorintegerproperty in that version's output schema (otherwise400); - the account has a free slot in the category; by default an account can
register up to 3 custom measures (otherwise
403). UseGET /v3/ControlPlane/ConversationInsights/CustomFieldMappingsCapacityto check the remaining slots.
Create-only: if a mapping with the same name already exists for the
account, 409 is returned with the existing mapping's id and nothing
is changed. To modify an existing mapping, use
PATCH /v3/ControlPlane/ConversationInsights/CustomFieldMappings/{mappingId}.
application/jsonThe category of the custom field. Supported values:
MEASURE: a numeric value that can be aggregated and queried as a measure in Conversations Insights.
MEASUREName of the custom field, used to reference it in Insights queries.
Contains only letters, digits and _, and must not be empty.
Must be unique within the account across every sourceType;
registering an existing name returns 409. Cannot be changed after
registration.
LeadScorePattern: ^[A-Za-z0-9_]+$Optional, free-text description of this custom field mapping, up to 150 characters. Display-only — not part of any uniqueness check.
Lead quality score derived from sentiment analysisMax length: 150Identifies the entity that supplies this field's value. sourceType
selects the source, and the property named for that source carries its
details. Exactly that one source property must be present:
| sourceType | Required property |
|---|---|
| INTELLIGENCE_OPERATOR | intelligenceOperator |
A request whose sourceType doesn't match the source property it sends,
or that sends any other property, is rejected with 400.
The custom field mapping was created.
The unique identifier of the custom field mapping.
convinsights_mapping_01m31967b7em08vh1pqgbam3mjThe category of the custom field. Supported values:
MEASURE: a numeric value that can be aggregated and queried as a measure in Conversations Insights.
MEASUREOptional, free-text description supplied at registration time. Display-only — not part of any uniqueness check.
Lead quality score derived from sentiment analysisMax length: 150Identifies the entity that supplies this field's value. sourceType
selects the source, and the property named for that source carries its
details. Exactly that one source property must be present:
| sourceType | Required property |
|---|---|
| INTELLIGENCE_OPERATOR | intelligenceOperator |
A request whose sourceType doesn't match the source property it sends,
or that sends any other property, is rejected with 400.
When the mapping was registered.
2026-08-13T14:30:00ZWhen the mapping was last modified via PATCH. Null until the first update.
2026-09-30T10:00:00Z1// Download the helper library from https://www.twilio.com/docs/node/install2const twilio = require("twilio"); // Or, for ESM: import twilio from "twilio";34// Find your Account SID and Auth Token at twilio.com/console5// and set the environment variables. See http://twil.io/secure6const accountSid = process.env.TWILIO_ACCOUNT_SID;7const authToken = process.env.TWILIO_AUTH_TOKEN;8const client = twilio(accountSid, authToken);910async function createCustomFieldMapping() {11const customFieldMapping =12await client.insights.v3.customFieldMappings.create({13category: "MEASURE",14name: "LeadScore",15description: "Lead quality score derived from sentiment analysis",16entityMetadata: {17sourceType: "INTELLIGENCE_OPERATOR",18intelligenceOperator: {19operatorId: "intelligence_operator_01kcgy1ew0e9x8re6jq542zt8b",20operatorName: "Sentiment Analysis",21field: "leadScore",22},23},24});2526console.log(customFieldMapping.id);27}2829createCustomFieldMapping();
Response
1{2"category": "MEASURE",3"createdAt": "2026-08-13T14:30:00Z",4"description": "Lead quality score derived from sentiment analysis",5"entityMetadata": {6"sourceType": "INTELLIGENCE_OPERATOR",7"intelligenceOperator": {8"operatorId": "intelligence_operator_01kcgy1ew0e9x8re6jq542zt8b",9"operatorName": "Sentiment Analysis",10"field": "leadScore"11}12},13"id": "convinsights_mapping_01m31967b7em08vh1pqgbam3mj",14"name": "LeadScore",15"updatedAt": "2026-09-30T10:00:00Z"16}