---
updatedAt: 2025-03-06T23:15:07.000Z
agentTools:
  projectIndex: https://reference.airbyte.com/llms.txt
---

# Initiate OAuth for a source

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.

> 📘 See our OAuth setup guide
>
> [How to Create OAuth Sources](https://reference.airbyte.com/reference/creating-oauth-sources)

> 📘 Sources supported via API OAuth
>
> **Only some sources are supported via OAuth, including:**
>
> Asana, Facebook Marketing, Google Ads, Google Analytics (Universal Analytics), Google Analytics 4 (GA4), Google Directory, Google Drive, Google Search Console, Google Sheets, HubSpot, Instagram, Intercom, Monday.com, Notion, Posthog, Quickbooks, Sentry, Slack, Xero

<br />

# OpenAPI definition

```json
{
  "openapi": "3.1.0",
  "info": {
    "title": "Sources",
    "version": "1.0.0",
    "description": "Programatically control Airbyte Cloud, OSS & Enterprise."
  },
  "servers": [
    {
      "url": "https://api.airbyte.com/v1",
      "description": "Airbyte API v1"
    }
  ],
  "paths": {
    "/sources/initiateOAuth": {
      "post": {
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/InitiateOauthRequest"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "$ref": "#/components/responses/InitiateOauthResponse"
          },
          "400": {
            "description": "A field in the body has not been set appropriately."
          },
          "403": {
            "description": "API key is invalid."
          }
        },
        "operationId": "initiateOAuth",
        "x-speakeasy-alias": "initiateOAuth",
        "x-speakeasy-group": "Sources",
        "summary": "Initiate OAuth for a source",
        "description": "Given a source ID, workspace ID, and redirect URL, initiates OAuth for the source.\n\nThis 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.\n\nThat secret ID can be used to create a source with credentials in place of actual tokens."
      }
    }
  },
  "components": {
    "responses": {
      "InitiateOauthResponse": {
        "content": {
          "application/json": {}
        },
        "description": "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.",
        "x-speakeasy-component": true
      }
    },
    "schemas": {
      "OAuthConfiguration": {
        "description": "The values required to configure OAuth flows. The schema for this must match the `OAuthConfigSpecification.oauthUserInputFromConnectorConfigSpecification` schema.",
        "x-speakeasy-component": true
      },
      "OAuthInputConfiguration": {
        "$ref": "#/components/schemas/OAuthConfiguration",
        "x-speakeasy-component": true
      },
      "InitiateOauthRequest": {
        "title": "Root Type for initiate-oauth-post-body",
        "description": "POST body for initiating OAuth via the public API",
        "required": [
          "redirectUrl",
          "workspaceId",
          "sourceType"
        ],
        "type": "object",
        "example": {
          "redirectUrl": "https://cloud.airbyte.io/v1/api/oauth/callback",
          "workspaceId": "871d9b60-11d1-44cb-8c92-c246d53bf87e",
          "destinationId": "3d93b16c-ff5f-421c-8908-5a3c82088f14"
        },
        "properties": {
          "redirectUrl": {
            "description": "The URL to redirect the user to with the OAuth secret stored in the secret_id query string parameter after authentication is complete.",
            "type": "string"
          },
          "workspaceId": {
            "format": "uuid",
            "description": "The workspace to create the secret and eventually the full source.",
            "type": "string"
          },
          "oAuthInputConfiguration": {
            "$ref": "#/components/schemas/OAuthInputConfiguration",
            "description": "Input configuration for OAuth required by some sources."
          },
          "sourceType": {
            "$ref": "#/components/schemas/OAuthActorNames"
          }
        }
      },
      "OAuthActorNames": {
        "enum": [
          "airtable",
          "amazon-ads",
          "amazon-seller-partner",
          "asana",
          "azure-blob-storage",
          "bing-ads",
          "facebook-marketing",
          "github",
          "gitlab",
          "google-ads",
          "google-analytics-data-api",
          "google-drive",
          "google-search-console",
          "google-sheets",
          "hubspot",
          "instagram",
          "intercom",
          "lever-hiring",
          "linkedin-ads",
          "mailchimp",
          "microsoft-onedrive",
          "microsoft-sharepoint",
          "microsoft-teams",
          "monday",
          "notion",
          "pinterest",
          "retently",
          "salesforce",
          "slack",
          "smartsheets",
          "snapchat-marketing",
          "snowflake",
          "square",
          "surveymonkey",
          "tiktok-marketing",
          "trello",
          "typeform",
          "youtube-analytics",
          "zendesk-chat",
          "zendesk-sunshine",
          "zendesk-support",
          "zendesk-talk"
        ]
      }
    },
    "securitySchemes": {
      "bearerAuth": {
        "type": "http",
        "scheme": "bearer",
        "bearerFormat": "JWT"
      }
    }
  },
  "security": [
    {
      "bearerAuth": []
    }
  ],
  "x-readme": {
    "explorer-enabled": true,
    "proxy-enabled": true
  }
}
```