Skip to navigation

create

View as MarkdownOpen in Claude

Create a new SIP endpoint resource.

Request

usernamestringRequired
The username of the Sip Endpoint
passwordstringRequired
The password the SIP device uses to register with this Sip Endpoint.
caller_idstringOptional
The caller ID that will showup when dialing from this Sip Endpoint
send_asstringOptional
The Sip username that will show up on the calle's side. Overrides the username.
cipherslist of enumsOptional
Ciphers that can be enabled for calls on this Sip Endpoint.
Allowed values:
codecslist of enumsOptional
Codecs that can be enabled for calls on this Sip Endpoint.
encryptionenumOptionalDefaults to default
The set encryption type on the Sip Endpoint.
Allowed values:
call_handlerenumOptionalDefaults to default
Specify how the SIP endpoint will handle outbound calls. - **default**: The SIP endpoint will pull the outbound policy setting from the [SIP Profile Settings](https://my.signalwire.com?page=sip_profile/edit). This allows centralized management of outbound call behavior across multiple endpoints from a single configuration. - **passthrough**: The SIP endpoint will be allowed to dial PSTN numbers. This permits outbound calling to traditional phone numbers without restrictions. - **block-pstn**: The SIP endpoint will be blocked from dialing PSTN numbers. Use this to restrict the endpoint from initiating calls to the public telephone network. - **resource**: Outbound calls from this SIP endpoint will dial the specified resource and execute its instructions. Requires setting `calling_handler_resource_id` to a valid resource. This enables custom call handling workflows for outbound calls.
Allowed values:
calling_handler_resource_idstringOptionalformat: "uuid"
The ID of the resource that handles outbound calls. Required when `call_handler` is `resource`.

Response

idstringRequiredformat: "uuid"
Unique ID of the SIP Endpoint.
project_idstringRequiredformat: "uuid"
Unique ID of the Project.
display_namestringRequired
Display name of the SIP Endpoint Fabric Resource
typeenumRequired
Type of the Fabric Resource
Allowed values:
created_atdatetimeRequired
Date and time when the resource was created.
updated_atdatetimeRequired
Date and time when the resource was updated.
sip_endpointobjectRequired
SIP Endpoint data.

Response Example

Response
{
"id": "993ed018-9e79-4e50-b97b-984bd5534095",
"project_id": "1313fe58-5e14-4c11-bbe7-6fdfa11fe780",
"display_name": "Conference Room Phone",
"type": "sip_endpoint",
"created_at": "2024-05-06T12:20:00Z",
"updated_at": "2024-05-06T12:20:00Z",
"sip_endpoint": {
"id": "993ed018-9e79-4e50-b97b-984bd5534095",
"username": "User",
"caller_id": "123456789",
"send_as": "Support",
"ciphers": [
"AEAD_AES_256_GCM_8",
"AES_256_CM_HMAC_SHA1_32"
],
"codecs": [
"G722",
"PCMA",
"PCMU",
"VP8"
],
"encryption": "default",
"call_handler": "default",
"calling_handler_resource_id": "993ed018-9e79-4e50-b97b-984bd5534095"
}
}

Example

from signalwire.rest import RestClient
client = RestClient(
project="your-project-id",
token="your-api-token",
host="your-space.signalwire.com",
)
result = client.fabric.sip_endpoints.create(
username="my-endpoint", caller_id="+15551234567", send_as="+15551234567",
encryption="required", ciphers=["AEAD_AES_256_GCM_8"], codecs=["OPUS"],
call_handler="relay_app", calling_handler_resource_id="resource-id",
)
print(f"Created: {result['id']}")