OAuth Applications

The /oauth-apps endpoint manages project-level OAuth 2.0 application configurations. OAuth Applications store the client credentials and endpoint URLs needed to authenticate users with third-party services (e.g., Salesforce, HubSpot, GitHub).

Once configured, OAuth Applications can be used by:

  • MCP tool collections — reference an OAuth Application instead of relying on dynamic client registration (see Tool Collections)
  • Workflow activities — request tokens for OAuth-protected APIs
  • UI integrations — authenticate users via the standard OAuth 2.0 Authorization Code flow with optional PKCE

OAuthApplication Object

FieldData TypeDescription
idstringUnique identifier for the OAuth application.
namestringKebab-case identifier, unique within the project.
display_namestringHuman-readable label.
projectstringProject ID this application belongs to.
authorization_endpointstringOAuth 2.0 authorization URL.
token_endpointstringOAuth 2.0 token exchange URL.
client_idstringOAuth client identifier.
has_client_secretbooleanWhether a client secret is configured (never returned in plaintext).
default_scopesstring[]Default OAuth scopes to request during authorization.
use_pkcebooleanWhether PKCE is used for authorization flows.
revocation_endpointstringOAuth 2.0 token revocation URL.
created_atstringISO 8601 creation timestamp.
updated_atstringISO 8601 last update timestamp.

OAuthAppAuthStatus Object

FieldData TypeDescription
oauth_app_idstringThe OAuth application ID.
oauth_app_namestringThe OAuth application name.
authenticatedbooleanWhether the current user has valid tokens.
expires_atstringISO 8601 token expiration time.
scopestringGranted OAuth scopes.

List OAuth Applications

Endpoint: /oauth-apps

Method: GET

Requirements: User must have project_settings_write permission.

Headers

HeaderValue
AuthorizationBearer <YOUR_JWT_TOKEN>

Example Response

[
  {
    "id": "6650a1b2c3d4e5f678901234",
    "name": "salesforce",
    "display_name": "Salesforce",
    "project": "6650a1b2c3d4e5f678905678",
    "authorization_endpoint": "https://login.salesforce.com/services/oauth2/authorize",
    "token_endpoint": "https://login.salesforce.com/services/oauth2/token",
    "client_id": "3MVG9...",
    "has_client_secret": true,
    "default_scopes": ["api", "refresh_token"],
    "use_pkce": true,
    "revocation_endpoint": "https://login.salesforce.com/services/oauth2/revoke",
    "created_at": "2024-06-01T12:00:00.000Z",
    "updated_at": "2024-06-01T12:00:00.000Z"
  }
]

Code Example

List OAuth Applications

curl --location --request GET 'https://api.vertesia.io/api/v1/oauth-apps' \
--header 'Authorization: Bearer <YOUR_JWT_TOKEN>'

Retrieve an OAuth Application

Endpoint: /oauth-apps/<OAUTH_APP_ID>

Method: GET

Requirements: User must have project_settings_write permission.

Headers

HeaderValue
AuthorizationBearer <YOUR_JWT_TOKEN>

Path Parameters

ParameterData TypeDescription
<OAUTH_APP_ID>string(Required) The ID of the OAuth application.

Code Example

Retrieve OAuth Application

curl --location --request GET 'https://api.vertesia.io/api/v1/oauth-apps/<OAUTH_APP_ID>' \
--header 'Authorization: Bearer <YOUR_JWT_TOKEN>'

Create an OAuth Application

Endpoint: /oauth-apps

Method: POST

Requirements: User must have project_settings_write permission.

Headers

HeaderValue
AuthorizationBearer <YOUR_JWT_TOKEN>
Content-Typeapplication/json

Input Parameters

ParameterData TypeDescription
namestring(Required) Kebab-case identifier, unique within the project.
display_namestring(Required) Human-readable label.
authorization_endpointstringOAuth 2.0 authorization URL. Required for standalone OAuth apps; auto-discovered for MCP OAuth apps.
token_endpointstringOAuth 2.0 token exchange URL. Required for standalone OAuth apps; auto-discovered for MCP OAuth apps.
client_idstring(Required) OAuth client identifier.
client_secretstringClient secret (encrypted at rest, never returned in responses).
default_scopesstring[]Default OAuth scopes.
use_pkcebooleanUse PKCE for authorization flows. Defaults to true.
revocation_endpointstringOAuth 2.0 token revocation URL.

Example Request

{
  "name": "salesforce",
  "display_name": "Salesforce",
  "authorization_endpoint": "https://login.salesforce.com/services/oauth2/authorize",
  "token_endpoint": "https://login.salesforce.com/services/oauth2/token",
  "client_id": "3MVG9...",
  "client_secret": "my-secret-value",
  "default_scopes": ["api", "refresh_token"],
  "use_pkce": true,
  "revocation_endpoint": "https://login.salesforce.com/services/oauth2/revoke"
}

Code Example

Create OAuth Application

curl --location --request POST 'https://api.vertesia.io/api/v1/oauth-apps' \
--header 'Authorization: Bearer <YOUR_JWT_TOKEN>' \
--header 'Content-Type: application/json' \
--data-raw '{
  "name": "salesforce",
  "display_name": "Salesforce",
  "authorization_endpoint": "https://login.salesforce.com/services/oauth2/authorize",
  "token_endpoint": "https://login.salesforce.com/services/oauth2/token",
  "client_id": "3MVG9...",
  "client_secret": "my-secret-value",
  "default_scopes": ["api", "refresh_token"],
  "use_pkce": true
}'

Update an OAuth Application

Endpoint: /oauth-apps/<OAUTH_APP_ID>

Method: PUT

Requirements: User must have project_settings_write permission.

Headers

HeaderValue
AuthorizationBearer <YOUR_JWT_TOKEN>
Content-Typeapplication/json

Path Parameters

ParameterData TypeDescription
<OAUTH_APP_ID>string(Required) The ID of the OAuth application.

Input Parameters

All fields from the create payload are accepted. Only provided fields are updated.

ParameterData TypeDescription
display_namestringHuman-readable label.
authorization_endpointstringOAuth 2.0 authorization URL.
token_endpointstringOAuth 2.0 token exchange URL.
client_idstringOAuth client identifier.
client_secretstringNew client secret. Send empty string to clear.
default_scopesstring[]Default OAuth scopes.
use_pkcebooleanUse PKCE for authorization flows.
revocation_endpointstringOAuth 2.0 token revocation URL.

Code Example

Update OAuth Application

curl --location --request PUT 'https://api.vertesia.io/api/v1/oauth-apps/<OAUTH_APP_ID>' \
--header 'Authorization: Bearer <YOUR_JWT_TOKEN>' \
--header 'Content-Type: application/json' \
--data-raw '{
  "display_name": "Salesforce Production",
  "default_scopes": ["api", "refresh_token", "full"]
}'

Delete an OAuth Application

Endpoint: /oauth-apps/<OAUTH_APP_ID>

Method: DELETE

Requirements: User must have project_admin permission.

Headers

HeaderValue
AuthorizationBearer <YOUR_JWT_TOKEN>

Path Parameters

ParameterData TypeDescription
<OAUTH_APP_ID>string(Required) The ID of the OAuth application.

Code Example

Delete OAuth Application

curl --location --request DELETE 'https://api.vertesia.io/api/v1/oauth-apps/<OAUTH_APP_ID>' \
--header 'Authorization: Bearer <YOUR_JWT_TOKEN>'

Initiate OAuth Authorization

Starts an OAuth 2.0 Authorization Code flow for the current user. Returns an authorization URL to open in a popup or browser.

Endpoint: /oauth-apps/<OAUTH_APP_ID>/authorize

Method: GET

Requirements: User must be authenticated.

Headers

HeaderValue
AuthorizationBearer <YOUR_JWT_TOKEN>

Path Parameters

ParameterData TypeDescription
<OAUTH_APP_ID>string(Required) The ID of the OAuth application.

Example Response

{
  "authorization_url": "https://login.salesforce.com/services/oauth2/authorize?response_type=code&client_id=3MVG9...&redirect_uri=https%3A%2F%2Fapp.vertesia.io%2Foauth%2Fcallback&state=abc123&code_challenge=xyz&code_challenge_method=S256&scope=api+refresh_token",
  "state": "abc123"
}

Code Example

Initiate Authorization

curl --location --request GET 'https://api.vertesia.io/api/v1/oauth-apps/<OAUTH_APP_ID>/authorize' \
--header 'Authorization: Bearer <YOUR_JWT_TOKEN>'

Exchange Authorization Code

Called by the UI callback page after the user completes authorization. Exchanges the authorization code for tokens and stores them server-side.

Endpoint: /oauth-apps/exchange

Method: POST

Requirements: User must be authenticated.

Headers

HeaderValue
AuthorizationBearer <YOUR_JWT_TOKEN>
Content-Typeapplication/json

Input Parameters

ParameterData TypeDescription
codestring(Required) Authorization code from the OAuth provider.
statestring(Required) State parameter for CSRF verification.

Example Response

{
  "success": true
}

Code Example

Exchange Authorization Code

curl --location --request POST 'https://api.vertesia.io/api/v1/oauth-apps/exchange' \
--header 'Authorization: Bearer <YOUR_JWT_TOKEN>' \
--header 'Content-Type: application/json' \
--data-raw '{
  "code": "auth_code_from_provider",
  "state": "abc123"
}'

Check Authentication Status

Check whether the current user has valid OAuth tokens for an application.

Endpoint: /oauth-apps/<OAUTH_APP_ID>/status

Method: GET

Requirements: User must be authenticated.

Headers

HeaderValue
AuthorizationBearer <YOUR_JWT_TOKEN>

Path Parameters

ParameterData TypeDescription
<OAUTH_APP_ID>string(Required) The ID of the OAuth application.

Example Response

{
  "oauth_app_id": "6650a1b2c3d4e5f678901234",
  "oauth_app_name": "salesforce",
  "authenticated": true,
  "expires_at": "2024-06-01T13:00:00.000Z",
  "scope": "api refresh_token"
}

Code Example

Check Authentication Status

curl --location --request GET 'https://api.vertesia.io/api/v1/oauth-apps/<OAUTH_APP_ID>/status' \
--header 'Authorization: Bearer <YOUR_JWT_TOKEN>'

Get Access Token

Retrieve a valid access token for an OAuth application. Automatically refreshes expired tokens when a refresh token is available. Primarily used by workflow activities.

Endpoint: /oauth-apps/<OAUTH_APP_ID>/token

Method: POST

Requirements: User must be authenticated.

Headers

HeaderValue
AuthorizationBearer <YOUR_JWT_TOKEN>

Path Parameters

ParameterData TypeDescription
<OAUTH_APP_ID>string(Required) The ID of the OAuth application.

Example Response

{
  "access_token": "eyJhbGciOi..."
}

Code Example

Get Access Token

curl --location --request POST 'https://api.vertesia.io/api/v1/oauth-apps/<OAUTH_APP_ID>/token' \
--header 'Authorization: Bearer <YOUR_JWT_TOKEN>' \
--header 'Content-Type: application/json' \
--data-raw '{}'

Disconnect (Revoke Tokens)

Delete the current user's stored tokens for an OAuth application.

Endpoint: /oauth-apps/<OAUTH_APP_ID>/disconnect

Method: DELETE

Requirements: User must be authenticated.

Headers

HeaderValue
AuthorizationBearer <YOUR_JWT_TOKEN>

Path Parameters

ParameterData TypeDescription
<OAUTH_APP_ID>string(Required) The ID of the OAuth application.

Example Response

{
  "success": true
}

Code Example

Disconnect

curl --location --request DELETE 'https://api.vertesia.io/api/v1/oauth-apps/<OAUTH_APP_ID>/disconnect' \
--header 'Authorization: Bearer <YOUR_JWT_TOKEN>'

Was this page helpful?