{
  "openapi": "3.0.0",
  "info": {
    "title": "Enterprise Management",
    "x-alternate-name": "Enterprise Management",
    "description": "## Introduction\n\nWith the Enterprise Management API, you can create and manage IBM Cloud® enterprises. An enterprise is a hierarchical account structure that you can use to centrally manage billing and usage across multiple IBM Cloud accounts. You can recreate your organizational structure in the cloud, with billing consolidated across all accounts to the enterprise level.\n\nIn an enterprise, you can import existing accounts from outside the enterprise or create new accounts within the enterprise, and then organize the accounts by using account groups. To create a multitiered hierarchy, you can nest account groups within an account group. See [What is an enterprise?](https://cloud.ibm.com/docs/enterprise-management?topic=enterprise-management-what-is-enterprise&interface=ui) for more information about how enterprises can simplify your account management.\n\nSDKs for Java, Node, Python, and Go are available to make it easier to programmatically access the API from your code. The client libraries that are provided by the SDKs implement best practices for using the API and reduce the amount of code that you need to write. The tab for each language includes code examples that demonstrate how to use the client libraries. For more information about using the SDKs, see the [IBM Cloud SDK Common project](https://github.com/IBM/ibm-cloud-sdk-common) on GitHub.\n\nInstalling the Java SDK\n\nMaven\n\n```xml\n<dependency>\n    <groupId>com.ibm.cloud</groupId>\n    <artifactId>enterprise-management</artifactId>\n    <version>{version}</version>\n</dependency>\n```\n\nGradle\n\n```java\ncompile 'com.ibm.cloud:enterprise-management:{version}'\n```\n\nFor more installation options, view this project in GitHub.\nhttps://github.com/IBM/platform-services-java-sdk\n\nInstalling the Go SDK\n\nInstallation\n\n```bash\ngo get -u github.com/IBM/platform-services-go-sdk/enterprisemanagementv1\n```\n\nFor more installation options, view this project in GitHub.\nhttps://github.com/IBM/platform-services-go-sdk\n\nInstalling the Node SDK\n\nInstallation\n\n```bash\nnpm install @ibm-cloud/platform-services\n```\n\nFor more installation options, view this project in GitHub.\nhttps://github.com/IBM/platform-services-node-sdk\n\nInstalling the Python SDK\n\nInstallation\n\n```bash\npip install --upgrade \"ibm-platform-services\"\n```\n\nFor more installation options, view this project in GitHub.\nhttps://github.com/IBM/platform-services-python-sdk\n\n## Endpoint URLs\n\nThe Enterprise Management API uses the following global endpoint URL. When you call the API, add the path for each method to form the complete API endpoint for your requests.\n\n```\nhttps://enterprise.cloud.ibm.com\n```\n\nIf you enabled service endpoints in your account, you can send API requests over the IBM Cloud® private network at the following base endpoint URLs. For more information, see [Enabling VRF and service endpoints](https://cloud.ibm.com/docs/account?topic=account-vrf-service-endpoint).\n\n* Private endpoint URL for VPC infrastructure: `https://private.enterprise.cloud.ibm.com`\n* Private endpoint URLs for classic infrastructure:\n   * Dallas: `https://private.us-south.enterprise.cloud.ibm.com`\n   * Washington DC: `https://private.us-east.enterprise.cloud.ibm.com`\n\nExample API request\n\n```\ncurl -X {request_method} \"https://enterprise.cloud.ibm.com/{method_endpoint}\"\n```\n\nReplace `{request_method}` and `{method_endpoint}` in this example with the values for your particular API call.\n\n## Authentication\n\nAuthorization to the Enterprise Management REST API is enforced by using an IBM Cloud Identity and Access Management (IAM) access token. The token is used to determine the actions that the identity has access to when using various Enterprise API services. Obtaining an IAM token for an authenticated user or service ID is described in the [IAM Identity Services API](https://cloud.ibm.com/apidocs/iam-identity-token-api) documentation.\n\nTo use the API, add a valid IAM Token to the HTTP `Authorization` request header, for example, `-H 'Authorization: Bearer $TOKEN'`.\n\nAdequate access is required to use the API. Each method lists the IAM action that you need to be assigned access to. The access control is hierarchical, which means that granting access to an entity in the enterprise hierarchy also grants access to its children. For example, if you grant a user access to the Enterprise service on an account group, the user also has that access on the accounts and account groups in it. For more information, see [Assigning access for enterprise management](https://cloud.ibm.com/docs/enterprise-management?topic=enterprise-management-assign-access-enterprise&interface=ui).\n\nTo create an enterprise, you must have the Administrator role on the Billing service in the account. After the enterprise is created, a user with the Administrator or Editor on the Enterprise service can update enterprise properties, such as the name or domain, of the enterprise. A user with the Viewer role on the Enterprise service can retrieve and list the enterprise, account groups, and accounts within the enterprise.\n\nTo retrieve your access token:\n\n```bash\ncurl -X POST \\\n  \"https://iam.cloud.ibm.com/identity/token\" \\\n  --header 'Content-Type: application/x-www-form-urlencoded' \\\n  --header 'Accept: application/json' \\\n  --data-urlencode 'grant_type=urn:ibm:params:oauth:grant-type:apikey' \\\n  --data-urlencode 'apikey={api_key}'\n```\n\nReplace `<API_KEY>` with your service credentials. Then use the full `IAM token` value, prefixed by the _Bearer_ token type, to authenticate your API requests.\n\nExample that sets options by using environment variables\n\n```bash\nexport ENTERPRISE_MANAGEMENT_APIKEY={api_key}\n```\n\n```java\nimport com.ibm.cloud.platform_services.enterprise_management.v1.EnterpriseManagement;\n\nEnterpriseManagement enterpriseManagementService = EnterpriseManagement.newInstance();\n```\n\nReplace `{api_key}` with your IBM Cloud IAM API key. Invoke service operations by using the `enterpriseManagementService` variable.\n\nFor more authentication examples, check out the [IBM Cloud SDK Common project on GitHub](https://github.com/IBM/ibm-cloud-sdk-common/blob/main/README.md#authentication).\n\nExample that sets options by using environment variables\n\n```bash\nexport ENTERPRISE_MANAGEMENT_APIKEY={api_key}\n```\n\n```go\nenterpriseManagementService, err := enterprisemanagementv1.NewEnterpriseManagementV1UsingExternalConfig(\n        &enterprisemanagementv1.EnterpriseManagementV1Options{})\nif err != nil {\n    panic(err)\n}\n```\n\nReplace `{api_key}` with your IBM Cloud IAM API key. Invoke service operations by using the `enterpriseManagementService` variable.\n\nFor more authentication examples, check out the [IBM Cloud SDK Common project on GitHub](https://github.com/IBM/ibm-cloud-sdk-common/blob/main/README.md#authentication).\n\nExample that sets options by using environment variables\n\n```bash\nexport ENTERPRISE_MANAGEMENT_APIKEY={api_key}\n```\n\n```python\nfrom ibm_platform_services import  EnterpriseManagementV1\nenterprise_management_service =  EnterpriseManagementV1.new_instance()\n```\n\nReplace `{api_key}` with your IBM Cloud IAM API key. Invoke service operations by using the `enterprise_management_service` variable.\n\nFor more authentication examples, check out the [IBM Cloud SDK Common project on GitHub](https://github.com/IBM/ibm-cloud-sdk-common/blob/main/README.md#authentication).\n\nExample that sets options by using environment variables\n\n```bash\nexport ENTERPRISE_MANAGEMENT_APIKEY={api_key}\n```\n\n```javascript\nconst EnterpriseManagementV1 = require('ibm-platform-services/enterprise-management/v1');\n\nconst enterpriseManagementService = EnterpriseManagementV1.newInstance({});\n```\n\nReplace `{api_key}` with your IBM Cloud IAM API key. Invoke service operations by using the `enterpriseManagementService` variable.\n\nFor more authentication examples, check out the [IBM Cloud SDK Common project on GitHub](https://github.com/IBM/ibm-cloud-sdk-common/blob/main/README.md#authentication).\n\n## Auditing\n\nYou can monitor API activity within your account by using the IBM Cloud Logs service. Whenever an API method is called, an event is generated that you can then track and audit from within IBM Cloud Logs. The specific event type is listed for each individual method.\n\nFor more information about how to track activity in an enterprise, see [Activity tracking events for enterprise management](https://cloud.ibm.com/docs/enterprise-management?topic=enterprise-management-at_events_em).\n\n## Error handling\n\nThe Enterprise Management API returns standard HTTP status codes to indicate the success or failure of a request. The response is in JSON format as shown in the following example:\n```json\n{\n    \"message\": \"Not Authenticated\",\n    \"trace\": \"27249289915\",\n    \"errors\": [\n        {\n            \"code\": \"invalid_token\",\n            \"message\": \"Not Authenticated\",\n            \"target\": {\n                \"type\": \"\",\n                \"name\": \"\"\n            }\n        }\n    ]\n}\n```\n\nThe server returns an appropriate error code when a particular operation can't be fulfilled. All responses from the Enterprise Management API are in JSON format.\n\nThe API can return the following error codes.\n\n| HTTP Error Code | Description | Recovery |\n|-----------------|-------------|----------|\n| `200` | Success | The request was successful. |\n| `201` | Created | The resource was successfully created. |\n| `204` | No Content | The request was successful. No response body is provided. |\n| `400` | Bad Request | The input parameters in the request body are either incomplete or in the wrong format. Be sure to include all required parameters in your request. |\n| `401` | Unauthorized | You are not authorized to make this request. The token is either missing or expired. Get a new valid token and try again.     |\n| `403` | Forbidden | The supplied authentication is not authorized to perform the operation. If this error persists, contact the account owner to check your permissions. |\n| `404` | Not Found | The requested resource could not be found. |\n| `409` | Conflict | The entity is already in the requested state. |\n| `429` | Too Many Requests | Too many requests were made within a period of time. Wait before you call the API again. |\n| `500` | Internal Server Error | The API had an internal server error and could not process the request. |\n| `503` | Service Temporarily Unavailable | The API or one of its internal dependent services is currently unavailable. Your request could not be processed. Wait a few minutes and try again. |\n\n## Pagination\n\nSome API requests might return many results. To avoid performance issues, these results are returned one page at a time, with a limited number of results on each page. `GET` requests for the following resources use pagination:\n\n   * `/v1/enterprises`\n   * `/v1/enterprises?enterprise_account_id={account_id}`\n   * `/v1/enterprises?enterprise_id={enterprise_id}&next_docid={next_docid}`\n   * `/v1/enterprises?account_group_id={account_group_id}`\n   * `/v1/enterprises?account_id={account_id}`\n   * `/v1/account-groups`\n   * `/v1/account-groups?enterprise_id={enterprise_id}`\n   * `/v1/account-groups?account_group_id={account_group_id}&next_docid={next_docid}`\n   * `/v1/account-groups?parent_account_group_id={account_group_id}`\n   * `/v1/account-groups?parent={parent_crn}`\n   * `/v1/accounts`\n   * `/v1/accounts?enterprise_id={enterprise_id}`\n   * `/v1/accounts?account_id={account_id}&next_docid={next_docid}`\n   * `/v1/accounts?account_group_id={account_group_id}`\n   * `/v1/accounts?parent={parent_crn}`\n\nThe `rows_count`, `next_url` and `resources` fields are included in the collection response. The `next_url` field gives the link to the next page of results.\n\nBy default, each page contains 100 items, which is also the maximum number of items per page. To specify a different number of items per page, use the `limit` query parameter.\n\nThe `rows_count` field indicates the number of resources that exist on the page.\n\n## Rate limiting\n\nRate limits for API requests are enforced on a per-caller basis. If the number of requests for a particular method and endpoint reaches the request limit within the specified time window, no further requests are accepted until the timer expires. After the timer expires, a new time window begins with the next accepted request.\n\n* `X-RateLimit-Reset`: The time the current timer expires (in UNIX epoch time)\n* `X-RateLimit-Remaining`: The number of requests that are remaining in the current time window\n* `X-RateLimit-Limit`: The total number of requests allowed within the time window\n\nAn HTTP status code of `429` indicates that the rate limit was exceeded.\n\nThe number of allowed requests, and the length of the time window, might vary by method and endpoint. The reference information for each endpoint specifies the rate limit that applies.\n\n## Related APIs\n\nWhen you work with the Enterprise API endpoints, it might be helpful to be familiar with the following related APIs:\n\n* [Enterprise Usage Reports API](https://cloud.ibm.com/apidocs/enterprise-apis/resource-usage-reports): Get usage reports for an enterprise, account group, or account.\n* [Enterprise Billing Units API](https://cloud.ibm.com/apidocs/enterprise-apis/billing-unit): Manage enterprise billing and credit pools.\n* [Resource Controller API](https://cloud.ibm.com/apidocs/resource-controller): Manage resource instances, keys, bindings, and more.",
    "version": "1.0",
    "x-codegen-config": {
      "java": {
        "apiPackage": "com.ibm.cloud.platform_services"
      },
      "go": {
        "apiPackage": "github.com/IBM/platform-services-go-sdk",
        "improvedNameFormattingV2": true
      },
      "python": {
        "apiPackage": "ibm_platform_services"
      }
    },
    "x-sdk-supported-languages": [
      "curl",
      "python",
      "node",
      "java",
      "go"
    ],
    "x-github": "https://github.ibm.com/cloud-api-docs/enterprise",
    "x-github-issues": "https://github.ibm.com/cloud-api-docs/enterprise/issues/new",
    "x-last-updated": "2026-04-14"
  },
  "servers": [
    {
      "url": "https://enterprise.cloud.ibm.com/v1"
    }
  ],
  "security": [
    {
      "IAM": []
    }
  ],
  "tags": [
    {
      "name": "Enterprise Operations"
    },
    {
      "name": "Account Operations"
    },
    {
      "name": "Account Group Operations"
    }
  ],
  "paths": {
    "/enterprises": {
      "post": {
        "operationId": "create_enterprise",
        "summary": "Create an enterprise",
        "description": "Create a new enterprise, which you can use to centrally manage multiple accounts. To create an enterprise, you must have an active Subscription account. <br/><br/>The API creates an enterprise entity, which is the root of the enterprise hierarchy. It also creates a new enterprise account that is used to manage the enterprise. All subscriptions, support entitlements, credits, and discounts from the source subscription account are migrated to the enterprise account, and the source account becomes a child account in the hierarchy. The user that you assign as the enterprise primary contact is also assigned as the owner of the enterprise account.",
        "tags": [
          "Enterprise Operations"
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/CreateEnterpriseRequest"
              }
            }
          },
          "description": "The body required to create an enterprise.",
          "required": true
        },
        "x-ibm-permissions": {
          "actions": [
            {
              "name": "enterprise.enterprise.create"
            }
          ]
        },
        "x-ibm-events": {
          "events": [
            {
              "name": "enterprise.enterprise.create"
            }
          ]
        },
        "x-codegen-request-body-name": "body",
        "x-sdk-operations": {
          "request-examples": {
            "curl": [
              {
                "name": "Example request",
                "example": [
                  {
                    "type": "code",
                    "source": [
                      "curl -X POST \\\n",
                      "\"https://enterprise.cloud.ibm.com/v1/enterprises \\\n",
                      "-H \"Authorization: Bearer <IAM_Token>\" \\\n",
                      "-H 'Content-Type: application/json' \\\n",
                      "-d '{\n",
                      "  \"source_account_id\": \"a1b2c32a5ea94809a9840f5e23c362d\",\n",
                      "  \"name\": \"Example Enterprise\",\n",
                      "  \"domain\": \"example.com\",\n",
                      "  \"primary_contact_iam_id\": \"IBMid-0123ABC\"\n",
                      "}'"
                    ]
                  }
                ]
              }
            ],
            "go": [
              {
                "name": "Example request",
                "example": [
                  {
                    "type": "code",
                    "source": [
                      "createEnterpriseOptions := enterpriseManagementService.NewCreateEnterpriseOptions(\n",
                      "  srcAccountID,\n",
                      "  \"Example Enterprise\",\n",
                      "  contactIamID,\n",
                      ")\n",
                      "\n",
                      "createEnterpriseResponse, response, err := enterpriseManagementService.CreateEnterprise(createEnterpriseOptions)\n",
                      "if err != nil {\n",
                      "  panic(err)\n",
                      "}\n",
                      "b, _ := json.MarshalIndent(createEnterpriseResponse, \"\", \"  \")\n",
                      "fmt.Println(string(b))"
                    ]
                  }
                ]
              }
            ],
            "java": [
              {
                "name": "Example request",
                "example": [
                  {
                    "type": "code",
                    "source": [
                      "CreateEnterpriseOptions createEnterpriseOptions = new CreateEnterpriseOptions.Builder()\n",
                      "    .sourceAccountId(srcAccountId)\n",
                      "    .name(\"Example Enterprise\")\n",
                      "    .primaryContactIamId(contactIamId)\n",
                      "    .build();\n",
                      "\n",
                      "Response<CreateEnterpriseResponse> response = enterpriseManagementService.createEnterprise(createEnterpriseOptions).execute();\n",
                      "CreateEnterpriseResponse createEnterpriseResponse = response.getResult();\n",
                      "\n",
                      "System.out.println(createEnterpriseResponse);"
                    ]
                  }
                ]
              }
            ],
            "node": [
              {
                "name": "Example request",
                "example": [
                  {
                    "type": "code",
                    "source": [
                      "const params = {\n",
                      "  sourceAccountId: srcAccountId,\n",
                      "  name: 'Example Enterprise',\n",
                      "  primaryContactIamId: contactIamId,\n",
                      "};\n",
                      "\n",
                      "try {\n",
                      "  const res = await enterpriseManagementService.createEnterprise(params);\n",
                      "  console.log(JSON.stringify(res.result, null, 2));\n",
                      "} catch (err) {\n",
                      "  console.warn(err);\n",
                      "}"
                    ]
                  }
                ]
              }
            ],
            "python": [
              {
                "name": "Example request",
                "example": [
                  {
                    "type": "code",
                    "source": [
                      "create_enterprise_response = enterprise_management_service.create_enterprise(\n",
                      "  source_account_id=src_account_id,\n",
                      "  name='Example Enterprise',\n",
                      "  primary_contact_iam_id=contact_iam_id,\n",
                      ").get_result()\n",
                      "\n",
                      "print(json.dumps(create_enterprise_response, indent=2))"
                    ]
                  }
                ]
              }
            ]
          }
        },
        "responses": {
          "202": {
            "description": "Enterprise is now in 'PENDING' state. Enterprise state will update to 'ACTIVE' when asynchronous processing is complete",
            "headers": {
              "transaction-id": {
                "description": "The transaction ID that's used to track the request.",
                "schema": {
                  "type": "string"
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/CreateEnterpriseResponse"
                },
                "examples": {
                  "response": {
                    "value": {
                      "enterprise_id": "$ENTERPRISE_ID",
                      "enterprise_account_id": "$ENTERPRISE_ACCOUNT_ID"
                    }
                  }
                }
              }
            }
          },
          "400": {
            "description": "Bad Request",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorContainer"
                },
                "examples": {
                  "response": {
                    "value": {
                      "trace": "15264906437",
                      "errors": [
                        {
                          "code": "CANNOT_CONVERT_TO_ENTERPRISE",
                          "message": "The `source_account_id` cannot be converted to an enterprise: Source account is not a SUBSCRIPTION account",
                          "more_info": "n/a"
                        }
                      ]
                    }
                  }
                }
              }
            }
          },
          "401": {
            "description": "Invalid or Expired Access Token",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorContainer"
                },
                "examples": {
                  "response": {
                    "value": {
                      "message": "Not Authorized",
                      "trace": "59075132505",
                      "errors": [
                        {
                          "code": "invalid_or_expired_token",
                          "message": "Not Authorized"
                        }
                      ]
                    }
                  }
                }
              }
            }
          },
          "403": {
            "description": "Access Denied",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorContainer"
                },
                "examples": {
                  "response": {
                    "value": {
                      "message": "Not Authenticated",
                      "trace": "55748601058",
                      "errors": [
                        {
                          "code": "forbidden",
                          "message": "Not Authenticated"
                        }
                      ]
                    }
                  }
                }
              }
            }
          },
          "500": {
            "description": "Internal Server Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorContainer"
                },
                "examples": {
                  "response": {
                    "value": {
                      "trace": "14706814780",
                      "errors": [
                        {
                          "code": "ENTERPRISE_ACCOUNT_NOT_CREATED",
                          "message": "Could not create enterprise account for source account ID: ${ACCOUNT_ID}",
                          "more_info": "n/a",
                          "dependency_code": "ACCOUNT_MANAGEMENT"
                        }
                      ]
                    }
                  }
                }
              }
            }
          },
          "503": {
            "description": "Service Unavailable",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorContainer"
                },
                "examples": {
                  "response": {
                    "value": {
                      "trace": "98806352835",
                      "errors": [
                        {
                          "code": "service_unavailable",
                          "message": "Service Temporarily Unavailable"
                        }
                      ]
                    }
                  }
                }
              }
            }
          }
        }
      },
      "get": {
        "operationId": "list_enterprises",
        "summary": "List enterprises",
        "description": "Retrieve all enterprises for a given ID by passing the IDs on query parameters. If no ID is passed, the enterprises for which the calling identity is the primary contact are returned. You can use pagination parameters to filter the results. <br/><br/>This method ensures that only the enterprises that the user has access to are returned. Access can be controlled either through a policy on a specific enterprise, or account-level platform services access roles, such as Administrator, Editor, Operator, or Viewer. When you call the method with the `enterprise_account_id` or `account_id` query parameter, the account ID in the token is compared with that in the query parameter. If these account IDs match, authentication isn't performed and the enterprise information is returned. If the account IDs don't match, authentication is performed and only then is the enterprise information returned in the response.",
        "tags": [
          "Enterprise Operations"
        ],
        "parameters": [
          {
            "description": "Get enterprises for a given enterprise account ID.",
            "name": "enterprise_account_id",
            "in": "query",
            "schema": {
              "type": "string"
            }
          },
          {
            "description": "Get enterprises for a given account group ID.",
            "name": "account_group_id",
            "in": "query",
            "schema": {
              "type": "string"
            }
          },
          {
            "description": "Get enterprises for a given account ID.",
            "name": "account_id",
            "in": "query",
            "schema": {
              "type": "string"
            }
          },
          {
            "description": "The first item to be returned in the page of results. This value can be obtained from the next_url property from the previous call of the operation. If not specified, then the first page of results is returned.",
            "name": "next_docid",
            "in": "query",
            "schema": {
              "type": "string"
            }
          },
          {
            "description": "Return results up to this limit. Valid values are between `0` and `100`.",
            "name": "limit",
            "in": "query",
            "schema": {
              "type": "integer",
              "default": 100,
              "maximum": 100
            }
          }
        ],
        "x-ibm-permissions": {
          "actions": [
            {
              "name": "enterprise.enterprise.retrieve"
            }
          ]
        },
        "x-sdk-operations": {
          "request-examples": {
            "curl": [
              {
                "name": "Example request",
                "example": [
                  {
                    "type": "code",
                    "source": [
                      "curl -X GET \\\n",
                      "\"https://enterprise.cloud.ibm.com/v1/enterprises\" \\\n",
                      "-H \"Authorization: Bearer <IAM_Token>\" \\\n",
                      "-H 'Content-Type: application/json'"
                    ]
                  }
                ]
              }
            ],
            "go": [
              {
                "name": "Example request",
                "example": [
                  {
                    "type": "code",
                    "source": [
                      "listEnterprisesOptions := &enterprisemanagementv1.ListEnterprisesOptions{\n",
                      "  EnterpriseAccountID: &enterpriseAccountID,\n",
                      "}\n",
                      "\n",
                      "pager, err := enterpriseManagementService.NewEnterprisesPager(listEnterprisesOptions)\n",
                      "if err != nil {\n",
                      "  panic(err)\n",
                      "}\n",
                      "\n",
                      "var allResults []enterprisemanagementv1.Enterprise\n",
                      "for pager.HasNext() {\n",
                      "  nextPage, err := pager.GetNext()\n",
                      "  if err != nil {\n",
                      "    panic(err)\n",
                      "  }\n",
                      "  allResults = append(allResults, nextPage...)\n",
                      "}\n",
                      "b, _ := json.MarshalIndent(allResults, \"\", \"  \")\n",
                      "fmt.Println(string(b))"
                    ]
                  }
                ]
              }
            ],
            "java": [
              {
                "name": "Example request",
                "example": [
                  {
                    "type": "code",
                    "source": [
                      "ListEnterprisesOptions listEnterprisesOptions = new ListEnterprisesOptions.Builder()\n",
                      "  .enterpriseAccountId(enterpriseAccountId)\n",
                      "  .build();\n",
                      "\n",
                      "EnterprisesPager pager = new EnterprisesPager(enterpriseManagementService, listEnterprisesOptions);\n",
                      "List<Enterprise> allResults = new ArrayList<>();\n",
                      "while (pager.hasNext()) {\n",
                      "  List<Enterprise> nextPage = pager.getNext();\n",
                      "  allResults.addAll(nextPage);\n",
                      "}\n",
                      "\n",
                      "System.out.println(GsonSingleton.getGson().toJson(allResults));"
                    ]
                  }
                ]
              }
            ],
            "node": [
              {
                "name": "Example request",
                "example": [
                  {
                    "type": "code",
                    "source": [
                      "const params = {\n",
                      "  accountId: enterpriseAccountId,\n",
                      "};\n",
                      "\n",
                      "const allResults = [];\n",
                      "try {\n",
                      "  const pager = new EnterpriseManagementV1.EnterprisesPager(enterpriseManagementService, params);\n",
                      "  while (pager.hasNext()) {\n",
                      "    const nextPage = await pager.getNext();\n",
                      "    expect(nextPage).not.toBeNull();\n",
                      "    allResults.push(...nextPage);\n",
                      "  }\n",
                      "  console.log(JSON.stringify(allResults, null, 2));\n",
                      "} catch (err) {\n",
                      "  console.warn(err);\n",
                      "}"
                    ]
                  }
                ]
              }
            ],
            "python": [
              {
                "name": "Example request",
                "example": [
                  {
                    "type": "code",
                    "source": [
                      "all_results = []\n",
                      "pager = EnterprisesPager(\n",
                      "  client=enterprise_management_service,\n",
                      "  account_id=enterprise_account_id,\n",
                      ")\n",
                      "while pager.has_next():\n",
                      "  next_page = pager.get_next()\n",
                      "  assert next_page is not None\n",
                      "  all_results.extend(next_page)\n",
                      "\n",
                      "print(json.dumps(all_results, indent=2))"
                    ]
                  }
                ]
              }
            ]
          }
        },
        "responses": {
          "200": {
            "description": "Success",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ListEnterprisesResponse"
                },
                "examples": {
                  "response": {
                    "value": {
                      "rows_count": 1,
                      "next_url": "/v1/enterprises?$ENTERPRISE_ID&next_docid=$NEXT_DOCID",
                      "resources": [
                        {
                          "url": "/v1/enterprises/$ENTERPRISE_ID",
                          "id": "$ENTERPRISE_ID",
                          "enterprise_account_id": "$ENTERPRISE_ACCOUNT_ID",
                          "crn": "crn:v1:bluemix:public:enterprise::a/$ENTERPRISE_ACCOUNT_ID::enterprise:$ENTERPRISE_ID",
                          "name": "Sample Enterprise",
                          "domain": "example.com",
                          "state": "ACTIVE",
                          "primary_contact_iam_id": "IBMid-0123ABC",
                          "primary_contact_email": "user@example.com",
                          "source_account_id": "a1b2c32a5ea94809a9840f5e23c362d",
                          "created_at": "2019-05-14T19:46:51.522Z",
                          "updated_at": "2019-05-14T19:46:54.437Z",
                          "created_by": "iam-ServiceId-c8dae",
                          "updated_by": "iam-ServiceId-bfe3d"
                        }
                      ]
                    }
                  }
                }
              }
            }
          },
          "401": {
            "description": "Invalid or Expired Access Token",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorContainer"
                },
                "examples": {
                  "response": {
                    "value": {
                      "message": "Not Authorized",
                      "trace": "19184974366",
                      "errors": [
                        {
                          "code": "invalid_or_expired_token",
                          "message": "Not Authorized"
                        }
                      ]
                    }
                  }
                }
              }
            }
          },
          "403": {
            "description": "Access Denied",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorContainer"
                },
                "examples": {
                  "response": {
                    "value": {
                      "message": "Not Authenticated",
                      "trace": "63023172185",
                      "errors": [
                        {
                          "code": "forbidden",
                          "message": "Not Authenticated"
                        }
                      ]
                    }
                  }
                }
              }
            }
          },
          "500": {
            "description": "Internal Server Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorContainer"
                },
                "examples": {
                  "response": {
                    "value": {
                      "trace": "83466393038",
                      "errors": [
                        {
                          "code": "RETRIEVE_ENTERPRISE_ERROR",
                          "message": "Cannot find enterprise with ID: $ENTERPRISE_ID",
                          "more_info": "n/a",
                          "dependency_code": "CLOUDANT"
                        }
                      ]
                    }
                  }
                }
              }
            }
          },
          "503": {
            "description": "Service Unavailable",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorContainer"
                },
                "examples": {
                  "response": {
                    "value": {
                      "trace": "43754748116",
                      "errors": [
                        {
                          "code": "service_unavailable",
                          "message": "Service Temporarily Unavailable"
                        }
                      ]
                    }
                  }
                }
              }
            }
          }
        }
      }
    },
    "/enterprises/{enterprise_id}": {
      "parameters": [
        {
          "description": "The ID of the enterprise to retrieve.",
          "name": "enterprise_id",
          "in": "path",
          "required": true,
          "schema": {
            "type": "string"
          }
        }
      ],
      "get": {
        "operationId": "get_enterprise",
        "summary": "Get enterprise by ID",
        "description": "Retrieve an enterprise by the `enterprise_id` parameter. All data related to the enterprise is returned only if the caller has access to retrieve the enterprise.",
        "tags": [
          "Enterprise Operations"
        ],
        "x-ibm-permissions": {
          "actions": [
            {
              "name": "enterprise.enterprise.retrieve"
            }
          ]
        },
        "x-sdk-operations": {
          "request-examples": {
            "curl": [
              {
                "name": "Example request",
                "example": [
                  {
                    "type": "code",
                    "source": [
                      "curl -X GET \\\n",
                      "\"https://enterprise.cloud.ibm.com/v1/enterprises/$ENTERPRISE_ID\" \\\n",
                      "-H \"Authorization: Bearer <IAM_Token>\" \\\n",
                      "-H 'Content-Type: application/json'"
                    ]
                  }
                ]
              }
            ],
            "go": [
              {
                "name": "Example request",
                "example": [
                  {
                    "type": "code",
                    "source": [
                      "getEnterpriseOptions := enterpriseManagementService.NewGetEnterpriseOptions(\n",
                      "  enterpriseID,\n",
                      ")\n",
                      "\n",
                      "enterprise, response, err := enterpriseManagementService.GetEnterprise(getEnterpriseOptions)\n",
                      "if err != nil {\n",
                      "  panic(err)\n",
                      "}\n",
                      "b, _ := json.MarshalIndent(enterprise, \"\", \"  \")\n",
                      "fmt.Println(string(b))"
                    ]
                  }
                ]
              }
            ],
            "java": [
              {
                "name": "Example request",
                "example": [
                  {
                    "type": "code",
                    "source": [
                      "GetEnterpriseOptions getEnterpriseOptions = new GetEnterpriseOptions.Builder()\n",
                      "    .enterpriseId(enterpriseId)\n",
                      "    .build();\n",
                      "\n",
                      "Response<Enterprise> response = enterpriseManagementService\n",
                      "    .getEnterprise(getEnterpriseOptions)\n",
                      "    .execute();\n",
                      "Enterprise enterprise = response.getResult();\n",
                      "\n",
                      "System.out.println(enterprise);"
                    ]
                  }
                ]
              }
            ],
            "node": [
              {
                "name": "Example request",
                "example": [
                  {
                    "type": "code",
                    "source": [
                      "const params = {\n",
                      "  enterpriseId: enterpriseId,\n",
                      "};\n",
                      "\n",
                      "try {\n",
                      "  const res = await enterpriseManagementService.getEnterprise(params);\n",
                      "  console.log(JSON.stringify(res.result, null, 2));\n",
                      "} catch (err) {\n",
                      "  console.warn(err);\n",
                      "}"
                    ]
                  }
                ]
              }
            ],
            "python": [
              {
                "name": "Example request",
                "example": [
                  {
                    "type": "code",
                    "source": [
                      "enterprise = enterprise_management_service.get_enterprise(enterprise_id=enterprise_id).get_result()\n",
                      "\n",
                      "print(json.dumps(enterprise, indent=2))"
                    ]
                  }
                ]
              }
            ]
          }
        },
        "responses": {
          "200": {
            "description": "Successfully retrieved enterprise by ID",
            "headers": {
              "transaction-id": {
                "description": "The transaction ID of the get enterprise request.",
                "schema": {
                  "type": "string"
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Enterprise"
                },
                "examples": {
                  "response": {
                    "value": {
                      "url": "/v1/enterprises/$ENTERPRISE_ID",
                      "id": "$ENTERPRISE_ID",
                      "enterprise_account_id": "$ENTERPRISE_ACCOUNT_ID",
                      "crn": "crn:v1:bluemix:public:enterprise::a/$ENTERPRISE_ACCOUNT_ID::enterprise:$ENTERPRISE_ID",
                      "name": "Sample Enterprise",
                      "domain": "example.com",
                      "state": "ACTIVE",
                      "primary_contact_iam_id": "IBMid-0123ABC",
                      "primary_contact_email": "user@example.com",
                      "source_account_id": "a1b2c32a5ea94809a9840f5e23c362d",
                      "created_at": "2019-05-14T19:46:51.522Z",
                      "updated_at": "2019-05-14T19:46:54.437Z",
                      "created_by": "iam-ServiceId-c8dae",
                      "updated_by": "iam-ServiceId-bfe3d"
                    }
                  }
                }
              }
            }
          },
          "401": {
            "description": "Invalid or Expired Access Token",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorContainer"
                },
                "examples": {
                  "response": {
                    "value": {
                      "message": "Not Authorized",
                      "trace": "20417281627",
                      "errors": [
                        {
                          "code": "invalid_or_expired_token",
                          "message": "Not Authorized"
                        }
                      ]
                    }
                  }
                }
              }
            }
          },
          "403": {
            "description": "Access Denied",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorContainer"
                },
                "examples": {
                  "response": {
                    "value": {
                      "message": "Not Authenticated",
                      "trace": "53451896518",
                      "errors": [
                        {
                          "code": "forbidden",
                          "message": "Not Authenticated"
                        }
                      ]
                    }
                  }
                }
              }
            }
          },
          "404": {
            "description": "Not Found",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorContainer"
                },
                "examples": {
                  "response": {
                    "value": {
                      "trace": "28807154668",
                      "errors": [
                        {
                          "code": "RETRIEVE_ENTERPRISE_ERROR",
                          "message": "Can't find enterprise with ID: $ENTERPRISE_ID",
                          "more_info": "n/a",
                          "dependency_code": "ENTERPRISES"
                        }
                      ]
                    }
                  }
                }
              }
            }
          },
          "500": {
            "description": "Internal Server Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorContainer"
                },
                "examples": {
                  "response": {
                    "value": {
                      "trace": "20862652978",
                      "errors": [
                        {
                          "code": "RETRIEVE_ENTERPRISE_ERROR",
                          "message": "Can't find enterprise with ID: $ENTERPRISE_ID",
                          "more_info": "n/a",
                          "dependency_code": "CLOUDANT"
                        }
                      ]
                    }
                  }
                }
              }
            }
          },
          "503": {
            "description": "Service Unavailable",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorContainer"
                },
                "examples": {
                  "response": {
                    "value": {
                      "trace": "12345678-abcd-1a2b-a1b2-1234567890ab",
                      "errors": [
                        {
                          "code": "service_unavailable",
                          "message": "Service Temporarily Unavailable"
                        }
                      ]
                    }
                  }
                }
              }
            }
          }
        }
      },
      "patch": {
        "operationId": "update_enterprise",
        "summary": "Update an enterprise",
        "description": "Update the name, domain, or IAM ID of the primary contact for an existing enterprise. The new primary contact must already be a user in the enterprise account.",
        "tags": [
          "Enterprise Operations"
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/UpdateEnterpriseRequest"
              }
            }
          },
          "description": "Parameters to update the enterprise.",
          "required": true
        },
        "x-ibm-permissions": {
          "actions": [
            {
              "name": "enterprise.enterprise.update"
            }
          ]
        },
        "x-ibm-events": {
          "events": [
            {
              "name": "enterprise.enterprise.update"
            }
          ]
        },
        "x-codegen-request-body-name": "body",
        "x-sdk-operations": {
          "request-examples": {
            "curl": [
              {
                "name": "Example request",
                "example": [
                  {
                    "type": "code",
                    "source": [
                      "curl -X PATCH \\\n",
                      "\"https://enterprise.cloud.ibm.com/v1/enterprises/$ENTERPRISE_ID\" \\\n",
                      "-H \"Authorization: Bearer <IAM_Token>\" \\\n",
                      "-H 'Content-Type: application/json' \\\n",
                      "-d '{\n",
                      "  \"name\": \"Updated Example Enterprise\",\n",
                      "  \"domain\": \"new.example.com\"\n",
                      "}'"
                    ]
                  }
                ]
              }
            ],
            "go": [
              {
                "name": "Example request",
                "example": [
                  {
                    "type": "code",
                    "source": [
                      "updateEnterpriseOptions := enterpriseManagementService.NewUpdateEnterpriseOptions(\n",
                      "  enterpriseID,\n",
                      ")\n",
                      "updateEnterpriseOptions.SetName(\"Updated Example Enterprise\")\n",
                      "updateEnterpriseOptions.SetPrimaryContactIamID(enterpriseAccountIamID)\n",
                      "\n",
                      "response, err := enterpriseManagementService.UpdateEnterprise(updateEnterpriseOptions)\n",
                      "if err != nil {\n",
                      "  panic(err)\n",
                      "}"
                    ]
                  }
                ]
              }
            ],
            "java": [
              {
                "name": "Example request",
                "example": [
                  {
                    "type": "code",
                    "source": [
                      "UpdateEnterpriseOptions updateEnterpriseOptions = new UpdateEnterpriseOptions.Builder()\n",
                      "    .enterpriseId(enterpriseId)\n",
                      "    .name(\"Updated Example Enterprise\")\n",
                      "    .build();\n",
                      "\n",
                      "Response<Void> response = enterpriseManagementService.updateEnterprise(updateEnterpriseOptions)\n",
                      "    .execute();"
                    ]
                  }
                ]
              }
            ],
            "node": [
              {
                "name": "Example request",
                "example": [
                  {
                    "type": "code",
                    "source": [
                      "const params = {\n",
                      "  enterpriseId: enterpriseId,\n",
                      "  name: 'Updated Example Enterprise',\n",
                      "  primaryContactIamId: enterpriseAccountIamId,\n",
                      "};\n",
                      "\n",
                      "try {\n",
                      "  await enterpriseManagementService.updateEnterprise(params);\n",
                      "} catch (err) {\n",
                      "  console.warn(err);\n",
                      "}"
                    ]
                  }
                ]
              }
            ],
            "python": [
              {
                "name": "Example request",
                "example": [
                  {
                    "type": "code",
                    "source": [
                      "response = enterprise_management_service.update_enterprise(\n",
                      "  enterprise_id=enterprise_id,\n",
                      "  name='Updated Example Enterprise',\n",
                      "  primary_contact_iam_id=enterprise_account_iam_id,\n",
                      ")"
                    ]
                  }
                ]
              }
            ]
          }
        },
        "responses": {
          "204": {
            "description": "Success"
          },
          "400": {
            "description": "Bad Request. The payload passed to the request is invalid.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorContainer"
                },
                "examples": {
                  "response": {
                    "value": {
                      "trace": "8107105611",
                      "errors": [
                        {
                          "code": "INVALID_PAYLOAD",
                          "message": "Instance additionalProperty \"named\" exists in instance when not allowed.",
                          "more_info": "n/a"
                        }
                      ]
                    }
                  }
                }
              }
            }
          },
          "401": {
            "description": "Invalid or Expired Access Token",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorContainer"
                },
                "examples": {
                  "response": {
                    "value": {
                      "message": "Not Authorized",
                      "trace": "70766899258",
                      "errors": [
                        {
                          "code": "invalid_or_expired_token",
                          "message": "Not Authorized"
                        }
                      ]
                    }
                  }
                }
              }
            }
          },
          "403": {
            "description": "Access Denied",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorContainer"
                },
                "examples": {
                  "response": {
                    "value": {
                      "message": "Not Authenticated",
                      "trace": "25000450205",
                      "errors": [
                        {
                          "code": "forbidden",
                          "message": "Not Authenticated"
                        }
                      ]
                    }
                  }
                }
              }
            }
          },
          "404": {
            "description": "Not Found",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorContainer"
                },
                "examples": {
                  "response": {
                    "value": {
                      "trace": "28807154668",
                      "errors": [
                        {
                          "code": "UPDATE_ENTERPRISE_ERROR",
                          "message": "Can't find enterprise with ID: $ENTERPRISE_ID",
                          "more_info": "n/a",
                          "dependency_code": "ENTERPRISES"
                        }
                      ]
                    }
                  }
                }
              }
            }
          },
          "500": {
            "description": "Internal Server Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorContainer"
                },
                "examples": {
                  "response": {
                    "value": {
                      "trace": "85221918317",
                      "errors": [
                        {
                          "code": "UPDATE_ENTERPRISE_ERROR",
                          "message": "Can't find enterprise with ID: $ENTERPRISE_ID",
                          "more_info": "n/a",
                          "dependency_code": "CLOUDANT"
                        }
                      ]
                    }
                  }
                }
              }
            }
          },
          "503": {
            "description": "Service Unavailable",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorContainer"
                },
                "examples": {
                  "response": {
                    "value": {
                      "trace": "88208326006",
                      "errors": [
                        {
                          "code": "service_unavailable",
                          "message": "Service Temporarily Unavailable",
                          "more_info": "n/a"
                        }
                      ]
                    }
                  }
                }
              }
            }
          }
        }
      }
    },
    "/enterprises/{enterprise_id}/import/accounts/{account_id}": {
      "parameters": [
        {
          "description": "The ID of the enterprise to import the stand-alone account into.",
          "name": "enterprise_id",
          "in": "path",
          "required": true,
          "schema": {
            "type": "string"
          }
        },
        {
          "description": "The ID of the existing stand-alone account to be imported.",
          "name": "account_id",
          "in": "path",
          "required": true,
          "schema": {
            "type": "string"
          }
        }
      ],
      "put": {
        "operationId": "import_account_to_enterprise",
        "summary": "Import an account into an enterprise",
        "description": "Import an existing stand-alone account into an enterprise. The existing account can be any type: trial (`TRIAL`), Lite (`STANDARD`), Pay-As-You-Go (`PAYG`), or Subscription (`SUBSCRIPTION`). In the case of a `SUBSCRIPTION` account, the credits, promotional offers, and discounts are migrated to the billing unit of the enterprise. For a billable account (`PAYG` or `SUBSCRIPTION`), the country and currency code of the existing account and the billing unit of the enterprise must match. The API returns a `202` response and performs asynchronous operations to import the account into the enterprise. <br/></br>For more information about impacts to the account, see [Adding accounts to an enterprise](https://{DomainName}/docs/account?topic=account-enterprise-add).",
        "tags": [
          "Account Operations"
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/ImportToEnterpriseRequest"
              }
            }
          },
          "description": "The body of the request to import an account into the enterprise."
        },
        "x-ibm-permissions": {
          "actions": [
            {
              "name": "enterprise.enterprise.import"
            }
          ]
        },
        "x-ibm-events": {
          "events": [
            {
              "name": "enterprise.enterprise.import"
            }
          ]
        },
        "x-codegen-request-body-name": "body",
        "x-sdk-operations": {
          "request-examples": {
            "curl": [
              {
                "name": "Example request",
                "example": [
                  {
                    "type": "code",
                    "source": [
                      "curl -X PUT \\\n",
                      "\"https://enterprise.cloud.ibm.com/v1/enterprises/$ENTERPRISE_ID/import/accounts/$ACCOUNT_ID\" \\\n",
                      "-H \"Authorization: Bearer <IAM_Token>\" ",
                      "-H 'Content-Type: application/json' \\\n",
                      "-d '{\n",
                      "  \"parent\": \"crn:v1:bluemix:public:enterprise::a/$ENTERPRISE_ACCOUNT_ID::enterprise:$ENTERPRISE_ID\",\n",
                      "  \"billing_unit_id\": \"$BILLING_UNIT_ID\"\n",
                      "}'"
                    ]
                  }
                ]
              }
            ],
            "go": [
              {
                "name": "Example request",
                "example": [
                  {
                    "type": "code",
                    "source": [
                      "importAccountToEnterpriseOptions := enterpriseManagementService.NewImportAccountToEnterpriseOptions(\n",
                      "  enterpriseID,\n",
                      "  importAccountID,\n",
                      ")\n",
                      "\n",
                      "response, err := enterpriseManagementService.ImportAccountToEnterprise(importAccountToEnterpriseOptions)\n",
                      "if err != nil {\n",
                      "  panic(err)\n",
                      "}"
                    ]
                  }
                ]
              }
            ],
            "java": [
              {
                "name": "Example request",
                "example": [
                  {
                    "type": "code",
                    "source": [
                      "ImportAccountToEnterpriseOptions importAccountToEnterpriseOptions = new ImportAccountToEnterpriseOptions.Builder()\n",
                      "    .enterpriseId(enterpriseId)\n",
                      "    .accountId(importAccountId)\n",
                      "    .build();\n",
                      "\n",
                      "Response<Void> response = enterpriseManagementService.importAccountToEnterprise(importAccountToEnterpriseOptions).execute();"
                    ]
                  }
                ]
              }
            ],
            "node": [
              {
                "name": "Example request",
                "example": [
                  {
                    "type": "code",
                    "source": [
                      "const params = {\n",
                      "  enterpriseId: enterpriseId,\n",
                      "  accountId: importAccountId,\n",
                      "};\n",
                      "\n",
                      "try {\n",
                      "  await enterpriseManagementService.importAccountToEnterprise(params);\n",
                      "} catch (err) {\n",
                      "  console.warn(err);\n",
                      "}"
                    ]
                  }
                ]
              }
            ],
            "python": [
              {
                "name": "Example request",
                "example": [
                  {
                    "type": "code",
                    "source": [
                      "response = enterprise_management_service.import_account_to_enterprise(\n",
                      "  enterprise_id=enterprise_id,\n",
                      "  account_id=import_account_id,\n",
                      ")"
                    ]
                  }
                ]
              }
            ]
          }
        },
        "responses": {
          "202": {
            "description": "The request was accepted and the account was imported into the enterprise. After the account’s billing unit is updated to the enterprise’s, the asynchronous process is complete."
          },
          "401": {
            "description": "Invalid Access Token",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorContainer"
                },
                "examples": {
                  "response": {
                    "value": {
                      "message": "Not Authorized",
                      "trace": "26078847046",
                      "errors": [
                        {
                          "code": "invalid_or_expired_token",
                          "message": "Not Authorized"
                        }
                      ]
                    }
                  }
                }
              }
            }
          },
          "403": {
            "description": "Access Denied",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorContainer"
                },
                "examples": {
                  "response": {
                    "value": {
                      "message": "Not Authenticated",
                      "trace": "30813993394",
                      "errors": [
                        {
                          "code": "forbidden",
                          "message": "Not Authenticated"
                        }
                      ]
                    }
                  }
                }
              }
            }
          },
          "404": {
            "description": "Not Found",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorContainer"
                },
                "examples": {
                  "response": {
                    "value": {
                      "trace": "1650292197",
                      "errors": [
                        {
                          "code": "IMPORT_TO_ENTERPRISE_ERROR",
                          "message": "Could not find an account with account ID: $ACCOUNT_ID",
                          "more_info": "n/a",
                          "dependency_code": "CLOUDANT"
                        }
                      ]
                    }
                  }
                }
              }
            }
          },
          "500": {
            "description": "Internal Server Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorContainer"
                },
                "examples": {
                  "response": {
                    "value": {
                      "trace": "75897520404",
                      "errors": [
                        {
                          "code": "IMPORT_TO_ENTERPRISE_ERROR",
                          "message": "Internal Server Error",
                          "more_info": "n/a",
                          "dependency_code": "ENTERPRISES"
                        }
                      ]
                    }
                  }
                }
              }
            }
          },
          "503": {
            "description": "Service Unavailable",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorContainer"
                },
                "examples": {
                  "response": {
                    "value": {
                      "trace": "11770819756",
                      "errors": [
                        {
                          "code": "service_unavailable",
                          "message": "Service Temporarily Unavailable"
                        }
                      ]
                    }
                  }
                }
              }
            }
          }
        }
      }
    },
    "/account-groups": {
      "post": {
        "operationId": "create_account_group",
        "summary": "Create an account group",
        "description": "Create a new account group, which can be used to group together multiple accounts. To create an account group, you must have an existing enterprise. The API creates an account group entity under the parent that is specified in the payload of the request. The request also takes in the name and the primary contact of this new account group.",
        "tags": [
          "Account Group Operations"
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/CreateAccountGroupRequest"
              }
            }
          },
          "description": "The body that is required to create an account group.",
          "required": true
        },
        "x-ibm-permissions": {
          "actions": [
            {
              "name": "enterprise.account-group.create"
            }
          ]
        },
        "x-ibm-events": {
          "events": [
            {
              "name": "enterprise.account-group.create"
            }
          ]
        },
        "x-codegen-request-body-name": "body",
        "x-sdk-operations": {
          "request-examples": {
            "curl": [
              {
                "name": "Example request",
                "example": [
                  {
                    "type": "code",
                    "source": [
                      "curl -X POST \\\n",
                      "\"https://enterprise.cloud.ibm.com/v1/account-groups \\\n",
                      "-H \"Authorization: Bearer <IAM_Token>\" \\\n",
                      "-H 'Content-Type: application/json' \\\n",
                      "-d '{\n",
                      "  \"parent\": \"crn:v1:bluemix:public:enterprise::a/$ENTERPRISE_ACCOUNT_ID::enterprise:$ENTERPRISE_ID\",\n",
                      "  \"name\": \"Example Account Group\",\n",
                      "  \"primary_contact_iam_id\": \"$PRIMARY_CONTACT_IAM_ID\"\n",
                      "}'"
                    ]
                  }
                ]
              }
            ],
            "go": [
              {
                "name": "Example request",
                "example": [
                  {
                    "type": "code",
                    "source": [
                      "createAccountGroupOptions := enterpriseManagementService.NewCreateAccountGroupOptions(\n",
                      "  parentCRN,\n",
                      "  \"Example Account Group\",\n",
                      "  enterpriseAccountIamID,\n",
                      ")\n",
                      "\n",
                      "createAccountGroupResponse, response, err := enterpriseManagementService.CreateAccountGroup(createAccountGroupOptions)\n",
                      "if err != nil {\n",
                      "  panic(err)\n",
                      "}\n",
                      "b, _ := json.MarshalIndent(createAccountGroupResponse, \"\", \"  \")\n",
                      "fmt.Println(string(b))"
                    ]
                  }
                ]
              }
            ],
            "java": [
              {
                "name": "Example request",
                "example": [
                  {
                    "type": "code",
                    "source": [
                      "CreateAccountGroupOptions createAccountGroupOptions = new CreateAccountGroupOptions.Builder()\n",
                      "    .parent(parentCRN)\n",
                      "    .name(\"Example Account Group\")\n",
                      "    .primaryContactIamId(enterpriseAccountIamId)\n",
                      "    .build();\n",
                      "\n",
                      "Response<CreateAccountGroupResponse> response = enterpriseManagementService.createAccountGroup(createAccountGroupOptions).execute();\n",
                      "CreateAccountGroupResponse createAccountGroupResponse = response.getResult();\n",
                      "\n",
                      "System.out.println(createAccountGroupResponse);"
                    ]
                  }
                ]
              }
            ],
            "node": [
              {
                "name": "Example request",
                "example": [
                  {
                    "type": "code",
                    "source": [
                      "const params = {\n",
                      "  parent: parentCrn,\n",
                      "  name: 'Example Account Group',\n",
                      "  primaryContactIamId: enterpriseAccountIamId,\n",
                      "};\n",
                      "\n",
                      "let res;\n",
                      "try {\n",
                      "  res = await enterpriseManagementService.createAccountGroup(params);\n",
                      "  console.log(JSON.stringify(res.result, null, 2));\n",
                      "} catch (err) {\n",
                      "  console.warn(err);\n",
                      "}\n",
                      "\n",
                      "accountGroupId = res.result.account_group_id;\n",
                      "\n",
                      "params.name = 'New Example Account Group';\n",
                      "\n",
                      "try {\n",
                      "  res = await enterpriseManagementService.createAccountGroup(params);\n",
                      "  console.log(JSON.stringify(res.result, null, 2));\n",
                      "} catch (err) {\n",
                      "  console.warn(err);\n",
                      "}"
                    ]
                  }
                ]
              }
            ],
            "python": [
              {
                "name": "Example request",
                "example": [
                  {
                    "type": "code",
                    "source": [
                      "create_account_group_response = enterprise_management_service.create_account_group(\n",
                      "  parent=parent_crn,\n",
                      "  name='Example Account Group',\n",
                      "  primary_contact_iam_id=enterprise_account_iam_id,\n",
                      ").get_result()\n",
                      "\n",
                      "print(json.dumps(create_account_group_response, indent=2))"
                    ]
                  }
                ]
              }
            ]
          }
        },
        "responses": {
          "201": {
            "description": "Create account group request completed successfully.",
            "headers": {
              "transaction-id": {
                "description": "The transaction ID that's used to track the request.",
                "schema": {
                  "type": "string"
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/CreateAccountGroupResponse"
                },
                "examples": {
                  "response": {
                    "value": {
                      "account_group_id": "$ACCOUNT_GROUP_ID"
                    }
                  }
                }
              }
            }
          },
          "400": {
            "description": "Bad Request",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorContainer"
                },
                "examples": {
                  "response": {
                    "value": {
                      "trace": "51246885673",
                      "errors": [
                        {
                          "code": "INVALID_PAYLOAD",
                          "message": "Instance requires property \"parent\". Instance `additionalProperty` \"parents\" exists in instance when not allowed.",
                          "more_info": "n/a"
                        }
                      ]
                    }
                  }
                }
              }
            }
          },
          "401": {
            "description": "Invalid or Expired Access Token",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorContainer"
                },
                "examples": {
                  "response": {
                    "value": {
                      "message": "Not Authorized",
                      "trace": "59075132505",
                      "errors": [
                        {
                          "code": "invalid_or_expired_token",
                          "message": "Not Authorized"
                        }
                      ]
                    }
                  }
                }
              }
            }
          },
          "403": {
            "description": "Access Denied",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorContainer"
                },
                "examples": {
                  "response": {
                    "value": {
                      "message": "Not Authenticated",
                      "trace": "55748601058",
                      "errors": [
                        {
                          "code": "forbidden",
                          "message": "Not Authenticated"
                        }
                      ]
                    }
                  }
                }
              }
            }
          },
          "500": {
            "description": "Internal Server Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorContainer"
                },
                "examples": {
                  "response": {
                    "value": {
                      "trace": "14706814780",
                      "errors": [
                        {
                          "code": "CANNOT_CREATE_ACCOUNT_GROUP",
                          "message": "Could not create account group.",
                          "more_info": "n/a",
                          "dependency_code": "ENTERPRISES"
                        }
                      ]
                    }
                  }
                }
              }
            }
          },
          "503": {
            "description": "Service Unavailable",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorContainer"
                },
                "examples": {
                  "response": {
                    "value": {
                      "trace": "98806352835",
                      "errors": [
                        {
                          "code": "service_unavailable",
                          "message": "Service Temporarily Unavailable"
                        }
                      ]
                    }
                  }
                }
              }
            }
          }
        }
      },
      "get": {
        "operationId": "list_account_groups",
        "summary": "List account groups",
        "description": "Retrieve all account groups based on the values that are passed in the query parameters. If no query parameter is passed, all of the account groups in the enterprise for which the calling identity has access are returned. <br/><br/>You can use pagination parameters to filter the results. The `limit` field can be used to limit the number of results that are displayed for this method.<br/><br/>This method ensures that only the account groups that the user has access to are returned. Access can be controlled either through a policy on a specific account group, or account-level platform services access roles, such as Administrator, Editor, Operator, or Viewer. When you call the method with the `enterprise_id`, `parent_account_group_id` or `parent` query parameter, all of the account groups that are immediate children of this entity are returned. Authentication is performed on all account groups before they are returned to the user to ensure that only those account groups are returned to which the calling identity has access.",
        "tags": [
          "Account Group Operations"
        ],
        "parameters": [
          {
            "description": "Get account groups that are either immediate children or are a part of the hierarchy for a given enterprise ID.",
            "name": "enterprise_id",
            "in": "query",
            "schema": {
              "type": "string"
            }
          },
          {
            "description": "Get account groups that are either immediate children or are a part of the hierarchy for a given account group ID.",
            "name": "parent_account_group_id",
            "in": "query",
            "schema": {
              "type": "string"
            }
          },
          {
            "description": "The first item to be returned in the page of results. This value can be obtained from the next_url property from the previous call of the operation. If not specified, then the first page of results is returned.",
            "name": "next_docid",
            "in": "query",
            "schema": {
              "type": "string"
            }
          },
          {
            "description": "Get account groups that are either immediate children or are a part of the hierarchy for a given parent CRN.",
            "name": "parent",
            "in": "query",
            "schema": {
              "type": "string"
            }
          },
          {
            "description": "Return results up to this limit. Valid values are between `0` and `100`.",
            "name": "limit",
            "in": "query",
            "schema": {
              "type": "integer",
              "default": 100,
              "maximum": 100
            }
          },
          {
            "description": "Include the deleted account groups from an enterprise when used in conjunction with other query parameters.",
            "name": "include_deleted",
            "in": "query",
            "schema": {
              "type": "boolean"
            }
          }
        ],
        "x-ibm-permissions": {
          "actions": [
            {
              "name": "enterprise.account-group.retrieve"
            }
          ]
        },
        "x-sdk-operations": {
          "request-examples": {
            "curl": [
              {
                "name": "Example request",
                "example": [
                  {
                    "type": "code",
                    "source": [
                      "curl -X GET \\\n",
                      "\"https://enterprise.cloud.ibm.com/v1/account-groups?enterprise_id=$ENTERPRISE_ID&limit=100&include_deleted=true\" \\\n",
                      "-H \"Authorization: Bearer <IAM_Token>\" \\\n",
                      "-H 'Content-Type: application/json'"
                    ]
                  }
                ]
              }
            ],
            "go": [
              {
                "name": "Example request",
                "example": [
                  {
                    "type": "code",
                    "source": [
                      "listAccountGroupsOptions := &enterprisemanagementv1.ListAccountGroupsOptions{\n",
                      "  EnterpriseID: &enterpriseID,\n",
                      "}\n",
                      "\n",
                      "pager, err := enterpriseManagementService.NewAccountGroupsPager(listAccountGroupsOptions)\n",
                      "if err != nil {\n",
                      "  panic(err)\n",
                      "}\n",
                      "\n",
                      "var allResults []enterprisemanagementv1.AccountGroup\n",
                      "for pager.HasNext() {\n",
                      "  nextPage, err := pager.GetNext()\n",
                      "  if err != nil {\n",
                      "    panic(err)\n",
                      "  }\n",
                      "  allResults = append(allResults, nextPage...)\n",
                      "}\n",
                      "b, _ := json.MarshalIndent(allResults, \"\", \"  \")\n",
                      "fmt.Println(string(b))"
                    ]
                  }
                ]
              }
            ],
            "java": [
              {
                "name": "Example request",
                "example": [
                  {
                    "type": "code",
                    "source": [
                      "ListAccountGroupsOptions listAccountGroupsOptions = new ListAccountGroupsOptions.Builder()\n",
                      "  .enterpriseId(enterpriseId)\n",
                      "  .build();\n",
                      "\n",
                      "AccountGroupsPager pager = new AccountGroupsPager(enterpriseManagementService, listAccountGroupsOptions);\n",
                      "List<AccountGroup> allResults = new ArrayList<>();\n",
                      "while (pager.hasNext()) {\n",
                      "  List<AccountGroup> nextPage = pager.getNext();\n",
                      "  allResults.addAll(nextPage);\n",
                      "}\n",
                      "\n",
                      "System.out.println(GsonSingleton.getGson().toJson(allResults));"
                    ]
                  }
                ]
              }
            ],
            "node": [
              {
                "name": "Example request",
                "example": [
                  {
                    "type": "code",
                    "source": [
                      "const params = {\n",
                      "  enterpriseId: enterpriseId,\n",
                      "};\n",
                      "\n",
                      "const allResults = [];\n",
                      "try {\n",
                      "  const pager = new EnterpriseManagementV1.AccountGroupsPager(enterpriseManagementService, params);\n",
                      "  while (pager.hasNext()) {\n",
                      "    const nextPage = await pager.getNext();\n",
                      "    expect(nextPage).not.toBeNull();\n",
                      "    allResults.push(...nextPage);\n",
                      "  }\n",
                      "  console.log(JSON.stringify(allResults, null, 2));\n",
                      "} catch (err) {\n",
                      "  console.warn(err);\n",
                      "}"
                    ]
                  }
                ]
              }
            ],
            "python": [
              {
                "name": "Example request",
                "example": [
                  {
                    "type": "code",
                    "source": [
                      "all_results = []\n",
                      "pager = AccountGroupsPager(\n",
                      "  client=enterprise_management_service,\n",
                      "  enterprise_id=enterprise_id,\n",
                      ")\n",
                      "while pager.has_next():\n",
                      "  next_page = pager.get_next()\n",
                      "  assert next_page is not None\n",
                      "  all_results.extend(next_page)\n",
                      "\n",
                      "print(json.dumps(all_results, indent=2))"
                    ]
                  }
                ]
              }
            ]
          }
        },
        "responses": {
          "200": {
            "description": "Success",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ListAccountGroupsResponse"
                },
                "examples": {
                  "response": {
                    "value": {
                      "rows_count": 2,
                      "next_url": "/v1/account-groups?$ACCOUNT_GROUP_1_ID&next_docid=$NEXT_DOCID",
                      "resources": [
                        {
                          "url": "/v1/account-groups/$ACCOUNT_GROUP_1_ID",
                          "id": "$ACCOUNT_GROUP_1_ID",
                          "crn": "crn:v1:bluemix:public:enterprise::a/$ENTERPRISE_ACCOUNT_ID::account-group:$ACCOUNT_GROUP_1_ID",
                          "parent": "crn:v1:bluemix:public:enterprise::a/$ENTERPRISE_ACCOUNT_ID::enterprise:$ENTERPRISE_ID",
                          "enterprise_account_id": "$ENTERPRISE_ACCOUNT_ID",
                          "enterprise_id": "$ENTERPRISE_ID",
                          "enterprise_path": "enterprise:$ENTERPRISE_ID",
                          "name": "Updated Account Group History Name",
                          "state": "ACTIVE",
                          "primary_contact_iam_id": "IBMid-55ABCD",
                          "primary_contact_email": "user@example.com",
                          "created_at": "2019-07-02T08:46:01.582Z",
                          "updated_at": "2019-07-02T08:47:49.285Z",
                          "created_by": "iam-ServiceId-acab",
                          "updated_by": "iam-ServiceId-acab"
                        },
                        {
                          "url": "/v1/account-groups/$ACCOUNT_GROUP_2_ID",
                          "id": "$ACCOUNT_GROUP_2_ID",
                          "crn": "crn:v1:bluemix:public:enterprise::a/$ENTERPRISE_ACCOUNT_ID::account-group:$ACCOUNT_GROUP_2_ID",
                          "parent": "crn:v1:bluemix:public:enterprise::a/$ENTERPRISE_ACCOUNT_ID::account-group:$ACCOUNT_GROUP_1_ID",
                          "enterprise_account_id": "$ENTERPRISE_ACCOUNT_ID",
                          "enterprise_id": "$ENTERPRISE_ID",
                          "enterprise_path": "enterprise:$ENTERPRISE_ID/account-group:$ACCOUNT_GROUP_1_ID",
                          "name": "Example Account Group",
                          "state": "ACTIVE",
                          "primary_contact_iam_id": "IBMid-55EFGH",
                          "primary_contact_email": "user@example.com",
                          "created_at": "2019-05-16T18:05:56.659Z",
                          "updated_at": "2019-05-16T18:05:56.659Z",
                          "created_by": "iam-ServiceId-c8da",
                          "updated_by": "iam-ServiceId-c8da"
                        }
                      ]
                    }
                  }
                }
              }
            }
          },
          "401": {
            "description": "Invalid or Expired Access Token",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorContainer"
                },
                "examples": {
                  "response": {
                    "value": {
                      "message": "Not Authorized",
                      "trace": "19184974366",
                      "errors": [
                        {
                          "code": "invalid_or_expired_token",
                          "message": "Not Authorized"
                        }
                      ]
                    }
                  }
                }
              }
            }
          },
          "403": {
            "description": "Access Denied",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorContainer"
                },
                "examples": {
                  "response": {
                    "value": {
                      "message": "Not Authenticated",
                      "trace": "63023172185",
                      "errors": [
                        {
                          "code": "forbidden",
                          "message": "Not Authenticated"
                        }
                      ]
                    }
                  }
                }
              }
            }
          },
          "500": {
            "description": "Internal Server Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorContainer"
                },
                "examples": {
                  "response": {
                    "value": {
                      "trace": "83466393038",
                      "errors": [
                        {
                          "code": "RETRIEVE_ACCOUNT_GROUPS_ERROR",
                          "message": "Cannot find account groups with ID: $ACCOUNT_GROUP_ID",
                          "more_info": "n/a",
                          "dependency_code": "CLOUDANT"
                        }
                      ]
                    }
                  }
                }
              }
            }
          },
          "503": {
            "description": "Service Unavailable",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorContainer"
                },
                "examples": {
                  "response": {
                    "value": {
                      "trace": "43754748116",
                      "errors": [
                        {
                          "code": "service_unavailable",
                          "message": "Service Temporarily Unavailable"
                        }
                      ]
                    }
                  }
                }
              }
            }
          }
        }
      }
    },
    "/account-groups/{account_group_id}": {
      "parameters": [
        {
          "description": "The ID of the account group to retrieve.",
          "name": "account_group_id",
          "in": "path",
          "required": true,
          "schema": {
            "type": "string"
          }
        }
      ],
      "get": {
        "operationId": "get_account_group",
        "summary": "Get account group by ID",
        "description": "Retrieve an account by the `account_group_id` parameter. All data related to the account group is returned only if the caller has access to retrieve the account group.",
        "tags": [
          "Account Group Operations"
        ],
        "x-ibm-permissions": {
          "actions": [
            {
              "name": "enterprise.account-group.retrieve"
            }
          ]
        },
        "x-sdk-operations": {
          "request-examples": {
            "curl": [
              {
                "name": "Example request",
                "example": [
                  {
                    "type": "code",
                    "source": [
                      "curl -X GET \\\n",
                      "\"https://enterprise.cloud.ibm.com/v1/account-groups/$ACCOUNT_GROUP_ID\" \\\n",
                      "-H \"Authorization: Bearer <IAM_Token>\" \\\n",
                      "-H 'Content-Type: application/json'"
                    ]
                  }
                ]
              }
            ],
            "go": [
              {
                "name": "Example request",
                "example": [
                  {
                    "type": "code",
                    "source": [
                      "getAccountGroupOptions := enterpriseManagementService.NewGetAccountGroupOptions(\n",
                      "  accountGroupID,\n",
                      ")\n",
                      "\n",
                      "accountGroup, response, err := enterpriseManagementService.GetAccountGroup(getAccountGroupOptions)\n",
                      "if err != nil {\n",
                      "  panic(err)\n",
                      "}\n",
                      "b, _ := json.MarshalIndent(accountGroup, \"\", \"  \")\n",
                      "fmt.Println(string(b))"
                    ]
                  }
                ]
              }
            ],
            "java": [
              {
                "name": "Example request",
                "example": [
                  {
                    "type": "code",
                    "source": [
                      "GetAccountGroupOptions getAccountGroupOptions = new GetAccountGroupOptions.Builder()\n",
                      "    .accountGroupId(accountGroupId)\n",
                      "    .build();\n",
                      "\n",
                      "Response<AccountGroup> response = enterpriseManagementService.getAccountGroup(getAccountGroupOptions).execute();\n",
                      "AccountGroup accountGroup = response.getResult();\n",
                      "\n",
                      "System.out.println(accountGroup);"
                    ]
                  }
                ]
              }
            ],
            "node": [
              {
                "name": "Example request",
                "example": [
                  {
                    "type": "code",
                    "source": [
                      "const params = {\n",
                      "  accountGroupId: accountGroupId,\n",
                      "};\n",
                      "\n",
                      "try {\n",
                      "  const res = await enterpriseManagementService.getAccountGroup(params);\n",
                      "  console.log(JSON.stringify(res.result, null, 2));\n",
                      "} catch (err) {\n",
                      "  console.warn(err);\n",
                      "}"
                    ]
                  }
                ]
              }
            ],
            "python": [
              {
                "name": "Example request",
                "example": [
                  {
                    "type": "code",
                    "source": [
                      "account_group = enterprise_management_service.get_account_group(\n",
                      "  account_group_id=account_group_id,\n",
                      ").get_result()\n",
                      "\n",
                      "print(json.dumps(account_group, indent=2))"
                    ]
                  }
                ]
              }
            ]
          }
        },
        "responses": {
          "200": {
            "description": "Successfully retrieved account group by ID.",
            "headers": {
              "transaction-id": {
                "description": "The transaction ID of the get account group request.",
                "schema": {
                  "type": "string"
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/AccountGroup"
                },
                "examples": {
                  "response": {
                    "value": {
                      "url": "/v1/account-groups/$ACCOUNT_GROUP_2_ID",
                      "id": "$ACCOUNT_GROUP_2_ID",
                      "crn": "crn:v1:bluemix:public:enterprise::a/$ENTERPRISE_ACCOUNT_ID::account-group:$ACCOUNT_GROUP_2_ID",
                      "parent": "crn:v1:bluemix:public:enterprise::a/$ENTERPRISE_ACCOUNT_ID::account-group:$ACCOUNT_GROUP_1_ID",
                      "enterprise_account_id": "$ENTERPRISE_ACCOUNT_ID",
                      "enterprise_id": "$ENTERPRISE_ID",
                      "enterprise_path": "enterprise:$ENTERPRISE_ID/account-group:$ACCOUNT_GROUP_1_ID",
                      "name": "Example Account Group",
                      "state": "ACTIVE",
                      "primary_contact_iam_id": "IBMid-55EFGH",
                      "primary_contact_email": "user@example.com",
                      "created_at": "2019-05-16T18:05:56.659Z",
                      "updated_at": "2019-05-16T18:05:56.659Z",
                      "created_by": "iam-ServiceId-c8da",
                      "updated_by": "iam-ServiceId-c8da"
                    }
                  }
                }
              }
            }
          },
          "401": {
            "description": "Invalid or Expired Access Token",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorContainer"
                },
                "examples": {
                  "response": {
                    "value": {
                      "message": "Not Authorized",
                      "trace": "20417281627",
                      "errors": [
                        {
                          "code": "invalid_or_expired_token",
                          "message": "Not Authorized"
                        }
                      ]
                    }
                  }
                }
              }
            }
          },
          "403": {
            "description": "Access Denied",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorContainer"
                },
                "examples": {
                  "response": {
                    "value": {
                      "message": "Not Authenticated",
                      "trace": "53451896518",
                      "errors": [
                        {
                          "code": "forbidden",
                          "message": "Not Authenticated"
                        }
                      ]
                    }
                  }
                }
              }
            }
          },
          "404": {
            "description": "Not Found",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorContainer"
                },
                "examples": {
                  "response": {
                    "value": {
                      "trace": "28807154668",
                      "errors": [
                        {
                          "code": "RETRIEVE_ACCOUNT_GROUP_ERROR",
                          "message": "Cannot find account group with ID: $ACCOUNT_GROUP_ID",
                          "more_info": "n/a",
                          "dependency_code": "ENTERPRISES"
                        }
                      ]
                    }
                  }
                }
              }
            }
          },
          "500": {
            "description": "Internal Server Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorContainer"
                },
                "examples": {
                  "response": {
                    "value": {
                      "trace": "20862652978",
                      "errors": [
                        {
                          "code": "RETRIEVE_ACCOUNT_GROUP_ERROR",
                          "message": "Can't find account group with ID: $ACCOUNT_GROUP_ID",
                          "more_info": "n/a",
                          "dependency_code": "CLOUDANT"
                        }
                      ]
                    }
                  }
                }
              }
            }
          },
          "503": {
            "description": "Service Unavailable",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorContainer"
                },
                "examples": {
                  "response": {
                    "value": {
                      "trace": "12345678-abcd-1a2b-a1b2-1234567890ab",
                      "errors": [
                        {
                          "code": "service_unavailable",
                          "message": "Service Temporarily Unavailable"
                        }
                      ]
                    }
                  }
                }
              }
            }
          }
        }
      },
      "patch": {
        "operationId": "update_account_group",
        "summary": "Update an account group",
        "description": "Update the name or IAM ID of the primary contact for an existing account group. The new primary contact must already be a user in the enterprise account.",
        "tags": [
          "Account Group Operations"
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/UpdateAccountGroupRequest"
              }
            }
          },
          "description": "The ID of the account group to update.",
          "required": true
        },
        "x-ibm-permissions": {
          "actions": [
            {
              "name": "enterprise.account-group.update"
            }
          ]
        },
        "x-ibm-events": {
          "events": [
            {
              "name": "enterprise.account-group.update"
            }
          ]
        },
        "x-codegen-request-body-name": "body",
        "x-sdk-operations": {
          "request-examples": {
            "curl": [
              {
                "name": "Example request",
                "example": [
                  {
                    "type": "code",
                    "source": [
                      "curl -X PATCH \\\n",
                      "\"https://enterprise.cloud.ibm.com/v1/account-groups/$ACCOUNT_GROUP_ID\" \\\n",
                      "-H \"Authorization: Bearer <IAM_Token>\" \\\n",
                      "-H 'Content-Type: application/json' \\\n",
                      "-d '{\n",
                      "  \"name\": \"Updated Example Account Group\",\n",
                      "}'"
                    ]
                  }
                ]
              }
            ],
            "go": [
              {
                "name": "Example request",
                "example": [
                  {
                    "type": "code",
                    "source": [
                      "updateAccountGroupOptions := enterpriseManagementService.NewUpdateAccountGroupOptions(\n",
                      "  accountGroupID,\n",
                      ")\n",
                      "updateAccountGroupOptions.SetName(\"Updated Example Account Group\")\n",
                      "updateAccountGroupOptions.SetPrimaryContactIamID(enterpriseAccountIamID)\n",
                      "\n",
                      "response, err := enterpriseManagementService.UpdateAccountGroup(updateAccountGroupOptions)\n",
                      "if err != nil {\n",
                      "  panic(err)\n",
                      "}"
                    ]
                  }
                ]
              }
            ],
            "java": [
              {
                "name": "Example request",
                "example": [
                  {
                    "type": "code",
                    "source": [
                      "UpdateAccountGroupOptions updateAccountGroupOptions = new UpdateAccountGroupOptions.Builder()\n",
                      "    .accountGroupId(accountGroupId)\n",
                      "    .name(\"Updated Example Account Group\")\n",
                      "    .build();\n",
                      "\n",
                      "Response<Void> response = enterpriseManagementService.updateAccountGroup(updateAccountGroupOptions).execute();"
                    ]
                  }
                ]
              }
            ],
            "node": [
              {
                "name": "Example request",
                "example": [
                  {
                    "type": "code",
                    "source": [
                      "const params = {\n",
                      "  accountGroupId: accountGroupId,\n",
                      "  name: 'Updated Example Account Group',\n",
                      "  primaryContactIamId: enterpriseAccountIamId,\n",
                      "};\n",
                      "\n",
                      "try {\n",
                      "  await enterpriseManagementService.updateAccountGroup(params);\n",
                      "} catch (err) {\n",
                      "  console.warn(err);\n",
                      "}"
                    ]
                  }
                ]
              }
            ],
            "python": [
              {
                "name": "Example request",
                "example": [
                  {
                    "type": "code",
                    "source": [
                      "response = enterprise_management_service.update_account_group(\n",
                      "  account_group_id=account_group_id,\n",
                      "  name='Updated Example Account Group',\n",
                      "  primary_contact_iam_id=enterprise_account_iam_id,\n",
                      ")"
                    ]
                  }
                ]
              }
            ]
          }
        },
        "responses": {
          "204": {
            "description": "Success"
          },
          "400": {
            "description": "Bad Request. The payload passed to the request is invalid.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorContainer"
                },
                "examples": {
                  "response": {
                    "value": {
                      "trace": "8107105611",
                      "errors": [
                        {
                          "code": "INVALID_PAYLOAD",
                          "message": "Instance `additionalProperty` \"named\" exists in instance when not allowed.",
                          "more_info": "n/a"
                        }
                      ]
                    }
                  }
                }
              }
            }
          },
          "401": {
            "description": "Invalid or Expired Access Token",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorContainer"
                },
                "examples": {
                  "response": {
                    "value": {
                      "message": "Not Authorized",
                      "trace": "70766899258",
                      "errors": [
                        {
                          "code": "invalid_or_expired_token",
                          "message": "Not Authorized"
                        }
                      ]
                    }
                  }
                }
              }
            }
          },
          "403": {
            "description": "Access Denied",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorContainer"
                },
                "examples": {
                  "response": {
                    "value": {
                      "message": "Not Authenticated",
                      "trace": "25000450205",
                      "errors": [
                        {
                          "code": "forbidden",
                          "message": "Not Authenticated"
                        }
                      ]
                    }
                  }
                }
              }
            }
          },
          "404": {
            "description": "Not Found",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorContainer"
                },
                "examples": {
                  "response": {
                    "value": {
                      "trace": "28807154668",
                      "errors": [
                        {
                          "code": "UPDATE_ACCOUNT_GROUP_ERROR",
                          "message": "Can't find account group with ID: $ACCOUNT_GROUP_ID",
                          "more_info": "n/a",
                          "dependency_code": "ENTERPRISES"
                        }
                      ]
                    }
                  }
                }
              }
            }
          },
          "500": {
            "description": "Internal Server Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorContainer"
                },
                "examples": {
                  "response": {
                    "value": {
                      "trace": "85221918317",
                      "errors": [
                        {
                          "code": "UPDATE_ACCOUNT_GROUP_ERROR",
                          "message": "Can't find account group with ID: $ACCOUNT_GROUP_ID",
                          "more_info": "n/a",
                          "dependency_code": "CLOUDANT"
                        }
                      ]
                    }
                  }
                }
              }
            }
          },
          "503": {
            "description": "Service Unavailable",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorContainer"
                },
                "examples": {
                  "response": {
                    "value": {
                      "trace": "88208326006",
                      "errors": [
                        {
                          "code": "service_unavailable",
                          "message": "Service Temporarily Unavailable",
                          "more_info": "n/a"
                        }
                      ]
                    }
                  }
                }
              }
            }
          }
        }
      },
      "delete": {
        "operationId": "delete_account_group",
        "summary": "Delete an account group from the enterprise",
        "description": "Delete an existing account group from the enterprise. You can't delete an account group that has child account groups, the delete request will fail. This API doesn't perform a recursive delete on the child account groups, it only deletes the current account group.",
        "tags": [
          "Account Group Operations"
        ],
        "x-ibm-permissions": {
          "actions": [
            {
              "name": "enterprise.account-group.delete"
            }
          ]
        },
        "x-ibm-events": {
          "events": [
            {
              "name": "enterprise.account-group.delete"
            }
          ]
        },
        "x-codegen-request-body-name": "body",
        "x-sdk-operations": {
          "request-examples": {
            "curl": [
              {
                "name": "Example request",
                "example": [
                  {
                    "type": "code",
                    "source": [
                      "curl -X DELETE \\\n",
                      "\"https://enterprise.cloud.ibm.com/v1/account-groups/$ACCOUNT_GROUP_ID\" \\\n",
                      "-H \"Authorization: Bearer <IAM_Token>\" \\\n",
                      "-H 'Content-Type: application/json'"
                    ]
                  }
                ]
              }
            ],
            "go": [
              {
                "name": "Example request",
                "example": [
                  {
                    "type": "code",
                    "source": [
                      "deleteAccountGroupOptions := enterpriseManagementService.NewDeleteAccountGroupOptions(\n",
                      "  accountGroupID,\n",
                      ")\n",
                      "\n",
                      "response, err := enterpriseManagementService.DeleteAccountGroup(deleteAccountGroupOptions)\n",
                      "if err != nil {\n",
                      "  panic(err)\n",
                      "}"
                    ]
                  }
                ]
              }
            ],
            "java": [
              {
                "name": "Example request",
                "example": [
                  {
                    "type": "code",
                    "source": [
                      "DeleteAccountGroupOptions deleteAccountGroupOptions = new DeleteAccountGroupOptions.Builder()\n",
                      "  .accountGroupId(accountGroupId)\n",
                      "  .build();\n",
                      "\n",
                      "Response<Void> response = enterpriseManagementService.deleteAccountGroup(deleteAccountGroupOptions).execute();"
                    ]
                  }
                ]
              }
            ],
            "node": [
              {
                "name": "Example request",
                "example": [
                  {
                    "type": "code",
                    "source": [
                      "const params = {\n",
                      "  accountGroupId,\n",
                      "};\n",
                      "\n",
                      "try {\n",
                      "  await enterpriseManagementService.deleteAccountGroup(params);\n",
                      "} catch (err) {\n",
                      "  console.warn(err);\n",
                      "}"
                    ]
                  }
                ]
              }
            ],
            "python": [
              {
                "name": "Example request",
                "example": [
                  {
                    "type": "code",
                    "source": [
                      "response = enterprise_management_service.delete_account_group(\n",
                      "  account_group_id=account_group_id,\n",
                      ")"
                    ]
                  }
                ]
              }
            ]
          }
        },
        "responses": {
          "204": {
            "description": "Successfully removed the account group from the enterprise.",
            "headers": {
              "transaction-id": {
                "description": "The transaction ID of the delete account group request.",
                "schema": {
                  "type": "string"
                }
              }
            }
          },
          "400": {
            "description": "Bad Request.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorContainer"
                },
                "examples": {
                  "response": {
                    "value": {
                      "trace": "63408483586",
                      "errors": [
                        {
                          "code": "DELETE_ACCOUNT_GROUP_ERROR",
                          "message": "Cannot delete account group: Cannot delete account group 0023612f6b with child entities.",
                          "more_info": "n/a",
                          "dependency_code": "ENTERPRISES"
                        }
                      ]
                    }
                  }
                }
              }
            }
          },
          "401": {
            "description": "Invalid or Expired Access Token",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorContainer"
                },
                "examples": {
                  "response": {
                    "value": {
                      "message": "Not Authorized",
                      "trace": "88966899251",
                      "errors": [
                        {
                          "code": "invalid_or_expired_token",
                          "message": "Not Authorized"
                        }
                      ]
                    }
                  }
                }
              }
            }
          },
          "403": {
            "description": "Access Denied",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorContainer"
                },
                "examples": {
                  "response": {
                    "value": {
                      "message": "Not Authenticated",
                      "trace": "25000450205",
                      "errors": [
                        {
                          "code": "forbidden",
                          "message": "Not Authenticated"
                        }
                      ]
                    }
                  }
                }
              }
            }
          },
          "404": {
            "description": "Not Found",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorContainer"
                },
                "examples": {
                  "response": {
                    "value": {
                      "trace": "54632395887",
                      "errors": [
                        {
                          "code": "DELETE_ACCOUNT_GROUP_ERROR",
                          "message": "Failed to get account group with id: aa23612f6be54c6a9e1136c087a0c3a, error: Invalid Id: aa23612f6be54c6a9e1136c087a0c3a",
                          "more_info": "n/a",
                          "dependency_code": "ENTERPRISES"
                        }
                      ]
                    }
                  }
                }
              }
            }
          },
          "500": {
            "description": "Internal Server Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorContainer"
                },
                "examples": {
                  "response": {
                    "value": {
                      "trace": "85221918317",
                      "errors": [
                        {
                          "code": "DELETE_ACCOUNT_GROUP_ERROR",
                          "message": "Can't find account group with ID: $ACCOUNT_GROUP_ID",
                          "more_info": "n/a",
                          "dependency_code": "CLOUDANT"
                        }
                      ]
                    }
                  }
                }
              }
            }
          },
          "503": {
            "description": "Service Unavailable",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorContainer"
                },
                "examples": {
                  "response": {
                    "value": {
                      "trace": "88208326006",
                      "errors": [
                        {
                          "code": "service_unavailable",
                          "message": "Service Temporarily Unavailable",
                          "more_info": "n/a"
                        }
                      ]
                    }
                  }
                }
              }
            }
          }
        }
      }
    },
    "/accounts": {
      "post": {
        "operationId": "create_account",
        "summary": "Create a new account in an enterprise",
        "description": "Create a new account as a part of an existing enterprise. The API creates an account entity under the parent that is specified in the payload of the request. The request also takes in the name and the owner of this new account. The owner must have a valid IBMid that's registered with IBM Cloud, but they don't need to be a user in the enterprise account.",
        "tags": [
          "Account Operations"
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/CreateAccountRequest"
              }
            }
          },
          "description": "The body required to create a new account.",
          "required": true
        },
        "x-ibm-permissions": {
          "actions": [
            {
              "name": "enterprise.account.create"
            }
          ]
        },
        "x-ibm-events": {
          "events": [
            {
              "name": "enterprise.account.create"
            }
          ]
        },
        "x-codegen-request-body-name": "body",
        "x-sdk-operations": {
          "request-examples": {
            "curl": [
              {
                "name": "Example request",
                "example": [
                  {
                    "type": "code",
                    "source": [
                      "curl -X POST \\\n",
                      "\"https://enterprise.cloud.ibm.com/v1/accounts \\\n",
                      "-H \"Authorization: Bearer <IAM_Token>\" \\\n",
                      "-H 'Content-Type: application/json' \\\n",
                      "-d '{\n",
                      "  \"parent\": \"crn:v1:bluemix:public:enterprise::a/$ENTERPRISE_ACCOUNT_ID::account-group:$ACCOUNT_GROUP_ID\",\n",
                      "  \"name\": \"Example Account\",\n",
                      "  \"owner_iam_id\": \"$OWNER_IAM_ID\"\n",
                      "}'"
                    ]
                  }
                ]
              },
              {
                "name": "Example request to opt-out of Multi-Factor Authentication when creating a child account",
                "example": [
                  {
                    "type": "code",
                    "source": [
                      "curl -X POST \\\n",
                      "\"https://enterprise.cloud.ibm.com/v1/accounts \\\n",
                      "-H \"Authorization: Bearer <IAM_Token>\" \\\n",
                      "-H 'Content-Type: application/json' \\\n",
                      "-d '{\n",
                      "  \"parent\": \"crn:v1:bluemix:public:enterprise::a/$ENTERPRISE_ACCOUNT_ID::enterprise:$ENTERPRISE_ID\",\n",
                      "  \"name\": \"Example Account\",\n",
                      "  \"owner_iam_id\": \"$OWNER_IAM_ID\",\n",
                      "  \"traits\": { \"mfa\": \"\" }\n",
                      "}'"
                    ]
                  }
                ]
              },
              {
                "name": "Example request to set Enterprise IAM settings when creating a child account",
                "example": [
                  {
                    "type": "code",
                    "source": [
                      "curl -X POST \\\n",
                      "\"https://enterprise.cloud.ibm.com/v1/accounts \\\n",
                      "-H \"Authorization: Bearer <IAM_Token>\" \\\n",
                      "-H 'Content-Type: application/json' \\\n",
                      "-d '{\n",
                      "  \"parent\": \"crn:v1:bluemix:public:enterprise::a/$ENTERPRISE_ACCOUNT_ID::account-group:$ACCOUNT_GROUP_ID\",\n",
                      "  \"name\": \"Example Account\",\n",
                      "  \"owner_iam_id\": \"$OWNER_IAM_ID\",\n",
                      "  \"traits\": { \"enterprise_iam_managed\": true }\n",
                      "}'"
                    ]
                  }
                ]
              },
              {
                "name": "Example request to create IAM service id with IAM api key and owner policies when creating a child account",
                "example": [
                  {
                    "type": "code",
                    "source": [
                      "curl -X POST \\\n",
                      "\"https://enterprise.cloud.ibm.com/v1/accounts \\\n",
                      "-H \"Authorization: Bearer <IAM_Token>\" \\\n",
                      "-H 'Content-Type: application/json' \\\n",
                      "-d '{\n",
                      "  \"parent\": \"crn:v1:bluemix:public:enterprise::a/$ENTERPRISE_ACCOUNT_ID::account-group:$ACCOUNT_GROUP_ID\",\n",
                      "  \"name\": \"Example Account\",\n",
                      "  \"owner_iam_id\": \"$OWNER_IAM_ID\",\n",
                      "  \"options\": { \"create_iam_service_id_with_apikey_and_owner_policies\": true }\n",
                      "}'"
                    ]
                  }
                ]
              }
            ],
            "go": [
              {
                "name": "Example request",
                "example": [
                  {
                    "type": "code",
                    "source": [
                      "createAccountOptions := enterpriseManagementService.NewCreateAccountOptions(\n",
                      "  parentCRN,\n",
                      "  \"Example Account\",\n",
                      "  enterpriseAccountIamID,\n",
                      ")\n",
                      "\n",
                      "createAccountResponse, response, err := enterpriseManagementService.CreateAccount(createAccountOptions)\n",
                      "if err != nil {\n",
                      "  panic(err)\n",
                      "}\n",
                      "b, _ := json.MarshalIndent(createAccountResponse, \"\", \"  \")\n",
                      "fmt.Println(string(b))"
                    ]
                  }
                ]
              }
            ],
            "java": [
              {
                "name": "Example request",
                "example": [
                  {
                    "type": "code",
                    "source": [
                      "CreateAccountOptions createAccountOptions = new CreateAccountOptions.Builder()\n",
                      "    .parent(parentCRN)\n",
                      "    .name(\"Example Account\")\n",
                      "    .ownerIamId(enterpriseAccountIamId)\n",
                      "    .build();\n",
                      "\n",
                      "Response<CreateAccountResponse> response = enterpriseManagementService.createAccount(createAccountOptions).execute();\n",
                      "CreateAccountResponse createAccountResponse = response.getResult();\n",
                      "\n",
                      "System.out.println(createAccountResponse);"
                    ]
                  }
                ]
              }
            ],
            "node": [
              {
                "name": "Example request",
                "example": [
                  {
                    "type": "code",
                    "source": [
                      "const params = {\n",
                      "  parent: parentCrn,\n",
                      "  name: 'Example Account',\n",
                      "  ownerIamId: enterpriseAccountIamId,\n",
                      "};\n",
                      "\n",
                      "let res;\n",
                      "try {\n",
                      "  res = await enterpriseManagementService.createAccount(params);\n",
                      "  console.log(JSON.stringify(res.result, null, 2));\n",
                      "} catch (err) {\n",
                      "  console.warn(err);\n",
                      "}\n",
                      "\n",
                      "accountId = res.result.account_id;\n",
                      "\n",
                      "params.name = 'New Example Account';\n",
                      "\n",
                      "try {\n",
                      "  res = await enterpriseManagementService.createAccount(params);\n",
                      "  console.log(JSON.stringify(res.result, null, 2));\n",
                      "} catch (err) {\n",
                      "  console.warn(err);\n",
                      "}"
                    ]
                  }
                ]
              }
            ],
            "python": [
              {
                "name": "Example request",
                "example": [
                  {
                    "type": "code",
                    "source": [
                      "create_account_response = enterprise_management_service.create_account(\n",
                      "  parent=parent_crn,\n",
                      "  name='Example Account',\n",
                      "  owner_iam_id=enterprise_account_iam_id,\n",
                      ").get_result()\n",
                      "\n",
                      "print(json.dumps(create_account_response, indent=2))"
                    ]
                  }
                ]
              }
            ]
          }
        },
        "responses": {
          "202": {
            "description": "The create account request completed successfully",
            "headers": {
              "transaction-id": {
                "description": "The transaction ID that is used to track the request.",
                "schema": {
                  "type": "string"
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/CreateAccountResponse"
                },
                "examples": {
                  "response_1": {
                    "value": {
                      "account_id": "<new-account-id>"
                    }
                  },
                  "response_2": {
                    "value": {
                      "account_id": "<new-account-id>",
                      "iam_service_id": "iam-ServiceId-<service-id-guid>",
                      "iam_apikey_id": "ApiKey-<api-key-guid>",
                      "iam_apikey": "<actual-api-key>"
                    }
                  }
                }
              }
            }
          },
          "400": {
            "description": "Bad Request",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorContainer"
                },
                "examples": {
                  "response": {
                    "value": {
                      "trace": "51246885673",
                      "errors": [
                        {
                          "code": "INVALID_PAYLOAD",
                          "message": "Instance requires property \"parent\". Instance `additionalProperty` \"parents\" exists in instance when not allowed",
                          "more_info": "n/a"
                        }
                      ]
                    }
                  }
                }
              }
            }
          },
          "401": {
            "description": "Invalid or Expired Access Token",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorContainer"
                },
                "examples": {
                  "response": {
                    "value": {
                      "message": "Not Authorized",
                      "trace": "59075132505",
                      "errors": [
                        {
                          "code": "invalid_or_expired_token",
                          "message": "Not Authorized"
                        }
                      ]
                    }
                  }
                }
              }
            }
          },
          "403": {
            "description": "Access Denied",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorContainer"
                },
                "examples": {
                  "response": {
                    "value": {
                      "message": "Not Authenticated",
                      "trace": "55748601058",
                      "errors": [
                        {
                          "code": "forbidden",
                          "message": "Not Authenticated"
                        }
                      ]
                    }
                  }
                }
              }
            }
          },
          "500": {
            "description": "Internal Server Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorContainer"
                },
                "examples": {
                  "response": {
                    "value": {
                      "trace": "14706814780",
                      "errors": [
                        {
                          "code": "CANNOT_CREATE_ACCOUNT",
                          "message": "Could not create account.",
                          "more_info": "n/a",
                          "dependency_code": "ENTERPRISES"
                        }
                      ]
                    }
                  }
                }
              }
            }
          },
          "503": {
            "description": "Service Unavailable",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorContainer"
                },
                "examples": {
                  "response": {
                    "value": {
                      "trace": "98806352835",
                      "errors": [
                        {
                          "code": "service_unavailable",
                          "message": "Service Temporarily Unavailable"
                        }
                      ]
                    }
                  }
                }
              }
            }
          }
        }
      },
      "get": {
        "operationId": "list_accounts",
        "summary": "List accounts",
        "description": "Retrieve all accounts based on the values that are passed in the query parameters. If no query parameter is passed, all of the accounts in the enterprise for which the calling identity has access are returned. <br/><br/>You can use pagination parameters to filter the results. The `limit` field can be used to limit the number of results that are displayed for this method.<br/><br/>This method ensures that only the accounts that the user has access to are returned. Access can be controlled either through a policy on a specific account, or account-level platform services access roles, such as Administrator, Editor, Operator, or Viewer. When you call the method with the `enterprise_id`, `account_group_id` or `parent` query parameter, all of the accounts that are immediate children of this entity are returned. Authentication is performed on all the accounts before they are returned to the user to ensure that only those accounts are returned to which the calling identity has access to.",
        "tags": [
          "Account Operations"
        ],
        "parameters": [
          {
            "description": "Get accounts that are either immediate children or are a part of the hierarchy for a given enterprise ID.",
            "name": "enterprise_id",
            "in": "query",
            "schema": {
              "type": "string"
            }
          },
          {
            "description": "Get accounts that are either immediate children or are a part of the hierarchy for a given account group ID.",
            "name": "account_group_id",
            "in": "query",
            "schema": {
              "type": "string"
            }
          },
          {
            "description": "The first item to be returned in the page of results. This value can be obtained from the next_url property from the previous call of the operation. If not specified, then the first page of results is returned.",
            "name": "next_docid",
            "in": "query",
            "schema": {
              "type": "string"
            }
          },
          {
            "description": "Get accounts that are either immediate children or are a part of the hierarchy for a given parent CRN.",
            "name": "parent",
            "in": "query",
            "schema": {
              "type": "string"
            }
          },
          {
            "description": "Return results up to this limit. Valid values are between `0` and `100`.",
            "name": "limit",
            "in": "query",
            "schema": {
              "type": "integer",
              "default": 100,
              "maximum": 100
            }
          },
          {
            "description": "Include the deleted accounts from an enterprise when used in conjunction with enterprise_id.",
            "name": "include_deleted",
            "in": "query",
            "schema": {
              "type": "boolean"
            }
          }
        ],
        "x-ibm-permissions": {
          "actions": [
            {
              "name": "enterprise.account.retrieve"
            }
          ]
        },
        "x-sdk-operations": {
          "request-examples": {
            "curl": [
              {
                "name": "Example request",
                "example": [
                  {
                    "type": "code",
                    "source": [
                      "curl -X GET \\\n",
                      "\"https://enterprise.cloud.ibm.com/v1/accounts?enterprise_id=$ENTERPRISE_ID&limit=100&include_deleted=true\" \\\n",
                      "-H \"Authorization: Bearer <IAM_Token>\" \\\n",
                      "-H 'Content-Type: application/json'"
                    ]
                  }
                ]
              }
            ],
            "go": [
              {
                "name": "Example request",
                "example": [
                  {
                    "type": "code",
                    "source": [
                      "listAccountsOptions := &enterprisemanagementv1.ListAccountsOptions{\n",
                      "  EnterpriseID: &enterpriseID,\n",
                      "}\n",
                      "\n",
                      "pager, err := enterpriseManagementService.NewAccountsPager(listAccountsOptions)\n",
                      "if err != nil {\n",
                      "  panic(err)\n",
                      "}\n",
                      "\n",
                      "var allResults []enterprisemanagementv1.Account\n",
                      "for pager.HasNext() {\n",
                      "  nextPage, err := pager.GetNext()\n",
                      "  if err != nil {\n",
                      "    panic(err)\n",
                      "  }\n",
                      "  allResults = append(allResults, nextPage...)\n",
                      "}\n",
                      "b, _ := json.MarshalIndent(allResults, \"\", \"  \")\n",
                      "fmt.Println(string(b))"
                    ]
                  }
                ]
              }
            ],
            "java": [
              {
                "name": "Example request",
                "example": [
                  {
                    "type": "code",
                    "source": [
                      "ListAccountsOptions listAccountsOptions = new ListAccountsOptions.Builder()\n",
                      "  .enterpriseId(enterpriseId)\n",
                      "  .build();\n",
                      "\n",
                      "AccountsPager pager = new AccountsPager(enterpriseManagementService, listAccountsOptions);\n",
                      "List<Account> allResults = new ArrayList<>();\n",
                      "while (pager.hasNext()) {\n",
                      "  List<Account> nextPage = pager.getNext();\n",
                      "  allResults.addAll(nextPage);\n",
                      "}\n",
                      "\n",
                      "System.out.println(GsonSingleton.getGson().toJson(allResults));"
                    ]
                  }
                ]
              }
            ],
            "node": [
              {
                "name": "Example request",
                "example": [
                  {
                    "type": "code",
                    "source": [
                      "const params = {\n",
                      "  enterpriseId: enterpriseId,\n",
                      "};\n",
                      "\n",
                      "const allResults = [];\n",
                      "try {\n",
                      "  const pager = new EnterpriseManagementV1.AccountsPager(enterpriseManagementService, params);\n",
                      "  while (pager.hasNext()) {\n",
                      "    const nextPage = await pager.getNext();\n",
                      "    expect(nextPage).not.toBeNull();\n",
                      "    allResults.push(...nextPage);\n",
                      "  }\n",
                      "  console.log(JSON.stringify(allResults, null, 2));\n",
                      "} catch (err) {\n",
                      "  console.warn(err);\n",
                      "}"
                    ]
                  }
                ]
              }
            ],
            "python": [
              {
                "name": "Example request",
                "example": [
                  {
                    "type": "code",
                    "source": [
                      "all_results = []\n",
                      "pager = AccountsPager(\n",
                      "  client=enterprise_management_service,\n",
                      "  enterprise_id=enterprise_id,\n",
                      ")\n",
                      "while pager.has_next():\n",
                      "  next_page = pager.get_next()\n",
                      "  assert next_page is not None\n",
                      "  all_results.extend(next_page)\n",
                      "\n",
                      "print(json.dumps(all_results, indent=2))"
                    ]
                  }
                ]
              }
            ]
          }
        },
        "responses": {
          "200": {
            "description": "Success",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ListAccountsResponse"
                },
                "examples": {
                  "response": {
                    "value": {
                      "rows_count": 2,
                      "next_url": "/v1/accounts?$ACCOUNT_1_ID&next_docid=$NEXT_DOCID",
                      "resources": [
                        {
                          "url": "/v1/accounts/$ACCOUNT_1_ID",
                          "id": "$ACCOUNT_1_ID",
                          "parent": "crn:v1:bluemix:public:enterprise::a/$ENTERPRISE_ACCOUNT_ID::account-group:$ACCOUNT_GROUP_2",
                          "enterprise_account_id": "$ENTERPRISE_ACCOUNT_ID",
                          "enterprise_id": "$ENTERPRISE_ID",
                          "enterprise_path": "enterprise:$ENTERPRISE_ID/account-group:$ACCOUNT_GROUP_1/account-group:$ACCOUNT_GROUP_2",
                          "name": "IBM",
                          "state": "ACTIVE",
                          "paid": true,
                          "owner_iam_id": "IBMid-55MNOP",
                          "owner_email": "user@example.com",
                          "created_at": "2019-05-14T19:45:01.071Z",
                          "updated_at": "2019-05-14T19:46:53.695Z",
                          "crn": "crn:v1:bluemix:public:enterprise::a/$ENTERPRISE_ACCOUNT_ID::account:$ACCOUNT_1_ID",
                          "is_enterprise_account": false,
                          "created_by": "iam-ServiceId-acab",
                          "updated_by": "iam-ServiceId-acab"
                        },
                        {
                          "url": "/v1/accounts/$ENTERPRISE_ACCOUNT_ID",
                          "id": "$ENTERPRISE_ACCOUNT_ID",
                          "parent": "crn:v1:bluemix:public:enterprise::a/$ENTERPRISE_ACCOUNT_ID::enterprise:$ENTERPRISE_ID",
                          "enterprise_account_id": "$ENTERPRISE_ACCOUNT_ID",
                          "enterprise_id": "$ENTERPRISE_ID",
                          "enterprise_path": "enterprise:$ENTERPRISE_ID",
                          "name": "Billing Fields Enterprise 5",
                          "state": "ACTIVE",
                          "paid": true,
                          "owner_iam_id": "IBMid-55HIJK",
                          "owner_email": "user@example.com",
                          "created_at": "2019-05-14T19:46:53.495Z",
                          "updated_at": "2019-05-19T21:14:15.079Z",
                          "crn": "crn:v1:bluemix:public:enterprise::a/$ENTERPRISE_ACCOUNT_ID::account:$ENTERPRISE_ACCOUNT_ID",
                          "is_enterprise_account": true,
                          "created_by": "iam-ServiceId-acab",
                          "updated_by": "iam-ServiceId-acab"
                        }
                      ]
                    }
                  }
                }
              }
            }
          },
          "401": {
            "description": "Invalid or Expired Access Token",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorContainer"
                },
                "examples": {
                  "response": {
                    "value": {
                      "message": "Not Authorized",
                      "trace": "19184974366",
                      "errors": [
                        {
                          "code": "invalid_or_expired_token",
                          "message": "Not Authorized"
                        }
                      ]
                    }
                  }
                }
              }
            }
          },
          "403": {
            "description": "Access Denied",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorContainer"
                },
                "examples": {
                  "response": {
                    "value": {
                      "message": "Not Authenticated",
                      "trace": "63023172185",
                      "errors": [
                        {
                          "code": "forbidden",
                          "message": "Not Authenticated"
                        }
                      ]
                    }
                  }
                }
              }
            }
          },
          "500": {
            "description": "Internal Server Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorContainer"
                },
                "examples": {
                  "response": {
                    "value": {
                      "trace": "83466393038",
                      "errors": [
                        {
                          "code": "RETRIEVE_ACCOUNTS_ERROR",
                          "message": "Cannot find accounts with ID: $ACCOUNT_ID",
                          "more_info": "n/a",
                          "dependency_code": "CLOUDANT"
                        }
                      ]
                    }
                  }
                }
              }
            }
          },
          "503": {
            "description": "Service Unavailable",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorContainer"
                },
                "examples": {
                  "response": {
                    "value": {
                      "trace": "43754748116",
                      "errors": [
                        {
                          "code": "service_unavailable",
                          "message": "Service Temporarily Unavailable"
                        }
                      ]
                    }
                  }
                }
              }
            }
          }
        }
      }
    },
    "/accounts/{account_id}": {
      "parameters": [
        {
          "description": "The ID of the target account.",
          "name": "account_id",
          "in": "path",
          "required": true,
          "schema": {
            "type": "string"
          }
        }
      ],
      "get": {
        "operationId": "get_account",
        "summary": "Get account by ID",
        "description": "Retrieve an account by the `account_id` parameter. All data related to the account is returned only if the caller has access to retrieve the account.",
        "tags": [
          "Account Operations"
        ],
        "x-ibm-permissions": {
          "actions": [
            {
              "name": "enterprise.account.retrieve"
            }
          ]
        },
        "x-sdk-operations": {
          "request-examples": {
            "curl": [
              {
                "name": "Example request",
                "example": [
                  {
                    "type": "code",
                    "source": [
                      "curl -X GET \\\n",
                      "\"https://enterprise.cloud.ibm.com/v1/accounts/$ACCOUNT_ID\" \\\n",
                      "-H \"Authorization: Bearer <IAM_Token>\" \\\n",
                      "-H 'Content-Type: application/json'"
                    ]
                  }
                ]
              }
            ],
            "go": [
              {
                "name": "Example request",
                "example": [
                  {
                    "type": "code",
                    "source": [
                      "getAccountOptions := enterpriseManagementService.NewGetAccountOptions(\n",
                      "  accountID,\n",
                      ")\n",
                      "\n",
                      "account, response, err := enterpriseManagementService.GetAccount(getAccountOptions)\n",
                      "if err != nil {\n",
                      "  panic(err)\n",
                      "}\n",
                      "b, _ := json.MarshalIndent(account, \"\", \"  \")\n",
                      "fmt.Println(string(b))"
                    ]
                  }
                ]
              }
            ],
            "java": [
              {
                "name": "Example request",
                "example": [
                  {
                    "type": "code",
                    "source": [
                      "GetAccountOptions getAccountOptions = new GetAccountOptions.Builder()\n",
                      "    .accountId(accountId)\n",
                      "    .build();\n",
                      "\n",
                      "Response<Account> response = enterpriseManagementService.getAccount(getAccountOptions).execute();\n",
                      "Account account = response.getResult();\n",
                      "\n",
                      "System.out.println(account);"
                    ]
                  }
                ]
              }
            ],
            "node": [
              {
                "name": "Example request",
                "example": [
                  {
                    "type": "code",
                    "source": [
                      "const params = {\n",
                      "  accountId: accountId,\n",
                      "};\n",
                      "\n",
                      "try {\n",
                      "  const res = await enterpriseManagementService.getAccount(params);\n",
                      "  console.log(JSON.stringify(res.result, null, 2));\n",
                      "} catch (err) {\n",
                      "  console.warn(err);\n",
                      "}"
                    ]
                  }
                ]
              }
            ],
            "python": [
              {
                "name": "Example request",
                "example": [
                  {
                    "type": "code",
                    "source": [
                      "account = enterprise_management_service.get_account(\n",
                      "  account_id=account_id,\n",
                      ").get_result()\n",
                      "\n",
                      "print(json.dumps(account, indent=2))"
                    ]
                  }
                ]
              }
            ]
          }
        },
        "responses": {
          "200": {
            "description": "Successfully retrieved account by ID",
            "headers": {
              "transaction-id": {
                "description": "The transaction ID of the get account request.",
                "schema": {
                  "type": "string"
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Account"
                },
                "examples": {
                  "response": {
                    "value": {
                      "url": "/v1/accounts/$ACCOUNT_1_ID",
                      "id": "$ACCOUNT_1_ID",
                      "parent": "crn:v1:bluemix:public:enterprise::a/$ENTERPRISE_ACCOUNT_ID::account-group:$ACCOUNT_GROUP_2",
                      "enterprise_account_id": "$ENTERPRISE_ACCOUNT_ID",
                      "enterprise_id": "$ENTERPRISE_ID",
                      "enterprise_path": "enterprise:$ENTERPRISE_ID/account-group:$ACCOUNT_GROUP_1/account-group:$ACCOUNT_GROUP_2",
                      "name": "IBM",
                      "state": "ACTIVE",
                      "paid": true,
                      "owner_iam_id": "IBMid-55MNOP",
                      "owner_email": "user@example.com",
                      "created_at": "2019-05-14T19:45:01.071Z",
                      "updated_at": "2019-05-14T19:46:53.695Z",
                      "crn": "crn:v1:bluemix:public:enterprise::a/$ENTERPRISE_ACCOUNT_ID::account:$ACCOUNT_1_ID",
                      "is_enterprise_account": false,
                      "created_by": "iam-ServiceId-acab",
                      "updated_by": "iam-ServiceId-acab"
                    }
                  }
                }
              }
            }
          },
          "401": {
            "description": "Invalid or Expired Access Token",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorContainer"
                },
                "examples": {
                  "response": {
                    "value": {
                      "message": "Not Authorized",
                      "trace": "20417281627",
                      "errors": [
                        {
                          "code": "invalid_or_expired_token",
                          "message": "Not Authorized"
                        }
                      ]
                    }
                  }
                }
              }
            }
          },
          "403": {
            "description": "Access Denied",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorContainer"
                },
                "examples": {
                  "response": {
                    "value": {
                      "message": "Not Authenticated",
                      "trace": "53451896518",
                      "errors": [
                        {
                          "code": "forbidden",
                          "message": "Not Authenticated"
                        }
                      ]
                    }
                  }
                }
              }
            }
          },
          "404": {
            "description": "Not Found",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorContainer"
                },
                "examples": {
                  "response": {
                    "value": {
                      "trace": "28807154668",
                      "errors": [
                        {
                          "code": "RETRIEVE_ACCOUNT_ERROR",
                          "message": "Cannot find account with ID: $ACCOUNT_ID",
                          "more_info": "n/a",
                          "dependency_code": "ENTERPRISES"
                        }
                      ]
                    }
                  }
                }
              }
            }
          },
          "500": {
            "description": "Internal Server Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorContainer"
                },
                "examples": {
                  "response": {
                    "value": {
                      "trace": "20862652978",
                      "errors": [
                        {
                          "code": "RETRIEVE_ACCOUNT_ERROR",
                          "message": "Can't find account with ID: $ACCOUNT_ID",
                          "more_info": "n/a",
                          "dependency_code": "CLOUDANT"
                        }
                      ]
                    }
                  }
                }
              }
            }
          },
          "503": {
            "description": "Service Unavailable",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorContainer"
                },
                "examples": {
                  "response": {
                    "value": {
                      "trace": "20862652919",
                      "errors": [
                        {
                          "code": "service_unavailable",
                          "message": "Service Temporarily Unavailable"
                        }
                      ]
                    }
                  }
                }
              }
            }
          }
        }
      },
      "patch": {
        "operationId": "update_account",
        "summary": "Move an account within the enterprise",
        "description": "Move an account to a different parent within the same enterprise.",
        "tags": [
          "Account Operations"
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/MoveAccountRequest"
              }
            }
          },
          "description": "The ID of the account to move.",
          "required": true
        },
        "x-ibm-permissions": {
          "actions": [
            {
              "name": "enterprise.account.move"
            }
          ]
        },
        "x-ibm-events": {
          "events": [
            {
              "name": "enterprise.account.move"
            }
          ]
        },
        "x-codegen-request-body-name": "body",
        "x-sdk-operations": {
          "request-examples": {
            "curl": [
              {
                "name": "Example request",
                "example": [
                  {
                    "type": "code",
                    "source": [
                      "curl -X PATCH \\\n",
                      "\"https://enterprise.cloud.ibm.com/v1/accounts/$ACCOUNT_ID\" \\\n",
                      "-H \"Authorization: Bearer <IAM_Token>\" \\\n",
                      "-H 'Content-Type: application/json' \\\n",
                      "-d '{\n",
                      "  \"parent\": crn:v1:bluemix:public:enterprise::a/$ENTERPRISE_ACCOUNT_ID::account-group:$NEW_PARENT_ACCOUNT_GROUP\"\",\n",
                      "}'"
                    ]
                  }
                ]
              }
            ],
            "go": [
              {
                "name": "Example request",
                "example": [
                  {
                    "type": "code",
                    "source": [
                      "updateAccountOptions := enterpriseManagementService.NewUpdateAccountOptions(\n",
                      "  accountID,\n",
                      "  newParentCRN,\n",
                      ")\n",
                      "\n",
                      "response, err := enterpriseManagementService.UpdateAccount(updateAccountOptions)\n",
                      "if err != nil {\n",
                      "  panic(err)\n",
                      "}"
                    ]
                  }
                ]
              }
            ],
            "java": [
              {
                "name": "Example request",
                "example": [
                  {
                    "type": "code",
                    "source": [
                      "UpdateAccountOptions updateAccountOptions = new UpdateAccountOptions.Builder()\n",
                      "    .accountId(accountId)\n",
                      "    .parent(newParentCRN)\n",
                      "    .build();\n",
                      "\n",
                      "Response<Void> response = enterpriseManagementService.updateAccount(updateAccountOptions).execute();"
                    ]
                  }
                ]
              }
            ],
            "node": [
              {
                "name": "Example request",
                "example": [
                  {
                    "type": "code",
                    "source": [
                      "const params = {\n",
                      "  accountId: newAccountId,\n",
                      "  parent: newParentCrn,\n",
                      "};\n",
                      "\n",
                      "try {\n",
                      "  await enterpriseManagementService.updateAccount(params);\n",
                      "} catch (err) {\n",
                      "  console.warn(err);\n",
                      "}"
                    ]
                  }
                ]
              }
            ],
            "python": [
              {
                "name": "Example request",
                "example": [
                  {
                    "type": "code",
                    "source": [
                      "response = enterprise_management_service.update_account(\n",
                      "  account_id=account_id,\n",
                      "  parent=new_parent_crn,\n",
                      ")"
                    ]
                  }
                ]
              }
            ]
          }
        },
        "responses": {
          "202": {
            "description": "Moving account process is in PENDING state. After the parent field of the account shows the new parent, asynchronous processing is complete."
          },
          "204": {
            "description": "Update Successful"
          },
          "400": {
            "description": "Bad Request. The payload passed to the request is invalid.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorContainer"
                },
                "examples": {
                  "response": {
                    "value": {
                      "trace": "8107105611",
                      "errors": [
                        {
                          "code": "INVALID_PAYLOAD",
                          "message": "Instance additionalProperty \"parents\" exists in instance when not allowed.",
                          "more_info": "n/a"
                        }
                      ]
                    }
                  }
                }
              }
            }
          },
          "401": {
            "description": "Invalid or Expired Access Token",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorContainer"
                },
                "examples": {
                  "response": {
                    "value": {
                      "message": "Not Authorized",
                      "trace": "70766899258",
                      "errors": [
                        {
                          "code": "invalid_or_expired_token",
                          "message": "Not Authorized"
                        }
                      ]
                    }
                  }
                }
              }
            }
          },
          "403": {
            "description": "Access Denied",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorContainer"
                },
                "examples": {
                  "response": {
                    "value": {
                      "message": "Not Authenticated",
                      "trace": "25000450205",
                      "errors": [
                        {
                          "code": "forbidden",
                          "message": "Not Authenticated"
                        }
                      ]
                    }
                  }
                }
              }
            }
          },
          "404": {
            "description": "Not Found",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorContainer"
                },
                "examples": {
                  "response": {
                    "value": {
                      "trace": "28807154668",
                      "errors": [
                        {
                          "code": "CANNOT_MOVE_ACCOUNT",
                          "message": "Can't find account with ID: $ACCOUNT_ID",
                          "more_info": "n/a",
                          "dependency_code": "ENTERPRISES"
                        }
                      ]
                    }
                  }
                }
              }
            }
          },
          "500": {
            "description": "Internal Server Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorContainer"
                },
                "examples": {
                  "response": {
                    "value": {
                      "trace": "85221918317",
                      "errors": [
                        {
                          "code": "CANNOT_MOVE_ACCOUNT",
                          "message": "Can't find account with ID: $ACCOUNT_ID",
                          "more_info": "n/a",
                          "dependency_code": "CLOUDANT"
                        }
                      ]
                    }
                  }
                }
              }
            }
          },
          "503": {
            "description": "Service Unavailable",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorContainer"
                },
                "examples": {
                  "response": {
                    "value": {
                      "trace": "88208326006",
                      "errors": [
                        {
                          "code": "service_unavailable",
                          "message": "Service Temporarily Unavailable",
                          "more_info": "n/a"
                        }
                      ]
                    }
                  }
                }
              }
            }
          }
        }
      },
      "delete": {
        "operationId": "delete_account",
        "summary": "Remove an account from its enterprise",
        "description": "Remove an account from the enterprise that it's currently in. After an account is removed, it is canceled and cannot be reactivated.",
        "tags": [
          "Account Operations"
        ],
        "x-ibm-permissions": {
          "actions": [
            {
              "name": "enterprise.account.delete"
            }
          ]
        },
        "x-ibm-events": {
          "events": [
            {
              "name": "enterprise.account.delete"
            }
          ]
        },
        "x-sdk-operations": {
          "request-examples": {
            "curl": [
              {
                "name": "Example request",
                "example": [
                  {
                    "type": "code",
                    "source": [
                      "curl -X DELETE \\\n",
                      "\"https://enterprise.cloud.ibm.com/v1/accounts/$ACCOUNT_ID\" \\\n",
                      "-H \"Authorization: Bearer <IAM_Token>\" \\\n",
                      "-H 'Content-Type: application/json'"
                    ]
                  }
                ]
              }
            ],
            "go": [
              {
                "name": "Example request",
                "example": [
                  {
                    "type": "code",
                    "source": [
                      "deleteAccountOptions := enterpriseManagementService.NewDeleteAccountOptions(\n",
                      "  accountID,\n",
                      ")\n",
                      "\n",
                      "response, err := enterpriseManagementService.DeleteAccount(deleteAccountOptions)\n",
                      "if err != nil {\n",
                      "  panic(err)\n",
                      "}"
                    ]
                  }
                ]
              }
            ],
            "java": [
              {
                "name": "Example request",
                "example": [
                  {
                    "type": "code",
                    "source": [
                      "DeleteAccountOptions deleteAccountOptions = new DeleteAccountOptions.Builder()\n",
                      "  .accountId(accountId)\n",
                      "  .build();\n",
                      "\n",
                      "Response<Void> response = enterpriseManagementService.deleteAccount(deleteAccountOptions).execute();"
                    ]
                  }
                ]
              }
            ],
            "node": [
              {
                "name": "Example request",
                "example": [
                  {
                    "type": "code",
                    "source": [
                      "const params = {\n",
                      "  accountId,\n",
                      "};\n",
                      "\n",
                      "try {\n",
                      "  await enterpriseManagementService.deleteAccount(params);\n",
                      "} catch (err) {\n",
                      "  console.warn(err);\n",
                      "}"
                    ]
                  }
                ]
              }
            ],
            "python": [
              {
                "name": "Example request",
                "example": [
                  {
                    "type": "code",
                    "source": [
                      "response = enterprise_management_service.delete_account(\n",
                      "  account_id=account_id,\n",
                      ")"
                    ]
                  }
                ]
              }
            ]
          }
        },
        "responses": {
          "204": {
            "description": "Successfully removed the account from the enterprise.",
            "headers": {
              "transaction-id": {
                "description": "The transaction ID of the delete account request.",
                "schema": {
                  "type": "string"
                }
              }
            }
          },
          "400": {
            "description": "Bad Request",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorContainer"
                },
                "examples": {
                  "response": {
                    "value": {
                      "trace": "23488481242",
                      "errors": [
                        {
                          "code": "CANNOT_DELETE_ACCOUNT_FROM_ENTERPRISE",
                          "message": "Cannot delete account: The account 628802a48c0844618b19ca47ba255fe2 is not part of an enterprise.",
                          "more_info": "n/a",
                          "dependency_code": "ENTERPRISES"
                        }
                      ]
                    }
                  }
                }
              }
            }
          },
          "401": {
            "description": "Invalid or Expired Access Token",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorContainer"
                },
                "examples": {
                  "response": {
                    "value": {
                      "message": "Not Authorized",
                      "trace": "20417281627",
                      "errors": [
                        {
                          "code": "invalid_or_expired_token",
                          "message": "Not Authorized"
                        }
                      ]
                    }
                  }
                }
              }
            }
          },
          "403": {
            "description": "Access Denied",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorContainer"
                },
                "examples": {
                  "response": {
                    "value": {
                      "message": "Not Authenticated",
                      "trace": "53451896518",
                      "errors": [
                        {
                          "code": "forbidden",
                          "message": "Not Authenticated"
                        }
                      ]
                    }
                  }
                }
              }
            }
          },
          "404": {
            "description": "Not Found",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorContainer"
                },
                "examples": {
                  "response": {
                    "value": {
                      "trace": "28807154668",
                      "errors": [
                        {
                          "code": "RETRIEVE_ACCOUNT_ERROR",
                          "message": "Cannot find account with ID: $ACCOUNT_ID",
                          "more_info": "n/a",
                          "dependency_code": "ENTERPRISES"
                        }
                      ]
                    }
                  }
                }
              }
            }
          },
          "500": {
            "description": "Internal Server Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorContainer"
                },
                "examples": {
                  "response": {
                    "value": {
                      "trace": "14706814780",
                      "errors": [
                        {
                          "code": "CANNOT_DELETE_ACCOUNT_FROM_ENTERPRISE",
                          "message": "Could not delete account from enterprise.",
                          "more_info": "n/a",
                          "dependency_code": "ENTERPRISES"
                        }
                      ]
                    }
                  }
                }
              }
            }
          },
          "503": {
            "description": "Service Unavailable",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorContainer"
                },
                "examples": {
                  "response": {
                    "value": {
                      "trace": "98806352835",
                      "errors": [
                        {
                          "code": "service_unavailable",
                          "message": "Service Temporarily Unavailable"
                        }
                      ]
                    }
                  }
                }
              }
            }
          }
        }
      }
    },
    "/enterprises/{enterprise_id}/permissible-actions": {},
    "/account-groups/{account_group_id}/permissible-actions": {},
    "/accounts/{account_id}/permissible-actions": {}
  },
  "components": {
    "securitySchemes": {
      "IAM": {
        "type": "apiKey",
        "name": "Authorization",
        "in": "header",
        "description": "Authorization Token used for the request"
      }
    },
    "schemas": {
      "ErrorContainer": {
        "description": "ErrorContainer contains the `transaction-id`, status code, and an array of errors that are returned to the user.",
        "type": "object",
        "properties": {
          "trace": {
            "type": "string",
            "description": "The `transaction-id` of the request"
          },
          "errors": {
            "type": "array",
            "description": "Array of error which contains the code and message for an error returned to the user",
            "items": {
              "$ref": "#/components/schemas/Error"
            }
          }
        }
      },
      "Error": {
        "type": "object",
        "description": "Error contains the code and message for an error returned to the user. The code is a string that identifies the problem, such as \"missing_field\" or \"reserved_value\". The message is a string that explains the solution to the problem that was encountered.",
        "properties": {
          "code": {
            "type": "string",
            "description": "The code is a string that identifies the problem, such as \"missing_field\" or \"reserved_value\""
          },
          "message": {
            "type": "string",
            "description": "The message is a string that explains the solution to the problem that was encountered"
          },
          "more_info": {
            "type": "string",
            "description": "Additional information about the error"
          },
          "dependency_code": {
            "type": "string",
            "description": "A dependency code"
          }
        }
      },
      "CreateEnterpriseRequest": {
        "type": "object",
        "description": "The body required to create an enterprise",
        "required": [
          "source_account_id",
          "name",
          "primary_contact_iam_id"
        ],
        "properties": {
          "source_account_id": {
            "description": "The ID of the account that is used to create the enterprise.",
            "type": "string"
          },
          "name": {
            "description": "The name of the enterprise. This field must have 3 - 60 characters.",
            "type": "string"
          },
          "domain": {
            "description": "A domain or subdomain for the enterprise, such as `example.com` or `my.example.com`.",
            "type": "string"
          },
          "primary_contact_iam_id": {
            "description": "The IAM ID of the enterprise primary contact, such as `IBMid-0123ABC`. The IAM ID must already exist.",
            "type": "string"
          }
        }
      },
      "UpdateEnterpriseRequest": {
        "type": "object",
        "description": "The body required to update an enterprise",
        "properties": {
          "name": {
            "description": "The new name of the enterprise. This field must have 3 - 60 characters.",
            "type": "string"
          },
          "domain": {
            "description": "The new domain of the enterprise. This field has a limit of 60 characters.",
            "type": "string"
          },
          "primary_contact_iam_id": {
            "description": "The IAM ID of the user to be the new primary contact for the enterprise.",
            "type": "string"
          }
        }
      },
      "CreateEnterpriseResponse": {
        "type": "object",
        "description": "The response from calling create enterprise",
        "properties": {
          "enterprise_id": {
            "type": "string",
            "description": "The ID of the enterprise entity that was created. This entity is the root of the hierarchy."
          },
          "enterprise_account_id": {
            "type": "string",
            "description": "The ID of the enterprise account that was created. The enterprise account is used to manage billing and access to the enterprise management."
          }
        }
      },
      "ListEnterprisesResponse": {
        "type": "object",
        "description": "The response from calling list enterprises",
        "properties": {
          "rows_count": {
            "type": "integer",
            "description": "The number of enterprises returned from calling list enterprise"
          },
          "next_url": {
            "type": "string",
            "description": "A string that represents the link to the next page of results"
          },
          "resources": {
            "type": "array",
            "description": "A list of enterprise objects",
            "items": {
              "$ref": "#/components/schemas/Enterprise"
            }
          }
        }
      },
      "Enterprise": {
        "type": "object",
        "description": "An enterprise resource",
        "properties": {
          "url": {
            "type": "string",
            "description": "The URL of the enterprise."
          },
          "id": {
            "type": "string",
            "description": "The enterprise ID."
          },
          "enterprise_account_id": {
            "type": "string",
            "description": "The enterprise account ID."
          },
          "crn": {
            "type": "string",
            "description": "The Cloud Resource Name (CRN) of the enterprise."
          },
          "name": {
            "type": "string",
            "description": "The name of the enterprise."
          },
          "domain": {
            "type": "string",
            "description": "The domain of the enterprise."
          },
          "state": {
            "type": "string",
            "description": "The state of the enterprise."
          },
          "primary_contact_iam_id": {
            "type": "string",
            "description": "The IAM ID of the primary contact of the enterprise, such as `IBMid-0123ABC`."
          },
          "primary_contact_email": {
            "type": "string",
            "description": "The email of the primary contact of the enterprise."
          },
          "source_account_id": {
            "type": "string",
            "description": "The ID of the account that is used to create the enterprise."
          },
          "created_at": {
            "type": "string",
            "format": "date-time",
            "description": "The time stamp at which the enterprise was created."
          },
          "created_by": {
            "type": "string",
            "description": "The IAM ID of the user or service that created the enterprise."
          },
          "updated_at": {
            "type": "string",
            "format": "date-time",
            "description": "The time stamp at which the enterprise was last updated."
          },
          "updated_by": {
            "type": "string",
            "description": "The IAM ID of the user or service that updated the enterprise."
          }
        }
      },
      "PermissibleActionsRequest": {
        "type": "object",
        "description": "A list of actions to authenticate.",
        "properties": {
          "actions": {
            "type": "array",
            "description": "A list of names of permissible actions",
            "items": {
              "type": "string",
              "description": "A permissible action."
            }
          }
        }
      },
      "ImportToEnterpriseRequest": {
        "type": "object",
        "description": "The body of the request to import an account into the enterprise.",
        "properties": {
          "parent": {
            "type": "string",
            "description": "The CRN of the expected parent of the imported account. The parent is the enterprise or account group that the account is added to."
          },
          "billing_unit_id": {
            "type": "string",
            "description": "The ID of the [billing unit](/apidocs/enterprise-apis/billing-unit) to use for billing this account in the enterprise."
          }
        }
      },
      "CreateAccountGroupRequest": {
        "type": "object",
        "description": "The body that is required to create an account group.",
        "required": [
          "parent",
          "name",
          "primary_contact_iam_id"
        ],
        "properties": {
          "parent": {
            "description": "The CRN of the parent under which the account group will be created. The parent can be an existing account group or the enterprise itself.",
            "type": "string"
          },
          "name": {
            "description": "The name of the account group. This field must have 3 - 60 characters.",
            "type": "string"
          },
          "primary_contact_iam_id": {
            "description": "The IAM ID of the primary contact for this account group, such as `IBMid-0123ABC`. The IAM ID must already exist.",
            "type": "string"
          }
        }
      },
      "CreateAccountGroupResponse": {
        "type": "object",
        "description": "A newly-created account group.",
        "properties": {
          "account_group_id": {
            "type": "string",
            "description": "The ID of the account group entity that was created."
          }
        }
      },
      "ListAccountGroupsResponse": {
        "type": "object",
        "description": "The list_account_groups operation response",
        "properties": {
          "rows_count": {
            "type": "integer",
            "description": "The number of enterprises returned from calling list account groups"
          },
          "next_url": {
            "type": "string",
            "description": "A string that represents the link to the next page of results"
          },
          "resources": {
            "type": "array",
            "description": "A list of account groups",
            "items": {
              "$ref": "#/components/schemas/AccountGroup"
            }
          }
        }
      },
      "AccountGroup": {
        "type": "object",
        "description": "An account group resource",
        "properties": {
          "url": {
            "type": "string",
            "description": "The URL of the account group."
          },
          "id": {
            "type": "string",
            "description": "The account group ID."
          },
          "crn": {
            "type": "string",
            "description": "The Cloud Resource Name (CRN) of the account group."
          },
          "parent": {
            "type": "string",
            "description": "The CRN of the parent of the account group."
          },
          "enterprise_account_id": {
            "type": "string",
            "description": "The enterprise account ID."
          },
          "enterprise_id": {
            "type": "string",
            "description": "The enterprise ID that the account group is a part of."
          },
          "enterprise_path": {
            "type": "string",
            "description": "The path from the enterprise to this particular account group."
          },
          "name": {
            "type": "string",
            "description": "The name of the account group."
          },
          "state": {
            "type": "string",
            "description": "The state of the account group."
          },
          "primary_contact_iam_id": {
            "type": "string",
            "description": "The IAM ID of the primary contact of the account group."
          },
          "primary_contact_email": {
            "type": "string",
            "description": "The email address of the primary contact of the account group."
          },
          "created_at": {
            "type": "string",
            "format": "date-time",
            "description": "The time stamp at which the account group was created."
          },
          "created_by": {
            "type": "string",
            "description": "The IAM ID of the user or service that created the account group."
          },
          "updated_at": {
            "type": "string",
            "format": "date-time",
            "description": "The time stamp at which the account group was last updated."
          },
          "updated_by": {
            "type": "string",
            "description": "The IAM ID of the user or service that updated the account group."
          }
        }
      },
      "UpdateAccountGroupRequest": {
        "description": "Request to update the account group.",
        "type": "object",
        "properties": {
          "name": {
            "description": "The new name of the account group. This field must have 3 - 60 characters.",
            "type": "string"
          },
          "primary_contact_iam_id": {
            "description": "The IAM ID of the user to be the new primary contact for the account group.",
            "type": "string"
          }
        }
      },
      "CreateAccountRequest": {
        "type": "object",
        "description": "The request body required to create a new account.",
        "required": [
          "parent",
          "name",
          "owner_iam_id"
        ],
        "properties": {
          "parent": {
            "description": "The CRN of the parent under which the account will be created. The parent can be an existing account group or the enterprise itself.",
            "type": "string"
          },
          "name": {
            "description": "The name of the account. This field must have 3 - 60 characters.",
            "type": "string"
          },
          "owner_iam_id": {
            "description": "The IAM ID of the account owner, such as `IBMid-0123ABC`. The IAM ID must already exist.",
            "type": "string"
          },
          "traits": {
            "description": "The traits object can be used to set properties on child accounts of an enterprise. You can pass a field to opt-out of the default multi-factor authentication setting or enable enterprise-managed IAM when creating a child account in the enterprise. This is an optional field.",
            "type": "object",
            "properties": {
              "mfa": {
                "type": "string",
                "description": "By default MFA is set to `NONE_NO_ROPC` on a child account, which disables CLI logins with only a password. To opt out, pass the traits object with the mfa field set to empty string. This is an optional field."
              },
              "enterprise_iam_managed": {
                "type": "boolean",
                "description": "By default enterprise-managed IAM is turned off for a newly created child account. You can enable this property by passing 'true' in this boolean field. Enabling enterprise-managed IAM allows the enterprise account to assign IAM resources, like access groups, trusted profiles, and account settings, to the child account. This is an optional field."
              }
            }
          },
          "options": {
            "description": "The options object can be used to set properties on child accounts of an enterprise. You can pass a field to to create IAM service id with IAM api keyg when creating a child account in the enterprise. This is an optional field.",
            "type": "object",
            "properties": {
              "create_iam_service_id_with_apikey_and_owner_policies": {
                "type": "boolean",
                "description": "By default create_iam_service_id_with_apikey_and_owner_policies is turned off for a newly created child account. You can enable this property by passing 'true' in this boolean field. IAM service id has account owner IAM policies and the API key associated with it can generate a token and setup resources in the account. This is an optional field."
              }
            }
          }
        }
      },
      "CreateAccountResponse": {
        "type": "object",
        "description": "A newly-created account.",
        "properties": {
          "account_id": {
            "type": "string",
            "description": "The ID of the account entity that was created."
          },
          "iam_service_id": {
            "type": "string",
            "description": "The iam_service_id of the account entity that was created."
          },
          "iam_apikey_id": {
            "type": "string",
            "description": "The iam_apikey_id of the account entity that was created."
          },
          "iam_apikey": {
            "type": "string",
            "description": "The iam_apikey of the account entity with owner iam policies that was created."
          }
        }
      },
      "ListAccountsResponse": {
        "type": "object",
        "description": "The list_accounts operation response.",
        "properties": {
          "rows_count": {
            "type": "integer",
            "description": "The number of enterprises returned from calling list accounts"
          },
          "next_url": {
            "type": "string",
            "description": "A string that represents the link to the next page of results"
          },
          "resources": {
            "type": "array",
            "description": "A list of accounts",
            "items": {
              "$ref": "#/components/schemas/Account"
            }
          }
        }
      },
      "Account": {
        "type": "object",
        "description": "An account resource",
        "properties": {
          "url": {
            "type": "string",
            "description": "The URL of the account."
          },
          "id": {
            "type": "string",
            "description": "The account ID."
          },
          "crn": {
            "type": "string",
            "description": "The Cloud Resource Name (CRN) of the account."
          },
          "parent": {
            "type": "string",
            "description": "The CRN of the parent of the account."
          },
          "enterprise_account_id": {
            "type": "string",
            "description": "The enterprise account ID."
          },
          "enterprise_id": {
            "type": "string",
            "description": "The enterprise ID that the account is a part of."
          },
          "enterprise_path": {
            "type": "string",
            "description": "The path from the enterprise to this particular account."
          },
          "name": {
            "type": "string",
            "description": "The name of the account."
          },
          "state": {
            "type": "string",
            "description": "The state of the account."
          },
          "owner_iam_id": {
            "type": "string",
            "description": "The IAM ID of the owner of the account."
          },
          "paid": {
            "type": "boolean",
            "description": "The type of account - whether it is free or paid."
          },
          "owner_email": {
            "type": "string",
            "description": "The email address of the owner of the account."
          },
          "is_enterprise_account": {
            "type": "boolean",
            "description": "The flag to indicate whether the account is an enterprise account or not."
          },
          "created_at": {
            "type": "string",
            "format": "date-time",
            "description": "The time stamp at which the account was created."
          },
          "created_by": {
            "type": "string",
            "description": "The IAM ID of the user or service that created the account."
          },
          "updated_at": {
            "type": "string",
            "format": "date-time",
            "description": "The time stamp at which the account was last updated."
          },
          "updated_by": {
            "type": "string",
            "description": "The IAM ID of the user or service that updated the account."
          }
        }
      },
      "MoveAccountRequest": {
        "description": "Move account request.",
        "type": "object",
        "required": [
          "parent"
        ],
        "properties": {
          "parent": {
            "description": "The CRN of the new parent within the enterprise.",
            "type": "string"
          }
        }
      }
    }
  }
}