List User Teams

HTTP MethodURLRequires Auth

GET

/api/v1/users.listTeams

Query Parameters

KeyExample ValueDescription

userId*

JxemcN9PDCdfzJe

The user ID.

Example Call

curl --location --request POST 'http://localhost:3000/api/v1/users.listTeams\
--header 'X-Auth-Token: myauth-token' \
--header 'X-User-Id: myuser-name'
-d "userId=JxemcN9PDCdfzJe"

If the caller has permission to view all teams, there's no need to filter the teams.

Example Response

Success

{
    "teams": [
        {
            "_id": "612b8ae982d286c3",
            "name": "documentation-team",
            "type": 0,
            "createdAt": "2021-08-29T13:26:01.750Z",
            "createdBy": {
                "_id": "JxemcN9PDCdfzJe",
                "username": "renato.b"
            },
            "_updatedAt": "2021-08-29T13:26:01.762Z",
            "roomId": "GwktYAajqw4RiWiBK",
            "isOwner": true
        }
    ],
    "success": true
}

Errors

The following error can occur upon the endpoint.

  • Authorization: Requires an authentication token for the request to be made.

{
    "status": "error",
    "message": "You must be logged in to do this."
}

Last updated

Rocket.Chat versions receive support for six months after release.