Skip to contentSkip to navigationSkip to topbar

Fetch a computed trait


(new)

Beta

Twilio Cohorts is currently available as a Private Beta product and the information contained in this document is subject to change. You acknowledge and agree that your use of Twilio Cohorts is subject to the terms of the Services in Private Beta(link takes you to an external page). This means that some features are not yet implemented and others may be changed before the product is declared as Generally Available. Private Beta products are not covered by the Twilio Support Terms or Twilio Service Level Agreement.

(warning)

Not a HIPAA Eligible Service or PCI Compliant

Twilio Cohorts is not a HIPAA Eligible Service or PCI compliant and should not be enabled in workflows that are subject to HIPAA or PCI.

GET/preview/ComputedTraits/{computedTraitId}

Base url: https://audiences.twilio.com (base url)

Returns the computed trait's configuration, including the effective traitKey and parameters after overrides. Its Status is a separate sub-resource.


Conditional Requests

conditional-requests page anchor

Supports If-None-Match; returns 304 Not Modified when the ETag matches.


Headers

fetch-computed-trait-headers page anchor
Property nameTypeRequiredDescription
If-None-Matchstring

Optional

Used for conditional requests. If the ETag matches, the server returns 304 Not Modified, reducing bandwidth and improving performance.

Max length: 100
Property nameTypeRequiredDescription
computedTraitIdstring
required

The computedTraitId identifier


200304401403404429500

OK - The computed trait's configuration

SchemaExample
Property nameTypeRequiredDescriptionChild properties
idstring
read-only

Optional

Unique identifier for a computed trait following TTID format. Format: cmp_computedtrait_{uuidv7-encoded}

Example: cmp_computedtrait_01h9d8r0vte3hz8tykdj329t9fPattern: ^cmp_computedtrait_[a-zA-Z0-9]{26}$Max length: 100

displayNamestring

Optional

Human-readable name of the computed trait

Example: Marketing frequency capMin length: 1Max length: 128

descriptionstring

Optional

Optional description of the computed trait

Example: Whether the profile has hit its weekly marketing send capMax length: 1024

tagsobject

Optional

Tags for organizing and categorizing resources as key-value pairs.

  • Maximum of 10 key-value pairs
  • Maximum size of a tag key is 128 characters
  • Maximum size of a tag value is 256 characters
  • Keys and values must be non-empty and URL-safe: only unreserved characters (A-Z, a-z, 0-9, -, ., _, ~) are allowed. Tags are echoed back in the tags query parameter of the list endpoints, so anything you can store here can also be filtered on.
  • Keys cannot use the reserved twilio__ prefix
Example: {"environment":"production","campaign":"q1-2026"}Max properties: 10

storeIdobject

Optional

The profiles store the computation is performed on: its profiles are the ones computed over, and the computed value is written back onto them.


definitionobject

Optional

What the computed trait runs: one of the shapes listed, told apart by which field is present. Phase one has a single shape, the reference (definitionId).

The oneOf is declared now so later shapes are additive. Phase two (inline definitions, out of scope) adds a shape carrying expression instead of definitionId. Each shape requires its own field and sets additionalProperties: false, so a body matches exactly one; a body with both fields, or neither, matches none and returns 400. When reading a computed trait, check which field is present rather than assuming definitionId.


isEnabledboolean

Optional

Whether values are being computed and kept current

Example: true

traitKeystring
read-only

Optional

The trait the value is written to: definition.traitKey when overridden, otherwise the definition's own traitKey.

Example: SendIntelligence.weeklyCapMax length: 256

parametersobject
read-only

Optional

The parameter values a run binds: each parameter's defaultValue from the definition's parameterSchema, with any definition.parameters overrides merged over them.

Example: {"windowDays":7}Max properties: 32

createdAtstring<date-time>
read-only

Optional

When the computed trait was created

Example: 2026-09-16T14:22:40Z

updatedAtstring<date-time>
read-only

Optional

When the computed trait's configuration last changed

Example: 2026-09-16T14:22:40Z

operationIdstring
read-only

Optional

The ComputedTraitOperation tracking this change, on the response to a create, an enable, or a parameter change only. Never returned by a GET of the trait, so it is never stale. Poll GET /preview/ComputedTraitOperations/{operationId}.

Example: cmp_operation_01h9d8r0vte3hz8tykdj329t7rPattern: ^cmp_operation_[a-zA-Z0-9]{26}$Max length: 100
Fetch a computed traitLink to code sample: Fetch a computed trait
1
curl -X GET "https://audiences.twilio.com/preview/ComputedTraits/computedTraitId" \
2
-u $TWILIO_API_KEY:$TWILIO_API_SECRET

Response

Note about this response
1
{
2
"id": "cmp_computedtrait_01h9d8r0vte3hz8tykdj329t9f",
3
"displayName": "Marketing frequency cap",
4
"description": "Whether the profile has hit its weekly marketing send cap",
5
"tags": {
6
"team": "lifecycle"
7
},
8
"storeId": "mem_store_01h9d8r0vte3hz8tykdj329t7r",
9
"definition": {
10
"definitionId": "twilio.frequency_cap",
11
"parameters": {
12
"windowDays": 7
13
},
14
"traitKey": "SendIntelligence.weeklyCap"
15
},
16
"isEnabled": true,
17
"traitKey": "SendIntelligence.weeklyCap",
18
"parameters": {
19
"windowDays": 7,
20
"maxSends": 5
21
},
22
"createdAt": "2026-09-16T14:22:40Z",
23
"updatedAt": "2026-09-16T14:22:40Z"
24
}