---
title: create_child
slug: docs/createchild
docTags: 
createdAt: 2021-08-04T18:23:29.000Z
---

This call creates a child in a family system. This is very similar to `create`, but `connected_to` is mandatory and must be the same as `clogin_id` for the associated parent.

# Basic Parameters

| Name                    | Type    | Required | Description                                                                                                                                                                                                                                                                                                                                                                              |
| ----------------------- | ------- | -------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| `action`                | string  | true     | `create_child`                                                                                                                                                                                                                                                                                                                                                                           |
| `clogin_id`             | integer | false    | This is a central login id which identifies a user within your organization.<br /><br />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. <br /><br />`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.                                                                                                                                                                                                                                                                                                                      |
| `connected_to`          | integer | true     | This is the `clogin_id` of the parent you are trying to add a child to.                                                                                                                                                                                                                                                                                                                  |
| `doc`                   | array   | true     | See `doc` parameters below. If no information is needed, an empty `doc` must still be provided.                                                                                                                                                                                                                                                                                          |
| `submit_forms`          | boolean | false    | This disables emails from sending as a result of triggers.                                                                                                                                                                                                                                                                                                                               |
| `disable_email_sending` | boolean | false    | This prevents all forms from submitting, which often triggers actions to occur.                                                                                                                                                                                                                                                                                                          |

# Doc Parameters

| Name                 | Type    | Required | Description                                                                                                                                                                                                                  |
| -------------------- | ------- | -------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| `first_name`         | string  | false    | This is an important field which is responsible for the presentation of the first name on the user management page. It is strongly advised that this is included.                                                            |
| `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 system, it is still advised that first\_name and last\_name are included in addition to org\_name.     |
| `main_email`         | string  | false    | This is similar to first\_name, and often serves as username as well. Note that emails are both validated and checked against a DNS database, however the DNS check can be disabled in the project settings of your project. |
| `_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.<br />Should be formatted like "YYYY-MM-DD" or "YYYY-MM-DD hh\:mm\:ss".                  |
| `_prevent_duplicate` | logical | false    | This tries to find the user within the family to see if any member has the same email or the same combination of `first_name` and `last_name`. The default is `true`.                                                        |
| *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

### New child

This is an example that would create a new child. The key things to note are that `main_email`, `first_name`, ​and `last_name` are all supplied while `clogin_id` is `false`. Altogether, this is the equivalent of a parent registering a child and answering the yes/no question.

:::CodeblockTabs
```curl
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_child",
    "group_id": 100909072,
    "clogin_id": false,
    "connected_to": 102670540,
    "doc": {
        "first_name": "Bill",
        "last_name": "Evans",
        "your_instrument": "piano"
    }
}
```

```python
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_child",
    "group_id": 100909072,
    "clogin_id": false,
    "connected_to": 102670540,
    "doc": {
        "first_name": "Bill",
        "last_name": "Evans",
        "your_instrument": "piano"
    }
}
create_new_child_json = json.dumps(payload)
create_new_child_response = requests.post(url=users_endpoint, 
                                          data=create_new_child_json, 
                                          headers=headers, 
                                          timeout=10)
```
:::

### New user response

```json
{
    "msg": "Child created.",
    "system_action": [
        "child_created"
    ],
    "success": true,
    "user_info": {
        "clogin_id": "102715755",
        "group_id": "100909072",
        "connected_to": "102670540"
    },
    "meta_info": {
        "u_name": "Bill Evans",
        "total_forms": "6",
        "completed_forms": "0",
        "total_user_forms": "6",
        "total_completed_user_forms": "0",
        "total_user_mandatory_forms": "6",
        "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": "4085259",
        "clogin_id": "102715755",
        "excluded": "0",
        "connected_to": "102670540",
        "total_user_tags": "0",
        "user_tag_ids": null,
        "total_non_excluded_children": null,
        "star": "0",
        "admin_initials": null,
        "admin_color": null,
        "assigned_admin_id": null
    }
}
```













