Link calendar accounts
Learn how to link calendar accounts with Unipile API.
Unipile supports Google and Outlook calendars. Based on the provider, the following account should be linked:
- Google Calendar : Google Account
- Outlook: Microsoft Outlook Account
How does it work ?
Unipile offers a secure and user-friendly authentication flow via OAuth. Users are redirected to the official Google or Microsoft login pages, where they can grant your app permission to access their data.
This requires setting up OAuth in your app with the proper permission scopes. While configuring it for production takes some effort, the end result is a trusted flow where users can authenticate in just a few clicks.
Once you’ve completed account linking setup, we recommend configuring OAuth for production.
Note on email capabilitiesIf you want to use email capabilities, you can do so with the same linked account. There is no need to link it separately for email and for calendar. The available capabilities depend on the permission scopes granted, as described in the OAuth guides.
Link with Hosted Authentication
To link calendar accounts using Hosted Authentication, follow the Authenticate with Hosted Auth guide and specify *:CALENDAR as the providers when calling Create Auth Link.
Server code
// ...
const response = await unipile
.hostedAuth
.createAuthLink({
providers: "*:CALENDAR",
expires_on: dayjs().add(10, 'minutes').toISOString()
redirect_uri: "https://myapp.com/link-account/callback",
});
// ...# ...
response = hosted_auth_api.create_auth_link(
{
"providers": "*:CALENDAR",
"expires_on": "2025-05-05T00:00:00.000Z",
"redirect_uri": "https://myapp.com/link-account/callback",
}
)
# ...curl --request POST \
--url https://api.unipile.com/v2/auth/link \
--header 'X-API-KEY: api-key' \
--header 'accept: application/json' \
--header 'content-type: application/json' \
--data '
{
"providers": "*:CALENDAR",
"redirect_uri": "https://myapp.com/link-account/callback",
"expires_on": "2025-05-05T00:00:00.000Z"
}
'This will present users with the option to connect a calendar account through Google or Microsoft Outlook. Other Unipile-supported providers without calendars capabilities are hidden.
Link with Custom Authentication
To build a custom authentication form for Google & Outlook Accounts, they must follow the OAuth Flow.
Updated about 1 month ago