# Teams API

> Groups of users in your account, inside an organization or on their own. Team admins adjust settings for their team wherever a higher level has not locked them.

Part of the AGNT API reference. AGNT (https://agnt.ai) is the developer platform behind OpenAssistant (https://openassistant.us). Docs index: https://agnt.ai/llms.txt. Web page: https://agnt.ai/reference/api/teams

Base URL: `https://api.agnt.ai`. Auth: `Authorization: Bearer ak_live_...`.

## GET /teams

List teams

Returns the teams in your account, newest first, filtered by `status`. With organization-scoped credentials, returns only that organization's teams.

**Query parameters**

- `page` (integer)
- `perPage` (integer)
- `status` (string)

**Responses**

- `200`: Teams
  - `ok` (enum, required) One of: `true`.
  - `teams` (object[], required)
    - `id` (string): Team id
    - `account` (string): Your account id
    - `organization` (string | null): The organization the team belongs to
    - `name` (string)
    - `generalInfo` (string): Background about the team that its users' assistants know
    - `adminApprovalRequired` (boolean): Whether a team admin must approve people who ask to join
    - `brandingOnEvents` (boolean): Whether calendar events the assistant creates carry your app's branding
    - `brandingOnMessages` (boolean): Whether messages the assistant sends carry your app's branding
    - `status` (enum) One of: `active`, `archived`.
    - `createdAt` (string)
    - `updatedAt` (string)
  - `page` (integer)
  - `perPage` (integer)
  - `total` (integer)

```bash
curl 'https://api.agnt.ai/teams' \
  -H "Authorization: Bearer ak_live_..."
```

Example response:

```json
{
  "ok": true,
  "teams": [
    {
      "id": "6660c4a1f2e3b7d8a9c01234",
      "account": "account",
      "organization": "organization",
      "name": "Ava"
    }
  ]
}
```

## POST /teams

Create a team

Creates a team in the caller's organization, when there is one. Called as a user, that user is the owner; with an account key, pass `ownerId`.

**Request body** (JSON)

- `name` (string, required)
- `adminApprovalRequired` (boolean): Whether a team admin must approve people who ask to join
- `ownerId` (string): User id of the owner. Required with an account key.

**Responses**

- `201`: Created
  - `ok` (enum, required) One of: `true`.
  - `team` (object, required)
    - `id` (string): Team id
    - `account` (string): Your account id
    - `organization` (string | null): The organization the team belongs to
    - `name` (string)
    - `generalInfo` (string): Background about the team that its users' assistants know
    - `adminApprovalRequired` (boolean): Whether a team admin must approve people who ask to join
    - `brandingOnEvents` (boolean): Whether calendar events the assistant creates carry your app's branding
    - `brandingOnMessages` (boolean): Whether messages the assistant sends carry your app's branding
    - `status` (enum) One of: `active`, `archived`.
    - `createdAt` (string)
    - `updatedAt` (string)
- `400`: name missing, or ownerId missing with an account key
  - `status` (integer)
  - `error_code` (string)
  - `error` (string)
- `403`: Not an organization admin
  - `status` (integer)
  - `error_code` (string)
  - `error` (string)
- `404`: ownerId is not a user in your account
  - `status` (integer)
  - `error_code` (string)
  - `error` (string)

```bash
curl 'https://api.agnt.ai/teams' \
  -X POST \
  -H "Authorization: Bearer ak_live_..." \
  -H "Content-Type: application/json" \
  -d '{
  "name": "Ava"
}'
```

Example response:

```json
{
  "ok": true,
  "team": {
    "id": "6660c4a1f2e3b7d8a9c01234",
    "account": "account",
    "organization": "organization",
    "name": "Ava"
  }
}
```

## GET /teams/{teamId}

Retrieve a team

Retrieves a team.

**Path parameters**

- `teamId` (string, required)

**Responses**

- `200`: Team
  - Same fields as the `201` response of `POST /teams`.
- `404`: Team not found
  - `status` (integer)
  - `error_code` (string)
  - `error` (string)

```bash
curl 'https://api.agnt.ai/teams/<teamId>' \
  -H "Authorization: Bearer ak_live_..."
```

Example response:

```json
{
  "ok": true,
  "team": {
    "id": "6660c4a1f2e3b7d8a9c01234",
    "account": "account",
    "organization": "organization",
    "name": "Ava"
  }
}
```

## PUT /teams/{teamId}

Update a team

Updates a team. Only the fields you send change. Requires a team admin.

**Path parameters**

- `teamId` (string, required)

**Request body** (JSON)

- `name` (string)
- `generalInfo` (string): Background about the team that its users' assistants know
- `adminApprovalRequired` (boolean)
- `status` (enum) One of: `active`, `archived`.
- `brandingOnEvents` (boolean)
- `brandingOnMessages` (boolean)

**Responses**

- `200`: Updated
  - Same fields as the `201` response of `POST /teams`.
- `403`: Not a team admin
  - `status` (integer)
  - `error_code` (string)
  - `error` (string)
- `404`: Team not found
  - `status` (integer)
  - `error_code` (string)
  - `error` (string)

```bash
curl 'https://api.agnt.ai/teams/<teamId>' \
  -X PUT \
  -H "Authorization: Bearer ak_live_..." \
  -H "Content-Type: application/json" \
  -d '{
  "name": "Ava",
  "generalInfo": "generalinfo",
  "adminApprovalRequired": true,
  "status": "active"
}'
```

Example response:

```json
{
  "ok": true,
  "team": {
    "id": "6660c4a1f2e3b7d8a9c01234",
    "account": "account",
    "organization": "organization",
    "name": "Ava"
  }
}
```

## DELETE /teams/{teamId}

Delete a team

Deletes a team. Its memberships are archived, and its assistants are detached from it. Requires a team admin.

**Path parameters**

- `teamId` (string, required)

**Responses**

- `200`: Deleted
  - `ok` (enum, required) One of: `true`.
  - `team` (object, required)
    - `id` (string, required)
    - `deleted` (boolean)
    - `message` (string)

```bash
curl 'https://api.agnt.ai/teams/<teamId>' \
  -X DELETE \
  -H "Authorization: Bearer ak_live_..."
```

Example response:

```json
{
  "ok": true,
  "team": {
    "id": "6660c4a1f2e3b7d8a9c01234"
  }
}
```

## GET /teams/{teamId}/members

List team members

Returns the team's members, newest first, each with the user, role and status. Archived members appear only when you filter by `status`; `search` matches name and email.

**Path parameters**

- `teamId` (string, required)

**Query parameters**

- `page` (integer)
- `perPage` (integer)
- `status` (string)
- `search` (string)

**Responses**

- `200`: Members
  - `ok` (enum, required) One of: `true`.
  - `members` (object[], required)
    - `id` (string): Membership id: the memberId for PUT and DELETE /teams/{teamId}/members/{memberId}
    - `user` (object): The user
      - `id` (string, required)
      - `account` (string, required)
      - `email` (string)
      - `externalId` (string)
      - `assistant` (string | null, required)
      - `name` (string | null, required)
      - `firstName` (string)
      - `lastName` (string)
      - `avatarUrl` (string | null, required)
      - `timezone` (string, required)
      - `locale` (string, required)
      - `country` (string | null)
      - `city` (string)
      - `organization` (string | null, required)
      - `organizationRole` (enum, required) One of: `admin`, `member`, `guest`.
      - `team` (object | null, required)
        - `id` (string, required)
        - `name` (string, required)
        - `organization` (string | null, required)
        - `status` (string, required)
      - `teamRole` (enum, required) One of: `member`, `admin`, `owner`, `null`.
      - `status` (enum, required) One of: `active`, `inactive`, `suspended`.
      - `voice` (object | null)
        - `voiceId` (string, required)
        - `provider` (string, required)
      - `metadata` (object)
      - `firstLoginAt` (string)
      - `username` (string | null)
      - `preferences` (object)
        - `reminders` (object)
          - `level` (enum): Which calendar events get reminders: all-events (every event), agnt-events (only events the assistant created), or none. One of: `all-events`, `agnt-events`, `none`.
          - `smartReminders` (boolean)
          - `recipient` (object)
            - `asOrganizer` (enum) One of: `only-me`, `with-attendees`, `none`.
            - `asAttendee` (enum) One of: `only-me`, `none`.
          - `calendars` (object)
            - `read` (string[])
          - `email` (object)
            - `enabled` (boolean)
            - `virtualDuration` (number)
            - `inPersonDuration` (number)
          - `slack` (object)
            - `enabled` (boolean)
            - `virtualDuration` (number)
            - `inPersonDuration` (number)
          - `teams` (object)
            - `enabled` (boolean)
            - `virtualDuration` (number)
            - `inPersonDuration` (number)
          - `desktop` (object)
            - `enabled` (boolean)
            - `virtualDuration` (number)
            - `inPersonDuration` (number)
          - `checkInAfter` (number)
        - `preferredProviders` (object)
        - `preferredContactChannel` (object)
      - `assistantName` (string | null)
      - `appName` (string | null)
      - `createdAt` (string, required)
      - `updatedAt` (string, required)
      - `assistantInfo` (object): The user's primary assistant
        - `id` (string)
        - `name` (string | null)
        - `email` (string | null)
        - `avatarUrl` (string | null)
    - `role` (enum) One of: `member`, `admin`, `owner`.
    - `status` (enum) One of: `active`, `invited`, `archived`.
    - `createdAt` (string)
    - `updatedAt` (string)
    - `multiplier` (number | null): The member's seat credit multiplier, when your billing sets one
  - `page` (integer)
  - `perPage` (integer)
  - `total` (integer)
- `403`: Not a member of this team
  - `status` (integer)
  - `error_code` (string)
  - `error` (string)
- `404`: Team not found
  - `status` (integer)
  - `error_code` (string)
  - `error` (string)

```bash
curl 'https://api.agnt.ai/teams/<teamId>/members' \
  -H "Authorization: Bearer ak_live_..."
```

Example response:

```json
{
  "ok": true,
  "members": [
    {
      "id": "6660c4a1f2e3b7d8a9c01234",
      "user": {
        "id": "6660c4a1f2e3b7d8a9c01234",
        "account": "account",
        "assistant": "assistant",
        "name": "Ava",
        "avatarUrl": "https://example.com",
        "timezone": "America/New_York"
      },
      "role": "member",
      "status": "active"
    }
  ]
}
```

## POST /teams/{teamId}/members

Add a team member

Adds a user to the team as `member` or `admin`. A user has one active team, so this moves them from their current team; if they own that team and it has other active members, pass `newOwnerId`. Requires a team admin.

**Path parameters**

- `teamId` (string, required)

**Request body** (JSON)

- `userId` (string, required): AGNT user id
- `role` (enum) One of: `member`, `admin`.
- `newOwnerId` (string): If the user owns their current team and it has other active members, the user id of an active member of that team to hand it to. Without it the call returns 400 with requiresOwnershipTransfer.

**Responses**

- `201`: Added
  - `ok` (enum, required) One of: `true`.
  - `member` (object, required)
    - `id` (string): Membership id: the memberId for PUT and DELETE /teams/{teamId}/members/{memberId}
    - `user` (object): The user
      - `id` (string, required)
      - `account` (string, required)
      - `email` (string)
      - `externalId` (string)
      - `assistant` (string | null, required)
      - `name` (string | null, required)
      - `firstName` (string)
      - `lastName` (string)
      - `avatarUrl` (string | null, required)
      - `timezone` (string, required)
      - `locale` (string, required)
      - `country` (string | null)
      - `city` (string)
      - `organization` (string | null, required)
      - `organizationRole` (enum, required) One of: `admin`, `member`, `guest`.
      - `team` (object | null, required)
        - `id` (string, required)
        - `name` (string, required)
        - `organization` (string | null, required)
        - `status` (string, required)
      - `teamRole` (enum, required) One of: `member`, `admin`, `owner`, `null`.
      - `status` (enum, required) One of: `active`, `inactive`, `suspended`.
      - `voice` (object | null)
        - `voiceId` (string, required)
        - `provider` (string, required)
      - `metadata` (object)
      - `firstLoginAt` (string)
      - `username` (string | null)
      - `preferences` (object)
        - `reminders` (object)
          - `level` (enum): Which calendar events get reminders: all-events (every event), agnt-events (only events the assistant created), or none. One of: `all-events`, `agnt-events`, `none`.
          - `smartReminders` (boolean)
          - `recipient` (object)
            - `asOrganizer` (enum) One of: `only-me`, `with-attendees`, `none`.
            - `asAttendee` (enum) One of: `only-me`, `none`.
          - `calendars` (object)
            - `read` (string[])
          - `email` (object)
            - `enabled` (boolean)
            - `virtualDuration` (number)
            - `inPersonDuration` (number)
          - `slack` (object)
            - `enabled` (boolean)
            - `virtualDuration` (number)
            - `inPersonDuration` (number)
          - `teams` (object)
            - `enabled` (boolean)
            - `virtualDuration` (number)
            - `inPersonDuration` (number)
          - `desktop` (object)
            - `enabled` (boolean)
            - `virtualDuration` (number)
            - `inPersonDuration` (number)
          - `checkInAfter` (number)
        - `preferredProviders` (object)
        - `preferredContactChannel` (object)
      - `assistantName` (string | null)
      - `appName` (string | null)
      - `createdAt` (string, required)
      - `updatedAt` (string, required)
    - `role` (enum) One of: `member`, `admin`, `owner`.
    - `status` (enum) One of: `active`, `invited`, `archived`.
    - `createdAt` (string)
    - `updatedAt` (string)
- `400`: userId missing, or newOwnerId is not an active member
  - `status` (integer)
  - `error_code` (string)
  - `error` (string)
- `403`: Not a team admin, or the user belongs to another organization or team
  - `status` (integer)
  - `error_code` (string)
  - `error` (string)
- `404`: Team or user not found
  - `status` (integer)
  - `error_code` (string)
  - `error` (string)

```bash
curl 'https://api.agnt.ai/teams/<teamId>/members' \
  -X POST \
  -H "Authorization: Bearer ak_live_..." \
  -H "Content-Type: application/json" \
  -d '{
  "userId": "6702b1e8f9a0b1c2d3e4f5a6"
}'
```

Example response:

```json
{
  "ok": true,
  "member": {
    "id": "6660c4a1f2e3b7d8a9c01234",
    "user": {
      "id": "6660c4a1f2e3b7d8a9c01234",
      "account": "account",
      "assistant": "assistant",
      "name": "Ava",
      "avatarUrl": "https://example.com",
      "timezone": "America/New_York"
    },
    "role": "member",
    "status": "active"
  }
}
```

## PUT /teams/{teamId}/members/{memberId}

Update a team member

Changes a member's role or status. `memberId` is the membership id from the members list. When the owner makes someone else owner, the current owner becomes an admin.

**Path parameters**

- `teamId` (string, required)
- `memberId` (string, required)

**Request body** (JSON)

- `role` (enum) One of: `member`, `admin`, `owner`.
- `status` (enum) One of: `active`, `invited`, `archived`.

**Responses**

- `200`: Updated
  - Same fields as the `201` response of `POST /teams/{teamId}/members`.
- `403`: Not allowed to make this change
  - `status` (integer)
  - `error_code` (string)
  - `error` (string)
- `404`: Team or member not found
  - `status` (integer)
  - `error_code` (string)
  - `error` (string)

```bash
curl 'https://api.agnt.ai/teams/<teamId>/members/<memberId>' \
  -X PUT \
  -H "Authorization: Bearer ak_live_..." \
  -H "Content-Type: application/json" \
  -d '{
  "role": "member",
  "status": "active"
}'
```

Example response:

```json
{
  "ok": true,
  "member": {
    "id": "6660c4a1f2e3b7d8a9c01234",
    "user": {
      "id": "6660c4a1f2e3b7d8a9c01234",
      "account": "account",
      "assistant": "assistant",
      "name": "Ava",
      "avatarUrl": "https://example.com",
      "timezone": "America/New_York"
    },
    "role": "member",
    "status": "active"
  }
}
```

## DELETE /teams/{teamId}/members/{memberId}

Remove a team member

Removes a member from the team. `memberId` is the membership id from the members list. The owner cannot be removed, team admins cannot remove other admins, and you cannot remove yourself.

**Path parameters**

- `teamId` (string, required)
- `memberId` (string, required)

**Responses**

- `200`: Removed
  - `ok` (enum, required) One of: `true`.
  - `member` (object, required)
    - `id` (string, required)
    - `deleted` (boolean)
    - `message` (string)

```bash
curl 'https://api.agnt.ai/teams/<teamId>/members/<memberId>' \
  -X DELETE \
  -H "Authorization: Bearer ak_live_..."
```

Example response:

```json
{
  "ok": true,
  "member": {
    "id": "6660c4a1f2e3b7d8a9c01234"
  }
}
```

## GET /teams/{teamId}/settings/resource-permissions

Retrieve team policy

Returns the team's overrides (`null` inherits from the organization) and the action types the organization locked, with their pinned modes. Requires an account key or a team admin.

**Path parameters**

- `teamId` (string, required)

**Responses**

- `200`: Team policy
  - `ok` (boolean)
  - `settings` (object)
    - `skills` (object)
    - `workflows` (object)
    - `assistants` (object)
    - `store` (object)
    - `users` (object)
    - `capabilities` (object)
    - `approvalSettings` (object)
      - `matrix` (object | null): Action types: email_as_user (email from the user's mailbox), email_as_assistant (email from the assistant's mailbox), messaging (texts and chat messages), voice_call_as_assistant, voice_call_as_user, calendar, files, drive, contacts, third_party_skills (actions in connected apps), website.
        - `email_as_user` (object)
          - `mode` (enum): auto: acts on its own. time-boxed: waits out a window in which the user can stop it. manual: waits for approval. One of: `auto`, `time-boxed`, `manual`, `null`.
          - `timeBoxedWindowMin` (number | null)
        - `email_as_assistant` (object)
          - `mode` (enum): auto: acts on its own. time-boxed: waits out a window in which the user can stop it. manual: waits for approval. One of: `auto`, `time-boxed`, `manual`, `null`.
          - `timeBoxedWindowMin` (number | null)
        - `messaging` (object)
          - `mode` (enum): auto: acts on its own. time-boxed: waits out a window in which the user can stop it. manual: waits for approval. One of: `auto`, `time-boxed`, `manual`, `null`.
          - `timeBoxedWindowMin` (number | null)
        - `voice_call_as_assistant` (object)
          - `mode` (enum): auto: acts on its own. time-boxed: waits out a window in which the user can stop it. manual: waits for approval. One of: `auto`, `time-boxed`, `manual`, `null`.
          - `timeBoxedWindowMin` (number | null)
        - `voice_call_as_user` (object)
          - `mode` (enum): auto: acts on its own. time-boxed: waits out a window in which the user can stop it. manual: waits for approval. One of: `auto`, `time-boxed`, `manual`, `null`.
          - `timeBoxedWindowMin` (number | null)
        - `calendar` (object)
          - `mode` (enum): auto: acts on its own. time-boxed: waits out a window in which the user can stop it. manual: waits for approval. One of: `auto`, `time-boxed`, `manual`, `null`.
          - `timeBoxedWindowMin` (number | null)
        - `files` (object)
          - `mode` (enum): auto: acts on its own. time-boxed: waits out a window in which the user can stop it. manual: waits for approval. One of: `auto`, `time-boxed`, `manual`, `null`.
          - `timeBoxedWindowMin` (number | null)
        - `drive` (object)
          - `mode` (enum): auto: acts on its own. time-boxed: waits out a window in which the user can stop it. manual: waits for approval. One of: `auto`, `time-boxed`, `manual`, `null`.
          - `timeBoxedWindowMin` (number | null)
        - `contacts` (object)
          - `mode` (enum): auto: acts on its own. time-boxed: waits out a window in which the user can stop it. manual: waits for approval. One of: `auto`, `time-boxed`, `manual`, `null`.
          - `timeBoxedWindowMin` (number | null)
        - `third_party_skills` (object)
          - `mode` (enum): auto: acts on its own. time-boxed: waits out a window in which the user can stop it. manual: waits for approval. One of: `auto`, `time-boxed`, `manual`, `null`.
          - `timeBoxedWindowMin` (number | null)
        - `website` (object)
          - `mode` (enum): auto: acts on its own. time-boxed: waits out a window in which the user can stop it. manual: waits for approval. One of: `auto`, `time-boxed`, `manual`, `null`.
          - `timeBoxedWindowMin` (number | null)
        - `locked` (string[]): Action types lower levels cannot loosen. Sent inside matrix, next to the cells; replaces the list.
    - `connections` (object)
    - `mcpAccessLevel` (enum) One of: `off`, `read`, `read_write`, `null`.
    - `mcpLocked` (boolean | null)
    - `orgLockedCells` (string[]): Action types the organization locked
    - `orgLockedValues` (object): Action type to the { mode, timeBoxedWindowMin } the organization pinned it to
- `403`: Team admin role required
- `404`: Team not found

```bash
curl 'https://api.agnt.ai/teams/<teamId>/settings/resource-permissions' \
  -H "Authorization: Bearer ak_live_..."
```

Example response:

```json
{
  "ok": true,
  "settings": {
    "skills": {},
    "workflows": {},
    "assistants": {},
    "store": {}
  }
}
```

## PATCH /teams/{teamId}/settings/resource-permissions

Update team policy

Sets team overrides; `null` inherits from the organization. A team can only tighten: overrides for action types the organization locked are ignored, and the stricter lock wins. Requires an account key or a team admin.

**Path parameters**

- `teamId` (string, required)

**Request body** (JSON)

- `skills` (object): canBrowseStore, canInstallFromStore, canCreate, requireApproval, canShareWithTeam, requirePermissionToShare, blockUpstream, authorOwn: boolean or null
- `workflows` (object): canBrowseStore, canInstallFromStore, canCreate, requireApproval, canShareWithTeam, requirePermissionToShare: boolean or null
- `assistants` (object): canCreate, canShareWithTeam, requirePermissionToShare: boolean or null
- `store` (object)
  - `enabled` (boolean | null)
  - `allowlist` (string[] | null)
  - `blocklist` (string[] | null)
- `users` (object)
  - `createSkills` (boolean | null)
  - `shareSkills` (boolean | null)
- `approvalSettings` (object)
  - `matrix` (object): Merged into the team's settings; locked replaces the team's list. Cells and locks for action types the organization locked are ignored. Action types: email_as_user (email from the user's mailbox), email_as_assistant (email from the assistant's mailbox), messaging (texts and chat messages), voice_call_as_assistant, voice_call_as_user, calendar, files, drive, contacts, third_party_skills (actions in connected apps), website.
    - `email_as_user` (object)
      - `mode` (enum): auto: acts on its own. time-boxed: waits out a window in which the user can stop it. manual: waits for approval. One of: `auto`, `time-boxed`, `manual`, `null`.
      - `timeBoxedWindowMin` (number | null)
    - `email_as_assistant` (object)
      - `mode` (enum): auto: acts on its own. time-boxed: waits out a window in which the user can stop it. manual: waits for approval. One of: `auto`, `time-boxed`, `manual`, `null`.
      - `timeBoxedWindowMin` (number | null)
    - `messaging` (object)
      - `mode` (enum): auto: acts on its own. time-boxed: waits out a window in which the user can stop it. manual: waits for approval. One of: `auto`, `time-boxed`, `manual`, `null`.
      - `timeBoxedWindowMin` (number | null)
    - `voice_call_as_assistant` (object)
      - `mode` (enum): auto: acts on its own. time-boxed: waits out a window in which the user can stop it. manual: waits for approval. One of: `auto`, `time-boxed`, `manual`, `null`.
      - `timeBoxedWindowMin` (number | null)
    - `voice_call_as_user` (object)
      - `mode` (enum): auto: acts on its own. time-boxed: waits out a window in which the user can stop it. manual: waits for approval. One of: `auto`, `time-boxed`, `manual`, `null`.
      - `timeBoxedWindowMin` (number | null)
    - `calendar` (object)
      - `mode` (enum): auto: acts on its own. time-boxed: waits out a window in which the user can stop it. manual: waits for approval. One of: `auto`, `time-boxed`, `manual`, `null`.
      - `timeBoxedWindowMin` (number | null)
    - `files` (object)
      - `mode` (enum): auto: acts on its own. time-boxed: waits out a window in which the user can stop it. manual: waits for approval. One of: `auto`, `time-boxed`, `manual`, `null`.
      - `timeBoxedWindowMin` (number | null)
    - `drive` (object)
      - `mode` (enum): auto: acts on its own. time-boxed: waits out a window in which the user can stop it. manual: waits for approval. One of: `auto`, `time-boxed`, `manual`, `null`.
      - `timeBoxedWindowMin` (number | null)
    - `contacts` (object)
      - `mode` (enum): auto: acts on its own. time-boxed: waits out a window in which the user can stop it. manual: waits for approval. One of: `auto`, `time-boxed`, `manual`, `null`.
      - `timeBoxedWindowMin` (number | null)
    - `third_party_skills` (object)
      - `mode` (enum): auto: acts on its own. time-boxed: waits out a window in which the user can stop it. manual: waits for approval. One of: `auto`, `time-boxed`, `manual`, `null`.
      - `timeBoxedWindowMin` (number | null)
    - `website` (object)
      - `mode` (enum): auto: acts on its own. time-boxed: waits out a window in which the user can stop it. manual: waits for approval. One of: `auto`, `time-boxed`, `manual`, `null`.
      - `timeBoxedWindowMin` (number | null)
    - `locked` (string[]): Action types lower levels cannot loosen. Sent inside matrix, next to the cells; replaces the list.
- `connections` (object)
  - `allowedTypes` (string[] | null): null inherits; empty allows all
  - `connectionPermissions` (object): Connection to { resource: off | read | read_write | null }. Resources: calendar, contacts, email, drive, messaging, video, teams, projects, crm
  - `connectionLocks` (object): Connection to { resource: true | false | null }; a cell can be locked only if it has a value
- `mcpAccessLevel` (enum): Access to connected tool servers One of: `off`, `read`, `read_write`, `null`.
- `mcpLocked` (boolean | null): Locking requires mcpAccessLevel
- `capabilities` (object): workspaceCli, workspaceHandoff, browserAutomation: on | off | null; workspaceCliLocked, workspaceHandoffLocked, browserAutomationLocked: boolean or null; workspaceHandoffDomains: { allowlist, blocklist } of origins

**Responses**

- `200`: Team policy
  - `ok` (boolean)
  - `settings` (object)
- `400`: No valid fields, an invalid value or an invalid lock
- `403`: Team admin role required
- `404`: Team not found

```bash
curl 'https://api.agnt.ai/teams/<teamId>/settings/resource-permissions' \
  -X PATCH \
  -H "Authorization: Bearer ak_live_..." \
  -H "Content-Type: application/json" \
  -d '{
  "skills": {},
  "workflows": {},
  "assistants": {},
  "store": {
    "enabled": true,
    "allowlist": [
      "allowlist"
    ],
    "blocklist": [
      "blocklist"
    ]
  }
}'
```

Example response:

```json
{
  "ok": true,
  "settings": {}
}
```

## POST /teams/{teamId}/settings/security-preset

Apply the restricted preset

Turns off and locks connected tool servers, custom tool servers, the workspace shell, workspace handoff and browser automation for the team in one call. Requires an account key or a team admin.

**Path parameters**

- `teamId` (string, required)

**Request body** (JSON)

- `preset` (enum, required) One of: `restricted`.

**Responses**

- `200`: Team policy after the preset
  - `ok` (boolean)
  - `settings` (object)
- `400`: preset must be restricted
- `403`: Team admin role required
- `404`: Team not found

```bash
curl 'https://api.agnt.ai/teams/<teamId>/settings/security-preset' \
  -X POST \
  -H "Authorization: Bearer ak_live_..." \
  -H "Content-Type: application/json" \
  -d '{
  "preset": "restricted"
}'
```

Example response:

```json
{
  "ok": true,
  "settings": {}
}
```

## GET /teams/{teamId}/settings/connections

List team connections

Returns every connection available to the team (built in, from a skill, or a custom tool server) with the organization setting, the team override and the effective state, plus whether members can add custom tool servers. Requires an account key or a team admin.

**Path parameters**

- `teamId` (string, required)

**Responses**

- `200`: Connections
  - `connections` (object[])
    - `id` (string)
    - `displayName` (string)
    - `description` (string | null)
    - `authMethod` (string)
    - `source` (enum) One of: `builtin`, `skill`, `custom_mcp`.
    - `orgEnabled` (boolean | null)
    - `teamEnabled` (boolean | null)
    - `effectiveState` (enum) One of: `enabled`, `disabled`.
  - `allowCustomMcp` (object)
    - `effective` (boolean)
    - `orgOverride` (boolean | null)
    - `teamOverride` (boolean | null)
- `403`: Team admin role required
- `404`: Team not found

```bash
curl 'https://api.agnt.ai/teams/<teamId>/settings/connections' \
  -H "Authorization: Bearer ak_live_..."
```

Example response:

```json
{
  "connections": [
    {
      "id": "6660c4a1f2e3b7d8a9c01234",
      "displayName": "Ava",
      "description": "Draft it, get Maria to sign off, send it.",
      "authMethod": "authmethod"
    }
  ],
  "allowCustomMcp": {
    "effective": true,
    "orgOverride": true,
    "teamOverride": true
  }
}
```

## PATCH /teams/{teamId}/settings/connections/{connectionId}

Update a team connection

Turns a connection on or off for the team, or clears the override to inherit the organization setting. Requires an account key or a team admin.

**Path parameters**

- `teamId` (string, required)
- `connectionId` (string, required)

**Request body** (JSON)

- `enabled` (enum, required) One of: `inherit`, `on`, `off`.

**Responses**

- `200`: Saved
  - `connectionId` (string)
  - `teamEnabled` (enum) One of: `inherit`, `on`, `off`.
- `400`: enabled must be inherit, on or off
- `403`: Team admin role required
- `404`: Team not found

```bash
curl 'https://api.agnt.ai/teams/<teamId>/settings/connections/<connectionId>' \
  -X PATCH \
  -H "Authorization: Bearer ak_live_..." \
  -H "Content-Type: application/json" \
  -d '{
  "enabled": "inherit"
}'
```

Example response:

```json
{
  "connectionId": "6660c4a1f2e3b7d8a9c01234",
  "teamEnabled": "inherit"
}
```

## PATCH /teams/{teamId}/settings/custom-mcp

Update custom tool server access

Sets whether team members can add their own custom tool servers, or inherit the organization setting. A block at the organization or team level wins. Requires an account key or a team admin.

**Path parameters**

- `teamId` (string, required)

**Request body** (JSON)

- `allowCustomMcp` (enum, required) One of: `inherit`, `on`, `off`.

**Responses**

- `200`: Effective setting
  - `allowCustomMcp` (object)
    - `effective` (boolean)
    - `orgOverride` (boolean | null)
    - `teamOverride` (boolean | null)
- `400`: allowCustomMcp must be inherit, on or off
- `403`: Team admin role required
- `404`: Team not found

```bash
curl 'https://api.agnt.ai/teams/<teamId>/settings/custom-mcp' \
  -X PATCH \
  -H "Authorization: Bearer ak_live_..." \
  -H "Content-Type: application/json" \
  -d '{
  "allowCustomMcp": "inherit"
}'
```

Example response:

```json
{
  "allowCustomMcp": {
    "effective": true,
    "orgOverride": true,
    "teamOverride": true
  }
}
```

## POST /teams/{teamId}/transfer-ownership

Transfer team ownership

Makes another active member the owner. The current owner becomes a member, and the billing contact moves to the new owner. Call it as the current owner.

Acts as one user: send `X-User-Email`.

**Path parameters**

- `teamId` (string, required)

**Request body** (JSON)

- `newOwnerId` (string, required): User id of an active member of this team

**Responses**

- `200`: Transferred
  - `ok` (boolean)
  - `newOwner` (object)
    - `id` (string)
    - `email` (string)
- `400`: newOwnerId missing or equal to the caller
- `403`: Caller is not the current owner
- `404`: New owner is not an active team member

```bash
curl 'https://api.agnt.ai/teams/<teamId>/transfer-ownership' \
  -X POST \
  -H "Authorization: Bearer ak_live_..." \
  -H "X-User-Email: user@example.com" \
  -H "Content-Type: application/json" \
  -d '{
  "newOwnerId": "6660c4a1f2e3b7d8a9c01234"
}'
```

Example response:

```json
{
  "ok": true,
  "newOwner": {
    "id": "6660c4a1f2e3b7d8a9c01234",
    "email": "jane@harborview.co"
  }
}
```
