---
title: "Initiate OAuth for a source"
method: POST
path: "/sources/initiateOAuth"
---

# Initiate OAuth for a source

`POST /sources/initiateOAuth`

Given a source ID, workspace ID, and redirect URL, initiates OAuth for the source.

This returns a fully formed URL for performing user authentication against the relevant source identity provider (IdP). Once authentication has been completed, the IdP will redirect to an Airbyte endpoint which will save the access and refresh tokens off as a secret and return the secret ID to the redirect URL specified in the `secret_id` query string parameter.

That secret ID can be used to create a source with credentials in place of actual tokens.

## Request body

- InitiateOauthRequest — POST body for initiating OAuth via the public API
  - `redirectUrl` string, required — The URL to redirect the user to with the OAuth secret stored in the secret_id query string parameter after authentication is complete.
  - `workspaceId` string, uuid, required — The workspace to create the secret and eventually the full source.
  - `oAuthInputConfiguration` unknown
  - `sourceType` 'airtable' | 'amazon-ads' | 'amazon-seller-partner' | 'asana' | 'azure-blob-storage' | 'bing-ads' | 'drift' | 'facebook-marketing' | 'gcs' | 'github' | 'gitlab' | 'google-ads' | 'google-analytics-data-api' | 'google-drive' | 'google-search-console' | 'google-sheets' | 'hubspot' | 'instagram' | 'lever-hiring' | 'linkedin-ads' | 'mailchimp' | 'microsoft-onedrive' | 'microsoft-sharepoint' | 'microsoft-teams' | 'monday' | 'notion' | 'pinterest' | 'rd-station-marketing' | 'salesforce' | 'slack' | 'smartsheets' | 'snapchat-marketing' | 'snowflake' | 'surveymonkey' | 'tiktok-marketing' | 'trello' | 'typeform' | 'youtube-analytics' | 'zendesk-chat' | 'zendesk-support' | 'zendesk-talk', required

## Response `200`

Response from the initiate OAuth call should be an object with a single property which will be the `redirect_url`. If a user is redirected to this URL, they'll be prompted by the identity provider to authenticate.

## Other responses

- `400` — A field in the body has not been set appropriately.
- `403` — API key is invalid.

---

[API](https://skmtc.net/airbyte/apis/applications.md) · [All operations](https://skmtc.net/airbyte/apis/applications/llms.txt) · [OpenAPI document](https://skmtc-service-staging.skmtc.workers.dev/v1/apis/airbyte/applications/versions/561bf5551285/schema)
