Provider OAuth Setups

OAuth setups provide a way to authenticate users with providers that require OAuth. Create a setup, send users to the URL, and an auth config is created when they complete the flow.

Provider OAuth Setups object

Attributes

object

String

String representing the object's type

id

String

Unique OAuth setup identifier

status

StringNullable

Current OAuth setup status

is_ephemeral

Boolean

Whether this setup is ephemeral

provider_id

String

Provider ID

name

StringNullable

OAuth setup name

description

StringNullable

OAuth setup description

metadata

ObjectNullable

Custom key-value pairs

redirect_url

StringNullable

URL to redirect to after OAuth completion

url

StringNullable

OAuth setup URL for users to complete the setup

auth_config

ObjectNullable

credentials

ObjectNullable

auth_method

ObjectNullable

deployment

ObjectNullable

created_at

Date

Timestamp when created

updated_at

Date

Timestamp when last updated

expires_at

DateNullable

Timestamp when the setup expires

{
"object": "provider.oauth_setup",
"id": "pos_1aBcDeFgHjKlMnPq",
"status": "unused",
"provider_id": "pro_5gHjKlMnPqRsTuVw",
"name": "GitHub OAuth Setup",
"description": "Setup OAuth for GitHub integration",
"metadata": {
"environment": "production"
},
"redirect_url": "https://app.example.com/oauth/callback",
"url": "https://oauth.metorial.com/setup/pos_1aBcDeFgHjKlMnPq",
"auth_config": {
"id": "pac_1aBcDeFgHjKlMnPq",
"status": "active",
"type": "oauth2",
"name": "Production OAuth",
"description": "OAuth configuration for production",
"metadata": {
"environment": "production"
},
"provider_id": "pro_5gHjKlMnPqRsTuVw",
"provider_deployment_id": "pde_1aBcDeFgHjKlMnPq",
"provider_auth_method_id": "pam_1aBcDeFgHjKlMnPq",
"created_at": "2025-09-15T10:30:00.000Z",
"updated_at": "2026-01-10T14:45:00.000Z"
},
"credentials": {
"id": "pcr_1aBcDeFgHjKlMnPq",
"type": "oauth2",
"name": "Production Credentials",
"description": "OAuth credentials for production",
"metadata": {
"environment": "production"
},
"provider_id": "pro_5gHjKlMnPqRsTuVw",
"client_id": "client_abc123",
"created_at": "2025-09-15T10:30:00.000Z",
"updated_at": "2026-01-10T14:45:00.000Z"
},
"auth_method": {
"object": "provider.auth_method",
"id": "pam_2mNpQrStUvWxYzAb",
"type": "oauth",
"name": "OAuth 2.0",
"description": "Authenticate using OAuth 2.0",
"input_schema": {
"type": "object",
"properties": {
"client_id": {
"type": "string",
"description": "OAuth client ID"
},
"client_secret": {
"type": "string",
"description": "OAuth client secret"
}
},
"required": [
"client_id",
"client_secret"
]
},
"scopes": [
{
"object": "provider.auth_method.scope",
"id": "pams_8tUvWxYzAbCdEfGh",
"scope": "repo",
"name": "Repository Access",
"description": "Full control of private repositories"
}
],
"provider_id": "pro_5gHjKlMnPqRsTuVw",
"provider_specification_id": "psp_9gHjKlMnPqRsTuVw",
"created_at": "2025-09-15T10:30:00.000Z",
"updated_at": "2026-01-10T14:45:00.000Z"
},
"deployment": {
"id": "pde_1aBcDeFgHjKlMnPq",
"name": "Production",
"provider_id": "pro_5gHjKlMnPqRsTuVw"
},
"created_at": "2025-09-15T10:30:00.000Z",
"updated_at": "2026-01-10T14:45:00.000Z",
"expires_at": "2025-09-16T10:30:00.000Z"
}

List OAuth setups

Returns a paginated list of OAuth setups for a provider deployment.

URL Parameters

provider_deployment_id

String

The unique identifier for the provider_deployment

Query Parameters

limit

NumberOptional

Maximum number of items to return (1-100)

after

StringOptional

Return items after this ID

before

StringOptional

Return items before this ID

cursor

StringOptional

Pagination cursor from a previous response

order

EnumOptional

Sort order for results

GEThttp://api.metorial.com/provider-deployments/:provider_deployment_id/oauth-setups
curl -X GET "https://api.metorial.com/provider-deployments/pro_Rm4Mnheq2bfEPhBhP7SY/oauth-setups" \
-H "Authorization: Bearer metorial_sk_..."

Get OAuth setup

Retrieves a specific OAuth setup by ID.

URL Parameters

provider_deployment_id

String

The unique identifier for the provider_deployment

provider_oauth_setup_id

String

The unique identifier for the provider_oauth_setup

GEThttp://api.metorial.com/provider-deployments/:provider_deployment_id/oauth-setups/:provider_oauth_setup_id
curl -X GET "https://api.metorial.com/provider-deployments/pro_Rm4Mnheq2bfEPhBhP7SY/oauth-setups/pro_Rm4Mnheq2bfEPhBhP7SY" \
-H "Authorization: Bearer metorial_sk_..."

Create OAuth setup

Creates a new OAuth setup. Returns a URL that users should visit to complete the OAuth flow.

URL Parameters

provider_deployment_id

String

The unique identifier for the provider_deployment

Request Body

name

String

Display name for this setup

description

StringOptional

Optional description

metadata

ObjectOptional

Custom key-value pairs for storing additional information

redirect_url

StringOptional

URL to redirect to after OAuth completion

is_ephemeral

BooleanOptional

Whether this setup should be automatically cleaned up

provider_auth_credentials_id

StringOptional

ID of existing auth credentials to use

provider_auth_method_id

StringOptional

ID of the auth method to use

config

Object

OAuth configuration values

POSThttp://api.metorial.com/provider-deployments/:provider_deployment_id/oauth-setups
curl -X POST "https://api.metorial.com/provider-deployments/pro_Rm4Mnheq2bfEPhBhP7SY/oauth-setups" \
-H "Content-Type: application/json" \
-H "Authorization: Bearer metorial_sk_..." \
-d '{
"name": "example_name",
"description": "example_description",
"metadata": {},
"redirect_url": "example_redirect_url",
"is_ephemeral": false,
"provider_auth_credentials_id": "example_provider_auth_credentials_id",
"provider_auth_method_id": "example_provider_auth_method_id",
"config": {}
}'

Update OAuth setup

Updates an existing OAuth setup.

URL Parameters

provider_deployment_id

String

The unique identifier for the provider_deployment

provider_oauth_setup_id

String

The unique identifier for the provider_oauth_setup

Request Body

name

StringOptional

description

StringOptional

metadata

ObjectOptional

Custom key-value pairs for storing additional information

PATCHhttp://api.metorial.com/provider-deployments/:provider_deployment_id/oauth-setups/:provider_oauth_setup_id
curl -X PATCH "https://api.metorial.com/provider-deployments/pro_Rm4Mnheq2bfEPhBhP7SY/oauth-setups/pro_Rm4Mnheq2bfEPhBhP7SY" \
-H "Content-Type: application/json" \
-H "Authorization: Bearer metorial_sk_..." \
-d '{
"name": "example_name",
"description": "example_description",
"metadata": {}
}'