User
The User API provides comprehensive user management
functionalitycapabilitiesincludingforAAAthe(Authentication,GATEAuthorization,system,and Accounting) profile information. These endpoints enableallowing you to create, retrieve, update, and deleteusers,users along with their AAA (Authentication, Authorization, Accounting) profile information. These endpoints supportforboth ID-based and username-basedoperationsoperations, making it flexible forflexibledifferent 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 designedthe core component for completemanaging user lifecycle managementaccounts within the GATE system. It provides dualfull CRUD (Create, Read, Update, Delete) operations for user management, with additional support for AAA profiles that define user permissions and 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.levels.
Key Features:
-
Complete CRUD Operations: Create, read, update, and delete users with full profile information
Common IntegrationUse Scenarios:Cases:
- User
directory synchronization from LDAP/Active Directory
Endpoints
GET /user/
Description: RetrieveRetrieves a paginated list of all users within the system, including their AAA profile information. This endpoint supports comprehensive filtering options.options Thisto endpointhelp isyou idealfind forspecific building user directory listings, implementing search functionality,users or performinggroups bulkof operationsusers acrossbased useron datasets.various criteria.
Use Cases:
- Display
alluserusersdirectoriesinoranadministrationorganization for administrative purposespanels SearchBulkforuserspecificmanagementusers by username or organizationoperationsExportIntegration with external systems requiring userdata for reporting or compliance purposessynchronizationImplementReporting and analytics on userselection interfaces in other applicationsbase
Full URL Example:
https://gate.zequenze.com/api/v1/user/?organization=engineering123&is_active=true&limit=2520&offset=0
Parameters:
| Parameter | Type | In | Required | Description |
|---|---|---|---|---|
| id | string | query | No | Filter |
| username | string | query | No | Filter |
| organization | string | query | No | Filter |
| limit | integer | query | No | Number of results to return per page (default: |
| offset | integer | query | No |
cURL Example:
curl -X GET "https://gate.zequenze.com/api/v1/user/?organization=engineering123&limit=25"10" \
-H "Authorization: Bearer YOUR_API_TOKEN" \
-H "Content-Type: application/json"
Example Response:
{
"count": 156,150,
"next": "https://gate.zequenze.com/api/v1/user/?limit=2510&offset=25&organization=engineering"10",
"previous": null,
"results": [
{
"id": 42,1,
"username": "john.smith"doe",
"external_id": "AD_12345",
"klass": "employee",
"email": "john.smith@company.doe@company.com",
"first_name": "John",
"last_name": "Smith",
"organization": "engineering"Doe",
"is_active": true,
"last_login"organization": 123,
"description": "Senior Network Administrator",
"date_joined": "2024-01-15T10:30:00Z",
"first_login": "2024-01-15T14:22:30Z"00Z",
"date_joined"last_login": "2023-08-12T09:2024-03-20T09:15:00Z",
"groups"expiration": "2025-01-15T00:00:00Z",
"avatar_url": "https://avatars.company.com/john.doe.jpg",
"source_id": 5,
"profile": ["developers"network_admin", "vpn_users"]vpn_user", "aaa_profile": {
"role": "user",
"department": "Software Engineering",
"manager": "jane.doe",
"access_level": "standard"
}reporting_viewer"]
}
]
}
Response Codes:
| Status | Description |
|---|---|
| 200 | Success - Returns paginated user list |
| 401 | Unauthorized - Invalid or missing |
| 403 | Forbidden - Insufficient permissions to |
POST /user/
Description: CreateCreates a new user account in the system with complete profile information includingassociated AAA settings.profiles. This endpoint isallows essentialyou forto userprovision onboardingnew processes,users automatedwith provisioningall systems,necessary account information and administrativeaccess userpermissions creationin workflows.a single operation.
Use Cases:
Automated employeeUser onboardingfromandHRaccountsystemsprovisioningSelf-registration portals for external users
Full URL Example:
https://gate.zequenze.com/api/v1/user/
Request Body Parameters:
| Parameter | Type |
|---|
cURL Example:
curl -X POST "https://gate.zequenze.com/api/v1/user/" \
-H "Authorization: Bearer YOUR_API_TOKEN" \
-H "Content-Type: application/json" \
-d '{
"username": "sarah.johnson"jane.smith",
"password": "SecurePassword123!",
"email": "sarah.johnson@company.jane.smith@company.com",
"first_name": "Sarah"Jane",
"last_name": "Johnson"Smith",
"external_id": "HR_67890",
"klass": "contractor",
"organization": 123,
"marketing"description": "Network Security Specialist",
"password"expiration": "SecureP@ssw0rd!"2024-12-31T23:59:59Z",
"is_active": true,
"groups"profile": ["marketing_team"security_admin", "vpn_users"vpn_user"],
"aaa_profile": {
"role": "user",
"department": "Digital Marketing",
"manager": "mike.wilson",
"access_level": "standard"
}
}'
Example Response:
{
"id": 157,25,
"username": "sarah.johnson"jane.smith",
"external_id": "HR_67890",
"klass": "contractor",
"email": "sarah.johnson@company.jane.smith@company.com",
"first_name": "Sarah"Jane",
"last_name": "Johnson",
"organization": "marketing"Smith",
"is_active": true,
"last_login"organization": null,123,
"description": "Network Security Specialist",
"date_joined": "2024-01-16T10:03-20T10:30:45Z"00Z",
"groups"first_login": null,
"last_login": null,
"expiration": "2024-12-31T23:59:59Z",
"avatar_url": null,
"profile": ["marketing_team"security_admin", "vpn_users"vpn_user"],
"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 |
| 401 | Unauthorized - Invalid or missing |
GET /user/username/{username}/
Description: RetrieveRetrieves detailed information for a specific user identified by their username. This endpoint is particularly useful when integratingyou withknow systemsthe thatusername primarilybut worknot with usernames rather thanthe numeric IDs.ID, which is common in username-based authentication systems.
Use Cases:
- User profile lookups
induring authenticationflows - Username-based user
verificationmanagementprocesses
Full URL Example:
https://gate.zequenze.com/api/v1/user/username/john.smith/doe/
Path Parameters:
cURL Example:
curl -X GET "https://gate.zequenze.com/api/v1/user/username/john.smith/doe/" \
-H "Authorization: Bearer YOUR_API_TOKEN" \
-H "Content-Type: application/json"
Example Response:
{
"id": 42,1,
"username": "john.smith"doe",
"external_id": "AD_12345",
"klass": "employee",
"email": "john.smith@company.doe@company.com",
"first_name": "John",
"last_name": "Smith",
"organization": "engineering"Doe",
"is_active": true,
"last_login"organization": 123,
"description": "Senior Network Administrator",
"date_joined": "2024-01-15T10:30:00Z",
"first_login": "2024-01-15T14:22:30Z"00Z",
"date_joined"last_login": "2023-08-12T09:2024-03-20T09:15:00Z",
"groups"expiration": "2025-01-15T00:00:00Z",
"avatar_url": "https://avatars.company.com/john.doe.jpg",
"source_id": 5,
"profile": ["developers"network_admin", "vpn_users"vpn_user", "senior_staff"reporting_viewer"],
"aaa_profile": {
"role": "senior_developer",
"department": "Software Engineering",
"manager": "jane.doe",
"access_level": "elevated",
"security_clearance": "confidential"
}
}
Response Codes:
| Status | Description |
|---|---|
| 200 | Success - Returns user details |
| 401 | Unauthorized - Invalid or missing |
PUT /user/username/{username}/
Description: Completely updateupdates a user's profile information usingby theirusername, usernamereplacing asall the identifier. This operation replaces the entire user recordfields with the provided data,data. makingThis itis suitablea forfull comprehensiveupdate profileoperation updates.that requires all user fields to be specified in the request body.
Use Cases:
- Complete user profile
synchronizationupdates from externalHRsystems
Full URL Example:
https://gate.zequenze.com/api/v1/user/username/john.smith/doe/
cURL Example:
curl -X PUT "https://gate.zequenze.com/api/v1/user/username/john.smith/doe/" \
-H "Authorization: Bearer YOUR_API_TOKEN" \
-H "Content-Type: application/json" \
-d '{
"username": "john.smith"doe",
"email": "j.smith@company.doe@company.com",
"first_name": "Jonathan"John",
"last_name": "Smith"Doe",
"organization"external_id": "engineering"AD_12345_UPDATED",
"klass": "senior_employee",
"is_active": true,
"groups"organization": 123,
"description": "Lead Network Administrator",
"expiration": "2025-06-30T23:59:59Z",
"profile": ["developers"network_admin", "vpn_users"vpn_user", "team_leads"]reporting_admin", "aaa_profile": {
"role": "team_lead",
"department": "Software Engineering",
"manager": "jane.doe",
"access_level": "elevated"
}security_viewer"]
}'
Response Codes:
| Status | Description |
|---|---|
| 200 | Success - User updated successfully |
| 400 | Bad Request - Invalid |
| 401 | Unauthorized - Invalid or missing |
PATCH /user/username/{username}/
Description: Partially update specific fields ofupdates a user's profileinformation usingby theirusername, username. This endpoint allowsallowing you to modify only thespecific fields without affecting others. This is more efficient than PUT when you specifyonly whileneed leavingto otherchange usera datafew unchanged, perfect for targeted updates.attributes.
Use Cases:
UpdateUpdating specificprofileuserfieldsattributeslike(email,emailphone,or departmentdepartment)ChangeStatus changes (activate/deactivate users)
Full URL Example:
https://gate.zequenze.com/api/v1/user/username/john.smith/doe/
cURL Example:
curl -X PATCH "https://gate.zequenze.com/api/v1/user/username/john.smith/doe/" \
-H "Authorization: Bearer YOUR_API_TOKEN" \
-H "Content-Type: application/json" \
-d '{
"email": "john.smith.new@company.doe.updated@company.com",
"aaa_profile": {
"access_level"description": "admin"Senior }Network Administrator - Updated Role",
"profile": ["network_admin", "vpn_user", "reporting_viewer", "audit_viewer"]
}'
Response Codes:
| Status | Description |
|---|---|
| 200 | Success - User partially updated |
| 400 | Bad Request - Invalid |
| 401 | Unauthorized - Invalid or missing |
DELETE /user/username/{username}/
Description: Permanently deletedeletes a user account usingby their username as the identifier.username. This operation is irreversible and will removeremoves all user data and associated AAA profileprofiles information.from the system and cannot be undone.
Use Cases:
- Employee offboarding processes
- Account cleanup
forandinactivemaintenance
Full URL Example:
https://gate.zequenze.com/api/v1/user/username/john.smith/doe/
cURL Example:
curl -X DELETE "https://gate.zequenze.com/api/v1/user/username/john.smith/doe/" \
-H "Authorization: Bearer YOUR_API_TOKEN"
Response Codes:
| Status | Description |
|---|---|
| 204 | No Content - User successfully deleted |
| 401 | Unauthorized - Invalid or missing |
GET /user/{id}/
Description: RetrieveRetrieves detailed information for a specific user identified by their numeric ID. This endpoint is optimalideal forwhen applicationsyou thathave primarilythe workuser's withID from previous API calls or database IDs and need consistent, immutable user references.
Use Cases:
Database-drivenRetrievingapplicationsuser details with known ID from database
Full URL Example:
https://gate.zequenze.com/api/v1/user/42/123/
cURL Example:
curl -X GET "https://gate.zequenze.com/api/v1/user/42/123/" \
-H "Authorization: Bearer YOUR_API_TOKEN" \
-H "Content-Type: application/json"
Example Response:
{
"id": 42,
"username": "john.smith",
"email": "john.smith@company.com",
"first_name": "John",
"last_name": "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": "user",
"department": "Software Engineering",
"manager": "jane.doe",
"access_level": "standard"
}
}
Response Codes:
| Status | Description |
|---|---|
| 200 | Success - Returns user details |
| 401 | Unauthorized - Invalid or missing |
PUT /user/{id}/
Description: Completely updateupdates a user's profile information usingby theirID, replacing all fields with the provided data. Similar to the username-based PUT endpoint but uses numeric ID.ID Thisfor operation replaces the entire user record, providing a reliable way to synchronize complete user profiles in ID-based systems.identification.
Full URL Example:
https://gate.zequenze.com/api/v1/user/42/123/
cURL Example:
curl -X PUT "https://gate.zequenze.com/api/v1/user/42/123/" \
-H "Authorization: Bearer YOUR_API_TOKEN" \
-H "Content-Type: application/json" \
-d '{
"username": "john.smith"doe.updated",
"email": "john.smith.updated@company.com",
"first_name": "John",
"last_name": "Smith",
"organization": "engineering"Doe",
"is_active": true,
"groups"organization": 123,
"profile": ["developers"network_admin", "vpn_users", "architects"security_admin"],
"aaa_profile": {
"role": "senior_developer",
"department": "Software Engineering",
"manager": "jane.doe",
"access_level": "elevated"
}
}'
Response Codes:
| Status | Description |
|---|---|
| 200 | Success - User updated successfully |
| 400 | Bad Request - Invalid |
| 401 | Unauthorized - Invalid or missing |
PATCH /user/{id}/
Description: Partially update specific fields ofupdates a user's profileinformation usingby theirID, numericallowing ID.modification of specific fields only. This endpointprovides enablesthe precise,same field-levelpartial updatesupdate whilefunctionality maintainingas datathe integrityusername-based forPATCH unchanged fields.endpoint.
Full URL Example:
https://gate.zequenze.com/api/v1/user/42/123/
cURL Example:
curl -X PATCH "https://gate.zequenze.com/api/v1/user/42/123/" \
-H "Authorization: Bearer YOUR_API_TOKEN" \
-H "Content-Type: application/json" \
-d '{
"is_active": false,
"aaa_profile": {
"access_level"description": "Account temporarily suspended",
}"expiration": "2024-06-30T23:59:59Z"
}'
Response Codes:
| Status | Description |
|---|---|
| 200 | Success - User partially updated |
| 400 | Bad Request - Invalid |
| 401 | Unauthorized - Invalid or missing |
DELETE /user/{id}/
Description: Permanently deletedeletes a user account using their numericby ID. This operation provideshas athe reliablesame wayeffect toas removethe usersusername-based inDELETE systemsbut thatuses primarilynumeric workID withfor database IDs.identification.
Full URL Example:
https://gate.zequenze.com/api/v1/user/42/123/
cURL Example:
curl -X DELETE "https://gate.zequenze.com/api/v1/user/42/123/" \
-H "Authorization: Bearer YOUR_API_TOKEN"
Response Codes:
| Status | Description |
|---|---|
| 204 | No Content - User successfully deleted |
| 401 | Unauthorized - Invalid or missing |
Common Use Cases
Use Case 1: Employee Onboarding AutomationWorkflow
IntegrateWhen a new employee joins, create their account with appropriate AAA profiles, set expiration based on contract length, and link to external HR systems tousing automaticallythe createexternal_id userfield.
Endpoints when new employees join. UseUsed: POST /user/ to create accounts with complete AAA profiles, then use, PATCH /user/username/{username}/ to update group memberships as roles are assigned.
Use Case 2: User Directory Synchronization
Regularly sync user datausers from external directorydirectories services(LDAP/AD) by listing all users, comparing with external data, and updating changed information using partial updates.
Endpoints Used: GET /user/ to retrieve current users, then use, , PUTPATCH /user/{id}/operationsPOST to/user/
Use existingCase 3: Access Management and Compliance
Monitor user access by retrieving user profiles, updating AAA profiles orbased on POSTtorole createchanges, newand onessetting asexpiration needed.dates for temporary access.
Self-Service
Endpoints Profile Management
Build user portals where individuals can update their own information usingUsed:
GET /user/username/{username}/, PATCH /user/{id}/
Use Case 4: Automated Account Lifecycle Management
Implement automated processes to displaydeactivate currentexpired dataaccounts, remove inactive users, 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 forgenerate compliance reporting.reports based on user data.
Bulk
Endpoints OperationsUsed: and Maintenance
Leverage the list endpoint with pagination (GET /user/), PATCH /user/{id}/, DELETE /user/{id}/
Use Case 5: Self-Service User Management
Allow users to processview large user datasets efficiently, combined with batchand update operationstheir forown maintenanceprofile tasksinformation likethrough groupa membershipweb changesinterface orwhile policyrestricting updates.access to administrative fields.
Endpoints Used: GET /user/username/{username}/, PATCH /user/username/{username}/
Best Practices
-
Choose the Right Identifier:Useusername-basedPaginationendpoints for user-facing applications and ID-based endpoints for backend systems requiring stable references
limitwhen HandleImplement PartialProper UpdatesError CarefullyHandling: Check response codes and handle common errors like 404 (user not found) and 409 (username conflicts) gracefully in your applications.
Choose the Right Endpoint: Use username-based PATCHoperationsendpoints when integrating with username-centric systems, and ID-based endpoints for single-fielddatabase-driven updates to avoid overwriting data accidentally, reserve PUT for complete profile replacements
POST /user/applications.
ImplementSecure SoftPassword DeletionHandling: ConsiderNever log or store passwords in plaintext. The API handles password hashing automatically, but ensure secure transmission using HTTPS.PATCH
is_active: falseDELETECacheAAA UserProfile Data AppropriatelyManagement: UserCarefully manage AAA profiles as they directly impact user permissions. Implement approval workflows for profile data changes infrequentlyin -production implementenvironments.
MonitorData Rate LimitsConsistency: BulkWhen operationsusing shouldexternal_id implementfor system integration, ensure these IDs remain consistent across all systems to maintain proper user linking.
Monitoring and Auditing: Implement logging for all user management operations, especially creation and deletion, to maintain security audit trails.
Rate Limiting: Be mindful of API rate limits when performing bulk operations. Implement appropriate delays and respectretry APIlogic ratefor limitinglarge-scale touser maintainmanagement systemtasks.