Copy as Markdown[View as Markdown](/docs/sdk/functions/writeTeam.md)

***

# Function: writeTeam()

> **writeTeam**(`catalogDir`): (`team`, `options`) => `Promise`<`void`>

Defined in: teams.ts:105

Write a team to EventCatalog.

## Parameters[​](#parameters "Direct link to Parameters")

| Parameter    | Type     |
| ------------ | -------- |
| `catalogDir` | `string` |

## Returns[​](#returns "Direct link to Returns")

`Function`

### Parameters[​](#parameters-1 "Direct link to Parameters")

| Parameter           | Type                       |
| ------------------- | -------------------------- |
| `team`              | `Team`                     |
| `options`           | { `override`: `boolean`; } |
| `options.override`? | `boolean`                  |

### Returns[​](#returns-1 "Direct link to Returns")

`Promise`<`void`>

## Example[​](#example "Direct link to Example")

```
import utils from '@eventcatalog/utils';

const { writeTeam } = utils('/path/to/eventcatalog');

// Write a team to the catalog
// team would be written to teams/EventCatalogCoreTeam
await writeTeam({
  id: 'eventcatalog-core-team',
  name: 'EventCatalogCoreTeam',
  members: ['dboyne', 'asmith', 'msmith'],
  email: 'test@test.com',
  slackDirectMessageUrl: https://yourteam.slack.com/channels/boyney123
});

// Write a team to the catalog and override the existing content (if there is any)
await writeTeam({
  id: 'eventcatalog-core-team',
  name: 'EventCatalogCoreTeam',
  members: ['dboyne', 'asmith', 'msmith'],
  email: 'test@test.com',
  slackDirectMessageUrl: https://yourteam.slack.com/channels/boyney123
}, { override: true });
```
