TeamUsers
TeamUsers
The TeamUsers methods allows uou to retrieve, add, and remove users from a team.
add
The add method adds an user to the team.
import * as contentstack from '@contentstack/management'
const client = contentstack.client({ authtoken })
const usersMail = {
emails: ['emailId1','emailId2' ]
}
client.organization('organizationUid').teams('teamUid').teamUsers('userId').add(usersMail)
.then((response) => console.log(response))fetchAll
The fetchAll method allows you to fetch all details of the users of a team.
| Name | Type | Description |
|---|---|---|
| includeUserDetails | boolean | If true, include detailed user information for team members; otherwise, include only user UIDs. |
| include_count | boolean | Include total count of users |
import * as contentstack from '@contentstack/management'
const client = contentstack.client({ authtoken })
client.organization('organizationUid').teams('teamUid').teamUsers('userId').fetchAll()
.then((users) => console.log(users))remove
The remove method removes an user from the team.
import * as contentstack from '@contentstack/management'
const client = contentstack.client({ authtoken })
client.organization('organization_uid').teams('teamUid').teamUsers('userId').remove()
.then((response) => console.log(response)