Skip to main content

Me

The /meMe API provides endpoints for retrieving information about the currently authenticated user and their associated organization. This is essential for user profile management, organization endpoint provides access to the current user's organizational context within the GATE API system. This endpoint allows applications to retrieve essential organization details for the authenticated user, enabling proper scoping of resourcescontext, and permissionsbuilding basedpersonalized onapplication organizational membership.experiences.

Base URL: https://gate.zequenze.com/api/v1

Authentication: All endpoints require a Bearer token:

Authorization: Bearer <your-api-token>

Overview

The /meMe API category focusesis designed to provide authenticated users with access to their own profile information and organizational context. This is typically one of the first API calls made after authentication to establish the user's identity and permissions within the system.

Common use cases include:

    Displaying user profile information in application headers Determining organizational context for data filtering Validating user permissions and access levels Personalizing the user interface based on user-centricorganization informationsettings retrieval, specifically

    Key providingconcepts:

    access
      All endpoints return data specific to the authenticated user's organizationaltoken context.Organization Thisinformation endpointincludes ismetadata, fundamentalsettings, for applications that need to understand theand user's organizational scope before making other API calls.

      Understanding a user's organization is critical for:

        Resource Scoping: Ensuring users only see resources they have permission to accessrole within theirthe organization This Multi-tenantAPI Applications:is Properly segregating dataread-only and functionality basedfocused on organizationalretrieving boundariescurrent User Context: Displaying relevant organizationalstate information in user interfaces Permission Management: Making authorization decisions based on organizational membership and roles

        This endpoint is typically called early in an application's initialization process to establish the user's organizational context, which then informs subsequent API interactions and data filtering.


        Endpoints

        GET /me/organization/

        Description: Retrieves comprehensive information about the organization informationassociated forwith the currently authenticated user. This endpoint returnsprovides detailsessential aboutorganizational thecontext including organization the user belongs to, including organizational metadata, settings, anddetails, the user's role withinand thatpermissions, organization.and Essential for establishingrelevant organizational context in multi-tenant applications.settings.

        Use Cases:

        • Initialize application with user's organizational context
        • Display organization namebranding and detailsinformation in userthe interface headersUI
        • Determine organizationaluser's permissions and featurerole availabilitywithin the organization
        • ValidateFilter user'sdata and features based on organizational membership before accessing protected resourcessettings

        Full URL Example:

        https://gate.zequenze.com/api/v1/me/organization/
        

        Parameters:

        This endpoint does not accept queryany parameters. It returns organization information based on the authenticated user's token.

        cURL Example:

        curl -X GET "https://gate.zequenze.com/api/v1/me/organization/" \
          -H "Authorization: Bearer YOUR_API_TOKEN" \
          -H "Content-Type: application/json"
        

        Example Response:

        {
          "id": 12345,42,
          "name": "Acme Corporation",
          "slug": "acme-corp",
          "display_name": "Acme Corporation",
          "description": "Leading provider of enterpriseinnovative solutions",
          "status"logo_url": "active"https://gate.zequenze.com/media/logos/acme-corp.png",
          "subscription_tier"website": "enterprise"https://www.acmecorp.com",
          "created_at": "2023-01-15T09:05-15T08:30:00Z",
          "updated_at": "2024-02-20T14:45:01-10T14:22:00Z",
          "settings": {
            "timezone": "America/New_York",
            "date_format": "MM/DD/YYYY",
            "currency": "USD",
            "allow_api_access"language": true,"en"
          },
          "max_users"subscription": 500{
            }"plan": "professional",
            "status": "active",
            "expires_at": "2024-12-15T23:59:59Z",
            "features": [
              "advanced_reporting"advanced_analytics",
              "api_access",
              "sso_integration",
            "custom_branding"custom_integrations"
            ]
          },
          "user_role": {
            "name"role": "admin",
            "title": "System Administrator",
            "permissions": [
              "manage_users",
              "view_reports"manage_organization",
              "view_analytics",
              "api_access"
            ],
            "manage_settings"
            ]
          },
          "billing": {
            "plan"joined_at": "Enterprise Pro",
            "status": "active",
            "next_billing_date": "2024-03-01T00:2023-06-01T09:00:00Z"
          },
          "contact"statistics": {
            "email"total_users": "admin@acme-corp.com",25,
            "phone"active_users": "+1-555-0123",18,
            "address"total_projects": {12,
            "street"storage_used_gb": "123 Business Ave",15.7,
            "city"storage_limit_gb": "New York",
              "state": "NY",
              "postal_code": "10001",
              "country": "US"
            }100.0
          }
        }
        

        Response Codes:

        Status Description
        200 Success - Returns the user's organization information
        401 Unauthorized - Invalid, expired,Invalid or missing API token
        403 Forbidden - TokenUser isdoes validnot but lackshave permission to accessview organization datadetails
        429404 TooNot Many RequestsFound - RateUser limitis exceeded
        not associated with 500any Internal Server Error - Server encountered an error processing the requestorganization

        Common Use Cases

        Use Case 1: Application Initialization

        When a user logs into your application, call this endpoint to retrieve their organizational context. Use the returnedorganization dataname, logo, and settings to configurepersonalize the user interface, set appropriate permissions,interface and filterconfigure availableapplication featuresdefaults basedlike on the organization's subscription tiertimezone and enableddate features.formats.

        Use Case 2: Multi-tenant Data Filtering

        Before displaying resources like devices, users, or reports, use the organization ID from this endpoint to ensure you're only requesting and displaying data that belongs to the user's organization, maintaining proper data isolation.

        Use Case 3:Permission-Based Feature Availability CheckingAccess

        Check the featuresuser_role.permissions array and subscription_tier to dynamically enableshow or disablehide functionalityfeatures in your application. For example, only showdisplay the user management section if the user has the manage_users permission.

        Use Case 3: Subscription Feature Gating

        Use the subscription.features array to determine which advanced reportingfeatures optionsare ifavailable "advanced_reporting" is present into the featuresorganization. list.This allows you to implement feature gating based on the organization's subscription plan.

        Use Case 4: UserResource InterfaceUsage CustomizationMonitoring

        UseDisplay thestorage usage information and other statistics to help administrators monitor their organization's name,resource display_name,consumption and settingsplan likefor timezoneupgrades andwhen date_formatapproaching to customize the user experience, showing data in the organization's preferred formats and branding.

        Use Case 5: Permission Validation

        Examine the user_role.permissions array to determine what actions the current user can perform within their organization, enabling proper authorization checks before allowing sensitive operations.limits.


        Best Practices

        • Cache Organizationorganization Datadata: Since organizational information changes infrequently, consider caching thethis responsedata locally for a reasonable period (e.g., 1 hour) to reduce API calls and improve application performance.

        • Handle Permissionmissing Changesorganizations gracefully: OrganizationSome settingsusers andmight usernot rolesbe canassociated change.with Implementan properorganization erroryet, handlingso implement appropriate fallbacks for 403404 responses and consider refreshing organization data when permission-related errors occur.

        • ValidateRespect Featurepermission Accessboundaries: Always check both the organization's available features and the user's role permissions before enablingdisplaying functionality.administrative Anfeatures organizationor mightsensitive have a feature available, but the specific user might not have permission to use it.

          information
        • TimeMonitor Zonesubscription Handlingstatus: Regularly check the subscription status and provide appropriate warnings when approaching expiration

        Use timezone information: Apply the organization's timezone setting tofor display alldisplaying dates and times inconsistently theacross user'syour expected format. This is especially important for scheduling, logging, and reporting features. application

        GracefulImplement Degradationproper error handling: IfHandle theauthentication endpointerrors isgracefully temporarilyand unavailable,redirect ensureusers yourto application can still function with cached or default organizational data, but clearly indicatere-authenticate when livereceiving data401 isn't available.

        Security Considerations: Never expose sensitive organization data (like billing information) to unauthorized users, and always validate that the requesting user has permission to view organizational details before displaying them in your UI.

        responses