# Hosted pages

> The calls behind Workwae's hosted connect pages. Your backend creates the session; these routes are used by the page itself.

URL: https://docs.workwae.com/reference/hosted-pages

Guides: [Connect flows](/guides/connect#hosted).

| Method | Path | Operation | Scope |
| --- | --- | --- | --- |
| `GET` | `/v1/hosted/connect-sessions/{token}` | [Read a hosted connect session](#read-a-hosted-connect-session) | none |
| `POST` | `/v1/hosted/connect-sessions/{token}/imap-accounts` | [Connect an IMAP account from the hosted page](#connect-an-imap-account-from-the-hosted-page) | none |
| `GET` | `/v1/hosted/connect-sessions/{token}/autoconfig` | [Find IMAP and SMTP settings from the hosted page](#find-imap-and-smtp-settings-from-the-hosted-page) | none |
| `GET` | `/v1/hosted/meeting-connect-sessions/{token}` | [Read a hosted meeting connect session](#read-a-hosted-meeting-connect-session) | none |

## Read a hosted connect session

`GET /v1/hosted/connect-sessions/{token}`

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

### Parameters

| Name | In | Type | Required | Description |
| --- | --- | --- | --- | --- |
| `token` | path | string | yes | At least 1 character. |

### Responses

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

| Field | Type | Required | Description |
| --- | --- | --- | --- |
| `tenantName` | string | yes |  |
| `providers` | ("google" \| "microsoft" \| "imap")[] | yes |  |
| `microsoftCloud` | "global" \| "gcc-high" \| "dod" \| "china" | yes |  |
| `status` | "pending" \| "completed" \| "failed" | yes |  |
| `reauthEmail` | string \| null | yes |  |
| `modules` | object | yes |  |
| `modules.mail` | boolean | yes |  |
| `modules.calendar` | boolean | yes |  |
| `modules.contacts` | boolean | yes |  |
| `loginHint` | string \| null | 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: `connect_session_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 account from the hosted page

`POST /v1/hosted/connect-sessions/{token}/imap-accounts`

TypeScript SDK method: `workwae.hostedConnectSessions.createImapAccount()`

When the tenant's plan allows no more accounts, or its payment is past due beyond the grace period, the session fails and redirectUrl carries status=error&error=plan_limit_accounts (or billing_past_due), as the OAuth callback does. Giving dav switches settings.calendarEnabled and contactsEnabled on for the halves found unless the session's options name them, as POST /v1/imap-accounts does. A reconnect session replaces the password only: the account keeps its stored servers and DAV settings, and any sent here are ignored. Its DAV login is checked again: with the new password when DAV uses the IMAP password, otherwise with dav.password when given (which then replaces the stored DAV password) or the stored one.

### Parameters

| Name | In | Type | Required | Description |
| --- | --- | --- | --- | --- |
| `token` | path | string | yes | At least 1 character. |

### 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 |  |

### Responses

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

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

- **Errors**, by status and `code` (see [Errors](/guides/errors)):
  - 400: `invalid_input`, `invalid_idempotency_key`, `session_expired`, `redirect_uri_not_allowed`, `provider_not_allowed`, `login_failed`, `server_not_allowed`, `plaintext_not_allowed`, `dav_discovery_failed`, `not_dav_server`, `password_required`
  - 401: `unauthenticated`, `api_key_expired`
  - 403: `missing_scope`, `role_forbidden`, `account_token_forbidden`, `account_scope_forbidden`, `mcp_only_key`
  - 404: `connect_session_not_found`, `account_not_found`
  - 409: `idempotency_key_in_progress`, `session_used`, `account_exists`, `account_mismatch`
  - 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`

## Find IMAP and SMTP settings from the hosted page

`GET /v1/hosted/connect-sessions/{token}/autoconfig`

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

### Parameters

| Name | In | Type | Required | Description |
| --- | --- | --- | --- | --- |
| `token` | path | string | yes | At least 1 character. |
| `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`, `session_expired`, `redirect_uri_not_allowed`, `provider_not_allowed`
  - 401: `unauthenticated`, `api_key_expired`
  - 403: `missing_scope`, `role_forbidden`, `account_token_forbidden`, `account_scope_forbidden`, `mcp_only_key`
  - 404: `connect_session_not_found`
  - 409: `idempotency_key_in_progress`, `session_used`
  - 413: `payload_too_large`
  - 422: `idempotency_key_reused`, `autodiscovery_failed`
  - 429: `rate_limited`, `too_many_requests`
  - 500: `internal_error`
  - 503: `overloaded`

## Read a hosted meeting connect session

`GET /v1/hosted/meeting-connect-sessions/{token}`

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

### Parameters

| Name | In | Type | Required | Description |
| --- | --- | --- | --- | --- |
| `token` | path | string | yes | At least 1 character. |

### Responses

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

| Field | Type | Required | Description |
| --- | --- | --- | --- |
| `tenantName` | string | yes |  |
| `service` | "zoom" \| "webex" | yes |  |
| `accountEmail` | string | yes |  |
| `status` | "pending" \| "completed" \| "failed" | 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: `meeting_connect_session_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`
