Organization management API
The Organization Management API Definition (version v1).
Download the OpenAPI definition (YAML)
Security schemes
BasicAuth: HTTP basic
OAuth2: oauth2
authorizationCode flow, token URL https://localhost:9443/oauth2/token, authorization URL https://localhost:9443/oauth2/authorize
Organization
Retrieve organizations created for this tenant which matches the defined search criteria, if any.
GET /organizations
This API is used to search and retrieve organizations created for this tenant.
Organizations can be filtered by id, name, description, created, lastModified, status, parentId, and meta attributes.
Supported operators: "eq"(equals), "co"(contains), "sw"(starts with), "ew"(ends with), "ge"(greater than or equals), "le"(less than or equals), "gt"(greater than), "lt"(less than)
Multiple attributes can be combined using the "and" operator.
Examples:
- filter=name+eq+ABC Builders
- filter=attributes.Country+eq+Sri Lanka
Scope(Permission) required: internal_organization_view
Parameters
| Name | In | Type | Required | Description |
|---|---|---|---|---|
filter | query | string | Condition to filter the retrieval of records. | |
limit | query | integer (int32) | Maximum number of records to be returned. (Should be greater than 0) | |
after | query | string | Points to the next range of data to be returned. | |
before | query | string | Points to the previous range of data that can be retrieved. | |
recursive | query | boolean | Determines whether a recursive search should happen. If set to true, will include organizations in all levels of the hierarchy; If set to false, includes only organizations in the next level of the hierarchy. Default: |
Responses
| Code | Description | Schema |
|---|---|---|
200 | Successful response | OrganizationsResponse |
400 | Invalid input in the request. | Error |
401 | Authentication information is missing or invalid. | |
403 | Access forbidden. | |
500 | Internal server error. | Error |
501 | Not Implemented. | Error |
Create a new organization.
POST /organizations
This API is used to create the organization defined in the user input.
Scope(Permission) required: internal_organization_create
Request body (required): application/json
This represents the organization to be added.
Schema: OrganizationPOSTRequest
5 properties
| Name | Type | Required | Description |
|---|---|---|---|
name | string | Yes | |
orgHandle | string | ||
description | string | ||
parentId | string | The parent organization id should be the organization where the request is invoked. If a value is not specified it will be resolved internally. | |
attributes | array of Attribute |
Responses
| Code | Description | Schema |
|---|---|---|
201 | Successful response | OrganizationResponse |
400 | Invalid input in the request. | Error |
401 | Authentication information is missing or invalid. | |
403 | Access forbidden. | |
500 | Internal server error. | Error |
Check organization with given name exist among the organizations hierarchy.
POST /organizations/check-name
This API is used to check whether organization with particular name exist or not.
If the organization name is available for use, the response will be "available": true, else it will be "available": false.
Scope(Permission) required: internal_organization_view
Request body (required): application/json
OrganizationNameCheckPOSTRequest object containing the organization name.
Schema: OrganizationNameCheckPOSTRequest
1 property
| Name | Type | Required | Description |
|---|---|---|---|
name | string |
Responses
| Code | Description | Schema |
|---|---|---|
200 | Successful response | OrganizationNameCheckPOSTResponse |
400 | Invalid input in the request. | Error |
401 | Authentication information is missing or invalid. | |
403 | Access forbidden. | |
404 | Requested resource is not found. | Error |
500 | Internal server error. | Error |
Get an existing organization, identified by the organization ID.
GET /organizations/{organization-id}
This API is used to get an existing organization identified by the organization ID.
Scope(Permission) required: internal_organization_view
Parameters
| Name | In | Type | Required | Description |
|---|---|---|---|---|
organization-id | path | string | Yes | ID of the organization. |
includePermissions | query | boolean | Returns the organization details along with permissions assigned for the requested user in this organization. Default: |
Responses
| Code | Description | Schema |
|---|---|---|
200 | Successful response | GetOrganizationResponse |
400 | Invalid input in the request. | Error |
401 | Authentication information is missing or invalid. | |
403 | Access forbidden. | |
404 | Requested resource is not found. | Error |
500 | Internal server error. | Error |
Update an organization by ID.
PUT /organizations/{organization-id}
This API provides the capability to update an organization by its id.
Scope(Permission) required: internal_organization_update
Parameters
| Name | In | Type | Required | Description |
|---|---|---|---|---|
organization-id | path | string | Yes | ID of the organization to be updated. |
Request body (required): application/json
Schema: OrganizationPUTRequest
6 properties
| Name | Type | Required | Description |
|---|---|---|---|
name | string | Yes | |
orgHandle | string | ||
description | string | ||
status | string | Yes | Allowed values: |
version | string | ||
attributes | array of Attribute |
Responses
| Code | Description | Schema |
|---|---|---|
200 | Successful response | OrganizationResponse |
400 | Invalid input in the request. | Error |
401 | Authentication information is missing or invalid. | |
403 | Access forbidden. | |
404 | Requested resource is not found. | Error |
500 | Internal server error. | Error |
Delete an organization by using the organization's ID.
DEL /organizations/{organization-id}
This API provides the capability to delete an organization by giving its ID.
Scope(Permission) required: internal_organization_delete
Parameters
| Name | In | Type | Required | Description |
|---|---|---|---|---|
organization-id | path | string | Yes | ID of the organization to be deleted. |
Responses
| Code | Description | Schema |
|---|---|---|
204 | Successfully deleted | |
400 | Invalid input in the request. | Error |
401 | Authentication information is missing or invalid. | |
403 | Access forbidden. | |
404 | Requested resource is not found. | Error |
500 | Internal server error. | Error |
Patch an organization property by ID. Patch is supported only for key-value pairs.
PATCH /organizations/{organization-id}
This API provides the capability to update an organization property using patch request. Organization patch is supported only for key-value pairs.
Scope(Permission) required: internal_organization_update
Parameters
| Name | In | Type | Required | Description |
|---|---|---|---|---|
organization-id | path | string | Yes | ID of the organization to be patched. |
Request body (required): application/json
Schema: OrganizationPatchRequest
Responses
| Code | Description | Schema |
|---|---|---|
200 | Successful response | OrganizationResponse |
400 | Invalid input in the request. | Error |
401 | Authentication information is missing or invalid. | |
403 | Access forbidden. | |
404 | Requested resource is not found. | Error |
500 | Internal server error. | Error |
Get organization details of the currently accessing organization.
GET /organizations/self
This API retrieves the organization information associated with the currently accessing organization.
Scopes (Permissions) required: internal_organization_view
Responses
| Code | Description | Schema |
|---|---|---|
200 | Successful response | OrganizationResponse |
401 | Authentication information is missing or invalid. | |
403 | Access forbidden. | |
500 | Internal server error. | Error |
Update organization details of the currently accessing organization.
PATCH /organizations/self
This API updates the editable fields of the organization associated with the currently accessing organization. Currently only the organization name and version can be updated using this API.
Scopes (Permissions) required: internal_organization_update
Request body (required): application/json
Partial update payload for the organization.
Schema: OrganizationPatchRequest
Responses
| Code | Description | Schema |
|---|---|---|
200 | Successfully updated organization. | OrganizationResponse |
400 | Invalid input in the request. | Error |
401 | Authentication information is missing or invalid. | |
403 | Access forbidden. | |
500 | Internal server error. | Error |
Organization Metadata
Get metadata of the logged in organization.
GET /organizations/metadata
This API facilitates the retrieval of metadata including discovery attributes of the logged in organization.
Scope(Permission) required: internal_organization_view
Responses
| Code | Description | Schema |
|---|---|---|
200 | Successful response | OrganizationMetadata |
401 | Authentication information is missing or invalid. | |
403 | Access forbidden. | |
500 | Internal server error. | Error |
Organization Meta Attributes
Get meta attributes of organizations with filter capabilities.
GET /organizations/meta-attributes
This API facilitates the retrieval of organization meta attributes which matches the defined search criteria, if any.
Supported operators: "eq"(equals), "co"(contains), "sw"(starts with), "ew"(ends with), "ge"(greater than or equals), "le"(less than or equals), "gt"(greater than), "lt"(less than)
Multiple filters can be combined using the "and" operator.
Example: filter=attributes+eq+Country
Scope(Permission) required: internal_organization_view
Parameters
| Name | In | Type | Required | Description |
|---|---|---|---|---|
filter | query | string | Condition to filter the retrieval of records. | |
limit | query | integer (int32) | Maximum number of records to be returned. (Should be greater than 0) | |
after | query | string | Points to the next range of data to be returned. | |
before | query | string | Points to the previous range of data that can be retrieved. | |
recursive | query | boolean | Determines whether a recursive search should happen. If set to true, will include organizations in all levels of the hierarchy; If set to false, includes only organizations in the next level of the hierarchy. Default: |
Responses
| Code | Description | Schema |
|---|---|---|
200 | Successful response | MetaAttributesResponse |
400 | Invalid input in the request. | Error |
401 | Authentication information is missing or invalid. | |
403 | Access forbidden. | |
500 | Internal server error. | Error |
501 | Not Implemented. | Error |
Schemas
Error
Type: object
4 properties
| Name | Type | Required | Description |
|---|---|---|---|
code | string | Yes | An error code. |
message | string | Yes | An error message. |
description | string | An error description. | |
traceId | string | An error trace identifier. |
OrganizationPOSTRequest
Type: object
5 properties
| Name | Type | Required | Description |
|---|---|---|---|
name | string | Yes | |
orgHandle | string | ||
description | string | ||
parentId | string | The parent organization id should be the organization where the request is invoked. If a value is not specified it will be resolved internally. | |
attributes | array of Attribute |
OrganizationPUTRequest
Type: object
6 properties
| Name | Type | Required | Description |
|---|---|---|---|
name | string | Yes | |
orgHandle | string | ||
description | string | ||
status | string | Yes | Allowed values: |
version | string | ||
attributes | array of Attribute |
OrganizationsResponse
Type: object
2 properties
| Name | Type | Required | Description |
|---|---|---|---|
links | array of Link | ||
organizations | array of BasicOrganizationResponse |
Link
Type: object
2 properties
| Name | Type | Required | Description |
|---|---|---|---|
href | string (uri) | Endpoint that will return the next or previous page of data. | |
rel | string | Describes whether the provided link is to access the next or previous page of data. |
BasicOrganizationResponse
Type: object
8 properties
| Name | Type | Required | Description |
|---|---|---|---|
id | string | Yes | |
name | string | Yes | |
orgHandle | string | Yes | |
status | string | Yes | Allowed values: |
version | string | Yes | |
hasChildren | boolean | ||
ref | string | Yes | |
attributes | array of Attribute |
OrganizationResponse
Type: object
12 properties
| Name | Type | Required | Description |
|---|---|---|---|
id | string | Yes | |
name | string | Yes | |
orgHandle | string | Yes | |
description | string | ||
status | string | Yes | Allowed values: |
version | string | Yes | |
created | string | Yes | |
lastModified | string | Yes | |
type | string | Yes | Allowed values: |
parent | ParentOrganization | ||
hasChildren | boolean | ||
attributes | array of Attribute |
GetOrganizationResponse
Type: object
14 properties
| Name | Type | Required | Description |
|---|---|---|---|
id | string | Yes | |
name | string | Yes | |
orgHandle | string | Yes | |
description | string | ||
status | string | Yes | Allowed values: |
version | string | Yes | |
created | string | Yes | |
lastModified | string | Yes | |
hasChildren | boolean | ||
type | string | Yes | Allowed values: |
parent | ParentOrganization | ||
attributes | array of Attribute | ||
permissions | array of string | ||
ancestorPath | array of object | Ancestors up to the request initiated organization |
MetaAttributesResponse
Type: object
2 properties
| Name | Type | Required | Description |
|---|---|---|---|
links | array of Link | ||
attributes | array of string |
OrganizationPatchRequest
Type: array of OrganizationPatchRequestItem
OrganizationPatchRequestItem
Type: object
A JSONPatch as defined by RFC 6902. Patch operation is supported only for root level attributes of an organization.
3 properties
| Name | Type | Required | Description |
|---|---|---|---|
operation | string | Yes | The operation to be performed. Allowed values: |
path | string | Yes | A JSON-Pointer |
value | string | The value to be used within the operations. |
DiscoveryAttribute
Type: object
2 properties
| Name | Type | Required | Description |
|---|---|---|---|
type | string | Yes | |
values | array of string |
OrganizationMetadata
Type: object
13 properties
| Name | Type | Required | Description |
|---|---|---|---|
id | string | Yes | |
name | string | Yes | |
orgHandle | string | Yes | |
description | string | ||
status | string | Yes | Allowed values: |
version | string | Yes | |
created | string | Yes | |
lastModified | string | Yes | |
type | string | Yes | Allowed values: |
parent | ParentOrganization | ||
attributes | array of Attribute | ||
permissions | array of string | ||
discoveryAttributes | array of DiscoveryAttribute |
Was this page helpful?