# Insert

**Add a single user to one or more groups.** When new users are added, invites are sent automatically within 1-5 minutes. If the group does not exist, it will automatically be created.

### Parameters

| Key       | Type                                                          |
| --------- | ------------------------------------------------------------- |
| groups    | Array of Strings                                              |
| user      | User Object (firstname, lastname, email, optional telelphone) |
| invite    | Boolean (defaults to true)                                    |
| forceSync | Boolean (defaults to false)                                   |

{% hint style="warning" %}
**Caution**

When using `forceSync`, this will potentially **remove users from other groups they may have been manually assigned**. You should only use this **if it is unlikely** the user will be manually assigned to groups.
{% endhint %}

### Example

```
curl -X POST \
  v1/groups/insert \
  -H 'Authorization: Basic <Your Base64 Encoded Token>' \
  -d '{
	"groups" : ["Group One","Group Two"],
	"user" : {
	  "firstname" : "Test",
	  "lastname" : "User",
	  "email" : "test@example.com"   
        }
 }'
```

### Success Response

```
{
    "status": "success",
    "data": [
        {
            "group": "Group One",
            "status": "success",
            "inserts": 1,
            "warnings": 0
        },
        {
            "group": "Group Two",
            "status": "success",
            "inserts": 1,
            "warnings": 0
        }
    ],
    "hash": "15cc3e129ddd0c4ea2e5f0ebc4b18688",
    "response_time": 0.225816011428833
}
```


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## Querying This Documentation
If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://everyday-digital.gitbook.io/falkor-dev-docs/groups/insert.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
