Create an email inbox
Creates an inbox on an inbound-enabled domain. When domain_id is omitted, Telnyx
allocates the account’s shared inbound subdomain so the inbox is immediately usable
without customer DNS setup. When username is omitted, a unique username is generated.
import Telnyx from 'telnyx';
const client = new Telnyx({
apiKey: process.env['TELNYX_API_KEY'], // This is the default and can be omitted
});
const EmailInbox = await client.emailInboxes.create();
console.log(EmailInbox.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
)
email_inbox = client.email_inboxes.create()
print(email_inbox.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"),
)
emailInboxe, err := client.EmailInboxes.New(
context.TODO(),
telnyx.EmailInboxeNewParams{
},
)
if err != nil {
panic(err.Error())
}
fmt.Printf("%+v\n", emailInboxe.Data)
}
package com.telnyx.sdk.example;
import com.telnyx.sdk.client.TelnyxClient;
import com.telnyx.sdk.client.okhttp.TelnyxOkHttpClient;
import com.telnyx.sdk.models.emailInboxes.EmailInboxeCreateParams;
public final class Main {
private Main() {}
public static void main(String[] args) {
TelnyxClient client = TelnyxOkHttpClient.fromEnv();
EmailInboxeCreateParams params = EmailInboxeCreateParams.builder()
.build();
var response = client.emailInboxes().create(params);
}
}require "telnyx"
telnyx = Telnyx::Client.new(api_key: "My API Key")
email_inbox = telnyx.email_inboxes.create
puts(email_inbox)<?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 {
$email_inbox = $client->emailInboxes->create();
var_dump($email_inbox);
} catch (APIException $e) {
echo $e->getMessage();
}telnyx email-inboxes create \
--api-key 'My API Key'curl --request POST \
--url https://api.telnyx.com/v2/email_inboxes \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '{}'{
"data": {
"id": "11111111-1111-1111-1111-111111111111",
"record_type": "email_inbox",
"address": "[email protected]",
"status": "active",
"domain_id": "22222222-2222-2222-2222-222222222222",
"domain": "abc123def456.mail.test.telnyx.com",
"settings": {},
"created_at": "2026-07-12T00:00:00Z",
"updated_at": "2026-07-12T00:00:00Z"
}
}{
"errors": [
{
"code": "10006",
"title": "Not authorized",
"detail": "Invalid API key",
"meta": {
"url": "https://developers.telnyx.com/docs/overview/errors/10006"
}
}
]
}{
"errors": [
{
"code": "10015",
"title": "Validation Failed",
"detail": "username must start and end with a letter or digit and may contain only lowercase letters, digits, dots, hyphens, and underscores",
"source": {
"pointer": "/data/attributes/username"
}
}
]
}{
"errors": [
{
"code": "10016",
"title": "Service Unavailable",
"detail": "The email domain service is temporarily unavailable. Please try again later."
}
]
}Authorizations
Telnyx API key supplied as Authorization: Bearer <token>. In production, auth may be validated by the API gateway and forwarded via Telnyx auth headers.
Body
Both fields are optional. Omitting username generates one; omitting domain_id uses the account's shared inbound subdomain. Omitting both creates an instant inbox with a generated username.
Inbox local part. Trimmed and lowercased before validation; the normalized value must be 1-64 characters, start and end with a letter or digit, and contain only letters, digits, dots, hyphens, and underscores. Generated when omitted.
Account-owned, inbound-enabled domain UUID. The account's shared inbound subdomain is allocated when omitted.
Response
Email inbox created.
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 EmailInbox = await client.emailInboxes.create();
console.log(EmailInbox.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
)
email_inbox = client.email_inboxes.create()
print(email_inbox.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"),
)
emailInboxe, err := client.EmailInboxes.New(
context.TODO(),
telnyx.EmailInboxeNewParams{
},
)
if err != nil {
panic(err.Error())
}
fmt.Printf("%+v\n", emailInboxe.Data)
}
package com.telnyx.sdk.example;
import com.telnyx.sdk.client.TelnyxClient;
import com.telnyx.sdk.client.okhttp.TelnyxOkHttpClient;
import com.telnyx.sdk.models.emailInboxes.EmailInboxeCreateParams;
public final class Main {
private Main() {}
public static void main(String[] args) {
TelnyxClient client = TelnyxOkHttpClient.fromEnv();
EmailInboxeCreateParams params = EmailInboxeCreateParams.builder()
.build();
var response = client.emailInboxes().create(params);
}
}require "telnyx"
telnyx = Telnyx::Client.new(api_key: "My API Key")
email_inbox = telnyx.email_inboxes.create
puts(email_inbox)<?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 {
$email_inbox = $client->emailInboxes->create();
var_dump($email_inbox);
} catch (APIException $e) {
echo $e->getMessage();
}telnyx email-inboxes create \
--api-key 'My API Key'curl --request POST \
--url https://api.telnyx.com/v2/email_inboxes \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '{}'{
"data": {
"id": "11111111-1111-1111-1111-111111111111",
"record_type": "email_inbox",
"address": "[email protected]",
"status": "active",
"domain_id": "22222222-2222-2222-2222-222222222222",
"domain": "abc123def456.mail.test.telnyx.com",
"settings": {},
"created_at": "2026-07-12T00:00:00Z",
"updated_at": "2026-07-12T00:00:00Z"
}
}{
"errors": [
{
"code": "10006",
"title": "Not authorized",
"detail": "Invalid API key",
"meta": {
"url": "https://developers.telnyx.com/docs/overview/errors/10006"
}
}
]
}{
"errors": [
{
"code": "10015",
"title": "Validation Failed",
"detail": "username must start and end with a letter or digit and may contain only lowercase letters, digits, dots, hyphens, and underscores",
"source": {
"pointer": "/data/attributes/username"
}
}
]
}{
"errors": [
{
"code": "10016",
"title": "Service Unavailable",
"detail": "The email domain service is temporarily unavailable. Please try again later."
}
]
}