# Organization connections

> Register Google Workspace delegation or Microsoft 365 app-only access, then list the directory and add mailboxes as accounts.

URL: https://docs.workwae.com/reference/organization-connections

Guides: [Organization connections](/guides/organizations).

| Method | Path | Operation | Scope |
| --- | --- | --- | --- |
| `GET` | `/v1/org-connections` | [List organization connections](#list-organization-connections) | `admin` |
| `POST` | `/v1/org-connections` | [Register an organization connection](#register-an-organization-connection) | `admin` |
| `GET` | `/v1/org-connections/{connectionId}` | [Get an organization connection](#get-an-organization-connection) | `admin` |
| `PATCH` | `/v1/org-connections/{connectionId}` | [Update an organization connection](#update-an-organization-connection) | `admin` |
| `DELETE` | `/v1/org-connections/{connectionId}` | [Delete an organization connection](#delete-an-organization-connection) | `admin` |
| `POST` | `/v1/org-connections/{connectionId}/consent` | [Start Microsoft admin consent](#start-microsoft-admin-consent) | `admin` |
| `POST` | `/v1/org-connections/{connectionId}/test` | [Test an organization connection](#test-an-organization-connection) | `admin` |
| `GET` | `/v1/org-connections/{connectionId}/directory-entries` | [List the directory's mailboxes](#list-the-directorys-mailboxes) | `admin` |
| `POST` | `/v1/org-connections/{connectionId}/accounts` | [Add mailboxes as accounts](#add-mailboxes-as-accounts) | `write` |
| `POST` | `/v1/org-connections/{connectionId}/groups` | [Add a Google Group as an account](#add-a-google-group-as-an-account) | `admin` |

## List organization connections

`GET /v1/org-connections`

TypeScript SDK method: `workwae.orgConnections.list()`

Required scope: `admin`.

### Responses

- **200** OK (application/json, object)

| Field | Type | Required | Description |
| --- | --- | --- | --- |
| `items` | object[] | yes |  |
| `items[].id` | string (uuid) | yes | Example `"c4e6a8b0-1d3f-4a5c-8e7b-9d1f3a5c7e9b"`. |
| `items[].kind` | "google_delegation" \| "microsoft_app" | yes |  |
| `items[].name` | string | yes |  |
| `items[].clientId` | string | yes |  |
| `items[].status` | "pending_consent" \| "unverified" \| "active" \| "failing" | yes |  |
| `items[].statusDetail` | string \| null | yes |  |
| `items[].checkedAt` | string (date-time) \| null | yes | Example `"2026-05-04T09:30:00.000Z"`. |
| `items[].google` | object \| null | yes |  |
| `items[].google.domain` | string | yes |  |
| `items[].google.serviceAccountEmail` | string | yes |  |
| `items[].google.directoryAdmin` | string \| null | yes |  |
| `items[].google.scopes` | string[] | yes |  |
| `items[].google.groupsEnabled` | boolean | yes |  |
| `items[].microsoft` | object \| null | yes |  |
| `items[].microsoft.cloud` | "global" \| "gcc-high" \| "dod" \| "china" | yes |  |
| `items[].microsoft.credentialType` | "platform" \| "client_secret" \| "certificate" | yes |  |
| `items[].microsoft.directoryId` | string \| null | yes |  |
| `items[].microsoft.useConnectDomain` | boolean | yes |  |
| `items[].microsoft.redirectUri` | string \| null | yes | Example `"https://app.example.com/mail/connected"`. |
| `items[].microsoft.permissions` | object[] | yes |  |
| `items[].accounts` | integer | yes |  |
| `items[].createdAt` | string (date-time) | yes | Example `"2026-05-04T09:30:00.000Z"`. |
| `items[].updatedAt` | string (date-time) | yes | Example `"2026-05-04T09:30:00.000Z"`. |

- **Errors**, by status and `code` (see [Errors](/guides/errors)):
  - 400: `invalid_input`, `invalid_idempotency_key`
  - 401: `unauthenticated`, `api_key_expired`
  - 403: `missing_scope`, `role_forbidden`, `account_token_forbidden`, `account_scope_forbidden`, `mcp_only_key`
  - 409: `idempotency_key_in_progress`
  - 413: `payload_too_large`
  - 422: `idempotency_key_reused`
  - 429: `rate_limited`, `too_many_requests`
  - 500: `internal_error`
  - 503: `overloaded`

## Register an organization connection

`POST /v1/org-connections`

TypeScript SDK method: `workwae.orgConnections.create()`

Google: the service account key is checked and sealed; authorize the returned clientId for the returned scopes in the Admin console, then test. Microsoft: a platform connection starts in pending_consent (POST .../consent); a tenant app with a directoryId starts unverified.

Required scope: `admin`.

### Request body (required)

Content type `application/json`.

### Responses

- **201** OK (application/json, object)

| Field | Type | Required | Description |
| --- | --- | --- | --- |
| `id` | string (uuid) | yes | Example `"c4e6a8b0-1d3f-4a5c-8e7b-9d1f3a5c7e9b"`. |
| `kind` | "google_delegation" \| "microsoft_app" | yes |  |
| `name` | string | yes |  |
| `clientId` | string | yes |  |
| `status` | "pending_consent" \| "unverified" \| "active" \| "failing" | yes |  |
| `statusDetail` | string \| null | yes |  |
| `checkedAt` | string (date-time) \| null | yes | Example `"2026-05-04T09:30:00.000Z"`. |
| `google` | object \| null | yes |  |
| `google.domain` | string | yes |  |
| `google.serviceAccountEmail` | string | yes |  |
| `google.directoryAdmin` | string \| null | yes |  |
| `google.scopes` | string[] | yes |  |
| `google.groupsEnabled` | boolean | yes |  |
| `microsoft` | object \| null | yes |  |
| `microsoft.cloud` | "global" \| "gcc-high" \| "dod" \| "china" | yes |  |
| `microsoft.credentialType` | "platform" \| "client_secret" \| "certificate" | yes |  |
| `microsoft.directoryId` | string \| null | yes |  |
| `microsoft.useConnectDomain` | boolean | yes |  |
| `microsoft.redirectUri` | string \| null | yes | Example `"https://app.example.com/mail/connected"`. |
| `microsoft.permissions` | object[] | yes |  |
| `microsoft.permissions[].name` | string | yes |  |
| `microsoft.permissions[].isRequired` | boolean | yes |  |
| `accounts` | integer | yes |  |
| `createdAt` | string (date-time) | yes | Example `"2026-05-04T09:30:00.000Z"`. |
| `updatedAt` | string (date-time) | yes | Example `"2026-05-04T09:30:00.000Z"`. |

- **Errors**, by status and `code` (see [Errors](/guides/errors)):
  - 400: `invalid_input`, `invalid_idempotency_key`, `invalid_service_account_key`, `invalid_certificate`, `directory_id_not_allowed`, `connect_domain_unsupported`, `provider_not_configured`
  - 401: `unauthenticated`, `api_key_expired`
  - 403: `missing_scope`, `role_forbidden`, `account_token_forbidden`, `account_scope_forbidden`, `mcp_only_key`
  - 409: `idempotency_key_in_progress`, `connect_domain_inactive`
  - 413: `payload_too_large`
  - 422: `idempotency_key_reused`
  - 429: `rate_limited`, `too_many_requests`
  - 500: `internal_error`
  - 503: `overloaded`

## Get an organization connection

`GET /v1/org-connections/{connectionId}`

TypeScript SDK method: `workwae.orgConnections.get()`

Required scope: `admin`.

### Parameters

| Name | In | Type | Required | Description |
| --- | --- | --- | --- | --- |
| `connectionId` | path | string (uuid) | yes | Example `"d2c1cc43-b491-4d08-8b29-11a5f88293ab"`. |

### Responses

- **200** OK (application/json, object)

| Field | Type | Required | Description |
| --- | --- | --- | --- |
| `id` | string (uuid) | yes | Example `"c4e6a8b0-1d3f-4a5c-8e7b-9d1f3a5c7e9b"`. |
| `kind` | "google_delegation" \| "microsoft_app" | yes |  |
| `name` | string | yes |  |
| `clientId` | string | yes |  |
| `status` | "pending_consent" \| "unverified" \| "active" \| "failing" | yes |  |
| `statusDetail` | string \| null | yes |  |
| `checkedAt` | string (date-time) \| null | yes | Example `"2026-05-04T09:30:00.000Z"`. |
| `google` | object \| null | yes |  |
| `google.domain` | string | yes |  |
| `google.serviceAccountEmail` | string | yes |  |
| `google.directoryAdmin` | string \| null | yes |  |
| `google.scopes` | string[] | yes |  |
| `google.groupsEnabled` | boolean | yes |  |
| `microsoft` | object \| null | yes |  |
| `microsoft.cloud` | "global" \| "gcc-high" \| "dod" \| "china" | yes |  |
| `microsoft.credentialType` | "platform" \| "client_secret" \| "certificate" | yes |  |
| `microsoft.directoryId` | string \| null | yes |  |
| `microsoft.useConnectDomain` | boolean | yes |  |
| `microsoft.redirectUri` | string \| null | yes | Example `"https://app.example.com/mail/connected"`. |
| `microsoft.permissions` | object[] | yes |  |
| `microsoft.permissions[].name` | string | yes |  |
| `microsoft.permissions[].isRequired` | boolean | yes |  |
| `accounts` | integer | yes |  |
| `createdAt` | string (date-time) | yes | Example `"2026-05-04T09:30:00.000Z"`. |
| `updatedAt` | string (date-time) | yes | Example `"2026-05-04T09:30:00.000Z"`. |

- **Errors**, by status and `code` (see [Errors](/guides/errors)):
  - 400: `invalid_input`, `invalid_idempotency_key`
  - 401: `unauthenticated`, `api_key_expired`
  - 403: `missing_scope`, `role_forbidden`, `account_token_forbidden`, `account_scope_forbidden`, `mcp_only_key`
  - 404: `org_connection_not_found`
  - 409: `idempotency_key_in_progress`
  - 413: `payload_too_large`
  - 422: `idempotency_key_reused`
  - 429: `rate_limited`, `too_many_requests`
  - 500: `internal_error`
  - 503: `overloaded`

## Update an organization connection

`PATCH /v1/org-connections/{connectionId}`

TypeScript SDK method: `workwae.orgConnections.update()`

Replacing a credential or the authorized scopes makes the connection unverified until the next test.

Required scope: `admin`.

### Parameters

| Name | In | Type | Required | Description |
| --- | --- | --- | --- | --- |
| `connectionId` | path | string (uuid) | yes | Example `"d2c1cc43-b491-4d08-8b29-11a5f88293ab"`. |

### Request body

Content type `application/json`.

| Field | Type | Required | Description |
| --- | --- | --- | --- |
| `name` | string | no | 1 to 100 characters. |
| `serviceAccountKey` | string | no | 2 to 20000 characters. |
| `calendarEnabled` | boolean | no |  |
| `contactsEnabled` | boolean | no |  |
| `groupsEnabled` | boolean | no |  |
| `directoryAdmin` | string (email) \| null | no | Example `"ada@example.com"`. |
| `clientSecret` | string | no | 1 to 1024 characters. |
| `certificate` | string | no | 1 to 20000 characters. |
| `privateKey` | string | no | 1 to 20000 characters. |
| `directoryId` | string | no | 1 to 100 characters. |
| `useConnectDomain` | boolean | no |  |

### Responses

- **200** OK (application/json, object)

| Field | Type | Required | Description |
| --- | --- | --- | --- |
| `id` | string (uuid) | yes | Example `"c4e6a8b0-1d3f-4a5c-8e7b-9d1f3a5c7e9b"`. |
| `kind` | "google_delegation" \| "microsoft_app" | yes |  |
| `name` | string | yes |  |
| `clientId` | string | yes |  |
| `status` | "pending_consent" \| "unverified" \| "active" \| "failing" | yes |  |
| `statusDetail` | string \| null | yes |  |
| `checkedAt` | string (date-time) \| null | yes | Example `"2026-05-04T09:30:00.000Z"`. |
| `google` | object \| null | yes |  |
| `google.domain` | string | yes |  |
| `google.serviceAccountEmail` | string | yes |  |
| `google.directoryAdmin` | string \| null | yes |  |
| `google.scopes` | string[] | yes |  |
| `google.groupsEnabled` | boolean | yes |  |
| `microsoft` | object \| null | yes |  |
| `microsoft.cloud` | "global" \| "gcc-high" \| "dod" \| "china" | yes |  |
| `microsoft.credentialType` | "platform" \| "client_secret" \| "certificate" | yes |  |
| `microsoft.directoryId` | string \| null | yes |  |
| `microsoft.useConnectDomain` | boolean | yes |  |
| `microsoft.redirectUri` | string \| null | yes | Example `"https://app.example.com/mail/connected"`. |
| `microsoft.permissions` | object[] | yes |  |
| `microsoft.permissions[].name` | string | yes |  |
| `microsoft.permissions[].isRequired` | boolean | yes |  |
| `accounts` | integer | yes |  |
| `createdAt` | string (date-time) | yes | Example `"2026-05-04T09:30:00.000Z"`. |
| `updatedAt` | string (date-time) | yes | Example `"2026-05-04T09:30:00.000Z"`. |

- **Errors**, by status and `code` (see [Errors](/guides/errors)):
  - 400: `invalid_input`, `invalid_idempotency_key`, `invalid_service_account_key`, `invalid_certificate`, `directory_id_not_allowed`, `connect_domain_unsupported`, `credential_mismatch`
  - 401: `unauthenticated`, `api_key_expired`
  - 403: `missing_scope`, `role_forbidden`, `account_token_forbidden`, `account_scope_forbidden`, `mcp_only_key`
  - 404: `org_connection_not_found`
  - 409: `idempotency_key_in_progress`, `connect_domain_inactive`
  - 413: `payload_too_large`
  - 422: `idempotency_key_reused`
  - 429: `rate_limited`, `too_many_requests`
  - 500: `internal_error`
  - 503: `overloaded`

## Delete an organization connection

`DELETE /v1/org-connections/{connectionId}`

TypeScript SDK method: `workwae.orgConnections.delete()`

Required scope: `admin`.

### Parameters

| Name | In | Type | Required | Description |
| --- | --- | --- | --- | --- |
| `connectionId` | path | string (uuid) | yes | Example `"d2c1cc43-b491-4d08-8b29-11a5f88293ab"`. |

### Responses

- **204** OK (application/json, any)
- **Errors**, by status and `code` (see [Errors](/guides/errors)):
  - 400: `invalid_input`, `invalid_idempotency_key`
  - 401: `unauthenticated`, `api_key_expired`
  - 403: `missing_scope`, `role_forbidden`, `account_token_forbidden`, `account_scope_forbidden`, `mcp_only_key`
  - 404: `org_connection_not_found`
  - 409: `idempotency_key_in_progress`, `connection_in_use`
  - 413: `payload_too_large`
  - 422: `idempotency_key_reused`
  - 429: `rate_limited`, `too_many_requests`
  - 500: `internal_error`
  - 503: `overloaded`

## Start Microsoft admin consent

`POST /v1/org-connections/{connectionId}/consent`

TypeScript SDK method: `workwae.orgConnections.consent()`

Returns the URL an administrator of the directory grants consent at. Afterwards the browser returns to redirectUri with status=success|error, connection_id, error and state; the connection records the consenting directory and is tested. A tenant app uses /adminconsent, with the redirect URI the connection reports (microsoft.redirectUri): on the workspace's connect domain when microsoft.useConnectDomain is set, in which case a connect domain that is no longer active fails the consent with connect_domain_inactive (409) before it starts. The platform app is consented through a sign-in (authorize with prompt=admin_consent) and records the directory named by the sign-in's ID token; it can only be started from the console, and the console user who started it has to be signed in, in the browser that returns, for the directory to be recorded. Errors on return include access_denied, consent_failed, consent_unverified, directory_mismatch and directory_already_connected (another platform connection holds the directory).

Required scope: `admin`.

### Parameters

| Name | In | Type | Required | Description |
| --- | --- | --- | --- | --- |
| `connectionId` | path | string (uuid) | yes | Example `"d2c1cc43-b491-4d08-8b29-11a5f88293ab"`. |

### Request body (required)

Content type `application/json`.

| Field | Type | Required | Description |
| --- | --- | --- | --- |
| `redirectUri` | string (uri) | yes | Example `"https://app.example.com/mail/connected"`. |
| `state` | string | no | At most 1024 characters. Example `"opaque-value-you-check-on-return"`. |

### Responses

- **200** OK (application/json, object)

| Field | Type | Required | Description |
| --- | --- | --- | --- |
| `consentUrl` | string (uri) | yes | Example `"https://app.example.com/"`. |

- **Errors**, by status and `code` (see [Errors](/guides/errors)):
  - 400: `invalid_input`, `invalid_idempotency_key`, `not_microsoft`, `redirect_uri_not_allowed`, `provider_not_configured`
  - 401: `unauthenticated`, `api_key_expired`
  - 403: `missing_scope`, `role_forbidden`, `account_token_forbidden`, `account_scope_forbidden`, `mcp_only_key`, `session_required`
  - 404: `org_connection_not_found`
  - 409: `idempotency_key_in_progress`, `connect_domain_inactive`
  - 413: `payload_too_large`
  - 422: `idempotency_key_reused`
  - 429: `rate_limited`, `too_many_requests`
  - 500: `internal_error`
  - 503: `overloaded`

## Test an organization connection

`POST /v1/org-connections/{connectionId}/test`

TypeScript SDK method: `workwae.orgConnections.test()`

Requests a token the way accounts will and reports each check; the connection becomes active or failing. A passing test returns accounts that were moved to reauth_required to active. Google impersonates `user` (default: the directory admin).

Required scope: `admin`.

### Parameters

| Name | In | Type | Required | Description |
| --- | --- | --- | --- | --- |
| `connectionId` | path | string (uuid) | yes | Example `"d2c1cc43-b491-4d08-8b29-11a5f88293ab"`. |

### Request body

Content type `application/json`.

| Field | Type | Required | Description |
| --- | --- | --- | --- |
| `user` | string (email) | no | At most 320 characters. Example `"ada@example.com"`. |

### Responses

- **200** OK (application/json, object)

| Field | Type | Required | Description |
| --- | --- | --- | --- |
| `connection` | object | yes |  |
| `connection.id` | string (uuid) | yes | Example `"c4e6a8b0-1d3f-4a5c-8e7b-9d1f3a5c7e9b"`. |
| `connection.kind` | "google_delegation" \| "microsoft_app" | yes |  |
| `connection.name` | string | yes |  |
| `connection.clientId` | string | yes |  |
| `connection.status` | "pending_consent" \| "unverified" \| "active" \| "failing" | yes |  |
| `connection.statusDetail` | string \| null | yes |  |
| `connection.checkedAt` | string (date-time) \| null | yes | Example `"2026-05-04T09:30:00.000Z"`. |
| `connection.google` | object \| null | yes |  |
| `connection.google.domain` | string | yes |  |
| `connection.google.serviceAccountEmail` | string | yes |  |
| `connection.google.directoryAdmin` | string \| null | yes |  |
| `connection.google.scopes` | string[] | yes |  |
| `connection.google.groupsEnabled` | boolean | yes |  |
| `connection.microsoft` | object \| null | yes |  |
| `connection.microsoft.cloud` | "global" \| "gcc-high" \| "dod" \| "china" | yes |  |
| `connection.microsoft.credentialType` | "platform" \| "client_secret" \| "certificate" | yes |  |
| `connection.microsoft.directoryId` | string \| null | yes |  |
| `connection.microsoft.useConnectDomain` | boolean | yes |  |
| `connection.microsoft.redirectUri` | string \| null | yes | Example `"https://app.example.com/mail/connected"`. |
| `connection.microsoft.permissions` | object[] | yes |  |
| `connection.accounts` | integer | yes |  |
| `connection.createdAt` | string (date-time) | yes | Example `"2026-05-04T09:30:00.000Z"`. |
| `connection.updatedAt` | string (date-time) | yes | Example `"2026-05-04T09:30:00.000Z"`. |
| `checks` | object[] | yes |  |
| `checks[].name` | string | yes |  |
| `checks[].isOk` | boolean | yes |  |
| `checks[].isRequired` | boolean | yes |  |
| `checks[].detail` | string | yes |  |

- **Errors**, by status and `code` (see [Errors](/guides/errors)):
  - 400: `invalid_input`, `invalid_idempotency_key`, `user_required`
  - 401: `unauthenticated`, `api_key_expired`
  - 403: `missing_scope`, `role_forbidden`, `account_token_forbidden`, `account_scope_forbidden`, `mcp_only_key`
  - 404: `org_connection_not_found`
  - 409: `idempotency_key_in_progress`, `consent_required`
  - 413: `payload_too_large`
  - 422: `idempotency_key_reused`
  - 429: `rate_limited`, `too_many_requests`
  - 500: `internal_error`
  - 503: `overloaded`

## List the directory's mailboxes

`GET /v1/org-connections/{connectionId}/directory-entries`

TypeScript SDK method: `workwae.orgConnections.directoryEntries()`

Microsoft: Graph /users (needs User.Read.All). Google: the Admin SDK users.list as the directory admin (needs admin.directory.user.readonly). `query` matches the start of names and addresses. A nextCursor is good for an hour, on this connection only.

Required scope: `admin`.

### Parameters

| Name | In | Type | Required | Description |
| --- | --- | --- | --- | --- |
| `connectionId` | path | string (uuid) | yes | Example `"d2c1cc43-b491-4d08-8b29-11a5f88293ab"`. |
| `cursor` | query | string | no | 1 to 512 characters. Example `"eyJ0eG5pZCI6IjQyIiwiaWQiOjEwMDF9"`. |
| `limit` | query | integer | no | 1 to 200. Default `100`. |
| `query` | query | string | no | At most 100 characters. |

### Responses

- **200** OK (application/json, object)

| Field | Type | Required | Description |
| --- | --- | --- | --- |
| `items` | object[] | yes |  |
| `items[].id` | string | yes | 1 to 1024 characters. |
| `items[].email` | string | yes |  |
| `items[].displayName` | string \| null | yes |  |
| `items[].accountId` | string (uuid) \| null | yes | Example `"6f1c2a4e-8b3d-4e5f-9a7b-1c2d3e4f5a6b"`. |
| `nextCursor` | string \| null | yes | Example `"eyJ0eG5pZCI6IjQyIiwiaWQiOjEwMDF9"`. |

- **Errors**, by status and `code` (see [Errors](/guides/errors)):
  - 400: `invalid_input`, `invalid_idempotency_key`, `invalid_cursor`, `provider_rejected`
  - 401: `unauthenticated`, `api_key_expired`
  - 403: `missing_scope`, `role_forbidden`, `account_token_forbidden`, `account_scope_forbidden`, `mcp_only_key`
  - 404: `org_connection_not_found`, `provider_not_found`
  - 409: `idempotency_key_in_progress`, `consent_required`, `directory_unavailable`
  - 413: `payload_too_large`
  - 422: `idempotency_key_reused`
  - 429: `rate_limited`, `too_many_requests`, `provider_throttled`
  - 500: `internal_error`
  - 502: `provider_unavailable`
  - 503: `overloaded`

## Add mailboxes as accounts

`POST /v1/org-connections/{connectionId}/accounts`

TypeScript SDK method: `workwae.orgConnections.addAccounts()`

Each mailbox is checked through the connection before its account is created (Google: a delegated token for it; Microsoft: its inbox). items holds one result per mailbox, in request order. Per-mailbox failures are reported there with the reason the API would answer with, e.g. invalid_grant (no such user), consent_revoked (the scopes or permissions are not granted), provider_forbidden or provider_not_found (no mailbox access), plan_limit_accounts (the plan's account limit was reached part way through; the mailboxes before it are created).

Required scope: `write`.

### Parameters

| Name | In | Type | Required | Description |
| --- | --- | --- | --- | --- |
| `connectionId` | path | string (uuid) | yes | Example `"d2c1cc43-b491-4d08-8b29-11a5f88293ab"`. |

### Request body (required)

Content type `application/json`.

| Field | Type | Required | Description |
| --- | --- | --- | --- |
| `mailboxes` | object[] | yes | 1 to 100 items. |
| `mailboxes[].email` | string (email) | yes | At most 320 characters. Example `"ada@example.com"`. |
| `mailboxes[].displayName` | string | no | At most 255 characters. |
| `mailboxes[].externalRef` | string | no | At most 255 characters. Example `"user_42"`. |
| `settings` | object | no |  |
| `settings.bodyStorage` | "none" \| "cache" \| "full" | no |  |
| `settings.syncWindowDays` | integer \| null | no |  |
| `settings.mailEnabled` | boolean | no |  |
| `settings.calendarEnabled` | boolean | no |  |
| `settings.contactsEnabled` | boolean | no |  |
| `settings.undoSendSeconds` | integer | no | 0 to 60. |
| `settings.trackOpens` | boolean | no |  |
| `settings.trackClicks` | boolean | no |  |
| `settings.trackingHoneypot` | boolean | no |  |
| `settings.suppressionCheck` | "lists" \| "always" | no |  |
| `settings.sendsPerMinute` | integer \| null | no |  |

### Responses

- **200** OK (application/json, object)

| Field | Type | Required | Description |
| --- | --- | --- | --- |
| `items` | object[] | yes |  |
| `items[].email` | string | yes |  |
| `items[].status` | "created" \| "exists" \| "failed" | yes |  |
| `items[].accountId` | string (uuid) \| null | yes | Example `"6f1c2a4e-8b3d-4e5f-9a7b-1c2d3e4f5a6b"`. |
| `items[].error` | object \| null | yes |  |
| `items[].error.reason` | string | yes |  |
| `items[].error.message` | string | yes |  |

- **Errors**, by status and `code` (see [Errors](/guides/errors)):
  - 400: `invalid_input`, `invalid_idempotency_key`, `storage_unavailable`
  - 401: `unauthenticated`, `api_key_expired`
  - 402: `billing_past_due`
  - 403: `missing_scope`, `role_forbidden`, `account_token_forbidden`, `account_scope_forbidden`, `mcp_only_key`, `plan_limit_storage`
  - 404: `org_connection_not_found`
  - 409: `idempotency_key_in_progress`, `consent_required`
  - 413: `payload_too_large`
  - 422: `idempotency_key_reused`
  - 429: `rate_limited`, `too_many_requests`
  - 500: `internal_error`
  - 503: `overloaded`

## Add a Google Group as an account

`POST /v1/org-connections/{connectionId}/groups`

TypeScript SDK method: `workwae.orgConnections.addGroup()`

Google has no API to read a group, so the group becomes an account of its own (auth method google_group) that is read from and sent through a member user's mailbox, `relayEmail`, with the connection's delegated token. Only the group's mail in that mailbox is synced (Google Groups list mail and mail sent as the group); the rest of the user's mail is never indexed. The group is added to the relay's send-as addresses so replies go out From the group (same-domain groups are accepted at once). Needs the connection's `groupsEnabled` scope authorized in the Admin console. A group has no calendar or contacts. Re-adding an existing group account re-points it at the given relay. Deleting a group account leaves its send-as alias on the relay's mailbox.

Required scope: `admin`.

### Parameters

| Name | In | Type | Required | Description |
| --- | --- | --- | --- | --- |
| `connectionId` | path | string (uuid) | yes | Example `"d2c1cc43-b491-4d08-8b29-11a5f88293ab"`. |

### Request body (required)

Content type `application/json`.

| Field | Type | Required | Description |
| --- | --- | --- | --- |
| `email` | string (email) | yes | At most 320 characters. Example `"ada@example.com"`. |
| `relayEmail` | string (email) | yes | At most 320 characters. Example `"ada@example.com"`. |
| `displayName` | string | no | At most 255 characters. |
| `externalRef` | string | no | At most 255 characters. Example `"user_42"`. |
| `settings` | object | no |  |
| `settings.bodyStorage` | "none" \| "cache" \| "full" | no |  |
| `settings.syncWindowDays` | integer \| null | no |  |
| `settings.mailEnabled` | boolean | no |  |
| `settings.calendarEnabled` | boolean | no |  |
| `settings.contactsEnabled` | boolean | no |  |
| `settings.undoSendSeconds` | integer | no | 0 to 60. |
| `settings.trackOpens` | boolean | no |  |
| `settings.trackClicks` | boolean | no |  |
| `settings.trackingHoneypot` | boolean | no |  |
| `settings.suppressionCheck` | "lists" \| "always" | no |  |
| `settings.sendsPerMinute` | integer \| null | no |  |

### Responses

- **201** OK (application/json, object)

| Field | Type | Required | Description |
| --- | --- | --- | --- |
| `id` | string (uuid) | yes | Example `"c4e6a8b0-1d3f-4a5c-8e7b-9d1f3a5c7e9b"`. |
| `externalRef` | string \| null | yes | Example `"user_42"`. |
| `provider` | "gmail" \| "graph" \| "imap" | yes |  |
| `email` | string | yes |  |
| `displayName` | string \| null | yes |  |
| `oauthAppId` | string (uuid) \| null | yes | Example `"c6e11c75-050f-4212-9cff-bddb4fb07e36"`. |
| `cloud` | "global" \| "gcc-high" \| "dod" \| "china" \| null | yes |  |
| `status` | "active" \| "paused" \| "reauth_required" \| "disabled" | yes |  |
| `statusReason` | string \| null | yes |  |
| `settings` | object | yes |  |
| `settings.bodyStorage` | "none" \| "cache" \| "full" | yes |  |
| `settings.syncWindowDays` | integer \| null | yes |  |
| `settings.mailEnabled` | boolean | yes |  |
| `settings.calendarEnabled` | boolean | yes |  |
| `settings.contactsEnabled` | boolean | yes |  |
| `settings.undoSendSeconds` | integer | yes | 0 to 60. |
| `settings.trackOpens` | boolean | yes |  |
| `settings.trackClicks` | boolean | yes |  |
| `settings.trackingHoneypot` | boolean | yes |  |
| `settings.suppressionCheck` | "lists" \| "always" | yes |  |
| `settings.sendsPerMinute` | integer \| null | yes |  |
| `settingsOverride` | object | yes |  |
| `settingsOverride.bodyStorage` | "none" \| "cache" \| "full" | no |  |
| `settingsOverride.syncWindowDays` | integer \| null | no |  |
| `settingsOverride.mailEnabled` | boolean | no |  |
| `settingsOverride.calendarEnabled` | boolean | no |  |
| `settingsOverride.contactsEnabled` | boolean | no |  |
| `settingsOverride.undoSendSeconds` | integer | no | 0 to 60. |
| `settingsOverride.trackOpens` | boolean | no |  |
| `settingsOverride.trackClicks` | boolean | no |  |
| `settingsOverride.trackingHoneypot` | boolean | no |  |
| `settingsOverride.suppressionCheck` | "lists" \| "always" | no |  |
| `settingsOverride.sendsPerMinute` | integer \| null | no |  |
| `runtime` | object \| null | yes |  |
| `runtime.state` | "pending" \| "connecting" \| "connected" \| "error" \| "stopped" | yes |  |
| `runtime.detail` | string \| null | yes |  |
| `runtime.ownerInstanceId` | string (uuid) \| null | yes | Example `"b31a377d-3f38-46d6-b670-15babc0f5625"`. |
| `runtime.updatedAt` | string (date-time) | yes | Example `"2026-05-04T09:30:00.000Z"`. |
| `imap` | object \| null | yes |  |
| `imap.imap` | object | yes |  |
| `imap.imap.host` | string | yes |  |
| `imap.imap.port` | integer | yes |  |
| `imap.imap.security` | "tls" \| "starttls" \| "none" | yes |  |
| `imap.imap.user` | string | yes |  |
| `imap.smtp` | object \| null | yes |  |
| `imap.smtp.host` | string | yes |  |
| `imap.smtp.port` | integer | yes |  |
| `imap.smtp.security` | "tls" \| "starttls" \| "none" | yes |  |
| `imap.smtp.user` | string | yes |  |
| `imap.auth` | "password" \| "google" \| "microsoft" | yes |  |
| `imap.appendSent` | boolean | yes |  |
| `imap.dav` | object \| null | yes |  |
| `imap.dav.calendarUrl` | string \| null | yes |  |
| `imap.dav.contactsUrl` | string \| null | yes |  |
| `imap.dav.user` | string | yes |  |
| `imap.dav.auth` | "imap_password" \| "dav_password" | yes |  |
| `auth` | object | yes |  |
| `auth.method` | "oauth" \| "password" \| "google_delegation" \| "microsoft_app" \| "shared_mailbox" \| "google_group" | yes |  |
| `auth.orgConnectionId` | string (uuid) \| null | yes | Example `"17f753c8-b2ec-494b-9468-6e20a9a2f99c"`. |
| `auth.delegateAccountId` | string (uuid) \| null | yes | Example `"016ade53-f197-47ea-bd0e-48fda92e431f"`. |
| `auth.relayEmail` | string (email) \| null | yes | Example `"ada@example.com"`. |
| `mailPermissions` | "full" \| "read_send" \| "read" \| null | yes |  |
| `initializedAt` | string (date-time) \| null | yes | Example `"2026-05-04T09:30:00.000Z"`. |
| `calendarInitializedAt` | string (date-time) \| null | yes | Example `"2026-05-04T09:30:00.000Z"`. |
| `contactsInitializedAt` | string (date-time) \| null | yes | Example `"2026-05-04T09:30:00.000Z"`. |
| `createdAt` | string (date-time) | yes | Example `"2026-05-04T09:30:00.000Z"`. |
| `updatedAt` | string (date-time) | yes | Example `"2026-05-04T09:30:00.000Z"`. |

- **Errors**, by status and `code` (see [Errors](/guides/errors)):
  - 400: `invalid_input`, `invalid_idempotency_key`, `storage_unavailable`, `group_unsupported`, `scope_missing`
  - 401: `unauthenticated`, `api_key_expired`
  - 402: `plan_required`, `spend_cap_reached`, `billing_past_due`
  - 403: `missing_scope`, `role_forbidden`, `account_token_forbidden`, `account_scope_forbidden`, `mcp_only_key`, `plan_module_unavailable`, `plan_limit_storage`, `plan_limit_accounts`
  - 404: `org_connection_not_found`
  - 409: `idempotency_key_in_progress`, `group_alias_unverified`, `account_exists`
  - 413: `payload_too_large`
  - 422: `idempotency_key_reused`, `group_relay_inaccessible`
  - 429: `rate_limited`, `too_many_requests`, `provider_throttled`
  - 500: `internal_error`
  - 502: `provider_unavailable`
  - 503: `overloaded`
