Creates a Fax Application
Creates a new Fax Application based on the parameters sent in the request. The application name and webhook URL are required. Once created, you can assign phone numbers to your application using the /phone_numbers endpoint.
import Telnyx from 'telnyx';
const client = new Telnyx({
apiKey: process.env['TELNYX_API_KEY'], // This is the default and can be omitted
});
const faxApplication = await client.faxApplications.create({
application_name: 'fax-router',
webhook_event_url: 'https://example.com',
});
console.log(faxApplication.data);import os
from telnyx import Telnyx
client = Telnyx(
api_key=os.environ.get("TELNYX_API_KEY"), # This is the default and can be omitted
)
fax_application = client.fax_applications.create(
application_name="fax-router",
webhook_event_url="https://example.com",
)
print(fax_application.data)
package main
import (
"context"
"fmt"
"github.com/team-telnyx/telnyx-go"
"github.com/team-telnyx/telnyx-go/option"
)
func main() {
client := telnyx.NewClient(
option.WithAPIKey("My API Key"),
)
faxApplication, err := client.FaxApplications.New(context.TODO(), telnyx.FaxApplicationNewParams{
ApplicationName: "fax-router",
WebhookEventURL: "https://example.com",
})
if err != nil {
panic(err.Error())
}
fmt.Printf("%+v\n", faxApplication.Data)
}
package com.telnyx.sdk.example;
import com.telnyx.sdk.client.TelnyxClient;
import com.telnyx.sdk.client.okhttp.TelnyxOkHttpClient;
import com.telnyx.sdk.models.faxapplications.FaxApplicationCreateParams;
import com.telnyx.sdk.models.faxapplications.FaxApplicationCreateResponse;
public final class Main {
private Main() {}
public static void main(String[] args) {
TelnyxClient client = TelnyxOkHttpClient.fromEnv();
FaxApplicationCreateParams params = FaxApplicationCreateParams.builder()
.applicationName("fax-router")
.webhookEventUrl("https://example.com")
.build();
FaxApplicationCreateResponse faxApplication = client.faxApplications().create(params);
}
}require "telnyx"
telnyx = Telnyx::Client.new(api_key: "My API Key")
fax_application = telnyx.fax_applications.create(application_name: "fax-router", webhook_event_url: "https://example.com")
puts(fax_application)<?php
require_once dirname(__DIR__) . '/vendor/autoload.php';
use Telnyx\Client;
use Telnyx\Core\Exceptions\APIException;
use Telnyx\CredentialConnections\AnchorsiteOverride;
$client = new Client(apiKey: getenv('TELNYX_API_KEY') ?: 'My API Key');
try {
$faxApplication = $client->faxApplications->create(
applicationName: 'fax-router',
webhookEventURL: 'https://example.com',
active: false,
anchorsiteOverride: AnchorsiteOverride::AMSTERDAM_NETHERLANDS,
inbound: [
'channelLimit' => 10,
'sipSubdomain' => 'example',
'sipSubdomainReceiveSettings' => 'only_my_connections',
],
outbound: [
'channelLimit' => 10, 'outboundVoiceProfileID' => '1293384261075731499'
],
tags: ['tag1', 'tag2'],
webhookEventFailoverURL: 'https://failover.example.com',
webhookTimeoutSecs: 25,
);
var_dump($faxApplication);
} catch (APIException $e) {
echo $e->getMessage();
}telnyx fax-applications create \
--api-key 'My API Key' \
--application-name fax-router \
--webhook-event-url https://example.comcurl --request POST \
--url https://api.telnyx.com/v2/fax_applications \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"application_name": "fax-router",
"active": false,
"anchorsite_override": "Amsterdam, Netherlands",
"webhook_event_url": "https://example.com",
"webhook_event_failover_url": "https://failover.example.com",
"webhook_timeout_secs": 25,
"tags": [
"tag1",
"tag2"
],
"inbound": {
"channel_limit": 10,
"sip_subdomain": "example",
"sip_subdomain_receive_settings": "only_my_connections"
},
"outbound": {
"channel_limit": 10,
"outbound_voice_profile_id": "1293384261075731499"
}
}
'{
"data": {
"id": "1293384261075731499",
"record_type": "fax_application",
"application_name": "fax-router",
"active": false,
"anchorsite_override": "Amsterdam, Netherlands",
"webhook_event_url": "https://example.com",
"webhook_event_failover_url": "https://failover.example.com",
"webhook_timeout_secs": 25,
"inbound": {
"channel_limit": 10,
"sip_subdomain": "example",
"sip_subdomain_receive_settings": "only_my_connections"
},
"outbound": {
"channel_limit": 10,
"outbound_voice_profile_id": "1293384261075731499"
},
"created_at": "2018-02-02T22:25:27.521Z",
"updated_at": "2018-02-02T22:25:27.521Z"
}
}{
"errors": [
{
"code": "10009",
"title": "Authentication failed",
"detail": "Could not understand the provided credentials.",
"meta": {
"url": "https://developers.telnyx.com/docs/overview/errors/10009"
}
}
]
}{
"errors": [
{
"code": "422",
"title": "Unprocessable Entity",
"detail": "The request parameters failed validation"
}
]
}Authorizations
Bearer authentication header of the form Bearer <token>, where <token> is your auth token.
Body
Parameters that can be set when creating a Fax Application
A user-assigned name to help manage the application.
"call-router"
The URL where webhooks related to this connection will be sent. Must include a scheme, such as 'https'.
"https://example.com"
Specifies whether the connection can be used.
false
Latency directs Telnyx to route media through the site with the lowest round-trip time to the user's connection. Telnyx calculates this time using ICMP ping messages. This can be disabled by specifying a site to handle all media.
Latency, Chicago, IL, Ashburn, VA, San Jose, CA, Sydney, Australia, Amsterdam, Netherlands, London, UK, Toronto, Canada, Vancouver, Canada, Frankfurt, Germany "Amsterdam, Netherlands"
The failover URL where webhooks related to this connection will be sent if sending to the primary URL fails. Must include a scheme, such as 'https'.
"https://failover.example.com"
Specifies how many seconds to wait before timing out a webhook.
0 <= x <= 3025
Tags associated with the Fax Application.
["tag1", "tag2"]
Show child attributes
Show child attributes
Show child attributes
Show child attributes
Response
Successful response
Show child attributes
Show child attributes
{
"id": "1293384261075731499",
"record_type": "fax_application",
"application_name": "fax-router",
"active": false,
"anchorsite_override": "Amsterdam, Netherlands",
"webhook_event_url": "https://example.com",
"webhook_event_failover_url": "https://failover.example.com",
"webhook_timeout_secs": 25,
"inbound": {
"channel_limit": 10,
"sip_subdomain": "example",
"sip_subdomain_receive_settings": "only_my_connections"
},
"outbound": {
"channel_limit": 10,
"outbound_voice_profile_id": "1293384261075731499"
},
"created_at": "2018-02-02T22:25:27.521Z",
"updated_at": "2018-02-02T22:25:27.521Z"
}
Was this page helpful?
import Telnyx from 'telnyx';
const client = new Telnyx({
apiKey: process.env['TELNYX_API_KEY'], // This is the default and can be omitted
});
const faxApplication = await client.faxApplications.create({
application_name: 'fax-router',
webhook_event_url: 'https://example.com',
});
console.log(faxApplication.data);import os
from telnyx import Telnyx
client = Telnyx(
api_key=os.environ.get("TELNYX_API_KEY"), # This is the default and can be omitted
)
fax_application = client.fax_applications.create(
application_name="fax-router",
webhook_event_url="https://example.com",
)
print(fax_application.data)
package main
import (
"context"
"fmt"
"github.com/team-telnyx/telnyx-go"
"github.com/team-telnyx/telnyx-go/option"
)
func main() {
client := telnyx.NewClient(
option.WithAPIKey("My API Key"),
)
faxApplication, err := client.FaxApplications.New(context.TODO(), telnyx.FaxApplicationNewParams{
ApplicationName: "fax-router",
WebhookEventURL: "https://example.com",
})
if err != nil {
panic(err.Error())
}
fmt.Printf("%+v\n", faxApplication.Data)
}
package com.telnyx.sdk.example;
import com.telnyx.sdk.client.TelnyxClient;
import com.telnyx.sdk.client.okhttp.TelnyxOkHttpClient;
import com.telnyx.sdk.models.faxapplications.FaxApplicationCreateParams;
import com.telnyx.sdk.models.faxapplications.FaxApplicationCreateResponse;
public final class Main {
private Main() {}
public static void main(String[] args) {
TelnyxClient client = TelnyxOkHttpClient.fromEnv();
FaxApplicationCreateParams params = FaxApplicationCreateParams.builder()
.applicationName("fax-router")
.webhookEventUrl("https://example.com")
.build();
FaxApplicationCreateResponse faxApplication = client.faxApplications().create(params);
}
}require "telnyx"
telnyx = Telnyx::Client.new(api_key: "My API Key")
fax_application = telnyx.fax_applications.create(application_name: "fax-router", webhook_event_url: "https://example.com")
puts(fax_application)<?php
require_once dirname(__DIR__) . '/vendor/autoload.php';
use Telnyx\Client;
use Telnyx\Core\Exceptions\APIException;
use Telnyx\CredentialConnections\AnchorsiteOverride;
$client = new Client(apiKey: getenv('TELNYX_API_KEY') ?: 'My API Key');
try {
$faxApplication = $client->faxApplications->create(
applicationName: 'fax-router',
webhookEventURL: 'https://example.com',
active: false,
anchorsiteOverride: AnchorsiteOverride::AMSTERDAM_NETHERLANDS,
inbound: [
'channelLimit' => 10,
'sipSubdomain' => 'example',
'sipSubdomainReceiveSettings' => 'only_my_connections',
],
outbound: [
'channelLimit' => 10, 'outboundVoiceProfileID' => '1293384261075731499'
],
tags: ['tag1', 'tag2'],
webhookEventFailoverURL: 'https://failover.example.com',
webhookTimeoutSecs: 25,
);
var_dump($faxApplication);
} catch (APIException $e) {
echo $e->getMessage();
}telnyx fax-applications create \
--api-key 'My API Key' \
--application-name fax-router \
--webhook-event-url https://example.comcurl --request POST \
--url https://api.telnyx.com/v2/fax_applications \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"application_name": "fax-router",
"active": false,
"anchorsite_override": "Amsterdam, Netherlands",
"webhook_event_url": "https://example.com",
"webhook_event_failover_url": "https://failover.example.com",
"webhook_timeout_secs": 25,
"tags": [
"tag1",
"tag2"
],
"inbound": {
"channel_limit": 10,
"sip_subdomain": "example",
"sip_subdomain_receive_settings": "only_my_connections"
},
"outbound": {
"channel_limit": 10,
"outbound_voice_profile_id": "1293384261075731499"
}
}
'{
"data": {
"id": "1293384261075731499",
"record_type": "fax_application",
"application_name": "fax-router",
"active": false,
"anchorsite_override": "Amsterdam, Netherlands",
"webhook_event_url": "https://example.com",
"webhook_event_failover_url": "https://failover.example.com",
"webhook_timeout_secs": 25,
"inbound": {
"channel_limit": 10,
"sip_subdomain": "example",
"sip_subdomain_receive_settings": "only_my_connections"
},
"outbound": {
"channel_limit": 10,
"outbound_voice_profile_id": "1293384261075731499"
},
"created_at": "2018-02-02T22:25:27.521Z",
"updated_at": "2018-02-02T22:25:27.521Z"
}
}{
"errors": [
{
"code": "10009",
"title": "Authentication failed",
"detail": "Could not understand the provided credentials.",
"meta": {
"url": "https://developers.telnyx.com/docs/overview/errors/10009"
}
}
]
}{
"errors": [
{
"code": "422",
"title": "Unprocessable Entity",
"detail": "The request parameters failed validation"
}
]
}