> ## Documentation Index
> Fetch the complete documentation index at: https://developers.telnyx.com/llms.txt
> Use this file to discover all available pages before exploring further.

# 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.




## OpenAPI

````yaml /openapi/generated/email/inboxes.yml post /email_inboxes
openapi: 3.1.0
info:
  contact:
    email: support@telnyx.com
  description: API for managing email inboxes, drafts, messages, filters, and threads.
  title: Telnyx Email Inboxes API
  version: 2.0.0
servers:
  - url: https://api.telnyx.com/v2
security:
  - bearerAuth: []
paths:
  /email_inboxes:
    post:
      tags:
        - Email Inboxes
      summary: Create an email inbox
      description: >
        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.
      operationId: CreateEmailInbox
      requestBody:
        required: false
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/CreateEmailInboxRequest'
            examples:
              generatedUsername:
                value: {}
              instantInbox:
                value:
                  username: agent-1
              customDomainInbox:
                value:
                  username: support
                  domain_id: 22222222-2222-2222-2222-222222222222
      responses:
        '201':
          description: Email inbox created.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/EmailInboxResponse'
              example:
                data:
                  id: 11111111-1111-1111-1111-111111111111
                  record_type: email_inbox
                  address: agent-1@abc123def456.mail.test.telnyx.com
                  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'
        '401':
          $ref: '#/components/responses/email_UnauthorizedResponse'
        '422':
          description: Inbox validation failed (10015).
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/email_ErrorResponse'
              example:
                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
        '503':
          $ref: '#/components/responses/email_ServiceUnavailableResponse'
      x-codeSamples:
        - lang: JavaScript
          source: |-
            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);
        - lang: Python
          source: |-
            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)
        - lang: Go
          source: "package main\n\nimport (\n\t\"context\"\n\t\"fmt\"\n\n\t\"github.com/team-telnyx/telnyx-go\"\n\t\"github.com/team-telnyx/telnyx-go/option\"\n)\n\nfunc main() {\n\tclient := telnyx.NewClient(\n\t\toption.WithAPIKey(\"My API Key\"),\n\t)\n\temailInboxe, err := client.EmailInboxes.New(\n\t\tcontext.TODO(),\n\t\ttelnyx.EmailInboxeNewParams{\n\t\t},\n\t)\n\tif err != nil {\n\t\tpanic(err.Error())\n\t}\n\tfmt.Printf(\"%+v\\n\", emailInboxe.Data)\n}\n"
        - lang: Java
          source: |-
            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);
                }
            }
        - lang: Ruby
          source: |-
            require "telnyx"

            telnyx = Telnyx::Client.new(api_key: "My API Key")

            email_inbox = telnyx.email_inboxes.create

            puts(email_inbox)
        - lang: PHP
          source: >-
            <?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();
            }
        - lang: CLI
          source: |-
            telnyx email-inboxes create \
              --api-key 'My API Key'
components:
  schemas:
    CreateEmailInboxRequest:
      type: object
      description: >-
        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.
      properties:
        username:
          type: string
          description: >-
            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.
        domain_id:
          type: string
          format: uuid
          description: >-
            Account-owned, inbound-enabled domain UUID. The account's shared
            inbound subdomain is allocated when omitted.
    EmailInboxResponse:
      type: object
      properties:
        data:
          $ref: '#/components/schemas/EmailInbox'
      required:
        - data
    email_ErrorResponse:
      type: object
      properties:
        errors:
          type: array
          items:
            $ref: '#/components/schemas/ErrorObject'
        suppressed:
          type: array
          description: >-
            Present when every recipient is suppressed, so the request is
            rejected and no message is created.
          items:
            $ref: '#/components/schemas/SuppressedRecipient'
      required:
        - errors
    EmailInbox:
      type: object
      properties:
        id:
          type: string
          format: uuid
        record_type:
          type: string
          enum:
            - email_inbox
        address:
          type: string
          format: email
        status:
          type: string
          enum:
            - active
            - paused
        domain_id:
          type: string
          format: uuid
        domain:
          type: string
          description: Domain name used by the inbox address.
        settings:
          type: object
          additionalProperties: true
        created_at:
          type: string
          format: date-time
        updated_at:
          type: string
          format: date-time
      required:
        - id
        - record_type
        - address
        - status
        - domain_id
        - domain
        - settings
        - created_at
        - updated_at
    ErrorObject:
      type: object
      properties:
        code:
          type: string
          description: >-
            Telnyx error code. Edge idempotency errors use 10027 or 10036.
            Fallback 404/500 responses from the framework may use string status
            codes ('404', '500') instead.
          enum:
            - '10001'
            - '10006'
            - '10007'
            - '10015'
            - '10016'
            - '10019'
            - recipient_suppressed
            - reputation_suspended
            - '404'
            - '500'
            - '10027'
            - '10036'
        title:
          type: string
        detail:
          description: >-
            Human-readable error detail. Changeset responses may return a
            structured object.
          oneOf:
            - type: string
            - type: object
              additionalProperties: true
        source:
          type:
            - object
            - 'null'
          additionalProperties: true
        meta:
          type:
            - object
            - 'null'
          additionalProperties: true
          description: Additional metadata. Present on 401 errors with a documentation URL.
      required:
        - code
        - title
        - detail
    SuppressedRecipient:
      type: object
      properties:
        to:
          type: string
          format: email
          description: Suppressed recipient email address.
        reason:
          type: string
          description: Suppression reason returned by the recipient suppression service.
        scope:
          type: string
          description: Scope at which the suppression applies.
        override_allowed:
          type: boolean
          description: Whether an authorized send may override this suppression.
      required:
        - to
        - reason
        - scope
        - override_allowed
  responses:
    email_UnauthorizedResponse:
      description: Not authorized (10006).
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/email_ErrorResponse'
          example:
            errors:
              - code: '10006'
                title: Not authorized
                detail: Invalid API key
                meta:
                  url: https://developers.telnyx.com/docs/overview/errors/10006
    email_ServiceUnavailableResponse:
      description: >-
        Service unavailable (10016), including an unavailable upstream
        dependency or unavailable Edge idempotency protection for a keyed
        request.
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/email_ErrorResponse'
          example:
            errors:
              - code: '10016'
                title: Service Unavailable
                detail: >-
                  The email domain service is temporarily unavailable. Please
                  try again later.
  securitySchemes:
    bearerAuth:
      scheme: bearer
      type: http

````