Hi team, We're trying to sync the user informatio...
# ask-a-descoper
x
Hi team, We're trying to sync the user information in our database, so we would expect an api call sent whenever a user is created, modified or deleted. Based on the document, the audit webhook is the proper way to do that, but that requires upgrading the plan and we actually don't need other features for that plan. If using generic http, then it can only be placed inside a flow, which means we wouldn't know if a user is modified or deleted through the Descope console. Is there any other way we can achieve the purpose within the current plan? Only needs webhook for audit events. Thanks a lot for your help!
✅ 1
d
Alternative Solutions for User Sync You're correct that audit webhooks require a plan upgrade, and generic HTTP webhooks in flows won't capture console-initiated changes. Here are your alternatives within the current plan: Method 1: Search Users API Polling Use the Search Users API to periodically check for changes :
Copy code
POST <https://api.descope.com/v2/mgmt/user/search>
Authorization: Bearer PROJECT_ID:MANAGEMENT_KEY
Content-Type: application/json
{
  "filters": [
    {
      "field": "modifiedTime",
      "operator": "gte",
      "value": "2024-01-01T00:00:00Z"
    }
  ],
  "sort": [
    {
      "field": "modifiedTime",
      "desc": false
    }
  ]
}
Method 2: Management SDK Integration Implement user operations through your backend using the Management SDK, which allows you to trigger webhooks alongside user changes :
Copy code
import { DescopeClient } from '@descope/node-sdk';
const descopeClient = DescopeClient({ 
  projectId: 'your-project-id',
  managementKey: 'your-management-key' 
});
// Update user and trigger your webhook
await descopeClient.management.user.update('user-id', userDetails);
await triggerYourWebhook({ action: 'user_updated', userId: 'user-id' });
Notes • The Search Users API method requires polling but captures all changes • Console-initiated changes can only be tracked through the Search Users API approach • Audit events are not delivered in real-time and include throttling mechanisms How to Track User Updates | Descope Documentation
x
Got it, thx
d
Hi, I'm Descope's AI assistant. You're welcome! If you need help implementing either the Search Users API polling or Management SDK approach, or have other Descope questions, feel free to ask.