Me
RetrieveTheinformation/meaboutorganization endpoint provides access to therequestingcurrent user'sorganization.organizational context within the GATE API system. This endpoint allows applications to retrieve essential organization details for the authenticated user, enabling proper scoping of resources and permissions based on organizational membership.
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 focuses on user-centric information retrieval, specifically providing access to the authenticated user's organizational context. This endpoint is fundamental for applications that need to understand the user's organizational scope before making other API calls.
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 organization information for the currently authenticated user,user. This endpoint returns details about the organization the user belongs to, including organizationorganizational details,metadata, settings, and the user's role within thethat organization. Essential for establishing organizational context in multi-tenant applications.
Use Cases:
Full URL Example:
https://gate.zequenze.com/api/v1/me/organization/
Parameters:
This endpoint does not accept anyquery parameters. It returns organization information based on the authenticated user's token.
ExamplecURL Request:Example:
curl -X GET "https://gate.zequenze.com/api/v1/me/organization/" \
-H "Authorization: Bearer <your-api-token>YOUR_API_TOKEN" \
-H "Content-Type: application/json"
Example Response:
{
"id": "org_12345",12345,
"name": "Acme Corporation",
"slug": "acme-corp",
"display_name": "Acme Corp"Corporation",
"description": "TechnologyLeading solutionsprovider provider"of enterprise solutions",
"domain"status": "acme.com"active",
"subscription_tier": "enterprise",
"created_at": "2024-2023-01-15T10:15T09:30:00Z",
"updated_at": "2024-03-02-20T14:45:00Z",
"settings": {
"timezone": "UTC"America/New_York",
"locale"date_format": "en-US"MM/DD/YYYY",
"currency": "USD",
"allow_api_access": true,
"max_users": 500
},
"features": {[
"advanced_reporting",
"api_access": true,,
"advanced_reporting":sso_integration",
true"custom_branding"
}
}],
"user_role": {
"role"name": "admin"Administrator",
"permissions": [
"read:organization"manage_users",
"write:organization"view_reports",
"manage:users"
]api_access",
"joined_at":manage_settings"
"2024-01-15T10:30:00Z"]
},
"billing": {
"plan": "enterprise"Enterprise Pro",
"status": "active",
"next_billing_date": "2024-04-15T00:03-01T00:00:00Z"
},
"contact": {
"email": "admin@acme-corp.com",
"phone": "+1-555-0123",
"address": {
"street": "123 Business Ave",
"city": "New York",
"state": "NY",
"postal_code": "10001",
"country": "US"
}
}
}
Response Status Codes:
| Status | Description |
|---|---|
| 200 | |
| 401 | |
| 403 | |
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 returned data to configure the user interface, set appropriate permissions, and filter available features based on the organization's subscription tier and enabled features.
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: Feature Availability Checking
Check the features array and subscription_tier to dynamically enable or disable functionality in your application. For example, only show advanced reporting options if "advanced_reporting" is present in the features list.
Use Case 4: User Interface Customization
Use the organization's name, display_name, and settings like timezone and date_format 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.
Best Practices
-
TokenCacheSecurityOrganization Data:AlwaysSincestoreorganizationalAPI tokens securely and never expose them in client-side code
ErrorHandle HandlingPermission Changes: Organization settings and user roles can change. Implement proper error handling for cases403 whereresponses usersand consider refreshing organization data when permission-related errors occur.
Validate Feature Access: Always check both the organization's available features and the user's role permissions before enabling functionality. An organization might have a feature available, but the specific user might not behave associatedpermission withto anuse organizationit.
RateTime LimitingZone Handling: RespectUse APIthe rateorganization's limitstimezone setting to display all dates and times in the user's expected format. This is especially important for scheduling, logging, and reporting features.
Graceful Degradation: If the endpoint is temporarily unavailable, ensure your application can still function with cached or default organizational data, but clearly indicate when makinglive frequentdata requestsisn'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.