> For the complete documentation index, see [llms.txt](https://docs.buzzy.buzz/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.buzzy.buzz/developing-and-extending-buzzy/buzzy-rest-api/rest-api/user-and-organization-operations/insertteammembers.md).

# insertteammembers

### description

insert a list of users into a list of teams.

You can either supply a list of email addresses or existing userIDs. If email addresses, and the users do not exist, the users will be created and invited.

Note: the user inserting members must have organization or team admin right to be able to add users to a team. If you'd like to just invite to an organization, then use the "All Members" team of an organization.

### parameters

The `X-Auth-Token` and `X-User-Id` are derived from the values `authToken` and `userId` returned from the login endpoint and are used in the HTTP header.

```
{
        "teamIDs":["<teamid1>", "<teamid2>"],
        "emails": ["email1@test.com", "email2@test.com", "if not user will be invited"],
        "userIDs": ["option user id's for existing users"],
        "targetRoute": "<optiona 'app' or 'go'>",
        "targetInitialApp": "<optional app id if app route>",
        "targetInitialScreen": "<optional  if app route screen id>"        
}





```

### response

Returns the status of the request

### example

```
POST /api/insertteammembers 
X-Auth-Token:<insert token here>
X-User-Id:<insert user id here>

{
	"teamIDs":["<teamid1>", "<teamid2>"],
	"emails": ["email1@test.com", "email2@test.com"]
}
```

You should get back:

```
{
    "status": "success",
}
```

***
