> ## Documentation Index
> Fetch the complete documentation index at: https://docs.automate.ax/llms.txt
> Use this file to discover all available pages before exploring further.

> ## Agent Instructions
> Automate.ax automations are TypeScript programs.
> Use Bun for installation and command examples.
> Use Automate.ax for the product name and automate.ax for the package, CLI, and domain.
> Treat documented public APIs as current; do not invent transitional or deprecated names.

# Create chat

> Create a one-to-one or group Microsoft Teams chat.

`createChat` creates a chat with Microsoft 365 users and automatically adds the
connected user as an owner.

## Example

```ts automations/create-launch-chat.automation.ts theme={null}
import { automation } from "automate.ax"
import { createChat } from "automate.ax/teams"

export default automation("Create launch chat", () => {
  createChat({
    chatType: "group",
    topic: "Launch room",
    participants: [
      { user: "alex@example.com" },
      { user: "guest-user-id", role: "guest" },
    ],
  })
})
```

## Inputs

| Input          | Type                                                 | Required   | Default         | Description                                                               |
| -------------- | ---------------------------------------------------- | ---------- | --------------- | ------------------------------------------------------------------------- |
| `chatType`     | `"oneOnOne" \| "group"`                              | Yes        | —               | Chat kind to create.                                                      |
| `participants` | `{ user: string; role?: "owner" \| "guest" }[]`      | Yes        | —               | Other users by Entra ID or user principal name. Role defaults to `owner`. |
| `topic`        | `string`                                             | Group only | None            | Non-empty group-chat title.                                               |
| `account`      | `string \| IntegrationAccountReference<"microsoft">` | No         | Project default | Microsoft binding.                                                        |

A one-to-one chat requires exactly one other participant and cannot have a
topic. A group chat requires at least two other participants. Use `guest` only
for guest users in the same tenant.

## Output

Returns the created `TeamsChat` with `chatId`, `chatType`, and available topic,
tenant, timestamps, and web URL. Graph may return an existing one-to-one chat
between the same people rather than creating a duplicate.
