puter.teams.get()

Websites Puter Apps Node.js Workers

The Teams API is in beta. Method shapes, limits, and behavior may change between releases.

Returns one team the caller belongs to.

Syntax

puter.teams.get(uid)

Parameters

uid (String) (required)

The team's identifier, as returned by create() or list(). Handles are not accepted — see uid, not handle.

Return value

A Promise that resolves to a Team.

Rejects with team_not_found if the team does not exist or the caller is not a member. The two are not distinguished, so this cannot be used to probe for teams the caller has nothing to do with.

Examples

Read a team back

<html>
<body>
    <script src="https://js.puter.com/v2/"></script>
    <script>
        (async () => {
            const [first] = await puter.teams.list();
            if (!first) return puter.print('No team.');
            const team = await puter.teams.get(first.uid);
            puter.print(`${team.name} (@${team.handle ?? 'no handle'})`);
        })();
    </script>
</body>
</html>