Organization
The Organization API provides access to organizational hierarchy
anddata,structureallowingmanagement within the GATE system. This endpoint allows youusers to retrieve information aboutyourtheir organization andanyall associated sub-organizationsorganizations.youThishaveendpointaccessisto,essentialwithforflexibleunderstanding organizational structure, managing multi-tenant applications, and filteringoptionsdatato find specificby organizationalunits.scope.
Base URL: https://gate.zequenze.com/api/v1
Authentication: All endpoints require a Bearer token:
Authorization: Bearer <your-api-token>
Overview
The Organization API isenables designeddevelopers to helpaccess youand navigate andorganizational understandhierarchies within the organizational structure within your GATE environment.system. Organizations in GATE represent hierarchical business units, departments, or divisions that help segment and organize resources, users, and permissions.
This API is particularly usefulvaluable for:
TheKey organizationalConcepts:
Common Use Cases:
Endpoints
GET /organization/
Description: Retrieves a paginated list of organizations that the requestingauthenticated user has access to, including their ownprimary organization and anyall sub-organizations. This endpoint supports filtering by various organizationalorganization attributes and includesprovides paginationcomprehensive fororganization handlingdetails largeincluding organizationalhierarchy structures efficiently.information.
Use Cases:
DisplayPopulateanorganizationorganizationalselectionpickermenus inauserinterface
Full URL Example:
https://gate.zequenze.com/api/v1/organization/?parent=123name=headquarters&is_active=true&limit=20&offset=0
Parameters:
| Parameter | Type | In | Required | Description |
|---|---|---|---|---|
| id | string | query | No | Filter organizations by specific |
| name | string | query | No | Filter organizations by name (supports partial matching) |
| parent | string | query | No | Filter organizations by parent organization |
| limit | integer | query | No | Number of results to return per page (default: |
| offset | integer | query | No | The initial index from which to return |
cURL Example:
curl -X GET "https://gate.zequenze.com/api/v1/organization/?name=engineeringlimit=10&limit=10"is_active=true" \
-H "Authorization: Bearer YOUR_API_TOKEN" \
-H "Content-Type: application/json"
Example Response:
{
"count": 25,
"next": "https://gate.zequenze.com/api/v1/organization/?limit=10&offset=10",
"previous": null,
"results": [
{
"id": "org_12345",1,
"name": "EngineeringGlobal Division"Headquarters",
"short_name": "hq-global",
"is_active": true,
"deleted": false,
"country_code": "US",
"platform": 31,
"description": "Main headquarters managing global operations",
"parent": "org_001",null,
"parent_name"parent_obj": "Technology Department",null,
"description": "Software and hardware engineering teams",
"status": "active",
"level": 2,
"full_path": "Acme Corp > Technology Department > Engineering Division",
"created_at"created": "2024-01-15T10:30:00Z",
"updated_at": "2024-03-22T14:45:30Z",
"member_count": 45,
"sub_organization_count": 3,
"permissions": {
"can_edit": true,
"can_delete": false,
"can_create_sub_orgs": true
}
},
{
"id": "org_12346",2,
"name": "FrontendNorth Engineering"America Division",
"short_name": "na-division",
"is_active": true,
"deleted": false,
"country_code": "US",
"platform": 15,
"description": "North American operations division",
"parent": 1,
"org_12345"parent_obj": {
"id": 1,
"name": "Global Headquarters",
"parent_name"short_name": "Engineeringhq-global",
Division""is_active": true,
"deleted": false,
"country_code": "US",
"platform": 31,
"description": "UserMain interfaceheadquarters andmanaging userglobal experience development"operations",
"status"parent": null,
"created": "active"2024-01-15T10:30:00Z"
},
"level"created": "2024-01-20T14:45:00Z"
},
{
"id": 3,
"full_path"name": "AcmeEuropean Corp > Technology Department > Engineering Division > Frontend Engineering"Division",
"created_at"short_name": "2024-02-01T09:15:00Z"eu-division",
"updated_at"is_active": true,
"deleted": false,
"country_code": "2024-03-20T11:20:15Z"DE",
"member_count"platform": 12,7,
"sub_organization_count"description": 0,"European operations division",
"permissions"parent": 1,
"parent_obj": {
"can_edit"id": 1,
"name": "Global Headquarters",
"short_name": "hq-global",
"is_active": true,
"can_delete"deleted": true,false,
"can_create_sub_orgs"country_code": false"US",
"platform": 31,
"description": "Main headquarters managing global operations",
"parent": null,
"created": "2024-01-15T10:30:00Z"
},
"created": "2024-01-22T09:15:00Z"
}
]
}
Platform Values: The platform field uses bitwise flags that can be combined:
Response Codes:
| Status | Description |
|---|---|
| 200 | Success - Returns |
| 401 | Unauthorized - Invalid or missing authentication token |
| 403 | Forbidden - User lacks permission to |
Common Use Cases
Use Case 1: Building anOrganization Organizational Hierarchy WidgetSelector
Retrieve theall completeaccessible organizational structureorganizations to displaypopulate a dropdown menu for filtering or context switching in amulti-tenant treeapplications.
Example:
curl starting-X fromGET the"https://gate.zequenze.com/api/v1/organization/?is_active=true&limit=50" root\
and-H expanding"Authorization: sub-organizationsBearer asYOUR_API_TOKEN"
needed.
Use Case 2: Department-SpecificDisplaying ReportingOrganizational Hierarchy
FilterFetch organizations and use the parent_obj data byto specificbuild hierarchical tree views showing organizational unitsstructure.
Example:
curl department-specific-X reports,GET using"https://gate.zequenze.com/api/v1/organization/" the\
organization-H ID"Authorization: asBearer aYOUR_API_TOKEN"
filter parameter in other API calls.
Use Case 3: UserRegional AssignmentOrganization InterfaceFiltering
CreateFilter aorganizations dropdownby country or selection interface for assigning usersregion to organizations,display showinglocation-specific onlydata.
Example:
curl the-X currentGET user"https://gate.zequenze.com/api/v1/organization/?country_code=US" has\
permission-H to"Authorization: manage.Bearer YOUR_API_TOKEN"
Use Case 4: Multi-TenantFinding Application SetupSub-organizations
UseRetrieve organizationalall datachild toorganizations implementunder tenanta isolation,specific where eachparent organization representsfor adepartmental separateviews.
Example:
curl business-X unitGET with"https://gate.zequenze.com/api/v1/organization/?parent=1" its\
own-H data"Authorization: space.Bearer YOUR_API_TOKEN"
Use Case 5: OrganizationalOrganization Data SynchronizationSearch
RegularlySearch syncfor organizations by name to help users quickly find specific organizational structureunits.
Example:
curl systems-X likeGET HR"https://gate.zequenze.com/api/v1/organization/?name=division" platforms\
or-H directory"Authorization: servicesBearer toYOUR_API_TOKEN"
maintain consistency across business applications.
Best Practices
-
Implement Pagination:Pagination: Always usetheappropriatelimitandoffsetparameters for large organizational structures toprevent performance issues and timeout errors
permissionspossible, full_pathparent_obj field parentis_active=true member_countcurrent