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

# Update a managed account

> Update a single managed account.



## OpenAPI

````yaml https://telnyx-openapi-ng.s3.us-east-1.amazonaws.com/account-billing/managed-accounts.yml patch /managed_accounts/{id}
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/{id}:
    patch:
      tags:
        - Managed Accounts
      summary: Update a managed account
      description: Update a single managed account.
      operationId: UpdateManagedAccount
      parameters:
        - name: id
          in: path
          description: Managed Account User ID
          required: true
          schema:
            type: string
      requestBody:
        description: Parameters that define the updates to the managed account
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/UpdateManagedAccountRequest'
      responses:
        '200':
          $ref: '#/components/responses/ManagedAccountResponse'
        '401':
          $ref: '#/components/responses/managed-accounts_UnauthorizedResponse'
        '404':
          description: Resource not found
        '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.update('id');

            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.update(
                id="id",
            )
            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.Update(\n\t\tcontext.TODO(),\n\t\t\"id\",\n\t\ttelnyx.ManagedAccountUpdateParams{},\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.ManagedAccountUpdateParams;

            import
            com.telnyx.sdk.models.managedaccounts.ManagedAccountUpdateResponse;


            public final class Main {
                private Main() {}

                public static void main(String[] args) {
                    TelnyxClient client = TelnyxOkHttpClient.fromEnv();

                    ManagedAccountUpdateResponse managedAccount = client.managedAccounts().update("id");
                }
            }
        - lang: Ruby
          source: |-
            require "telnyx"

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

            managed_account = telnyx.managed_accounts.update("id")

            puts(managed_account)
        - 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 {
              $managedAccount = $client->managedAccounts->update(
                'id', managedAccountAllowCustomPricing: true
              );

              var_dump($managedAccount);
            } catch (APIException $e) {
              echo $e->getMessage();
            }
        - lang: CLI
          source: |-
            telnyx managed-accounts update \
              --api-key 'My API Key' \
              --id id
components:
  schemas:
    UpdateManagedAccountRequest:
      title: Update Managed Account Request
      properties:
        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, but
            there may be time lag between when the value is changed and pricing
            changes take effect.
          example: false
      example:
        managed_account_allow_custom_pricing: true
      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

````