---
title: "Teams"
description: "Teams"
url: "https://www.contentstack.com/docs/developers/sdks/content-management-sdk/javascript/reference/teams"
product: "Contentstack"
doc_type: "guide"
audience:
  - developers
  - admins
version: "current"
last_updated: "2026-09-04"
---

# Teams

## Teams

Teams streamline the process of assigning roles and permissions by grouping users together. Rather than assigning roles to individual users or at the stack level, you can assign roles directly to a team. This ensures that all users within a team share the same set of role permissions, making role management more efficient.

## fetch

The fetch method retrieves details of a specific team.

```
import * as contentstack from '@contentstack/management'
const client = contentstack.client({ authtoken })

client.organization('organization_uid').teams('teamUid').fetch()
.then((team) => console.log(team)
```

If true, include detailed user information for team members; otherwise, include only user UIDs.

## create

The create method creates a new team.

```
import * as contentstack from '@contentstack/management'
const client = contentstack.client({ authtoken })
const team = { 
name: 'name', 
organizationUid: 'organization_uid', 
users: [], 
stackRoleMapping: [], 
organizationRole: 'organizationRole'
}

client.organization('organizationUid').teams().create(team)
.then((response) => console.log(response))
```

If true, include detailed user information for team members; otherwise, include only user UIDs.

Details required for team creation.

## fetchAll

The fetchAll method retrieves the details of all teams.

```
import * as contentstack from '@contentstack/management'
const client = contentstack.client({ authtoken })

client.organization('organizationUid').teams().fetchAll()
.then((teams) => console.log(teams))
```

If true, include detailed user information for team members; otherwise, include only user UIDs.

Sort in either ascending or descending order

Used to match the given string in all teams name & return the matched result

Skip the number of teams

Limit the result to number of teams

list of user UIDs to be filtered

## delete

The delete method deletes an existing team.

```
import * as contentstack from '@contentstack/management'
const client = contentstack.client({ authtoken })

client.organization('organization_uid').teams('teamUid').delete()
.then((response) => console.log(response)
```

## update

The update method involves adding and removing users from teams, assigning and removing stack roles within teams, updating team descriptions, and adjusting team organization roles.

```
import * as contentstack from '@contentstack/management'
const client = contentstack.client({ authtoken })
const updateData = {
name: 'updatedname',
users: [{
email: 'abc@abc.com'
}],
organizationRole: 'blt09e5dfced326aaea',
stackRoleMapping: []
}

client.organization(s'organizationUid').teams('teamUid').update(updateData)
.then((response) => console.log(response))
```

If true, include detailed user information for team members; otherwise, include only user UIDs.

## TeamUsers

The TeamUsers method retrieves the UIDs of the users.

```
import * as contentstack from '@contentstack/management'
const client = contentstack.client({ authtoken })

client.organization('organizationUid').teams('teamUid').teamUsers().fetchAll()
.then((response) => console.log(response))
```

## stackRoleMappings

The stackRoleMappings method retrieves the stack role mapping details.

```
import * as contentstack from '@contentstack/management'
const client = contentstack.client({ authtoken })

client.organization(s'organizationUid').teams('teamUid').stackRoleMappings().fetchAll()
.then((response) => console.log(response))
```

## Teams | JavaScript Management SDK | Contentstack

Teams group users so you can assign roles and permissions to the whole team at once, in the JavaScript Management SDK.