# Create managed organization

Create a managed organization in context of a specific app. This should be called from the backend, using an admin access token (generated by a management app) or an organization admin access token. Required permissions: organizations:create, orgs:create.

Endpoint: POST /v1/organizations/{organization_id}/applications/{app_id}/managed-organizations
Security: AdminAccessToken

## Path parameters:

  - `organization_id` (string, required)
    The ID of the organization that creates the managed organization

  - `app_id` (string, required)
    ID of application

## Request fields (application/json):

  - `name` (string, required)
    Name of the organization

  - `domains` (array, required)
    Domains of the organization

  - `enabled` (boolean)
    Indicates if the organization is currently enabled

  - `alias_name` (string)
    Alias name of the managed organization

  - `domain` (string, required)
    Domain of the organization

## Response 201 fields (application/json):

  - `result` (object, required)

  - `result.organization_id` (string, required)
    ID of the organization

  - `result.app_ids` (array, required)
    A list of applications the organization can access

  - `result.name` (string, required)
    Name of the organization

  - `result.domains` (array)
    Domains of the organization

  - `result.created_at` (number)
    Date the organization was created in the tenant

  - `result.updated_at` (number)
    Date the organization was last updated

  - `result.enabled` (boolean, required)
    Indicates if the organization is currently enabled

  - `result.managed_organizations_by_app` (object)
    Mapping of app IDs to managed organization IDs assigned to this app

  - `result.managing_organization_id` (string)
    ID of the managing organization

  - `result.logo_url` (string)
    The URL of the organization's logo

  - `result.alias_name` (string)
    Alias name of the organization

  - `result.domain` (string, required)
    Domain of the organization

## Response 409 fields (application/json):

  - `message` (string, required)

  - `error_code` (number, required)

  - `ts_error_code` (string, required)


