Sync users from directory
GET
/api/security/sync
const url = 'https://example.com/api/security/sync';const options = {method: 'GET', headers: {Authorization: 'Bearer <token>'}};
try { const response = await fetch(url, options); const data = await response.json(); console.log(data);} catch (error) { console.error(error);}curl --request GET \ --url https://example.com/api/security/sync \ --header 'Authorization: Bearer <token>'Synchronizes users and groups from the configured WorkOS directory
Authorizations
Section titled “Authorizations”Responses
Section titled “Responses”Sync result message
Media typeapplication/json
string
Example
Sync startedAccess denied
Media typeapplication/json
object
error
required
Indicates an error occurred
boolean
message
required
Error message describing what went wrong
string
Example
{ "error": true, "message": "Item not found"}