# OAuth apps

> Register your own Google and Microsoft OAuth apps for the connect flow.

URL: https://docs.workwae.com/reference/oauth-apps

Guides: [Your own OAuth apps](/guides/oauth-apps).

| Method | Path | Operation | Scope |
| --- | --- | --- | --- |
| `GET` | `/v1/oauth-apps` | [List tenant OAuth apps](#list-tenant-oauth-apps) | `admin` |
| `POST` | `/v1/oauth-apps` | [Register a tenant OAuth app](#register-a-tenant-oauth-app) | `admin` |
| `PATCH` | `/v1/oauth-apps/{appId}` | [Change a tenant OAuth app: name, client secret, authority, connect domain or Gmail push](#change-a-tenant-oauth-app-name-client-secret-authority-connect-domain-or-gmail-push) | `admin` |
| `DELETE` | `/v1/oauth-apps/{appId}` | [Delete a tenant OAuth app](#delete-a-tenant-oauth-app) | `admin` |

## List tenant OAuth apps

`GET /v1/oauth-apps`

TypeScript SDK method: `workwae.oauthApps.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[].provider` | "google" \| "microsoft" | yes |  |
| `items[].name` | string | yes |  |
| `items[].clientId` | string | yes |  |
| `items[].cloud` | "global" \| "gcc-high" \| "dod" \| "china" \| null | yes |  |
| `items[].authority` | string \| null | yes |  |
| `items[].useConnectDomain` | boolean | yes |  |
| `items[].redirectUri` | string (uri) | yes | Example `"https://app.example.com/mail/connected"`. |
| `items[].gmailPush` | object \| null | yes |  |
| `items[].gmailPush.topic` | string | yes |  |
| `items[].gmailPush.serviceAccount` | object | yes |  |
| `items[].gmailPushEndpoint` | string (uri) \| null | yes | Example `"https://app.example.com/"`. |
| `items[].createdAt` | 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 a tenant OAuth app

`POST /v1/oauth-apps`

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

redirectUri is the callback to register at the provider as an authorized redirect URI. It is on the API host, or on the workspace's connect domain when useConnectDomain is set: Google only verifies an app whose redirect URIs are on domains its owner controls, so an app that is to be verified signs in through the workspace's own connect domain.

Required scope: `admin`.

### Request body (required)

Content type `application/json`.

| Field | Type | Required | Description |
| --- | --- | --- | --- |
| `provider` | "google" \| "microsoft" | yes |  |
| `cloud` | "global" \| "gcc-high" \| "dod" \| "china" | no |  |
| `name` | string | yes | 1 to 100 characters. |
| `clientId` | string | yes | At least 1 character. |
| `clientSecret` | string | yes | At least 1 character. |
| `authority` | string | no |  |
| `useConnectDomain` | boolean | no |  |

### Responses

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

| Field | Type | Required | Description |
| --- | --- | --- | --- |
| `id` | string (uuid) | yes | Example `"c4e6a8b0-1d3f-4a5c-8e7b-9d1f3a5c7e9b"`. |
| `provider` | "google" \| "microsoft" | yes |  |
| `name` | string | yes |  |
| `clientId` | string | yes |  |
| `cloud` | "global" \| "gcc-high" \| "dod" \| "china" \| null | yes |  |
| `authority` | string \| null | yes |  |
| `useConnectDomain` | boolean | yes |  |
| `redirectUri` | string (uri) | yes | Example `"https://app.example.com/mail/connected"`. |
| `gmailPush` | object \| null | yes |  |
| `gmailPush.topic` | string | yes |  |
| `gmailPush.serviceAccount` | object | yes |  |
| `gmailPushEndpoint` | string (uri) \| null | yes | Example `"https://app.example.com/"`. |
| `createdAt` | 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`, `cloud_required`, `not_microsoft`
  - 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`

## Change a tenant OAuth app: name, client secret, authority, connect domain or Gmail push

`PATCH /v1/oauth-apps/{appId}`

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

Accounts on the app use the new secret from their next token refresh. useConnectDomain moves the app's sign-ins to the workspace's connect domain, or back to the API host; register the new redirectUri at the provider first. A sign-in already started finishes on the host it began on. If the connect domain stops being active while an app uses it, the app's sign-ins fail with connect_domain_inactive (headless: 409) until it is active again or the app is moved back. gmailPush (Google apps) makes the app's accounts watch the topic with users.watch instead of being polled; null stops their watches and returns them to polling. Changing it wakes the app's accounts so it applies at once, and saving it again retries a watch Gmail refused.

Required scope: `admin`.

### Parameters

| Name | In | Type | Required | Description |
| --- | --- | --- | --- | --- |
| `appId` | path | string (uuid) | yes | Example `"25e70e52-969f-478b-90b0-9ff86b0b87d4"`. |

### Request body

Content type `application/json`.

| Field | Type | Required | Description |
| --- | --- | --- | --- |
| `name` | string | no | 1 to 100 characters. |
| `clientSecret` | string | no | At least 1 character. |
| `authority` | string | no | At least 1 character. |
| `gmailPush` | object \| null | no |  |
| `gmailPush.topic` | string | yes |  |
| `gmailPush.serviceAccount` | object | yes |  |
| `useConnectDomain` | boolean | no |  |

### Responses

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

| Field | Type | Required | Description |
| --- | --- | --- | --- |
| `id` | string (uuid) | yes | Example `"c4e6a8b0-1d3f-4a5c-8e7b-9d1f3a5c7e9b"`. |
| `provider` | "google" \| "microsoft" | yes |  |
| `name` | string | yes |  |
| `clientId` | string | yes |  |
| `cloud` | "global" \| "gcc-high" \| "dod" \| "china" \| null | yes |  |
| `authority` | string \| null | yes |  |
| `useConnectDomain` | boolean | yes |  |
| `redirectUri` | string (uri) | yes | Example `"https://app.example.com/mail/connected"`. |
| `gmailPush` | object \| null | yes |  |
| `gmailPush.topic` | string | yes |  |
| `gmailPush.serviceAccount` | object | yes |  |
| `gmailPushEndpoint` | string (uri) \| null | yes | Example `"https://app.example.com/"`. |
| `createdAt` | 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`, `not_microsoft`, `gmail_push_unsupported`, `push_unavailable`
  - 401: `unauthenticated`, `api_key_expired`
  - 403: `missing_scope`, `role_forbidden`, `account_token_forbidden`, `account_scope_forbidden`, `mcp_only_key`
  - 404: `oauth_app_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 a tenant OAuth app

`DELETE /v1/oauth-apps/{appId}`

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

Required scope: `admin`.

### Parameters

| Name | In | Type | Required | Description |
| --- | --- | --- | --- | --- |
| `appId` | path | string (uuid) | yes | Example `"25e70e52-969f-478b-90b0-9ff86b0b87d4"`. |

### 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: `oauth_app_not_found`
  - 409: `idempotency_key_in_progress`, `oauth_app_in_use`
  - 413: `payload_too_large`
  - 422: `idempotency_key_reused`
  - 429: `rate_limited`, `too_many_requests`
  - 500: `internal_error`
  - 503: `overloaded`
