Trigger "Synchronize external user data" programmatically

Hi,

I am using 1.14.1 and we would like to automate our onboarding process as much as possible. Gitea access is granted through the use of Active Directory groups. We would like to script that process so we can do the following steps:

  • add user to AD group (already done)
  • trigger Gitea external sync (this is our current gap since we have to do this part manually).
  • call Gitea’s API every minute until it finds the new user (already done).
  • send email to onboarded users (already done)

I can’t seem to find any endpoint for this in the API. However, I would like to know what command the sync task is doing so I can call it myself as part of my script.

Thanks for help.