Create a notification profile
Create a notification profile.
POST
/
notification_profiles
JavaScript
import Telnyx from 'telnyx';
const client = new Telnyx({
apiKey: process.env['TELNYX_API_KEY'], // This is the default and can be omitted
});
const notificationProfile = await client.notificationProfiles.create();
console.log(notificationProfile.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
)
notification_profile = client.notification_profiles.create()
print(notification_profile.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"),
)
notificationProfile, err := client.NotificationProfiles.New(context.TODO(), telnyx.NotificationProfileNewParams{})
if err != nil {
panic(err.Error())
}
fmt.Printf("%+v\n", notificationProfile.Data)
}package com.telnyx.sdk.example;
import com.telnyx.sdk.client.TelnyxClient;
import com.telnyx.sdk.client.okhttp.TelnyxOkHttpClient;
import com.telnyx.sdk.models.notificationprofiles.NotificationProfileCreateParams;
import com.telnyx.sdk.models.notificationprofiles.NotificationProfileCreateResponse;
public final class Main {
private Main() {}
public static void main(String[] args) {
TelnyxClient client = TelnyxOkHttpClient.fromEnv();
NotificationProfileCreateResponse notificationProfile = client.notificationProfiles().create();
}
}require "telnyx"
telnyx = Telnyx::Client.new(api_key: "My API Key")
notification_profile = telnyx.notification_profiles.create
puts(notification_profile)<?php
require_once dirname(__DIR__) . '/vendor/autoload.php';
use Telnyx\Client;
use Telnyx\Core\Exceptions\APIException;
$client = new Client(apiKey: getenv('TELNYX_API_KEY') ?: 'My API Key');
try {
$notificationProfile = $client->notificationProfiles->create(name: 'name');
var_dump($notificationProfile);
} catch (APIException $e) {
echo $e->getMessage();
}telnyx notification-profiles create \
--api-key 'My API Key'curl --request POST \
--url https://api.telnyx.com/v2/notification_profiles \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"name": "<string>"
}
'{
"data": {
"id": "12455643-3cf1-4683-ad23-1cd32f7d5e0a",
"name": "<string>",
"created_at": "2019-10-15T10:07:15.527Z",
"updated_at": "2019-10-15T10:07:15.527Z"
}
}{
"errors": [
{
"code": "<string>",
"title": "<string>",
"detail": "<string>",
"source": {
"pointer": "<string>",
"parameter": "<string>"
},
"meta": {}
}
]
}{
"errors": [
{
"code": "<string>",
"title": "<string>",
"detail": "<string>",
"source": {
"pointer": "<string>",
"parameter": "<string>"
},
"meta": {}
}
]
}{
"errors": [
{
"code": "<string>",
"title": "<string>",
"detail": "<string>",
"source": {
"pointer": "<string>",
"parameter": "<string>"
},
"meta": {}
}
]
}Authorizations
Bearer authentication header of the form Bearer <token>, where <token> is your auth token.
Body
application/json
Add a Notification Profile
A Collection of Notification Channels
A human readable name.
Response
A Notification Profile response
A Collection of Notification Channels
Show child attributes
Show child attributes
Was this page helpful?
⌘I
JavaScript
import Telnyx from 'telnyx';
const client = new Telnyx({
apiKey: process.env['TELNYX_API_KEY'], // This is the default and can be omitted
});
const notificationProfile = await client.notificationProfiles.create();
console.log(notificationProfile.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
)
notification_profile = client.notification_profiles.create()
print(notification_profile.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"),
)
notificationProfile, err := client.NotificationProfiles.New(context.TODO(), telnyx.NotificationProfileNewParams{})
if err != nil {
panic(err.Error())
}
fmt.Printf("%+v\n", notificationProfile.Data)
}package com.telnyx.sdk.example;
import com.telnyx.sdk.client.TelnyxClient;
import com.telnyx.sdk.client.okhttp.TelnyxOkHttpClient;
import com.telnyx.sdk.models.notificationprofiles.NotificationProfileCreateParams;
import com.telnyx.sdk.models.notificationprofiles.NotificationProfileCreateResponse;
public final class Main {
private Main() {}
public static void main(String[] args) {
TelnyxClient client = TelnyxOkHttpClient.fromEnv();
NotificationProfileCreateResponse notificationProfile = client.notificationProfiles().create();
}
}require "telnyx"
telnyx = Telnyx::Client.new(api_key: "My API Key")
notification_profile = telnyx.notification_profiles.create
puts(notification_profile)<?php
require_once dirname(__DIR__) . '/vendor/autoload.php';
use Telnyx\Client;
use Telnyx\Core\Exceptions\APIException;
$client = new Client(apiKey: getenv('TELNYX_API_KEY') ?: 'My API Key');
try {
$notificationProfile = $client->notificationProfiles->create(name: 'name');
var_dump($notificationProfile);
} catch (APIException $e) {
echo $e->getMessage();
}telnyx notification-profiles create \
--api-key 'My API Key'curl --request POST \
--url https://api.telnyx.com/v2/notification_profiles \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"name": "<string>"
}
'{
"data": {
"id": "12455643-3cf1-4683-ad23-1cd32f7d5e0a",
"name": "<string>",
"created_at": "2019-10-15T10:07:15.527Z",
"updated_at": "2019-10-15T10:07:15.527Z"
}
}{
"errors": [
{
"code": "<string>",
"title": "<string>",
"detail": "<string>",
"source": {
"pointer": "<string>",
"parameter": "<string>"
},
"meta": {}
}
]
}{
"errors": [
{
"code": "<string>",
"title": "<string>",
"detail": "<string>",
"source": {
"pointer": "<string>",
"parameter": "<string>"
},
"meta": {}
}
]
}{
"errors": [
{
"code": "<string>",
"title": "<string>",
"detail": "<string>",
"source": {
"pointer": "<string>",
"parameter": "<string>"
},
"meta": {}
}
]
}