Manage Organization Layout
Each entity or item within the organization model can be defined and changed individually through their related entity endpoint. To learn all available entity endpoints, see the endpoints for entities in the API reference.
Some entities can be managed through their related api endpoint using a declarative interface. To learn which entities are available in the declarative interface, see the endpoints for layout in the API reference.
Organization Layout API Endpoint
To manage every type of entity at once for the whole organization, use the following API endpoint:
/api/layout/organization
Note
Unlike other entities such as users, workspaces, Data Sources, and etc, that you can manage individually through the /api/entities
endpoints, when you make a call to the /api/entities/organization
endpoint, you only return the definition of the organization related to the hostname. When you call /api/layout/organization
, you return all of the entities within the organization that is related to the hostname.
The following information is not returned when you call /api/layout/organization
:
- The secret token for the organization
- Data Source passwords
You can PUT all entities available to the organization with the following restrictions:
- The organization secret token must be specified before you can PUT back a retrieved document.
- The password for a Data Source must be specified or the username must be removed.
Examples
To see the entire API specification, see the API Reference.
First, be aware of your application endpoint. For Helm Chart deployment, it represents the https://
In the following examples the endpoint is substituted by $ENDPOINT variable;
Retrieve the Organization Layout
The following example returns all the entities associated with the organization that is specified in the hostname of the call and saves the output to organization-layout.json:
curl -H "Authorization: Bearer YWRtaW46Ym9vdHN0cmFwOmFkbWluMTIz" \
$ENDPOINT/api/layout/organization > organization-layout.json
Organization Layout Document Structure
The following example shows the contents of the output that is returned when you call the /api/layout/organization
endpoint:
Notes
- The values for
oauthClientId
andoauthClientSecret
are replaced by dummy values. - To avoid a large example, all the components are left empty. You can view the component definitions under their particular section in the layout endpoints section of the API reference.
{
"dataSources": [],
"organization": {
"hostname": "localhost",
"name": "Good Organization",
"id": "org1",
"oauthClientId": "<clinet-id>",
"oauthClientSecret": "<secret>",
"oauthIssuerLocation": "https://oidc"
},
"users": [],
"userGroups": [],
"workspaceDataFilters": [],
"workspaces": []
}
Restore or Modify the Organization Layout
The following example uses the saved output from a call to the /api/layout/organization
endpoint to restore the organization to the state defined within the file:
Note
The organization secret token must be specified. If the Data Source password is not specified, the username must be removed. The Data Source will be unusable until the credentials are specified.
curl -H "Authorization: Bearer YWRtaW46Ym9vdHN0cmFwOmFkbWluMTIz" \
-H "Content-Type: application/json" \
-X PUT \
$ENDPOINT/api/layout/organization -d @organization-layout.json