> ## Documentation Index
> Fetch the complete documentation index at: https://docs.blinkops.com/llms.txt
> Use this file to discover all available pages before exploring further.

# Sync Users

Sync users by creating new ones or updating existing users based on their `username` or `id_number`.

After all user data is processed, course assignment rules are applied.

## Basic Parameters

<div className="integrations-table">
  | Parameter | Description                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                       |
  | --------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
  | Users     | Array of user objects to update. If a user doesn't exist, a new one will be created.<br /><br />**Important Notes:** <br /><br />\* `username`, `first_name`, `last_name` and `email` are required for each user, `id_number` is required when `Find By` is set to `ID Number`.<br /><br />\* The maximum allowed length for each required field is `100 characters`.<br /><br />\* The maximum number of users is `10`.<br /><br />For example:<br /><pre><code>\[<br />  \{<br />    "username": "[sally@company.tld](mailto:sally@company.tld)",<br />    "first\_name": "Sally",<br />    "last\_name": "Student",<br />    "email": "[sally@company.tld](mailto:sally@company.tld)",<br />    "title": "Sales Manager",<br />    "location": "South Office",<br />    "id\_number": "2-105",<br />    "state": "CA",<br />    "country": "US",<br />    "phone": "+1 555-555-9870",<br />    "department": "Sales",<br />    "suspended": false<br />  }<br />]</code></pre> |
</div>

## Advanced Parameters

<div className="integrations-table">
  | Parameter             | Description                                                                                            |
  | --------------------- | ------------------------------------------------------------------------------------------------------ |
  | Execute Rules         | Select whether course assignment rules should be executed after creating and updating user accounts.   |
  | Find By               | Specifies which field should be used to identify existing user accounts.                               |
  | Force Password Change | Select to require new users to change their password the first time they log into the LMS application. |
  | Track Changes         | Select to only update user records if there are detected changes.                                      |
</div>

## Example Output

```json theme={"dark"}
{
	"data": {
		"summary": {
			"created": 0,
			"updated": 1,
			"skipped": 0,
			"suspended": 0,
			"errors": 0
		},
		"details": {
			"users": [
				{
					"key": "2-105",
					"success": true,
					"operation": "updated",
					"user_id": 379,
					"username": "sally@company.tld",
					"department_id": 96,
					"message": ""
				}
			],
			"rule_logs": [
				{
					"execution_time": "2024-09-14T00:18:03.000000Z",
					"user_id": 379,
					"company_id": 5,
					"mock": false,
					"user_state": {
						"title": "Sales Manager",
						"location": "South Office",
						"hire_date": "",
						"department_id": 96,
						"role": "Student",
						"country": "US",
						"state": "CA"
					},
					"exec_log_rules": [
						{
							"rule_id": 8,
							"match": true,
							"rule_exec_log_definitions": [
								{
									"rule_definition_id": 305,
									"match": true,
									"definition_summary": "..."
								}
							],
							"log_courses": [
								{
									"course_id": 19,
									"rollout_id": 145,
									"assignable": true,
									"action_result": "Course assigned",
									"course": {
										"id": 19,
										"display_name": "Preventing Discrimination ...",
										"short_name": "PDHE_51_Office_US_eng_std_071723"
									}
								}
							],
							"rule": {
								"id": 8,
								"company_id": 5,
								"enabled": true,
								"rule_name": "Sales Users",
								"sort_order": 1
							}
						}
					]
				}
			]
		}
	}
}
```

## Workflow Library Example

[Sync Users with Traliant Lms and Send Results Via Email](https://library.blinkops.com/workflows/sync-users-with-traliant-lms-and-send-results-via-email)

<div className="iframe-wrapper">
  <div className="iframe-media">
    <img src="https://mintcdn.com/blinkops-2/ojHYuDeYX5FWuN8a/img/Icons/play-box.svg?fit=max&auto=format&n=ojHYuDeYX5FWuN8a&q=85&s=b8af968e71438a9499c3223c9bd29fb2" alt="Workflow Library" width="16" height="16" data-path="img/Icons/play-box.svg" />

    Preview this Workflow on desktop
  </div>

  <iframe className="iframe" src="https://library.blinkops.com/workflows/sync-users-with-traliant-lms-and-send-results-via-email/canvas" />
</div>
