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, organizationendpoint 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, andpermissionsbuildingbasedpersonalizedonapplicationorganizational membership.experiences.
Base URL: https://gate.zequenze.com/api/v1
Authentication: All endpoints require a Bearer token:
Authorization: Bearer <your-api-token>
Overview
The Me API category /mefocusesis 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:
Key providingconcepts:
Understanding a user's organization is critical for:
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 anddetailsinformation inusertheinterface headersUI - Determine
organizationaluser's permissions andfeatureroleavailabilitywithin the organization ValidateFilteruser'sdata and features based on organizationalmembership 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 - |
| 403 | Forbidden - |
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 arrayfeaturesuser_role.permissions and to dynamically subscription_tierenableshow 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 upgrades timezoneandwhen approaching date_formatto 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
OrganizationorganizationDatadata: Since organizational information changes infrequently, consider cachingthethisresponsedata locally for a reasonable period (e.g., 1 hour) to reduce API callsand improve application performance. -
Handle
PermissionmissingChangesorganizations gracefully:OrganizationSomesettingsusersandmightusernotrolesbecanassociatedchange.withImplementanproperorganizationerroryet,handlingso implement appropriate fallbacks for403404 responsesand consider refreshing organization data when permission-related errors occur. -
ValidateRespectFeaturepermissionAccessboundaries: Always checkboth the organization's available features andthe user'srolepermissions beforeenablingdisplayingfunctionality.administrativeAnfeaturesorganizationormightsensitivehave a feature available, but the specific user might not have permission to use it.information -
TimeMonitorZonesubscriptionHandlingstatus: Regularly check the subscription status and provide appropriate warnings when approaching expiration
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.