Jump to content

Connect SuperML | Leeroopedia MCP: Equip your AI agents with best practices, code verification, and debugging knowledge. Powered by Leeroo — building Organizational Superintelligence. Contact us at founders@leeroo.com.

Implementation:Elevenlabs Elevenlabs python CreateSipTrunkPhoneNumberRequest

From Leeroopedia
Attribute Value
Page Type Implementation
Language Python
SDK elevenlabs
Class CreateSipTrunkPhoneNumberRequest
Source File src/elevenlabs/types/create_sip_trunk_phone_number_request.py
Auto-Generated Yes (Fern API Definition)

Overview

Description

CreateSipTrunkPhoneNumberRequest is a Pydantic model representing the request payload for creating a new SIP trunk phone number in the ElevenLabs system. It includes the phone number itself, a human-readable label, deprecated flags for inbound/outbound support, and optional configuration objects for inbound and outbound trunk settings.

Usage

This model is used as the request body when registering a new SIP trunk phone number with the ElevenLabs API. It allows callers to specify the phone number, assign a label, and configure both inbound and outbound SIP trunk settings. The deprecated supports_inbound and supports_outbound fields should be avoided in favor of the trunk configuration objects.

Code Reference

Source Location

src/elevenlabs/types/create_sip_trunk_phone_number_request.py

Class Signature

class CreateSipTrunkPhoneNumberRequest(UncheckedBaseModel):
    ...

Import Statement

from elevenlabs.types import CreateSipTrunkPhoneNumberRequest

I/O Contract

Field Name Type Required Description
phone_number str Yes Phone number to register.
label str Yes Label for the phone number.
supports_inbound typing.Optional[bool] No (Deprecated) Whether this phone number supports inbound calls. This field is deprecated and will be removed in the future.
supports_outbound typing.Optional[bool] No (Deprecated) Whether this phone number supports outbound calls. This field is deprecated and will be removed in the future.
inbound_trunk_config typing.Optional[InboundSipTrunkConfigRequestModel] No Configuration for the inbound SIP trunk.
outbound_trunk_config typing.Optional[OutboundSipTrunkConfigRequestModel] No Configuration for the outbound SIP trunk.

Model Configuration:

  • Frozen (immutable) model
  • Allows extra fields
  • Supports both Pydantic v1 and v2

Usage Examples

Creating a basic SIP trunk phone number request

from elevenlabs.types import CreateSipTrunkPhoneNumberRequest

request = CreateSipTrunkPhoneNumberRequest(
    phone_number="+15551234567",
    label="Main Office Line",
)

Creating a request with trunk configurations

from elevenlabs.types import (
    CreateSipTrunkPhoneNumberRequest,
    InboundSipTrunkConfigRequestModel,
    OutboundSipTrunkConfigRequestModel,
)

request = CreateSipTrunkPhoneNumberRequest(
    phone_number="+15559876543",
    label="Support Line",
    inbound_trunk_config=InboundSipTrunkConfigRequestModel(
        allowed_addresses=["10.0.0.0/8"],
    ),
    outbound_trunk_config=OutboundSipTrunkConfigRequestModel(
        address="sip.provider.com",
    ),
)

Related Pages

Page Connections

Double-click a node to navigate. Hold to expand connections.
Principle
Implementation
Heuristic
Environment