Create a new managed account.
Create a new managed account owned by the authenticated user. You need to be explictly approved by Telnyx in order to become a manager account.
import Telnyx from 'telnyx';
const client = new Telnyx({
apiKey: process.env['TELNYX_API_KEY'], // This is the default and can be omitted
});
const managedAccount = await client.managedAccounts.create({
business_name: "Larry's Cat Food Inc",
});
console.log(managedAccount.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
)
managed_account = client.managed_accounts.create(
business_name="Larry's Cat Food Inc",
)
print(managed_account.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"),
)
managedAccount, err := client.ManagedAccounts.New(context.TODO(), telnyx.ManagedAccountNewParams{
BusinessName: "Larry's Cat Food Inc",
})
if err != nil {
panic(err.Error())
}
fmt.Printf("%+v\n", managedAccount.Data)
}
package com.telnyx.sdk.example;
import com.telnyx.sdk.client.TelnyxClient;
import com.telnyx.sdk.client.okhttp.TelnyxOkHttpClient;
import com.telnyx.sdk.models.managedaccounts.ManagedAccountCreateParams;
import com.telnyx.sdk.models.managedaccounts.ManagedAccountCreateResponse;
public final class Main {
private Main() {}
public static void main(String[] args) {
TelnyxClient client = TelnyxOkHttpClient.fromEnv();
ManagedAccountCreateParams params = ManagedAccountCreateParams.builder()
.businessName("Larry's Cat Food Inc")
.build();
ManagedAccountCreateResponse managedAccount = client.managedAccounts().create(params);
}
}require "telnyx"
telnyx = Telnyx::Client.new(api_key: "My API Key")
managed_account = telnyx.managed_accounts.create(business_name: "Larry's Cat Food Inc")
puts(managed_account)<?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 {
$managedAccount = $client->managedAccounts->create(
businessName: 'Larry\'s Cat Food Inc',
email: '[email protected]',
managedAccountAllowCustomPricing: false,
password: '3jVjLq!tMuWKyWx4NN*CvhnB',
rollupBilling: false,
);
var_dump($managedAccount);
} catch (APIException $e) {
echo $e->getMessage();
}telnyx managed-accounts create \
--api-key 'My API Key' \
--business-name "Larry's Cat Food Inc"curl --request POST \
--url https://api.telnyx.com/v2/managed_accounts \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data @- <<EOF
{
"email": "[email protected]",
"password": "3jVjLq!tMuWKyWx4NN*CvhnB",
"business_name": "Larry's Cat Food Inc",
"managed_account_allow_custom_pricing": false,
"rollup_billing": false
}
EOF{
"data": {
"record_type": "managed_account",
"id": "f65ceda4-6522-4ad6-aede-98de83385123",
"email": "[email protected]",
"api_key": "KEY01236170692E74656C6E79782E636F6D_YmlnIGlyb24gaXMgZGVhZA",
"api_user": "[email protected]",
"api_token": "x6oexQNHTs-fZ7-QsDMOeg",
"manager_account_id": "f65ceda4-6522-4ad6-aede-98de83385123",
"created_at": "2018-02-02T22:25:27.521Z",
"updated_at": "2018-02-02T22:25:27.521Z",
"organization_name": "Example Company LLC",
"balance": {
"record_type": "balance",
"balance": "300.00",
"credit_limit": "100.00",
"available_credit": "400.00",
"currency": "USD"
},
"managed_account_allow_custom_pricing": true,
"rollup_billing": false
}
}{
"errors": [
{
"code": "10027",
"title": "Unprocessable Entity",
"detail": "The server understood the syntax of the request but was unable to process the instructions."
}
]
}Authorizations
Bearer authentication header of the form Bearer <token>, where <token> is your auth token.
Body
Parameters that define the managed account to be created
The name of the business for which the new managed account is being created, that will be used as the managed accounts's organization's name.
"Larry's Cat Food Inc"
The email address for the managed account. If not provided, the email address will be generated based on the email address of the manager account.
Password for the managed account. If a password is not supplied, the account will not be able to be signed into directly. (A password reset may still be performed later to enable sign-in via password.)
"3jVjLq!tMuWKyWx4NN*CvhnB"
Boolean value that indicates if the managed account is able to have custom pricing set for it or not. If false, uses the pricing of the manager account. Defaults to false. This value may be changed after creation, but there may be time lag between when the value is changed and pricing changes take effect.
false
Boolean value that indicates if the billing information and charges to the managed account "roll up" to the manager account. If true, the managed account will not have its own balance and will use the shared balance with the manager account. This value cannot be changed after account creation without going through Telnyx support as changes require manual updates to the account ledger. Defaults to false.
false
Response
Successful response with information about a single managed account.
Show child attributes
Show child attributes
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 managedAccount = await client.managedAccounts.create({
business_name: "Larry's Cat Food Inc",
});
console.log(managedAccount.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
)
managed_account = client.managed_accounts.create(
business_name="Larry's Cat Food Inc",
)
print(managed_account.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"),
)
managedAccount, err := client.ManagedAccounts.New(context.TODO(), telnyx.ManagedAccountNewParams{
BusinessName: "Larry's Cat Food Inc",
})
if err != nil {
panic(err.Error())
}
fmt.Printf("%+v\n", managedAccount.Data)
}
package com.telnyx.sdk.example;
import com.telnyx.sdk.client.TelnyxClient;
import com.telnyx.sdk.client.okhttp.TelnyxOkHttpClient;
import com.telnyx.sdk.models.managedaccounts.ManagedAccountCreateParams;
import com.telnyx.sdk.models.managedaccounts.ManagedAccountCreateResponse;
public final class Main {
private Main() {}
public static void main(String[] args) {
TelnyxClient client = TelnyxOkHttpClient.fromEnv();
ManagedAccountCreateParams params = ManagedAccountCreateParams.builder()
.businessName("Larry's Cat Food Inc")
.build();
ManagedAccountCreateResponse managedAccount = client.managedAccounts().create(params);
}
}require "telnyx"
telnyx = Telnyx::Client.new(api_key: "My API Key")
managed_account = telnyx.managed_accounts.create(business_name: "Larry's Cat Food Inc")
puts(managed_account)<?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 {
$managedAccount = $client->managedAccounts->create(
businessName: 'Larry\'s Cat Food Inc',
email: '[email protected]',
managedAccountAllowCustomPricing: false,
password: '3jVjLq!tMuWKyWx4NN*CvhnB',
rollupBilling: false,
);
var_dump($managedAccount);
} catch (APIException $e) {
echo $e->getMessage();
}telnyx managed-accounts create \
--api-key 'My API Key' \
--business-name "Larry's Cat Food Inc"curl --request POST \
--url https://api.telnyx.com/v2/managed_accounts \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data @- <<EOF
{
"email": "[email protected]",
"password": "3jVjLq!tMuWKyWx4NN*CvhnB",
"business_name": "Larry's Cat Food Inc",
"managed_account_allow_custom_pricing": false,
"rollup_billing": false
}
EOF{
"data": {
"record_type": "managed_account",
"id": "f65ceda4-6522-4ad6-aede-98de83385123",
"email": "[email protected]",
"api_key": "KEY01236170692E74656C6E79782E636F6D_YmlnIGlyb24gaXMgZGVhZA",
"api_user": "[email protected]",
"api_token": "x6oexQNHTs-fZ7-QsDMOeg",
"manager_account_id": "f65ceda4-6522-4ad6-aede-98de83385123",
"created_at": "2018-02-02T22:25:27.521Z",
"updated_at": "2018-02-02T22:25:27.521Z",
"organization_name": "Example Company LLC",
"balance": {
"record_type": "balance",
"balance": "300.00",
"credit_limit": "100.00",
"available_credit": "400.00",
"currency": "USD"
},
"managed_account_allow_custom_pricing": true,
"rollup_billing": false
}
}{
"errors": [
{
"code": "10027",
"title": "Unprocessable Entity",
"detail": "The server understood the syntax of the request but was unable to process the instructions."
}
]
}