# Accounts

> List, update, sync and delete connected accounts, connect IMAP mailboxes and token imports, and mint account tokens.

URL: https://docs.workwae.com/reference/accounts

Guides: [Connect flows](/guides/connect), [IMAP and SMTP](/guides/imap), [Authentication](/guides/api-keys#account-tokens).

| Method | Path | Operation | Scope |
| --- | --- | --- | --- |
| `GET` | `/v1/accounts` | [List accounts](#list-accounts) | `read` |
| `POST` | `/v1/accounts` | [Connect an account from an existing refresh token](#connect-an-account-from-an-existing-refresh-token) | `write` |
| `GET` | `/v1/accounts/{accountId}` | [Get an account](#get-an-account) | `read` |
| `PATCH` | `/v1/accounts/{accountId}` | [Update an account](#update-an-account) | `write` |
| `DELETE` | `/v1/accounts/{accountId}` | [Delete an account](#delete-an-account) | `write` |
| `POST` | `/v1/accounts/{accountId}/sync` | [Sync an account now](#sync-an-account-now) | `write` |
| `POST` | `/v1/accounts/{accountId}/tokens` | [Mint an account-scoped token](#mint-an-account-scoped-token) | `write` |
| `POST` | `/v1/imap-accounts` | [Connect an IMAP/SMTP account with a password](#connect-an-imapsmtp-account-with-a-password) | `write` |
| `PATCH` | `/v1/accounts/{accountId}/imap-settings` | [Change an IMAP account's servers or password](#change-an-imap-accounts-servers-or-password) | `write` |
| `GET` | `/v1/autoconfig` | [Find IMAP, SMTP and DAV settings for an address](#find-imap-smtp-and-dav-settings-for-an-address) | `read` |

## List accounts

`GET /v1/accounts`

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

Newest first. q matches part of the email address or the external reference, case-insensitively; externalRef matches it exactly. An API key bound to accounts lists only those.

Required scope: `read`.

### Parameters

| Name | In | Type | Required | Description |
| --- | --- | --- | --- | --- |
| `limit` | query | integer | no | 1 to 200. Default `50`. |
| `cursor` | query | string | no | 1 to 512 characters. Example `"eyJ0eG5pZCI6IjQyIiwiaWQiOjEwMDF9"`. |
| `externalRef` | query | string | no | Example `"user_42"`. |
| `q` | query | string | no | 1 to 200 characters. Example `"invoice"`. |
| `status` | query | "active" \| "paused" \| "reauth_required" \| "disabled" | no |  |
| `orgConnectionId` | query | string (uuid) | no | Example `"17f753c8-b2ec-494b-9468-6e20a9a2f99c"`. |
| `delegateAccountId` | query | string (uuid) | no | Example `"016ade53-f197-47ea-bd0e-48fda92e431f"`. |

### 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[].externalRef` | string \| null | yes | Example `"user_42"`. |
| `items[].provider` | "gmail" \| "graph" \| "imap" | yes |  |
| `items[].email` | string | yes |  |
| `items[].displayName` | string \| null | yes |  |
| `items[].oauthAppId` | string (uuid) \| null | yes | Example `"c6e11c75-050f-4212-9cff-bddb4fb07e36"`. |
| `items[].cloud` | "global" \| "gcc-high" \| "dod" \| "china" \| null | yes |  |
| `items[].status` | "active" \| "paused" \| "reauth_required" \| "disabled" | yes |  |
| `items[].statusReason` | string \| null | yes |  |
| `items[].settings` | object | yes |  |
| `items[].settings.bodyStorage` | "none" \| "cache" \| "full" | yes |  |
| `items[].settings.syncWindowDays` | integer \| null | yes |  |
| `items[].settings.mailEnabled` | boolean | yes |  |
| `items[].settings.calendarEnabled` | boolean | yes |  |
| `items[].settings.contactsEnabled` | boolean | yes |  |
| `items[].settings.undoSendSeconds` | integer | yes | 0 to 60. |
| `items[].settings.trackOpens` | boolean | yes |  |
| `items[].settings.trackClicks` | boolean | yes |  |
| `items[].settings.trackingHoneypot` | boolean | yes |  |
| `items[].settings.suppressionCheck` | "lists" \| "always" | yes |  |
| `items[].settings.sendsPerMinute` | integer \| null | yes |  |
| `items[].settingsOverride` | object | yes |  |
| `items[].settingsOverride.bodyStorage` | "none" \| "cache" \| "full" | no |  |
| `items[].settingsOverride.syncWindowDays` | integer \| null | no |  |
| `items[].settingsOverride.mailEnabled` | boolean | no |  |
| `items[].settingsOverride.calendarEnabled` | boolean | no |  |
| `items[].settingsOverride.contactsEnabled` | boolean | no |  |
| `items[].settingsOverride.undoSendSeconds` | integer | no | 0 to 60. |
| `items[].settingsOverride.trackOpens` | boolean | no |  |
| `items[].settingsOverride.trackClicks` | boolean | no |  |
| `items[].settingsOverride.trackingHoneypot` | boolean | no |  |
| `items[].settingsOverride.suppressionCheck` | "lists" \| "always" | no |  |
| `items[].settingsOverride.sendsPerMinute` | integer \| null | no |  |
| `items[].runtime` | object \| null | yes |  |
| `items[].runtime.state` | "pending" \| "connecting" \| "connected" \| "error" \| "stopped" | yes |  |
| `items[].runtime.detail` | string \| null | yes |  |
| `items[].runtime.ownerInstanceId` | string (uuid) \| null | yes | Example `"b31a377d-3f38-46d6-b670-15babc0f5625"`. |
| `items[].runtime.updatedAt` | string (date-time) | yes | Example `"2026-05-04T09:30:00.000Z"`. |
| `items[].imap` | object \| null | yes |  |
| `items[].imap.imap` | object | yes |  |
| `items[].imap.smtp` | object \| null | yes |  |
| `items[].imap.auth` | "password" \| "google" \| "microsoft" | yes |  |
| `items[].imap.appendSent` | boolean | yes |  |
| `items[].imap.dav` | object \| null | yes |  |
| `items[].auth` | object | yes |  |
| `items[].auth.method` | "oauth" \| "password" \| "google_delegation" \| "microsoft_app" \| "shared_mailbox" \| "google_group" | yes |  |
| `items[].auth.orgConnectionId` | string (uuid) \| null | yes | Example `"17f753c8-b2ec-494b-9468-6e20a9a2f99c"`. |
| `items[].auth.delegateAccountId` | string (uuid) \| null | yes | Example `"016ade53-f197-47ea-bd0e-48fda92e431f"`. |
| `items[].auth.relayEmail` | string (email) \| null | yes | Example `"ada@example.com"`. |
| `items[].mailPermissions` | "full" \| "read_send" \| "read" \| null | yes |  |
| `items[].initializedAt` | string (date-time) \| null | yes | Example `"2026-05-04T09:30:00.000Z"`. |
| `items[].calendarInitializedAt` | string (date-time) \| null | yes | Example `"2026-05-04T09:30:00.000Z"`. |
| `items[].contactsInitializedAt` | string (date-time) \| null | yes | Example `"2026-05-04T09:30:00.000Z"`. |
| `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"`. |
| `nextCursor` | string \| null | yes | Example `"eyJ0eG5pZCI6IjQyIiwiaWQiOjEwMDF9"`. |

- **Errors**, by status and `code` (see [Errors](/guides/errors)):
  - 400: `invalid_input`, `invalid_idempotency_key`, `invalid_cursor`
  - 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`

## Connect an account from an existing refresh token

`POST /v1/accounts`

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

The address is the provider's (Google's userinfo, Graph's /me). The token must cover the calendar and contacts that settings.calendarEnabled and settings.contactsEnabled name as true. Where settings leaves one out and the workspace default is on, a Google token that already carries its scopes gets it, and any other token connects with it off for this account (a Microsoft token is refreshed only for the scopes asked, so name the setting to require them).

Required scope: `write`.

### Request body (required)

Content type `application/json`.

| Field | Type | Required | Description |
| --- | --- | --- | --- |
| `provider` | "google" \| "microsoft" | yes |  |
| `microsoftCloud` | "global" \| "gcc-high" \| "dod" \| "china" | no | Default `"global"`. |
| `refreshToken` | string | yes | At least 1 character. |
| `oauthAppId` | string (uuid) | no | Example `"c6e11c75-050f-4212-9cff-bddb4fb07e36"`. |
| `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 |  |
| `sharedMailboxesEnabled` | boolean | no |  |
| `mailPermissions` | "full" \| "read_send" \| "read" | 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`, `oauth_app_mismatch`, `oauth_app_secret_unreadable`, `provider_not_configured`, `invalid_grant`, `invalid_client`, `interaction_required`, `token_exchange_failed`, `scope_denied`, `access_token_rejected`, `identity_failed`, `identity_unavailable`, `mail_permissions_unsupported`
  - 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_limit_storage`, `plan_module_unavailable`, `plan_limit_accounts`
  - 409: `idempotency_key_in_progress`
  - 413: `payload_too_large`
  - 422: `idempotency_key_reused`, `unknown_oauth_app`
  - 429: `rate_limited`, `too_many_requests`
  - 500: `internal_error`
  - 502: `provider_unavailable`
  - 503: `overloaded`

## Get an account

`GET /v1/accounts/{accountId}`

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

Required scope: `read`.

### Parameters

| Name | In | Type | Required | Description |
| --- | --- | --- | --- | --- |
| `accountId` | path | string (uuid) | yes | Example `"6f1c2a4e-8b3d-4e5f-9a7b-1c2d3e4f5a6b"`. |

### Responses

- **200** 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`
  - 401: `unauthenticated`, `api_key_expired`
  - 403: `missing_scope`, `role_forbidden`, `account_token_forbidden`, `account_scope_forbidden`, `mcp_only_key`
  - 404: `account_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 account

`PATCH /v1/accounts/{accountId}`

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

Changing settings.bodyStorage, mailEnabled, calendarEnabled, contactsEnabled or syncWindowDays restarts the account's syncs: full stores every indexed message and backfills, none deletes stored content. status only moves between active and paused; only a new grant clears reauth_required and disabled.

Required scope: `write`.

### Parameters

| Name | In | Type | Required | Description |
| --- | --- | --- | --- | --- |
| `accountId` | path | string (uuid) | yes | Example `"6f1c2a4e-8b3d-4e5f-9a7b-1c2d3e4f5a6b"`. |

### Request body

Content type `application/json`.

| Field | Type | Required | Description |
| --- | --- | --- | --- |
| `externalRef` | string \| null | no | Example `"user_42"`. |
| `status` | "active" \| "paused" | no |  |
| `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 |
| --- | --- | --- | --- |
| `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`
  - 401: `unauthenticated`, `api_key_expired`
  - 402: `plan_required`, `spend_cap_reached`
  - 403: `missing_scope`, `role_forbidden`, `account_token_forbidden`, `account_scope_forbidden`, `mcp_only_key`, `plan_limit_accounts`, `plan_limit_storage`
  - 404: `account_not_found`
  - 409: `idempotency_key_in_progress`, `account_reauth_required`, `account_disabled`
  - 413: `payload_too_large`
  - 422: `idempotency_key_reused`
  - 429: `rate_limited`, `too_many_requests`
  - 500: `internal_error`
  - 503: `overloaded`

## Delete an account

`DELETE /v1/accounts/{accountId}`

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

Stops syncing and removes the credential at once. The account's data is purged for good after the retention period (default 30 days), or shortly after the call with ?purge=true; account.purged announces it. Its events are left to age out of the event log (within 31 days). purge=true also purges an account that is already deleted.

Required scope: `write`.

### Parameters

| Name | In | Type | Required | Description |
| --- | --- | --- | --- | --- |
| `accountId` | path | string (uuid) | yes | Example `"6f1c2a4e-8b3d-4e5f-9a7b-1c2d3e4f5a6b"`. |
| `purge` | query | boolean \| "true" \| "false" | no | Default `false`. |

### 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: `account_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`

## Sync an account now

`POST /v1/accounts/{accountId}/sync`

TypeScript SDK method: `workwae.accounts.sync()`

Wakes the account's sync the way a provider push does: one nudge per kind to the instance that owns it. The owner keeps at most one pending pass per kind, so a repeat while a pass is running becomes a single extra pass. At most 30 of these requests per account per minute (429 rate_limited). kinds defaults to every kind the account has enabled (each of mail, calendar and contacts its settings turn on). With no live owner the answer is still 202: the next owner starts with a full pass, and the backstop poll covers a wake nobody was listening for.

Required scope: `write`.

### Parameters

| Name | In | Type | Required | Description |
| --- | --- | --- | --- | --- |
| `accountId` | path | string (uuid) | yes | Example `"6f1c2a4e-8b3d-4e5f-9a7b-1c2d3e4f5a6b"`. |

### Request body

Content type `application/json`.

| Field | Type | Required | Description |
| --- | --- | --- | --- |
| `kinds` | ("mail" \| "calendar" \| "contacts")[] | no | At least 1 item. |

### Responses

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

| Field | Type | Required | Description |
| --- | --- | --- | --- |
| `kinds` | ("mail" \| "calendar" \| "contacts")[] | yes |  |

- **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: `account_not_found`
  - 409: `idempotency_key_in_progress`, `account_reauth_required`, `account_disabled`, `sync_kinds_disabled`
  - 413: `payload_too_large`
  - 422: `idempotency_key_reused`
  - 429: `rate_limited`, `too_many_requests`
  - 500: `internal_error`
  - 503: `overloaded`

## Mint an account-scoped token

`POST /v1/accounts/{accountId}/tokens`

TypeScript SDK method: `workwae.accounts.mintToken()`

The token is returned once; it is not retrievable later.

Required scope: `write`.

### Parameters

| Name | In | Type | Required | Description |
| --- | --- | --- | --- | --- |
| `accountId` | path | string (uuid) | yes | Example `"6f1c2a4e-8b3d-4e5f-9a7b-1c2d3e4f5a6b"`. |

### Request body

Content type `application/json`.

| Field | Type | Required | Description |
| --- | --- | --- | --- |
| `ttlSeconds` | integer | no | 60 to 86400. Default `900`. |

### Responses

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

| Field | Type | Required | Description |
| --- | --- | --- | --- |
| `token` | string | yes |  |
| `expiresAt` | 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: `account_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`

## Connect an IMAP/SMTP account with a password

`POST /v1/imap-accounts`

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

The login is checked before anything is stored, for DAV too. Giving dav switches settings.calendarEnabled and contactsEnabled on for the halves found unless settings names them.

Required scope: `write`.

### Request body (required)

Content type `application/json`.

| Field | Type | Required | Description |
| --- | --- | --- | --- |
| `email` | string (email) | yes | At most 320 characters. Example `"ada@example.com"`. |
| `displayName` | string | no | At most 255 characters. |
| `password` | string | yes | 1 to 1024 characters. |
| `smtpPassword` | string | no | 1 to 1024 characters. |
| `imap` | object | no |  |
| `imap.host` | string | yes | 1 to 253 characters. |
| `imap.port` | integer | yes | 1 to 65535. |
| `imap.security` | "tls" \| "starttls" \| "none" | yes |  |
| `imap.user` | string | no | 1 to 320 characters. |
| `smtp` | object \| null | no |  |
| `smtp.host` | string | yes | 1 to 253 characters. |
| `smtp.port` | integer | yes | 1 to 65535. |
| `smtp.security` | "tls" \| "starttls" \| "none" | yes |  |
| `smtp.user` | string | no | 1 to 320 characters. |
| `appendSent` | boolean | no |  |
| `dav` | object | no |  |
| `dav.calendarUrl` | string (uri) \| null | no | Example `"https://app.example.com/"`. |
| `dav.contactsUrl` | string (uri) \| null | no | Example `"https://app.example.com/"`. |
| `dav.user` | string | no | 1 to 320 characters. |
| `dav.password` | string \| null | no |  |
| `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`, `login_failed`, `server_not_allowed`, `plaintext_not_allowed`, `dav_discovery_failed`, `not_dav_server`, `storage_unavailable`
  - 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_limit_storage`, `plan_limit_accounts`, `plan_module_unavailable`
  - 409: `idempotency_key_in_progress`
  - 413: `payload_too_large`
  - 422: `idempotency_key_reused`, `autodiscovery_failed`
  - 429: `rate_limited`, `too_many_requests`, `provider_throttled`
  - 500: `internal_error`
  - 502: `provider_unavailable`
  - 503: `overloaded`

## Change an IMAP account's servers or password

`PATCH /v1/accounts/{accountId}/imap-settings`

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

Present fields replace the stored ones and the result is checked like a new account. An account in reauth_required becomes active again. A stored password is never sent to a new server or tried for another login: changing the IMAP server (host, port, security or user) needs password in the same request, changing the SMTP server (host, port, security or user) needs smtpPassword (or password when SMTP uses the IMAP password), switching SMTP from its own password to the IMAP one (smtpPassword: null) needs password, and adding DAV settings or changing their URLs, user or password source needs the password DAV logs in with (dav.password, or password when DAV uses the IMAP password). Sending dav: null removes the calendar and contacts; a CalDAV or CardDAV half the account did not have before switches settings.calendarEnabled or contactsEnabled on, unless the account's settings already name that key (an earlier opt-out stays); dav fields left out keep their stored values, or are discovered for an account without DAV settings. An account that signs in with OAuth always uses its provider's servers.

Required scope: `write`.

### Parameters

| Name | In | Type | Required | Description |
| --- | --- | --- | --- | --- |
| `accountId` | path | string (uuid) | yes | Example `"6f1c2a4e-8b3d-4e5f-9a7b-1c2d3e4f5a6b"`. |

### Request body

Content type `application/json`.

| Field | Type | Required | Description |
| --- | --- | --- | --- |
| `password` | string | no | 1 to 1024 characters. |
| `smtpPassword` | string \| null | no |  |
| `imap` | object | no |  |
| `imap.host` | string | yes | 1 to 253 characters. |
| `imap.port` | integer | yes | 1 to 65535. |
| `imap.security` | "tls" \| "starttls" \| "none" | yes |  |
| `imap.user` | string | no | 1 to 320 characters. |
| `smtp` | object \| null | no |  |
| `smtp.host` | string | yes | 1 to 253 characters. |
| `smtp.port` | integer | yes | 1 to 65535. |
| `smtp.security` | "tls" \| "starttls" \| "none" | yes |  |
| `smtp.user` | string | no | 1 to 320 characters. |
| `appendSent` | boolean | no |  |
| `dav` | object \| null | no |  |
| `dav.calendarUrl` | string (uri) \| null | no | Example `"https://app.example.com/"`. |
| `dav.contactsUrl` | string (uri) \| null | no | Example `"https://app.example.com/"`. |
| `dav.user` | string | no | 1 to 320 characters. |
| `dav.password` | string \| null | no |  |

### Responses

- **200** 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`, `login_failed`, `server_not_allowed`, `plaintext_not_allowed`, `dav_discovery_failed`, `not_dav_server`, `not_imap_account`, `password_required`, `password_not_stored`, `dav_unsupported`, `oauth_servers_fixed`, `password_unsupported`, `credential_missing`, `credential_conflict`, `invalid_client`, `token_exchange_failed`, `provider_not_configured`, `oauth_app_secret_unreadable`
  - 401: `unauthenticated`, `api_key_expired`
  - 403: `missing_scope`, `role_forbidden`, `account_token_forbidden`, `account_scope_forbidden`, `mcp_only_key`
  - 404: `account_not_found`
  - 409: `idempotency_key_in_progress`, `account_reauth_required`
  - 413: `payload_too_large`
  - 422: `idempotency_key_reused`
  - 429: `rate_limited`, `too_many_requests`, `provider_throttled`
  - 500: `internal_error`
  - 502: `provider_unavailable`
  - 503: `overloaded`

## Find IMAP, SMTP and DAV settings for an address

`GET /v1/autoconfig`

TypeScript SDK method: `workwae.autoconfig.lookup()`

dav carries CalDAV and CardDAV context URLs when a source names them; they need the login to resolve to the account's home sets, which creating the account does.

Required scope: `read`.

### Parameters

| Name | In | Type | Required | Description |
| --- | --- | --- | --- | --- |
| `email` | query | string (email) | yes | At most 320 characters. Example `"ada@example.com"`. |

### Responses

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

| Field | Type | Required | Description |
| --- | --- | --- | --- |
| `source` | "provider" \| "autoconfig" \| "ispdb" \| "srv" \| "mx" | yes |  |
| `imap` | object | yes |  |
| `imap.host` | string | yes |  |
| `imap.port` | integer | yes |  |
| `imap.security` | "tls" \| "starttls" \| "none" | yes |  |
| `imap.user` | string | yes |  |
| `smtp` | object \| null | yes |  |
| `smtp.host` | string | yes |  |
| `smtp.port` | integer | yes |  |
| `smtp.security` | "tls" \| "starttls" \| "none" | yes |  |
| `smtp.user` | string | yes |  |
| `oauth` | "google" \| "microsoft" \| null | yes |  |
| `dav` | object \| null | yes |  |
| `dav.source` | "provider" \| "well-known" \| "srv" | yes |  |
| `dav.calendarUrl` | string \| null | yes |  |
| `dav.contactsUrl` | string \| null | yes |  |

- **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`, `autodiscovery_failed`
  - 429: `rate_limited`, `too_many_requests`
  - 500: `internal_error`
  - 503: `overloaded`
