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:
Creating a new organization
The POST /external/organizations 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": "[email protected]",
"defaultLanguageCode": "en",
"description": "This is a new Org"
}
Response Body:
{
"externalId": "New_Org_Id",
"parentExternalId": null,
"name": "New_Org",
"defaultApprover": "[email protected]",
"defaultLanguageCode": "en",
"description": "This is a new Org"
}
Retrieving organization details
The GET /external/organizations 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": "[email protected]",
"defaultLanguageCode": "en-us",
"description": null,
"children": [
{
"externalId": null,
"parentExternalId": null,
"name": "Org 1",
"defaultApprover": "[email protected]",
"defaultLanguageCode": "en-us",
"description": null,
"children": []
},
{
"externalId": null,
"parentExternalId": null,
"name": "Org5",
"defaultApprover": "[email protected]",
"defaultLanguageCode": "en-us",
"description": null,
"children": []
}
]
}
Updating an existing organization
The PUT /external/organizations 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 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