> ## Documentation Index
> Fetch the complete documentation index at: https://cal.com/docs/llms.txt
> Use this file to discover all available pages before exploring further.

# Delegation credentials

> Connect the calendars of every organization member on your email domain with one admin-managed credential, including on-premises Microsoft Exchange through a service account.

A **delegation credential** lets an organization connect calendars for all of its members at once.
Instead of each member signing in to their calendar provider, an organization owner or admin adds
one credential for an email domain, for example `acme.com`. Once it's enabled, Cal.com reads busy
times and creates booking events in the calendar of every member whose email is on that domain.

Delegation credentials support three workspace platforms:

| Workspace platform | What members get |
| - | - |
| **Google Workspace** | Google Calendar and Google Meet, through a Google Cloud service account with domain-wide delegation |
| **Microsoft 365** | Outlook Calendar and Microsoft Teams, through a Microsoft Entra ID app |
| **Microsoft Exchange** | The Exchange calendar of an on-premises Exchange server, through an Exchange service account with `ApplicationImpersonation` |

An organization can have one delegation credential per email domain, and can use different
platforms for different domains.

## Who can manage delegation credentials

Delegation credentials are managed on the **Delegation credential** page of your organization
settings, at `/settings/organizations/delegation-credential`. Only organization owners and admins
with permission to update the organization can open it. To enable a credential, your own email
address must be verified.

When you enable a credential, Cal.com checks that it works by connecting to the provider as an
organization member on the credential's domain: you, if your email is on that domain, otherwise the
first accepted owner, then admin, whose email is on it. A credential that fails this check stays
disabled.

## What members get automatically

Once a credential is enabled, Cal.com sets up the calendar of every eligible member in the
background, so members don't have to configure anything:

* Their calendar is connected through the delegation credential.
* Their primary calendar is checked for conflicts, so busy times there block bookings.
* If they don't have a destination calendar yet, their primary calendar becomes the calendar new
  bookings are added to. A destination calendar a member has already chosen is never replaced.

Google Workspace members who already connected Google Calendar themselves are handled
differently: their existing calendars are moved onto the delegation credential with their current
conflict-checking and destination calendar settings, and nothing new is added.

For Google Workspace and Microsoft 365, every organization member whose email is on the
credential's domain is eligible. For Microsoft Exchange, the member's email must also be verified.
If Cal.com can't read a member's primary calendar, it doesn't set up their calendars and tries
again later. The exception is when Google Workspace rejects a member's email, for example because
that address isn't in the workspace: Cal.com then uses the member's email address as their calendar
and doesn't try again.

## Set up Microsoft Exchange (on-premises)

The **Microsoft Exchange** platform is for organizations that run their own Exchange server and
reach it through Exchange Web Services (EWS). Cal.com signs in with one service account and uses
Exchange impersonation to act as each member, so members don't need to enter their own Exchange
password.

> [!NOTE]
>
> Microsoft Exchange delegation is for on-premises Exchange only. Microsoft removed
> `ApplicationImpersonation` from Exchange Online, so if your mailboxes are in Microsoft 365, use
> the **Microsoft 365** platform instead.

Before you start, make sure that:

* Your organization is verified and the domain you want to connect is one of its verified email
  domains: your primary domain or a [verified secondary domain](https://cal.com/docs/features/verified-secondary-domains.md).
  Any other domain, including a secondary domain that's still pending verification, is rejected.
  Each credential covers one domain, so add a separate credential for each domain you want to
  connect.
* You have an Exchange service account and its EWS URL, for example
  `https://mail.acme.com/EWS/Exchange.asmx`. The Exchange server must accept requests from
  Cal.com.

**1. Add the credential**

Go to **Settings**, then under your organization select **Delegation credential**, and select **Add delegation
credential**. Enter one of your verified domains as the **Domain** and choose **Microsoft Exchange** as the workspace
platform, then fill in:

| Field | What to enter |
| - | - |
| **EWS URL** | The HTTP or HTTPS URL of your Exchange Web Services endpoint |
| **Service account username** | The service account's email address, or `DOMAIN\user` |
| **Service account password** | The service account's password |
| **Exchange version** | Your Exchange server version, from 2007 SP1 to 2016. Defaults to 2016 |
| **Authentication method** | **Basic authentication** or **NTLM authentication**. Defaults to Basic authentication |

Select **Create**. The credential is added in a disabled state.

![The Add delegation credential dialog with Microsoft Exchange selected as the workspace platform, showing the domain, EWS URL, service account username and password, Exchange version and authentication method fields](https://mintcdn.com/calcom/kyNgrG5YJe4A4sJn/images/delegation-credentials/add-exchange-delegation-credential.png?fit=max\&auto=format\&n=kyNgrG5YJe4A4sJn\&q=85\&s=99252850f5f96e34c3b47f8007f192a9)

**2. Grant ApplicationImpersonation in Exchange**

Under the new credential, Cal.com shows the service account and a command to run in the
Exchange Management Shell, for example:

```powershell theme={null}
New-ManagementRoleAssignment -Name "Cal.com impersonation" -Role ApplicationImpersonation -User svc-cal@acme.com
```

![A disabled Microsoft Exchange delegation credential on the Delegation credential page, with next steps showing the service account and the New-ManagementRoleAssignment command to copy](https://mintcdn.com/calcom/kyNgrG5YJe4A4sJn/images/delegation-credentials/exchange-delegation-credential-created.png?fit=max\&auto=format\&n=kyNgrG5YJe4A4sJn\&q=85\&s=eee73a3d04c83f05c31e2796f672d2a1)

> [!TIP]
>
> Grant only the access Cal.com needs. To limit impersonation to the mailboxes of Cal.com
> users, create a management scope and add `-CustomResourceScope` to the command:
>
> ```powershell theme={null}
> New-ManagementScope -Name "Cal.com users" -RecipientRestrictionFilter "Department -eq 'Cal.com'"
> New-ManagementRoleAssignment -Name "Cal.com impersonation" -Role ApplicationImpersonation -User svc-cal@acme.com -CustomResourceScope "Cal.com users"
> ```

**3. Enable the credential**

Once the role is assigned, turn on the switch next to the credential. Cal.com connects to the EWS URL with the service account and opens the
calendar of an owner or admin on the domain while impersonating them. If the check passes, the
credential is enabled.

If enabling fails, the error tells you what to fix:

| Error | What to check |
| - | - |
| Exchange authentication failed | The service account username and password |
| The service account may lack ApplicationImpersonation permission, or the mailbox may not exist | That the role assignment was run for this service account and covers the admin's mailbox |
| Couldn't connect to Exchange at the EWS URL | The URL, and that your server accepts requests from Cal.com |
| The EWS URL is not allowed | Use your Exchange server's public URL. Private and local network addresses are rejected |
| Microsoft Exchange delegation credentials must use one of your organization's verified email domains | That the organization is verified and the credential's domain is its primary domain or a verified secondary domain |

The check also needs an organization owner or admin with a verified email address on the
credential's domain to impersonate.

### What changes for members

Once the Exchange credential is enabled, every member whose primary email is verified and on the
credential's domain has their Exchange calendar connected automatically. Cal.com checks it for
conflicts and creates their bookings in their mailbox, without the member connecting anything.

* Members whose primary email isn't verified aren't connected through the credential. They can
  still connect Exchange themselves with their own login.
* Exchange has no conferencing app, so unlike Google and Microsoft 365, no video app is added for
  members.

### Change or remove an Exchange credential

You can't switch an existing credential to or from Microsoft Exchange. To move a domain to or from
Exchange, delete the credential and create a new one.

When you disable or delete a credential, Cal.com stops using it straight away and emails the
affected members. Members who hadn't connected their calendar themselves need to connect it to keep
their availability and bookings in sync.

## Manage delegation credentials with the API

Organization admins can also list, create, update, delete and verify delegation credentials with
API v2 under `/v2/organizations/{orgId}/delegation-credentials`. See the
[Delegation Credentials API reference](https://cal.com/docs/api-reference/v2/orgs-delegation-credentials/get-all-delegation-credentials-of-your-organization.md).


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.