Teams

Operations around Team management.

Endpoints

GET /api/teams
POST /api/teams
POST /api/teams/join
GET /api/teams/:teamId
POST /api/teams/:teamId
DELETE /api/teams/:teamId
GET /api/teams/:teamId/users
POST /api/teams/:teamId/users
GET /api/teams/:teamId/users/:userId
POST /api/teams/:teamId/users/:userId
DELETE /api/teams/:teamId/users/:userId
GET /api/teams/:teamId/websites

GET /api/teams

Returns all teams.

Parameters

  • page: (optional number, default 1) Determines page.
  • pageSize: (optional string) Determines how many results to return.

Sample response

{
  "data": [
    {
      "id": "xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx",
      "name": "Umami Software",
      "accessCode": "xxxxxxxxxx",
      "logoUrl": null,
      "createdAt": "2025-01-06T23:46:38.169Z",
      "updatedAt": "2025-02-14T17:38:27.607Z",
      "deletedAt": null,
      "members": [
        {
          "id": "xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx",
          "teamId": "xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx",
          "userId": "xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx",
          "role": "team-owner",
          "createdAt": "2025-01-06T23:46:38.169Z",
          "updatedAt": "2025-01-06T23:46:38.169Z",
          "user": {
            "id": "xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx",
            "username": "[email protected]"
          }
        },
        {
          "id": "xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx",
          "teamId": "xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx",
          "userId": "xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx",
          "role": "team-member",
          "createdAt": "2025-01-06T23:46:38.169Z",
          "updatedAt": "2025-01-06T23:46:38.169Z",
          "user": {
            "id": "xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx",
            "username": "[email protected]"
          }
        }
      ],
      "_count": {
        "websites": 1,
        "members": 2
      }
    }
  ],
  "count": 1,
  "page": 1,
  "pageSize": 20
}

POST /api/teams

Creates a team.

Parameters

  • name: (string) The team's name.

Request body

{
  "name": "marketing"
}

Sample response

[
  {
    "id": "xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx",
    "name": "marketing",
    "accessCode": "team_KBmjrm5KcDZSArah",
    "logoUrl": null,
    "createdAt": "0000-00-00T00:00:00.000Z",
    "updatedAt": "0000-00-00T00:00:00.000Z",
    "deletedAt": null
  },
  {
    "id": "xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx",
    "teamId": "xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx",
    "userId": "xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx",
    "role": "team-owner",
    "createdAt": "0000-00-00T00:00:00.000Z",
    "updatedAt": "0000-00-00T00:00:00.000Z"
  }
]

POST /api/teams/join

Join a team.

Parameters

  • accessCode: (string) The team's access code.

Request body

{
  "accessCode": "xxwtoY8pzKjDIUQi"
}

Sample response

{
  "id": "xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx",
  "teamId": "xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx",
  "userId": "xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx",
  "role": "team-member",
  "createdAt": "0000-00-00T00:00:00.000Z",
  "updatedAt": "0000-00-00T00:00:00.000Z"
}

GET /api/teams/:teamId

Get a team.

Sample response

{
  "id": "xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx",
  "name": "Umami Software",
  "accessCode": "xxxxxxxxxxx",
  "logoUrl": null,
  "createdAt": "2024-02-17T06:27:50.130Z",
  "updatedAt": "2025-02-14T17:37:50.306Z",
  "deletedAt": null,
  "members": [
    {
      "id": "xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx",
      "teamId": "xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx",
      "userId": "xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx",
      "role": "team-owner",
      "createdAt": "2024-02-17T06:27:50.130Z",
      "updatedAt": "2024-02-17T06:27:50.130Z"
    },
    {
      "id": "xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx",
      "teamId": "xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx",
      "userId": "xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx",
      "role": "team-member",
      "createdAt": "2024-02-29T17:47:21.354Z",
      "updatedAt": "2024-02-29T17:47:21.354Z"
    }
  ]
}

POST /api/teams/:teamId

Update a team.

Parameters

  • name: (string | optional) The team's name.
  • accessCode: (string | optional) The team's access code.

Request body

{
  "name": "Marketing"
}

Sample response

{
  "id": "xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx",
  "name": "Marketing",
  "accessCode": "xxxxxxxxxxx",
  "logoUrl": null,
  "createdAt": "2025-10-07T07:42:06.112Z",
  "updatedAt": "2025-10-10T22:41:22.191Z",
  "deletedAt": null
}

DELETE /api/teams/:teamId

Delete a team.

Sample response

{
  "ok": true
}

GET /api/teams/:teamId/users

Get all users that belong to a team.

Parameters

  • search: (optional string) Search text.
  • page: (optional number, default 1) Determines page.
  • pageSize: (optional string) Determines how many results to return.

Sample response

{
  "data": [
    {
      "id": "xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx",
      "teamId": "xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx",
      "userId": "xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx",
      "role": "team-owner",
      "createdAt": "2025-10-10T22:34:46.736Z",
      "updatedAt": "2025-10-10T22:34:46.736Z",
      "user": {
        "id": "xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx",
        "username": "[email protected]"
      }
    },
    {
      "id": "xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx",
      "teamId": "xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx",
      "userId": "xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx",
      "role": "team-member",
      "createdAt": "2025-10-10T22:37:38.587Z",
      "updatedAt": "2025-10-10T22:37:38.587Z",
      "user": {
        "id": "xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx",
        "username": "[email protected]"
      }
    }
  ],
  "count": 2,
  "page": 1,
  "pageSize": 20
}

POST /api/teams/:teamId/users

Add a user to a team.

Parameters

  • userId: ID of user to be added.
  • role: Team role for user (team-member| team-view-only | team-manager).

Request body

{
  "userId": "xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx",
  "role": "team-member"
}

Sample response

{
  "id": "xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx",
  "teamId": "xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx",
  "userId": "xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx",
  "role": "team-member",
  "createdAt": "0000-00-00T00:00:00.000Z",
  "updatedAt": "0000-00-00T00:00:00.000Z"
}

GET /api/teams/:teamId/users/:userId

Get a user belonging to a team.

Sample response

{
  "id": "xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx",
  "teamId": "xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx",
  "userId": "xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx",
  "role": "team-owner",
  "createdAt": "0000-00-00T00:00:00.000Z",
  "updatedAt": "0000-00-00T00:00:00.000Z"
}

POST /api/teams/:teamId/users/:userId

Update a user's role on a team.

Parameters

  • role: Team role for user (team-member| team-view-only | team-manager).

Request body

{
  "role": "team-member"
}

Sample response

{
  "id": "xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx",
  "teamId": "xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx",
  "userId": "xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx",
  "role": "team-member",
  "createdAt": "0000-00-00T00:00:00.000Z",
  "updatedAt": "0000-00-00T00:00:00.000Z"
}

DELETE /api/teams/:teamId/users/:userId

Remove a user from a team.

Sample response

{
  "ok": true
}

GET /api/teams/:teamId/websites

Get all websites that belong to a team.

Parameters

  • search: (optional string) Search text.
  • page: (optional number, default 1) Determines page.
  • pageSize: (optional string) Determines how many results to return.

Sample response

{
  "data": [
    {
      "id": "xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx",
      "name": "aol",
      "domain": "aol.com",
      "shareId": "xxxxxxxxxxxx",
      "resetAt": null,
      "userId": null,
      "teamId": "xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx",
      "createdBy": "xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx",
      "createdAt": "2020-07-19T06:53:33.482Z",
      "updatedAt": "2024-06-24T05:00:00.279Z",
      "deletedAt": null,
      "createUser": {
        "id": "xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx",
        "username": "[email protected]"
      }
    }
  ],
  "count": 1,
  "page": 1,
  "pageSize": 20
}