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



## OpenAPI

````yaml https://telnyx-openapi-ng.s3.us-east-1.amazonaws.com/account-billing/managed-accounts.yml post /managed_accounts
openapi: 3.1.0
info:
  title: Telnyx Managed Accounts API
  version: 2.0.0
  description: API for Managed accounts.
  contact:
    email: support@telnyx.com
servers:
  - url: https://api.telnyx.com/v2
security:
  - bearerAuth: []
paths:
  /managed_accounts:
    post:
      tags:
        - Managed Accounts
      summary: Create a new managed account.
      description: >-
        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.
      operationId: CreateManagedAccount
      parameters: []
      requestBody:
        description: Parameters that define the managed account to be created
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/CreateManagedAccountRequest'
      responses:
        '200':
          $ref: '#/components/responses/ManagedAccountResponse'
        '401':
          $ref: '#/components/responses/managed-accounts_UnauthorizedResponse'
        '422':
          $ref: '#/components/responses/UnprocessableManagedAccountEntity'
      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 managedAccount = await client.managedAccounts.create({
              business_name: "Larry's Cat Food Inc",
            });

            console.log(managedAccount.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
            )
            managed_account = client.managed_accounts.create(
                business_name="Larry's Cat Food Inc",
            )
            print(managed_account.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\tmanagedAccount, err := client.ManagedAccounts.New(context.TODO(), telnyx.ManagedAccountNewParams{\n\t\tBusinessName: \"Larry's Cat Food Inc\",\n\t})\n\tif err != nil {\n\t\tpanic(err.Error())\n\t}\n\tfmt.Printf(\"%+v\\n\", managedAccount.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.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);
                }
            }
        - lang: Ruby
          source: >-
            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)
        - lang: CLI
          source: |-
            telnyx managed-accounts create \
              --api-key 'My API Key' \
              --business-name "Larry's Cat Food Inc"
components:
  schemas:
    CreateManagedAccountRequest:
      title: Create Managed Account Request
      required:
        - business_name
      properties:
        email:
          type: string
          description: >-
            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.
          example: new_managed_account@customer.org
        password:
          type: string
          description: >-
            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.)
          example: 3jVjLq!tMuWKyWx4NN*CvhnB
        business_name:
          type: string
          description: >-
            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.
          example: Larry's Cat Food Inc
        managed_account_allow_custom_pricing:
          type: boolean
          description: >-
            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.
          example: false
        rollup_billing:
          type: boolean
          description: >-
            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.
          example: false
      example:
        email: larry_cat_food@customer.org
        password: 3jVjLq!tMuWKyWx4NN*CvhnB
        business_name: Larry's Cat Food Inc
        managed_account_allow_custom_pricing: false
        rollup_billing: false
      type: object
    ManagedAccount:
      type: object
      title: ManagedAccount
      required:
        - record_type
        - id
        - email
        - api_key
        - api_user
        - api_token
        - manager_account_id
        - created_at
        - updated_at
      properties:
        record_type:
          type: string
          example: managed_account
          enum:
            - managed_account
          description: Identifies the type of the resource.
        id:
          type: string
          format: uuid
          description: Uniquely identifies the managed account.
          example: f65ceda4-6522-4ad6-aede-98de83385123
        email:
          type: string
          format: email
          description: The managed account's email.
          example: user@example.com
        api_key:
          type: string
          description: The managed account's V2 API access key
          example: KEY01236170692E74656C6E79782E636F6D_YmlnIGlyb24gaXMgZGVhZA
        api_user:
          type: string
          description: >-
            The manager account's email, which serves as the V1 API user
            identifier
          example: managed_account@example.com
        api_token:
          type: string
          description: The managed account's V1 API token
          example: x6oexQNHTs-fZ7-QsDMOeg
        organization_name:
          type: string
          description: The organization the managed account is associated with.
          example: Example Company LLC
        manager_account_id:
          type: string
          description: The ID of the manager account associated with the managed account.
          example: f65ceda4-6522-4ad6-aede-98de83385123
        balance:
          $ref: '#/components/schemas/ManagedAccountBalance'
        created_at:
          type: string
          description: ISO 8601 formatted date indicating when the resource was created.
          example: '2018-02-02T22:25:27.521Z'
        updated_at:
          type: string
          description: ISO 8601 formatted date indicating when the resource was updated.
          example: '2018-02-02T22:25:27.521Z'
        managed_account_allow_custom_pricing:
          type: boolean
          description: >-
            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. There may be time lag between
            when the value is changed and pricing changes take effect.
          example: true
        rollup_billing:
          type: boolean
          description: >-
            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.
          example: false
    UnprocessableEntityError:
      required:
        - code
        - title
      properties:
        code:
          type: string
          x-format: int64
        title:
          type: string
        detail:
          type: string
        source:
          type: object
          properties:
            pointer:
              description: JSON pointer (RFC6901) to the offending entity.
              type: string
              format: json-pointer
            parameter:
              description: Indicates which query parameter caused the error.
              type: string
        meta:
          type: object
          additionalProperties: true
      type: object
    ManagedAccountBalance:
      type: object
      properties:
        record_type:
          type: string
          example: balance
          enum:
            - balance
          description: Identifies the type of the resource.
        balance:
          type: string
          description: The account's current balance.
          example: '300.00'
          x-format: decimal
        credit_limit:
          type: string
          description: The account's credit limit.
          example: '100.00'
          x-format: decimal
        available_credit:
          type: string
          description: Available amount to spend (balance + credit limit)
          example: '400.00'
          x-format: decimal
        currency:
          type: string
          description: The ISO 4217 currency identifier.
          example: USD
          x-format: iso4217
      example:
        record_type: balance
        balance: '300.00'
        credit_limit: '100.00'
        available_credit: '400.00'
        currency: USD
  responses:
    ManagedAccountResponse:
      description: Successful response with information about a single managed account.
      content:
        application/json:
          schema:
            type: object
            properties:
              data:
                $ref: '#/components/schemas/ManagedAccount'
    managed-accounts_UnauthorizedResponse:
      description: >-
        Unauthenticated response. Happens when the current user cannot be
        authenticated.
    UnprocessableManagedAccountEntity:
      description: Unprocessable entity. Check the 'detail' field in response for details.
      content:
        application/json:
          schema:
            type: object
            properties:
              errors:
                type: array
                items:
                  $ref: '#/components/schemas/UnprocessableEntityError'
  securitySchemes:
    bearerAuth:
      scheme: bearer
      type: http

````