Calls
User
create
10 min
this call creates a user, which is equivalent to a user registering in your project this call would apply to creating a parent or an individual; you would use create child to create a child in a family system the arguments that would be included in the doc are described below basic parameters name type required description action string true create clogin id integer false this is a central login id that identifies a user within your organization organizations can have multiple projects that the same user can register in if you know the clogin id from a separate project, you can use it to connect the accounts clogin id should be false for a user who is being created for the first time within your organization group id integer true this designates which project the action should be applied towards doc array false see doc parameters below submit forms boolean false this prevents the user's forms from submitting this is generally advised if you want to prevent the update from activating triggers that are set in your project false will prevent the forms from submitting, but true is the default disable email sending logical false this specifically prevents any emails from automatically sending as a result of an api call true will prevent the emails from sending, and false will allow emails to be sent although false is the default, it is generally advised that you set this to true if you're not sure which emails might trigger doc parameters name type required description username string false this is the user name that users will log in to the project with the project will default to requiring an email format if you would like to turn the email requirement off, you can do that by editing the login widget within your project if left blank, the system will 1) confirm main email isn't taken and use it 2) check for any existing email (and confirm this email has not already been taken) 3) if there is no email available, the system will generate a value of the form {uuid}{groupid}@regpacks com if desired, username can be something other than main email it is not recommended to deviate from an email as the username as a system generated email will prevent users from receiving important communications such as forgot password password string false passwords can be alphanumeric or special characters with a minimum length of 6 if not provided, the system will autogenerate a password that you can access by running a report in your project first name string false this is an important field that is responsible for the presentation of the first name on the user management page it is strongly advised to include this last name string false this functions like first name org name string false similar to first name but allows an organization name to display on the user management page note that in a family project, it is still advised to include first name and last name in addition to org name main email string false this is similar to first name and often serves as username as well note that email addresses are both validated and checked against a dns database, however the dns check can be disabled in the project settings if desired article on project settings application date string false this will default to the creation date if not supplied this is included in case you want to back date an applicant's creation date should be formatted in mysql date format ("yyyy mm dd" or "yyyy mm dd hh\ mm\ ss") fields string false these are the fields in your project, such as multiple choice fields, short answer fields, etc see "referencing fields in api calls" for more information on how to supply fields in the api examples create a new user this is an example which would create a new user in your organization the key things to note are that username , password , main email , org name , first name , and last name are all supplied while clogin id is false altogether, this is the equivalent of an end user registering and answering the yes/no question call curl x post "https //www regpack com/reg/api2/users/" \\ h "content type application/json" \\ h "accept application/json" \\ h "api id 15263" \\ h "api user api admin\@regpacks com" \\ h "api token cd2e514f 7gab 3cde 62fg 51abcd4e7362" \\ d '{ "action" "create", "group id" 100909072, "clogin id" false, "doc" { "username" "jim hall\@regpacks com", "password" "dont just play something sit there!", "org name" "jim hall trio", "main email" "jim hall\@regpacks com", "first name" "jim", "last name" "hall" } }import requests import json users endpoint = https //www regpack com/reg/api2/users/ current time = str(round(time time())) headers = { "content type" "application/json", "accept" "application/json", "api id" "15263", "api user" "api admin\@regpacks com", "api token" "cd2e514f 7gab 3cde 62fg 51abcd4e7362", } payload = { "action" "create", "group id" 100909072, "clogin id" false, "doc" { "username" "jim hall\@regpacks com", "password" "don't just play something sit there!", "org name" "jim hall trio", "main email" "jim hall\@regpacks com", "first name" "jim", "last name" "hall" } } create new user json = json dumps(payload) create new user response = requests post(url=users endpoint, data=create new user json, headers=headers, timeout=10) response { "msg" "user registered ", "system action" \[ "user registered" ], "success" true, "user info" { "clogin id" "102715741", "group id" "100909072", "connected to" "102715741" }, "meta info" { "u name" "jim hall", "total forms" "2", "completed forms" "0", "total user forms" "2", "total completed user forms" "0", "total user mandatory forms" "2", "total completed user mandatory forms" "0", "total order" "0 00", "total paid" "0 00", "total balance" "0 00", "status id" "0", "status name" null, "status color" null, "application date" "dec 8th 2021 17 20", "application date raw" "2021 12 08 17 20 08", "u comments" "0", "group id" "100909072", "uid" "4085257", "clogin id" "102715741", "excluded" "0", "connected to" "102715741", "total user tags" "0", "user tag ids" null, "total non excluded children" "0", "star" "0", "admin initials" null, "admin color" null, "assigned admin id" null } } add an existing user to a project this is an example of creating a user who exists in a previous project because clogin id is present, the system will pull username , password , main email , org name , first name , and last name whether they are provided or not (if the fields exist) what this means is that any values you provide will overwrite the previous values if clogin id cannot be found within your organization, the system will create a new user and return a new clogin id the system will disregard username and password if clogin id is provided and will not overwrite them with the values you provide in the doc note that in a family system, only an existing parent can be created, and all child users will be assigned a new clogin id call curl x post "https //www regpack com/reg/api2/users/" \\ h "content type application/json" \\ h "accept application/json" \\ h "api id 15263" \\ h "api user api admin\@regpacks com" \\ h "api token cd2e514f 7gab 3cde 62fg 51abcd4e7362" \\ d '{ "action" "create", "group id" 100909072, "clogin id" 102670540, "doc" { "username" "miles davis quintet\@regpacks com", "password" "stop playing the butter notes!", "org name" "miles davis quintet", "main email" "miles davis\@regpacks com", "first name" "miles", "last name" "davis", "your instrument" "trumpet" } }import requests import json users endpoint = https //www regpack com/reg/api2/users/ headers = { "content type" "application/json", "accept" "application/json", "api id" "15263", "api user" "api admin\@regpacks com", "api token" "cd2e514f 7gab 3cde 62fg 51abcd4e7362", } payload = { "action" "create", "group id" 100909072, "clogin id" 102670540, "doc" { "username" "miles davis quintet\@regpacks com", "password" "stop playing the butter notes!", "org name" "miles davis quintet", "main email" "miles davis\@regpacks com", "first name" "miles", "last name" "davis", "your instrument" "trumpet" } } create existing user json = json dumps(payload) create existing user response = requests post(url=users endpoint, data=create existing user json, headers=headers, timeout=10) response { "msg" "user registered ", "system action" \[ "user registered" ], "success" true, "user info" { "clogin id" "102670540", "group id" "100909072", "connected to" "102670540" }, "meta info" { "u name" "miles davis", "total forms" "2", "completed forms" "0", "total user forms" "2", "total completed user forms" "0", "total user mandatory forms" "2", "total completed user mandatory forms" "0", "total order" "0 00", "total paid" "0 00", "total balance" "0 00", "status id" "0", "status name" null, "status color" null, "application date" "dec 8th 2021 17 20", "application date raw" "2021 12 08 17 20 08", "u comments" "0", "group id" "100909072", "uid" "4085258", "clogin id" "102670540", "excluded" "0", "connected to" "102670540", "total user tags" "0", "user tag ids" null, "total non excluded children" "0", "star" "0", "admin initials" null, "admin color" null, "assigned admin id" null } } triggers when you create a user, the "user account created" trigger will fire this trigger is the essential mechanism that causes the user to have their forms added to their profile that said, it is possible that other actions in the system are triggered, and these can potentially have unanticipated consequences if you would like to limit these second order effects, it is advised that you include the following parameters / this disables emails from sending as a result of triggers / disable email sending\ true / while this prevents all forms from submitting, which often triggers actions to occur / submit forms\ false user account porting it is important to note that, if you are creating a user in a project that was copied from a previous project and that user is also both present and not archived in that previous project , then it will port over all of the user's data any fields you provide answers for in the docs will then overwrite that data as an example, if roger registers in "color con v", picks "blue" as his favorite color, and then you create him in "color con vi" with {"favorite color" "green"} , then it will overwrite his answer in the new "color con vi" project; otherwise, his favorite color will show as blue data cannot be overwritten with empty strings, so the correct way to prevent data from porting would be to archive the user in the original project (from which the new project was copied) this will prevent any fields from porting over except for the special user fields (such as first name , last name , etc )