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

# Managing Organizations

The Organizations APIs are used to set up the organizational hierarchy to define which business objects users can access.

For a sample postman collection of the Organizations APIs, click the link below:

[![Run in Postman](https://run.pstmn.io/button.svg)](https://app.getpostman.com/run-collection/55ff28ef8252fe0c6362)

## Creating a new organization

The [POST /external/organizations](/onetrust/reference/createorganizationusingpost) endpoint can be used to create a new organization in your account.

Note: If multiple organizations have their `ExternalId` as null and if a new organization is created with `parentExternalId` as null, the new organization is created as a child of the root organization.

*Example Request:*

`POST https://trial.onetrust.com/api/access/v1/external/organizations/`

*Request Body:*

```
{
  "externalId": "New_Org_Id",
  "parentExternalId": "null",
  "name": "New_Org",
  "defaultApprover": "newOrgUser@onetrust.com",
  "defaultLanguageCode": "en",
  "description": "This is a new Org"
}
```

*Response Body:*

```
{
  "externalId": "New_Org_Id",
  "parentExternalId": null,
  "name": "New_Org",
  "defaultApprover": "newOrgUser@onetrust.com",
  "defaultLanguageCode": "en",
  "description": "This is a new Org"
}
```

## Retrieving organization details

The [GET /external/organizations](/onetrust/reference/organizationtreestructureusingget) endpoint can be used to obtain complete details of the organizations in your account.

*Example Request*:

`GET https://trial.onetrust.com/api/access/v1/external/organizations`

*Response Body:*

```
{
  "externalId": null,
  "parentExternalId": null,
  "name": "testuser",
  "defaultApprover": "testuser@onetrust.com",
  "defaultLanguageCode": "en-us",
  "description": null,
  "children": [
    {
      "externalId": null,
      "parentExternalId": null,
      "name": "Org 1",
      "defaultApprover": "testuser@onetrust.com",
      "defaultLanguageCode": "en-us",
      "description": null,
      "children": []
    },
    {
      "externalId": null,
      "parentExternalId": null,
      "name": "Org5",
      "defaultApprover": "testuser@onetrust.com",
      "defaultLanguageCode": "en-us",
      "description": null,
      "children": []
    }
  ]
}
```

## Updating an existing organization

The [PUT /external/organizations](/onetrust/reference/updateorganizationusingput) endpoint can be used to update an existing organization in your account.

In the example below, the update Example Request would update the `name`, `defaultLanguageCode`, and `description` parameters of the organization with the `externalId` "New\_Org\_Id".

*Example Request:*

`PUT https://trial.onetrust.com/api/access/v1/external/organizations/New_Org_Id`

*Request Body:*

```
{
  "name": "New_Org2",
  "defaultLanguageCode": "de",
  "description": "This is the updated new Org"
}
```

*Response Body:*

`null`

## Deleting an existing organization

The [DELETE /external/organizations](/onetrust/reference/deleteorganizationpost) endpoint can be used to delete an existing organization in your account.

*Example Request:*

`DELETE https://trial.onetrust.com/api/access/v1/external/organizations/New_Org_Id?targetExternalId=New_Org_Id3`

*Response Body:*

`null`