Skip to main content

User

ManageThe User API provides comprehensive user accountsmanagement andfunctionality including AAA (Authentication, Authorization, and Accounting) profile information. These endpoints enable you to create, retrieve, update, and delete users, with support for both ID-based and username-based operations for flexible integration scenarios.

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

Authentication: All endpoints require a Bearer token:

Authorization: Bearer <your-api-token>

Overview

The User API category is designed for complete user lifecycle management within the GATE system. It provides dual access patterns - both ID-based and username-based operations - making it versatile for different integration approaches. Whether you're building a user management interface, synchronizing user data from external systems, or implementing automated user provisioning, these endpoints provide the necessary functionality.

Key Features:

    Complete CRUD Operations: Create, read, update, and delete users with full profile information Flexible Access Patterns: Access users by either numeric ID or username string AAA Profile Integration: Includes Authentication, Authorization, and Accounting profile data Organization Filtering: Support for multi-tenant scenarios with organization-based user management Pagination Support: Efficient handling of large user datasets with limit/offset pagination

    Common Integration Scenarios:

      User directory synchronization from LDAP/Active Directory Self-service user management portals Automated user provisioning for new employee onboarding Bulk user operations and maintenance tasks Integration with external authentication systems

      Endpoints

      GET /user/

      Description: Retrieve a paginated list of users with optionalcomprehensive filtering byoptions. ID,This username,endpoint is ideal for building user directory listings, implementing search functionality, or organization.performing bulk operations across user datasets.

      Use Cases:

        Display all users in an organization for administrative purposes Search for specific users by username or organization Export user data for reporting or compliance purposes Implement user selection interfaces in other applications

        Full URL Example:

        https://gate.zequenze.com/api/v1/user/?organization=engineering&limit=25&offset=0
        

        Parameters:

        Parameter Type In Required Description
        id string query No Filter users by specific user ID
        username string query No Filter users by username (supports partial matching)
        organization string query No Filter byusers belonging to a specific organization
        limit integer query No Number of results to return per page (default: 20, max: 100)
        offset integer query No The initial index from which to return theresults resultsfor pagination

        ExamplecURL Request:Example:

        curl -X GET "https://gate.zequenze.com/api/v1/user/?organization=acmeengineering&limit=20&offset=025" \
          -H "Authorization: Bearer YOUR_API_TOKEN" \
          -H "Content-Type: application/json"
        

        Example Response:

        {
          "count": 45,156,
          "next": "https://gate.zequenze.com/api/v1/user/?limit=2025&offset=20"25&organization=engineering",
          "previous": null,
          "results": [
            {
              "id": "12345",42,
              "username": "john.doe"smith",
              "email": "john.doe@acme.smith@company.com",
              "organization": "acme",
              "profile": {
              "first_name": "John",
              "last_name": "Doe"Smith",
              "organization": "engineering",
              "is_active": true,
              "last_login": "2024-01-15T14:22:30Z",
              "date_joined": "2023-08-12T09:15:00Z",
              "groups": ["developers", "vpn_users"],
              "aaa_profile": {
                "role": "admin"user",
                "created_at"department": "2024-01-15T10:30:00Z"Software Engineering",
                "manager": "jane.doe",
                "access_level": "standard"
              }
            }
          ]
        }
        

        Response Codes:

        Status Description
        200 Success - Returns paginated list of users
        401 Unauthorized - Invalid or missing authentication token
        403 Forbidden - Insufficient permissions to list users

        POST /user/

        Description: Create a new user accountwith withcomplete profile information including AAA profilesettings. information.This endpoint is essential for user onboarding processes, automated provisioning systems, and administrative user creation workflows.

        Parameters:Use Cases:

        • Automated employee Parameteronboarding Typefrom InHR Requiredsystems Description
        • Self-registration
        portals for external users dataBulk objectuser bodycreation Yesfrom UserCSV dataimports objectAPI-driven user provisioning for partner organizations

        ExampleFull Request:URL Example:

        POST https://gate.zequenze.com/api/v1/user/
        Content-Type: application/json
        
        {
          "username": "jane.smith",
          "email": "jane.smith@acme.com",
          "password": "secure_password123",
          "organization": "acme",
          "profile": {
            "first_name": "Jane",
            "last_name": "Smith",
            "role": "user"
          }
        }
        

        Example Response:

        {
          "id": "67890",
          "username": "jane.smith",
          "email": "jane.smith@acme.com",
          "organization": "acme",
          "profile": {
            "first_name": "Jane",
            "last_name": "Smith",
            "role": "user",
            "created_at": "2024-01-20T14:22:00Z"
          }
        }
        
        Status Description 201 Created 400 Bad Request 401 Unauthorized

        GET /user/username/{username}/

        Retrieve a specific user by their username.

        Example Request:

        GET /api/v1/user/username/john.doe/
        

        Example Response:

        {
          "id": "12345",
          "username": "john.doe",
          "email": "john.doe@acme.com",
          "organization": "acme",
          "profile": {
            "first_name": "John",
            "last_name": "Doe",
            "role": "admin",
            "created_at": "2024-01-15T10:30:00Z",
            "last_login": "2024-01-20T09:15:00Z"
          }
        }
        
        Status Description 200 Success 404 User not found 401 Unauthorized

        PUT /user/username/{username}/

        Update a user's complete information by username.

        Parameters:

        Parameter Type In Required Description
        data object body Yes Complete user dataobject objectwith profile and AAA information

        ExamplecURL Request:Example:

        PUTcurl -X POST "https://gate.zequenze.com/api/v1/user/username/john.doe/" \
          -H "Authorization: Bearer YOUR_API_TOKEN" \
          -H "Content-Type: application/jsonjson" \
          -d '{
            "username": "john.doe"sarah.johnson",
            "email": "john.doe@newcompany.sarah.johnson@company.com",
            "first_name": "Sarah",
            "last_name": "Johnson",
            "organization": "newcompany"marketing",
            "profile"password": "SecureP@ssw0rd!",
            "is_active": true,
            "groups": ["marketing_team", "vpn_users"],
            "aaa_profile": {
            "first_name": "John",
            "last_name": "Doe",
              "role": "user",
              "department": "Digital Marketing",
              "manager": "mike.wilson",
              "access_level": "standard"
            }
          }'
        

        Example Response:

        {
          "id": 157,
          "12345"username": "sarah.johnson",
          "email": "sarah.johnson@company.com",
          "first_name": "Sarah",
          "last_name": "Johnson",
          "organization": "marketing",
          "is_active": true,
          "last_login": null,
          "date_joined": "2024-01-16T10:30:45Z",
          "groups": ["marketing_team", "vpn_users"],
          "aaa_profile": {
            "role": "user",
            "department": "Digital Marketing",
            "manager": "mike.wilson",
            "access_level": "standard"
          }
        }
        

        Response Codes:

        Status Description 201 Created - User successfully created 400 Bad Request - Invalid user data or validation errors 401 Unauthorized - Invalid or missing authentication token 403 Forbidden - Insufficient permissions to create users 409 Conflict - Username or email already exists

        GET /user/username/{username}/

        Description: Retrieve detailed information for a specific user identified by their username. This endpoint is particularly useful when integrating with systems that primarily work with usernames rather than numeric IDs.

        Use Cases:

          User profile lookups in authentication flows Username-based user verification processes Profile display in applications using username as primary identifier Integration with external systems that reference users by username

          Full URL Example:

          https://gate.zequenze.com/api/v1/user/username/john.smith/
          

          cURL Example:

          curl -X GET "https://gate.zequenze.com/api/v1/user/username/john.smith/" \
            -H "Authorization: Bearer YOUR_API_TOKEN" \
            -H "Content-Type: application/json"
          

          Example Response:

          {
            "id": 42,
            "username": "john.doe"smith",
            "email": "john.doe@newcompany.smith@company.com",
            "organization": "newcompany",
            "profile": {
            "first_name": "John",
            "last_name": "Doe"Smith",
            "organization": "engineering",
            "is_active": true,
            "last_login": "2024-01-15T14:22:30Z",
            "date_joined": "2023-08-12T09:15:00Z",
            "groups": ["developers", "vpn_users", "senior_staff"],
            "aaa_profile": {
              "role": "manager"senior_developer",
              "updated_at"department": "2024-01-20T16:45:00Z"Software Engineering",
              "manager": "jane.doe",
              "access_level": "elevated",
              "security_clearance": "confidential"
            }
          }
          

          Response Codes:

          Status Description
          200 Success
          - Returns 404user User not founddetails 401 Unauthorized - Invalid or missing authentication token 403 Forbidden - Insufficient permissions to view user 404 Not Found - Username does not exist

          PATCHPUT /user/username/{username}/

          PartiallyDescription: Completely update a user's profile information byusing username.their username as the identifier. This operation replaces the entire user record with the provided data, making it suitable for comprehensive profile updates.

          Parameters:Use Cases:

          • Complete profile Parametersynchronization Typefrom Inexternal RequiredHR Descriptionsystems
          • Administrative
          profile overhauls Migration data object body Yes Partial useror data objectcorrection operations Bulk profile updates via automated scripts

          ExampleFull Request:URL Example:

          PATCH https://gate.zequenze.com/api/v1/user/username/john.doe/smith/
          

          cURL Example:

          curl -X PUT "https://gate.zequenze.com/api/v1/user/username/john.smith/" \
            -H "Authorization: Bearer YOUR_API_TOKEN" \
            -H "Content-Type: application/jsonjson" \
            -d '{
              "profile"username": "john.smith",
              "email": "j.smith@company.com",
              "first_name": "Jonathan",
              "last_name": "Smith",
              "organization": "engineering",
              "is_active": true,
              "groups": ["developers", "vpn_users", "team_leads"],
              "aaa_profile": {
                "role": "senior_admin"team_lead",
                "department": "Software Engineering",
                "manager": "jane.doe",
                "access_level": "elevated"
              }
            }'
          

          ExampleResponse Response:Codes:

          {
            "id": "12345",
            "username": "john.doe",
            "email": "john.doe@acme.com",
            "organization": "acme",
            "profile": {
              "first_name": "John",
              "last_name": "Doe",
              "role": "senior_admin",
              "updated_at": "2024-01-20T17:30:00Z"
            }
          }
          
          Status Description
          200 Success - User successfully updated
          404400 UserBad notRequest found- Invalid user data or validation errors
          401 Unauthorized - Invalid or missing authentication token
          403 Forbidden - Insufficient permissions to update user 404 Not Found - Username does not exist

          PATCH /user/username/{username}/

          Description: Partially update specific fields of a user's profile using their username. This endpoint allows you to modify only the fields you specify while leaving other user data unchanged, perfect for targeted updates.

          Use Cases:

            Update specific profile fields like email or department Change user status (activate/deactivate) without affecting other data Modify group memberships or access levels Implement granular profile editing interfaces

            Full URL Example:

            https://gate.zequenze.com/api/v1/user/username/john.smith/
            

            cURL Example:

            curl -X PATCH "https://gate.zequenze.com/api/v1/user/username/john.smith/" \
              -H "Authorization: Bearer YOUR_API_TOKEN" \
              -H "Content-Type: application/json" \
              -d '{
                "email": "john.smith.new@company.com",
                "aaa_profile": {
                  "access_level": "admin"
                }
              }'
            

            Response Codes:

            Status Description 200 Success - User partially updated 400 Bad Request - Invalid field data or validation errors 401 Unauthorized - Invalid or missing authentication token 403 Forbidden - Insufficient permissions to update user 404 Not Found - Username does not exist

            DELETE /user/username/{username}/

            DeleteDescription: Permanently delete a user byaccount using their username.username as the identifier. This operation is irreversible and will remove all user data and associated AAA profile information.

            ExampleUse Request:Cases:

              Employee offboarding processes Account cleanup for inactive or test users Compliance-driven data removal requests Automated account lifecycle management

              Full URL Example:

              DELETE https://gate.zequenze.com/api/v1/user/username/john.doe/smith/
              

              cURL Example:

              curl -X DELETE "https://gate.zequenze.com/api/v1/user/username/john.smith/" \
                -H "Authorization: Bearer YOUR_API_TOKEN"
              

              Response Codes:

              Status Description
              204 No Content (Success)
              - 404 User notsuccessfully founddeleted 401 Unauthorized - Invalid or missing authentication token 403 Forbidden - Insufficient permissions to delete user 404 Not Found - Username does not exist

              GET /user/{id}/

              Description: Retrieve detailed information for a specific user identified by their numeric ID. This endpoint is optimal for applications that primarily work with database IDs and need consistent, immutable user references.

              ExampleUse Request:Cases:

                Database-driven applications using numeric user IDs Foreign key relationships in related data systems Audit trails and logging systems Performance-optimized user lookups

                Full URL Example:

                GET https://gate.zequenze.com/api/v1/user/12345/42/
                

                cURL Example:

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

                Example Response:

                {
                  "id": "12345",42,
                  "username": "john.doe"smith",
                  "email": "john.doe@acme.smith@company.com",
                  "organization": "acme",
                  "profile": {
                  "first_name": "John",
                  "last_name": "Doe"Smith",
                  "organization": "engineering",
                  "is_active": true,
                  "last_login": "2024-01-15T14:22:30Z",
                  "date_joined": "2023-08-12T09:15:00Z",
                  "groups": ["developers", "vpn_users"],
                  "aaa_profile": {
                    "role": "admin"user",
                    "created_at"department": "2024-01-15T10:30:00Z"Software Engineering",
                    "manager": "jane.doe",
                    "access_level": "standard"
                  }
                }
                

                Response Codes:

                Status Description
                200 Success
                - Returns 404user User not founddetails 401 Unauthorized - Invalid or missing authentication token 403 Forbidden - Insufficient permissions to view user 404 Not Found - User ID does not exist

                PUT /user/{id}/

                UpdateDescription: Completely update a user's completeprofile information byusing their numeric ID. This operation replaces the entire user record, providing a reliable way to synchronize complete user profiles in ID-based systems.

                Parameters:

                Full
                URL Parameter Type In Required Description data object body Yes Complete user data object

                Example Request:Example:

                PUT https://gate.zequenze.com/api/v1/user/12345/42/
                

                cURL Example:

                curl -X PUT "https://gate.zequenze.com/api/v1/user/42/" \
                  -H "Authorization: Bearer YOUR_API_TOKEN" \
                  -H "Content-Type: application/jsonjson" \
                  -d '{
                    "username": "john.doe.updated"smith",
                    "email": "john.doe.updated@acme.smith.updated@company.com",
                  "organization": "acme",
                  "profile": {
                    "first_name": "John",
                    "last_name": "Doe-Smith",
                    "organization": "engineering",
                    "is_active": true,
                    "groups": ["developers", "vpn_users", "architects"],
                    "aaa_profile": {
                      "role": "super_admin"senior_developer",
                      "department": "Software Engineering",
                      "manager": "jane.doe",
                      "access_level": "elevated"
                    }
                  }'
                

                Response Codes:

                Status Description
                200 Success - User successfully updated
                404400 UserBad notRequest found- Invalid user data or validation errors
                401 Unauthorized - Invalid or missing authentication token
                403 Forbidden - Insufficient permissions to update user 404 Not Found - User ID does not exist

                PATCH /user/{id}/

                Description: Partially update specific fields of a user's informationprofile byusing their numeric ID. This endpoint enables precise, field-level updates while maintaining data integrity for unchanged fields.

                Parameters:

                Full
                URL Parameter Type In Required Description data object body Yes Partial user data object

                Example Request:Example:

                PATCH https://gate.zequenze.com/api/v1/user/12345/42/
                

                cURL Example:

                curl -X PATCH "https://gate.zequenze.com/api/v1/user/42/" \
                  -H "Authorization: Bearer YOUR_API_TOKEN" \
                  -H "Content-Type: application/jsonjson" \
                  -d '{
                    "is_active": false,
                    "aaa_profile": {
                      "email"access_level": "new.email@acme.com"suspended"
                    }
                  }'
                

                Response Codes:

                Status Description
                200 Success - User partially updated
                404400 UserBad notRequest found- Invalid field data or validation errors
                401 Unauthorized - Invalid or missing authentication token
                403 Forbidden - Insufficient permissions to update user 404 Not Found - User ID does not exist

                DELETE /user/{id}/

                DeleteDescription: Permanently delete a user byaccount using their numeric ID. This operation provides a reliable way to remove users in systems that primarily work with database IDs.

                ExampleFull Request:URL Example:

                DELETE https://gate.zequenze.com/api/v1/user/12345/42/
                

                cURL Example:

                curl -X DELETE "https://gate.zequenze.com/api/v1/user/42/" \
                  -H "Authorization: Bearer YOUR_API_TOKEN"
                

                Response Codes:

                Status Description
                204 No Content (Success)
                - 404 User notsuccessfully founddeleted 401 Unauthorized - Invalid or missing authentication token 403 Forbidden - Insufficient permissions to delete user 404 Not Found - User ID does not exist

                Common Use Cases

                Employee Onboarding Automation

                Integrate with HR systems to automatically create user accounts when new employees join. Use POST /user/ to create accounts with complete AAA profiles, then use PATCH /user/username/{username}/ to update group memberships as roles are assigned.

                User Directory Synchronization

                Regularly sync user data from external directory services using GET /user/ to retrieve current users, then use PUT operations to update existing profiles or POST to create new ones as needed.

                Self-Service Profile Management

                Build user portals where individuals can update their own information using GET /user/username/{username}/ to display current data and PATCH operations to save specific field changes.

                Compliance and Audit Workflows

                Use the dual access patterns (ID and username) to maintain consistent audit trails while supporting both human-readable usernames and immutable ID references for compliance reporting.

                Bulk Operations and Maintenance

                Leverage the list endpoint with pagination (GET /user/) to process large user datasets efficiently, combined with batch update operations for maintenance tasks like group membership changes or policy updates.


                Best Practices

                • Choose the Right Identifier: Use username-based endpoints for user-facing applications and ID-based endpoints for backend systems requiring stable references
                Implement Proper Pagination: Always use appropriate limit values (recommended: 25-50 users per page) to avoid performance issues with large user datasets Handle Partial Updates Carefully: Use limitPATCH and offset parametersoperations for largesingle-field datasets.updates Defaultto pageavoid sizesoverwriting aredata typicallyaccidentally, 20-100reserve itemsPUT for complete profile replacements Filtering:Validate CombineBefore query parameters for precise filtering (e.g., ?organization=acme&role=admin) Error Handling: Always check status codes and handle 404 errors when accessing users by ID or username Security: Never include passwords in response data. Use strong passwords when creating users Performance: Use specific field queries when you only need partial user information ValidationCreation: Ensure usernames and email addresses are unique withinand organizationsfollow organizational policies before creationcreating users via POST /user/ Implement Soft Deletion: Consider using PATCH to set is_active: false instead of DELETE operations to preserve audit trails and data relationships Cache User Data Appropriately: User profile data changes infrequently - implement reasonable caching strategies to reduce API calls Monitor Rate Limits: Bulk operations should implement appropriate delays and respect API rate limiting to maintain system stability