---
title: "Authenticate OAuth provider"
method: POST
path: "/orgs/connections/oauth/validate"
tags: ["Connections"]
---

# Authenticate OAuth provider

`POST /orgs/connections/oauth/validate`

## Request

- Base URL: `https://api.useinvent.com`
- URL: `https://api.useinvent.com/orgs/connections/oauth/validate`
- Auth: HTTP bearer

Step 2, first option. Send the full redirect URL from step 1 as `validation_url`. Returns the tokens and the provider user. Prefer Connect OAuth provider, which keeps the tokens on the server.

## Request body

- ValidateConnectionOAuthSchema: OAuth provider authentication request
  - `type` 'SCHEDULER' | 'WORKFLOWS' | 'TOOLS' | 'FILES' | 'EMAILS' | 'HTTP_CREDENTIALS' | 'TABLES' | 'PAGES' | 'KNOWLEDGE' | 'SKILLS' | 'CONTACTS' | 'SEGMENTS' | 'ASSISTANTS' | 'AGENTS' | 'CHATS' | 'INBOX' | 'MEMBERS' | 'SUB_ORGS' | 'BILLING' | 'BROADCASTS' | 'ANALYTICS' | 'AUDIT' | 'PHONE' | 'GMAIL' | 'GOOGLE_SHEETS' | 'GOOGLE_CALENDAR' | 'GOOGLE_DRIVE' | 'GOOGLE_MEET' | 'ONEDRIVE' | 'SHAREPOINT' | 'OUTLOOK_CALENDAR' | 'OUTLOOK' | 'AIRTABLE' | 'NOTION' | 'LINEAR' | 'HUBSPOT' | 'GOHIGHLEVEL' | 'CAL' | 'CALENDLY' | 'RESEND' | 'OAUTH' | 'SLACK' | 'TEAMS' | 'TELEGRAM' | 'TRELLO' | 'FACEBOOK' | 'WHATSAPP' | 'INSTAGRAM' | 'MESSENGER' | 'TIKTOK' | 'JAPIFON' | 'SMPP' | 'TWILIO' | 'TELNYX' | 'ZOHO' | 'ZOHO_BOOKINGS' | 'ZOHO_INVENTORY' | 'ZOHO_CALENDAR' | 'SALESFORCE' | 'STRIPE' | 'SHOPIFY' | 'ZENDESK' | 'MCP' | 'OPENAPI' | 'ODOO' | 'WOOCOMMERCE', required: Connection type
  - `subdomain` string: The subdomain of the OAuth provider
  - `environment` string: The environment of the OAuth provider to connect (one of the provider environments, e.g. live or sandbox)
  - `validation_url` string, uri, required: The validation URL of the OAuth provider

## Response `200`

The access token to authenticate with the OAuth provider.

- ConnectionOAuthValidatedSchema: OAuth provider validated connection
  - `config` ConnectionOAuthConfigSchema, required: Configuration of an OAuth connection
    - `type` 'OAUTH', required: The type of the connection
    - `access_token` string, required: The access token for OAuth authentication
    - `refresh_token` string: The refresh token for OAuth authentication
    - `expires_in` number: The expiration time of the access token
    - `next_refresh_at` number: The date when the access token will be refreshed
    - `scope` string: The scope of the access token
    - `api_url` string, uri: The base URL for the API of the OAuth provider
    - `subdomain` string: The subdomain for providers that use subdomain-based URLs
    - `environment` string: The environment of the OAuth provider to connect (one of the provider environments, e.g. live or sandbox)
  - `user` ConnectionOAuthUserSchema, required: OAuth provider user
    - `external_id` string, required
    - `external_name` string, nullable, required

---

[API](https://skmtc.dev/useinvent/apis/invent-api.md) · [All operations](https://skmtc.dev/useinvent/apis/invent-api/llms.txt) · [OpenAPI document](https://skmtc.dev/useinvent/apis/invent-api/revisions/98824f3fde82?raw)
