Prefix Object
The Prefix Object defines prefix-based routing rules used to route outbound calls within the network. When a dialed number matches a configured prefix, the associated routing configuration is applied, including destination trunk groups and transformations.
Prefixes can optionally be scoped to a specific source trunk group, limiting the rule to calls originating from that trunk group only. Prefix routing overrides normal DID routing.
Refer to How It Works: Prefix Routing to learn more about what prefixes are, what they are used for, and how you can work with them.
Prefix Object Attributes
The fields listed in the table below will be returned in a JSON object when a successful request has been made.
| Attribute | Data Type | Description |
|---|---|---|
| attributes | object | A key-value store for custom, user-defined data associated with the prefix. It is intended for customer convenience and organizational purposes only. It has no effect on routing or any other system behavior. |
| callback_url | string | This field is present in the prefix object but callbacks are not currently supported for prefixes. Do not use this field. It is reserved for potential future use. |
| name | string | The prefix name. The default value is N/A. |
| partner_sid read only | string | The secure ID of the partner associated with this prefix rule. |
| prefix | string | A sequence of alphanumeric characters or When a call originates from any endpoint on your account, the system checks the dialed number against all configured prefixes. If a match is found, the call is routed to the trunk group associated with this prefix, overriding the default routing. The There is no hard length restriction, but a prefix longer than the dialed number will never produce a match. When multiple prefixes overlap (for example, |
| prefix_sid read only | string | The prefix secure ID. |
| source_trunk_group_sid | string | The secure ID of the trunk group from which the call originates. When set, this prefix rule applies only to calls originating from the specified trunk group. Source-specific prefix rules take priority over generic prefix rules where this field is This field is optional. When |
| string_key_1 | string | Optional user-defined metadata field for custom identification or integration purposes. |
| string_key_2 | string | Optional user-defined metadata field for custom identification or integration purposes. |
| transformations | array | The list of transformations applied when the prefix rule matches. |
| trunk_group_sid | string | The secure ID of the destination trunk group that calls will be routed to when this prefix is matched. warning If this field is not specified or is |
Sample Prefix Object
{
"attributes": {},
"callback_url": null,
"name": "N/A",
"partner_sid": "e00430c3-a7d0-4666-ab5c-f7202448382f",
"prefix": "51625",
"prefix_sid": "cc367acb-94c8-418f-b247-85dce5806ef4",
"source_trunk_group_sid": null,
"string_key_1": null,
"string_key_2": null,
"transformations": [],
"trunk_group_sid": "df9bd225-8966-4f04-a2e3-1a317683afd5"
}