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
StringString representing the object's type
id
StringUnique OAuth setup identifier
status
StringNullableCurrent OAuth setup status
is_ephemeral
BooleanWhether this setup is ephemeral
provider_id
StringProvider ID
name
StringNullableOAuth setup name
description
StringNullableOAuth setup description
metadata
ObjectNullableCustom key-value pairs
redirect_url
StringNullableURL to redirect to after OAuth completion
url
StringNullableOAuth setup URL for users to complete the setup
auth_config
ObjectNullablecredentials
ObjectNullableauth_method
ObjectNullabledeployment
ObjectNullablecreated_at
DateTimestamp when created
updated_at
DateTimestamp when last updated
expires_at
DateNullableTimestamp 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
StringThe unique identifier for the provider_deployment
Query Parameters
limit
NumberOptionalMaximum number of items to return (1-100)
after
StringOptionalReturn items after this ID
before
StringOptionalReturn items before this ID
cursor
StringOptionalPagination cursor from a previous response
order
EnumOptionalSort order for results
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
StringThe unique identifier for the provider_deployment
provider_oauth_setup_id
StringThe unique identifier for the provider_oauth_setup
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
StringThe unique identifier for the provider_deployment
Request Body
name
StringDisplay name for this setup
description
StringOptionalOptional description
metadata
ObjectOptionalCustom key-value pairs for storing additional information
redirect_url
StringOptionalURL to redirect to after OAuth completion
is_ephemeral
BooleanOptionalWhether this setup should be automatically cleaned up
provider_auth_credentials_id
StringOptionalID of existing auth credentials to use
provider_auth_method_id
StringOptionalID of the auth method to use
config
ObjectOAuth configuration values
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
StringThe unique identifier for the provider_deployment
provider_oauth_setup_id
StringThe unique identifier for the provider_oauth_setup
Request Body
name
StringOptionaldescription
StringOptionalmetadata
ObjectOptionalCustom key-value pairs for storing additional information
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": {}}'