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

# Authenticate OAuth Provider

> Authenticate with an OAuth provider to create a new connection.



## OpenAPI

````yaml https://api.useinvent.com/openapi.json post /orgs/{org_id}/connections/oauth/validate
openapi: 3.1.0
info:
  version: 1.0.0
  title: Invent API
servers:
  - url: https://api.useinvent.com
security:
  - bearerAuth: []
paths:
  /orgs/{org_id}/connections/oauth/validate:
    post:
      tags:
        - Orgs Connections
      summary: Authenticate OAuth Provider
      description: Authenticate with an OAuth provider to create a new connection.
      parameters:
        - schema:
            type: string
          required: true
          name: org_id
          in: path
      requestBody:
        description: ''
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/ValidateConnectionOAuthSchema'
          multipart/form-data:
            schema:
              $ref: '#/components/schemas/ValidateConnectionOAuthSchema'
      responses:
        '200':
          description: The access token to authenticate with the OAuth provider.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ConnectionOAuthValidatedSchema'
components:
  schemas:
    ValidateConnectionOAuthSchema:
      type: object
      properties:
        type:
          $ref: '#/components/schemas/ConnectionTypeSchema'
        subdomain:
          type: string
          pattern: ^[a-z0-9-]+$
          description: The subdomain of the OAuth provider
        validation_url:
          type: string
          maxLength: 10000
          format: uri
          description: The validation URL of the OAuth provider
      required:
        - type
        - validation_url
      description: OAuth provider authentication request
    ConnectionOAuthValidatedSchema:
      type: object
      properties:
        config:
          $ref: '#/components/schemas/ConnectionOAuthConfigSchema'
        user:
          $ref: '#/components/schemas/ConnectionOAuthUserSchema'
      required:
        - config
        - user
      description: OAuth provider validated connection
    ConnectionTypeSchema:
      type: string
      enum:
        - SCHEDULER
        - WORKFLOWS
        - TOOLS
        - FILES
        - EMAILS
        - HTTP_CREDENTIALS
        - TABLES
        - PAGES
        - KNOWLEDGE
        - SKILLS
        - CONTACTS
        - SEGMENTS
        - ASSISTANTS
        - INBOX
        - MEMBERS
        - BROADCASTS
        - ANALYTICS
        - AUDIT
        - PHONE
        - GMAIL
        - GOOGLE_SHEETS
        - GOOGLE_CALENDAR
        - GOOGLE_DRIVE
        - OUTLOOK_CALENDAR
        - AIRTABLE
        - NOTION
        - LINEAR
        - HUBSPOT
        - GOHIGHLEVEL
        - CAL
        - CALENDLY
        - RESEND
        - OAUTH
        - SLACK
        - TELEGRAM
        - TRELLO
        - FACEBOOK
        - WHATSAPP
        - INSTAGRAM
        - MESSENGER
        - TIKTOK
        - JAPIFON
        - TWILIO
        - TELNYX
        - ZOHO
        - ZOHO_BOOKINGS
        - ZOHO_INVENTORY
        - ZOHO_CALENDAR
        - SALESFORCE
        - STRIPE
        - SHOPIFY
        - ZENDESK
        - MCP
        - ODOO
        - WOOCOMMERCE
      description: Connection type
      example: SLACK
    ConnectionOAuthConfigSchema:
      type: object
      properties:
        type:
          type: string
          enum:
            - OAUTH
          description: The type of the connection
        access_token:
          type: string
          maxLength: 8192
          description: The access token for OAuth authentication
        refresh_token:
          type: string
          maxLength: 8192
          description: The refresh token for OAuth authentication
        expires_in:
          type: number
          minimum: 0
          description: The expiration time of the access token
        next_refresh_at:
          type: number
          description: The date when the access token will be refreshed
        scope:
          type: string
          maxLength: 2048
          description: The scope of the access token
        api_url:
          type: string
          maxLength: 2048
          format: uri
          description: The base URL for the API of the OAuth provider
        subdomain:
          type: string
          maxLength: 255
          description: The subdomain for providers that use subdomain-based URLs
      required:
        - type
        - access_token
      description: Configuration of an OAuth connection
    ConnectionOAuthUserSchema:
      type: object
      properties:
        external_id:
          type: string
        external_name:
          type:
            - string
            - 'null'
      required:
        - external_id
        - external_name
      description: OAuth provider user
  securitySchemes:
    bearerAuth:
      type: http
      scheme: bearer
      bearerFormat: API Key
      description: Bearer token authentication using your API key

````