# Microsoft Teams

> Send messages in Microsoft Teams chats and channels, schedule meetings, and manage teams and members.

App · Messaging · 10 actions. Web page: https://docs.lodol.com/docs/integrations/microsoft-teams

## Actions

### Add member to team

Add a member to a Teams team.

**Inputs**

- Team ID (`ms_team_id`, text, required): The ID of the team. You can find it with the List joined teams or Get IDs from a Teams link actions.
- User ID or email (`ms_user_id`, text, required): The user ID or email address of the person to add. You can find the ID with the Search team members action, or simply enter their email address.
- Role (`role`, text): Optional role for the member (e.g., owner).

**Outputs**

- `ms_team_id` (text): The team ID.
- `ms_user_id` (text): The user ID.
- `result` (object): The member result.
- `status` (text): Operation status.

**Example output**

```json
{
  "ms_team_id": "team123",
  "ms_user_id": "user123",
  "result": {},
  "status": "success"
}
```

### Create channel

Create a new channel in a Teams team.

**Inputs**

- Team ID (`ms_team_id`, text, required): The ID of the team. You can find it with the List joined teams or Get IDs from a Teams link actions.
- Channel name (`display_name`, text, required): The name for the new channel.
- Description (`description`, text): Optional description for the channel.

**Outputs**

- `channel_id` (text): The created channel ID. Use as channel_id in send_channel_message.
- `ms_team_id` (text): The team ID.
- `result` (object): The created channel.
- `status` (text): Operation status.

**Example output**

```json
{
  "channel_id": "channel123",
  "ms_team_id": "team123",
  "result": {},
  "status": "success"
}
```

### Get IDs from a Teams link

Get the team, channel, and organization (tenant) IDs from a Microsoft Teams link.

**Inputs**

- Link (`link`, text, required): A Microsoft Teams URL (team or channel link).

**Outputs**

- `channel_id` (text): The channel ID extracted from the link, if present. Use as channel_id in send_channel_message.
- `ms_team_id` (text): The team (group) ID extracted from the link. Use as ms_team_id in other Teams actions.
- `status` (text): Operation status.
- `tenant_id` (text): The tenant ID extracted from the link, if present.

**Example output**

```json
{
  "channel_id": "19:abc123@thread.tacv2",
  "ms_team_id": "72602e12-78ac-474c-99d6-f619710353a9",
  "status": "success",
  "tenant_id": "aaaabbbb-0000-cccc-1111-dddd2222eeee"
}
```

### List joined teams

List all Teams the current user has joined.

**Inputs**

- Maximum results (`top`, number): Optional maximum number of teams to return.

**Outputs**

- `status` (text): Operation status.
- `team_count` (number): Number of teams.
- `teams` (list): List of teams.

**Example output**

```json
{
  "status": "success",
  "team_count": 1,
  "teams": [
    {
      "description": "Engineering team",
      "displayName": "Engineering",
      "id": "72602e12-78ac-474c-99d6-f619710353a9"
    }
  ]
}
```

### List team channels

List channels in a Teams team.

**Inputs**

- Team ID (`ms_team_id`, text, required): The ID of the team. You can find it with the List joined teams or Get IDs from a Teams link actions.
- Maximum results (`top`, number): Optional maximum number of channels to return.

**Outputs**

- `channel_count` (number): Number of channels.
- `channels` (list): List of channels.
- `ms_team_id` (text): The team ID.
- `status` (text): Operation status.

**Example output**

```json
{
  "channel_count": 1,
  "channels": [
    {
      "description": "General discussion",
      "displayName": "General",
      "id": "19:general@thread.tacv2"
    }
  ],
  "ms_team_id": "team123",
  "status": "success"
}
```

### List user chats

List chats for a user.

**Inputs**

- User ID (`ms_user_id`, text): The user ID. Defaults to 'me', the signed-in user. Default: `me`.

**Outputs**

- `chat_count` (number): Number of chats.
- `chats` (list): List of chats.
- `ms_user_id` (text): The user ID.
- `status` (text): Operation status.

**Example output**

```json
{
  "chat_count": 1,
  "chats": [
    {
      "chatType": "group",
      "id": "19:abc123@thread.v2",
      "topic": "Project Discussion"
    }
  ],
  "ms_user_id": "me",
  "status": "success"
}
```

### Schedule meeting

Schedule a Teams meeting.

**Inputs**

- Organizer ID (`organizer_id`, text): The organizer's user ID. Defaults to 'me', the signed-in user. Default: `me`.
- Subject (`subject`, text, required): The meeting subject.
- Start date and time (`start_datetime`, date and time, required): When the meeting starts, for example 2026-07-15T09:00:00.
- End date and time (`end_datetime`, date and time, required): When the meeting ends, for example 2026-07-15T10:00:00.
- Timezone (`timezone`, text, required): Time zone for the meeting (e.g., 'America/New_York').
- Attendees (`attendees`, list, required): List of attendee email addresses.

**Outputs**

- `meeting_id` (text): The created event ID.
- `organizer_id` (text): The organizer user ID.
- `result` (object): The created event.
- `status` (text): Operation status.

**Example output**

```json
{
  "meeting_id": "event123",
  "organizer_id": "me",
  "result": {},
  "status": "success"
}
```

### Search team members

Search for members of a Teams team by name.

**Inputs**

- Team ID (`ms_team_id`, text, required): The ID of the team. You can find it with the List joined teams or Get IDs from a Teams link actions.
- Name to search for (`query`, text, required): The person's name to search for. Matches any part of the name and ignores capitalization.
- Maximum results (`top`, number): Optional maximum number of results to return.

**Outputs**

- `member_count` (number): Number of matching members.
- `members` (list): List of matching members.
- `ms_team_id` (text): The team ID.
- `status` (text): Operation status.

**Example output**

```json
{
  "member_count": 1,
  "members": [
    {
      "displayName": "John Doe",
      "email": "john@contoso.com",
      "id": "user123"
    }
  ],
  "ms_team_id": "team123",
  "status": "success"
}
```

### Send channel message

Send a message to a Teams channel.

**Inputs**

- Team ID (`ms_team_id`, text, required): The ID of the team. You can find it with the List joined teams or Get IDs from a Teams link actions.
- Channel ID (`channel_id`, text, required): The ID of the channel. You can find it with the List team channels, Get IDs from a Teams link, or Create channel actions.
- Message (`message`, text, required): The message content.

**Outputs**

- `channel_id` (text): The channel ID.
- `ms_team_id` (text): The team ID.
- `result` (object): The sent message.
- `status` (text): Operation status.

**Example output**

```json
{
  "channel_id": "channel123",
  "ms_team_id": "team123",
  "result": {},
  "status": "success"
}
```

### Send chat message

Send a message to a Teams chat.

**Inputs**

- Chat ID (`chat_id`, text, required): The ID of the chat. You can find it with the List user chats action.
- Message (`message`, text, required): The message content.
- Subject (`subject`, text): Optional message subject.

**Outputs**

- `chat_id` (text): The chat ID.
- `result` (object): The sent message.
- `status` (text): Operation status.

**Example output**

```json
{
  "chat_id": "chat123",
  "result": {},
  "status": "success"
}
```
