Bulk create or update users
const url = 'https://safe-api.safetyradar.com/v2/users/bulk';const options = { method: 'POST', headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'}, body: '{"users":[{"email":"hello@example.com","fullName":"example","phoneNumber":"example","role":"admin","externalId":"example","supervisorId":"example","departmentId":"example","locationId":"example","teamId":"2489E9AD-2EE2-8E00-8EC9-32D5F69181C0","permissionGroupId":"2489E9AD-2EE2-8E00-8EC9-32D5F69181C0"}]}'};
try { const response = await fetch(url, options); const data = await response.json(); console.log(data);} catch (error) { console.error(error);}curl --request POST \ --url https://safe-api.safetyradar.com/v2/users/bulk \ --header 'Authorization: Bearer <token>' \ --header 'Content-Type: application/json' \ --data '{ "users": [ { "email": "hello@example.com", "fullName": "example", "phoneNumber": "example", "role": "admin", "externalId": "example", "supervisorId": "example", "departmentId": "example", "locationId": "example", "teamId": "2489E9AD-2EE2-8E00-8EC9-32D5F69181C0", "permissionGroupId": "2489E9AD-2EE2-8E00-8EC9-32D5F69181C0" } ] }'Create or update multiple users in a single request. Users are upserted based on externalId. Maximum 1000 users per request. A user is one global record shared by every organization they belong to: an organization sync never changes the email (a row whose externalId is linked to a different email is reported as failed with an email conflict), and it updates fullName and phoneNumber only when the user has no other active organization membership and is not a SafetyRadar super admin. A verified phone number is never changed. A row whose name or phone was not applied succeeds and carries a warning saying why.
Authorizations
Section titled “Authorizations”Request Bodyrequired
Section titled “Request Bodyrequired”object
object
External identifier (required for bulk upsert)
Responses
Section titled “Responses”Bulk operation completed
object
object
object
object
Examplegenerated
{ "data": { "results": [ { "externalId": "example", "success": true, "created": true, "id": "2489E9AD-2EE2-8E00-8EC9-32D5F69181C0", "error": "example", "warning": "example" } ], "summary": { "total": 1, "created": 1, "updated": 1, "failed": 1 } }}Bad request
object
Machine-readable error code
Human-readable error message
Additional error details. For validation_error: issues, a list of { location, path, message } (location is query, param, header or json).
object
Example
{ "code": "validation_error", "message": "Request validation failed"}Unauthorized
object
Machine-readable error code
Human-readable error message
Additional error details. For validation_error: issues, a list of { location, path, message } (location is query, param, header or json).
object
Example
{ "code": "validation_error", "message": "Request validation failed"}Rate limit exceeded (rate_limit_exceeded)
object
Machine-readable error code
Human-readable error message
Additional error details. For validation_error: issues, a list of { location, path, message } (location is query, param, header or json).
object
Example
{ "code": "validation_error", "message": "Request validation failed"}Unexpected server error (internal_error)
object
Machine-readable error code
Human-readable error message
Additional error details. For validation_error: issues, a list of { location, path, message } (location is query, param, header or json).
object
Example
{ "code": "validation_error", "message": "Request validation failed"}
