Skip to main content

Me

The Me API provides endpoints for retrieving information about the currently authenticated user and their associated organization. This is essential for user profile management, organization context, and building personalized application 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 is 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 organization settings

Key concepts:

  • All endpoints return data specific to the authenticated user's token
  • Organization information includes metadata, settings, and user's role within the organization
  • This API is read-only and focused on retrieving current state information

Endpoints

GET /me/organization/

Description: Retrieves comprehensive information about the organization associated with the currently authenticated user. This endpoint provides essential organizational context including organization details, the user's role and permissions, and relevant organizational settings.

Use Cases:

  • Initialize application with user's organizational context
  • Display organization branding and information in the UI
  • Determine user's permissions and role within the organization
  • Filter data and features based on organizational settings

Full URL Example:

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

Parameters: This endpoint does not accept any parameters.

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": 42,
  "name": "Acme Corporation",
  "slug": "acme-corp",
  "description": "Leading provider of innovative solutions",
  "logo_url": "https://gate.zequenze.com/media/logos/acme-corp.png",
  "website": "https://www.acmecorp.com",
  "created_at": "2023-05-15T08:30:00Z",
  "updated_at": "2024-01-10T14:22:00Z",
  "settings": {
    "timezone": "America/New_York",
    "date_format": "MM/DD/YYYY",
    "currency": "USD",
    "language": "en"
  },
  "subscription": {
    "plan": "professional",
    "status": "active",
    "expires_at": "2024-12-15T23:59:59Z",
    "features": [
      "advanced_analytics",
      "api_access",
      "custom_integrations"
    ]
  },
  "user_role": {
    "role": "admin",
    "title": "System Administrator",
    "permissions": [
      "manage_users",
      "manage_organization",
      "view_analytics",
      "api_access"
    ],
    "joined_at": "2023-06-01T09:00:00Z"
  },
  "statistics": {
    "total_users": 25,
    "active_users": 18,
    "total_projects": 12,
    "storage_used_gb": 15.7,
    "storage_limit_gb": 100.0
  }
}

Response Codes:

Status Description
200 Success - Returns the user's organization information
401 Unauthorized - Invalid or missing API token
403 Forbidden - User does not have permission to view organization details
404 Not Found - User is not associated with any organization

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 organization name, logo, and settings to personalize the user interface and configure application defaults like timezone and date formats.

Use Case 2: Permission-Based Feature Access

Check the user_role.permissions array to dynamically show or hide features in your application. For example, only display 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 features are available to the organization. This allows you to implement feature gating based on the organization's subscription plan.

Use Case 4: Resource Usage Monitoring

Display storage usage information and other statistics to help administrators monitor their organization's resource consumption and plan for upgrades when approaching limits.


Best Practices

  • Cache organization data: Since organizational information changes infrequently, consider caching this data locally for a reasonable period (e.g., 1 hour) to reduce API calls
  • Handle missing organizations gracefully: Some users might not be associated with an organization yet, so implement appropriate fallbacks for 404 responses
  • Respect permission boundaries: Always check the user's permissions before displaying administrative features or sensitive information
  • Monitor subscription status: Regularly check the subscription status and provide appropriate warnings when approaching expiration
  • Use timezone information: Apply the organization's timezone setting for displaying dates and times consistently across your application
  • Implement proper error handling: Handle authentication errors gracefully and redirect users to re-authenticate when receiving 401 responses