Add contact group using webapi to user created by ldap syncronization

use this:

root@linux# curl “http://myserver/mysite/check_mk/webapi.py?action=edit_users&_username=automation&_secret=myautomationsecret” -d ’ request={“users”:{“hhirsch”:{“set_attributes”:{“email":"hhirsch@myCompany.org”, “contactgroups”:[“windows”]},“unset_attributes”:[“pager”]}}}’

as you can see contactgroups is set to windows so you have change that and delete attributes which you dont want.

https://checkmk.de/cms_web_api_references.html#edit_users