Skip to main content

Organization

The Organization API provides access to organizational hierarchy anddata, structureallowing management within the GATE system. This endpoint allows youusers to retrieve information about yourtheir organization and anyall associated sub-organizationsorganizations. youThis haveendpoint accessis to,essential withfor flexibleunderstanding organizational structure, managing multi-tenant applications, and filtering optionsdata to find specificby organizational units.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:

    Building organizational tree views in applications Implementing role-based access controls based on organizational membership Creating reports that need to be filtered by organizational units Synchronizing organizational data with external systems Managingfor multi-tenant applications where eachusers need to understand their organizational context and access data scoped to their organization representsand aits different client subsidiaries.

    TheKey organizationalConcepts:

    hierarchy
    allows forHierarchical nestedStructure: structures where organizationsOrganizations can have parent-child relationships, enablingcreating complexmulti-level businessorganizational structurestrees to Platform Support: Organizations can be accuratelyassociated represented.with Whendifferent youplatforms query(mobile, thisweb, endpoint,desktop, you'lletc.) receive informationActive aboutStatus: yourOrganizations owncan organizationbe marked as active or inactive, affecting visibility and anyaccess sub- Soft Deletion: Deleted organizations youremain have permission to view, respectingin the securitysystem boundariesbut definedare marked as deleted

    Common Use Cases:

      Building organizational selection dropdowns in yourapplications GATEFiltering configuration.data by organizational scope Displaying organizational hierarchies in dashboards Managing multi-tenant access controls Generating organization-specific reports

      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:

      • DisplayPopulate anorganization organizationalselection pickermenus in a user interface
      Generate reports filtered by specific organizational units Sync organizational data with external HR or ERP systemsinterfaces Build organizational charts orand hierarchy visualizations Filter dataother basedAPI oncalls organizationalby membershiporganization scope Display user's accessible organizations in multi-tenant applications

      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 ID. Useful when you need to verify existence or get details of a particular organizationID
      name string query No Filter organizations by name (supports partial matching). Case-insensitive search across organization names
      parent string query No Filter organizations by parent organization ID. Use this to get direct children of a specific organizationID
      limit integer query No Number of results to return per page (default: 20, max: 100). Controls pagination page sizevaries)
      offset integer query No The initial index from which to return results.results Used (for pagination to skip previously retrieved recordspagination)

      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:

        1: Mobile App 2: Web Application 4: Desktop Application 8: API Access 16: IoT Devices 32: Third-party Integrations 64: Administrative Tools

        Response Codes:

        Status Description
        200 Success - Returns thepaginated organization list of accessible organizations
        401 Unauthorized - Invalid or missing authentication token
        403 Forbidden - User lacks permission to viewaccess organizational dataorganizations
        404500 NotInternal FoundServer Error - SpecifiedServer-side parenterror organization does not exist or is not accessible
        422 Unprocessable Entity - Invalid query parameters providedoccurred

        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.

        view

        Example:

        component,
        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.

        to

        Example:

        generate
        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.

        the

        Example:

        organizations
        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.

        customer

        Example:

        or
        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.

        with

        Example:

        external
        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 use theappropriate limit and offset parameters for large organizational structures to prevent performance issues and timeout errors
        Cache Organizational Data: Organization structures change infrequently, so implement appropriate caching strategies to reduce API calls and improve applicationmaintain performance HandleCaching: PermissionsCache Properly:organization Alwaysdata checklocally thewhen permissionspossible, objectas inorganizational responsesstructures beforedon't enablingchange edit, delete, or create operations in your user interfacefrequently Hierarchy Navigation: Use Fullthe Path for Display: The full_pathparent_obj field providesto abuild completeefficient organizationaltree hierarchystructures that'swithout idealadditional forAPI user-friendly displays and breadcrumb navigationcalls Active Filtering: Filter Strategically: Use theby parentis_active=true parameterin user-facing interfaces unless you specifically need to buildshow hierarchicalinactive interfaces incrementally rather than loading the entire organizational tree at onceorganizations MonitorPlatform MemberFiltering: Counts:Decode Useplatform bitwise values to show relevant organizations based on the member_countcurrent fieldapplication to understand organizational size and potentially adjust UI layouts or implement additional pagination for member listscontext Error Handling:Handling: Implement robustproper error handling for 403cases responses, aswhere organizational access permissions canmay change,change affecting whichSecurity: organizationsNever aexpose userorganization canIDs or structure information to users who shouldn't have access to that level of organizational data