# Set auto-join mode and rules

> `autoJoin` is `all`, `hosted` (only meetings this account organises) or `manual` (never automatically). `barRules` are checked before `joinRules`, so a bar always wins. Rule values are lowercased and trimmed on the way in, so they match how meetings are compared.

`PATCH https://api-notetaker.nabrah.ai/ext/v1/calendar/connections/{id}`

Requires an API key in the `Authorization` header.

`autoJoin` is `all`, `hosted` (only meetings this account organises) or `manual` (never automatically). `barRules` are checked before `joinRules`, so a bar always wins. Rule values are lowercased and trimmed on the way in, so they match how meetings are compared.

## Path parameters

- `id` (string · uuid, required)

## Body

- `autoJoin` (enum) One of: `all`, `hosted`, `manual`.
- `joinRules` (object[])
  - `kind` (enum, required) One of: `title`, `email`, `domain`.
  - `value` (string, required)
- `barRules` (object[])
  - `kind` (enum, required) One of: `title`, `email`, `domain`.
  - `value` (string, required)

## Example request body

```json
{
  "autoJoin": "all",
  "joinRules": [
    {
      "kind": "title",
      "value": "string"
    }
  ],
  "barRules": [
    {
      "kind": "title",
      "value": "string"
    }
  ]
}
```

## Responses

- `200` — One calendar connection.
- `401` — No key, an unknown key, or one that has been revoked or has expired.
- `403` — The key is read only, or lacks the reach for this route.
- `404` — No such record — or one that belongs to another account.
- `422` — The body or query failed validation; `details` names the field.
- `429` — Too many requests. `Retry-After` says how long to wait.

### 200 example

```json
{
  "data": {
    "id": "00000000-0000-0000-0000-000000000000",
    "provider": "string",
    "accountEmail": "string",
    "calendarId": "string",
    "status": "active",
    "autoJoin": "all",
    "joinRules": [
      {
        "kind": "title",
        "value": "string"
      }
    ],
    "barRules": [
      {
        "kind": "title",
        "value": "string"
      }
    ],
    "lastSyncedAt": "string",
    "lastError": "string",
    "createdAt": "2026-01-01T09:00:00.000Z"
  }
}
```

### 401 example

```json
{
  "error": {
    "code": "string",
    "message": "string",
    "details": [
      {
        "path": "string",
        "message": "string"
      }
    ]
  }
}
```

### 403 example

```json
{
  "error": {
    "code": "string",
    "message": "string",
    "details": [
      {
        "path": "string",
        "message": "string"
      }
    ]
  }
}
```

### 404 example

```json
{
  "error": {
    "code": "string",
    "message": "string",
    "details": [
      {
        "path": "string",
        "message": "string"
      }
    ]
  }
}
```

### 422 example

```json
{
  "error": {
    "code": "string",
    "message": "string",
    "details": [
      {
        "path": "string",
        "message": "string"
      }
    ]
  }
}
```

### 429 example

```json
{
  "error": {
    "code": "string",
    "message": "string",
    "details": [
      {
        "path": "string",
        "message": "string"
      }
    ]
  }
}
```
