Provider Setup Sessions
A setup session tracks an in-progress OAuth flow, storing state during the redirect. On success, it creates an auth config with the user's access token.
Provider Setup Sessions object
Attributes
object
StringString representing the object's type
id
StringUnique setup session identifier
type
StringSetup session type
status
StringSession status
url
StringURL where user completes authentication
name
StringNullableDisplay name
description
StringNullableDescription
metadata
ObjectNullableCustom key-value pairs
provider_id
StringProvider ID
auth_method
Objectdeployment
ObjectNullablecredentials
ObjectNullableauth_config
ObjectNullableconfig
ObjectNullableui_mode
StringUI mode for setup
redirect_url
StringNullableURL to redirect after setup
created_at
DateTimestamp when created
updated_at
DateTimestamp when last updated
expires_at
DateTimestamp when the session expires
{"object": "provider.setup_session","id": "pas_6eFgHjKlMnPqRsTu","type": "oauth","status": "pending","url": "https://provider.metorial.com/setup/pas_6eFgHjKlMnPqRsTu","name": "GitHub OAuth Setup","description": "Connect your GitHub account","metadata": {"redirect_uri": "https://app.example.com/callback"},"provider_id": "pro_5gHjKlMnPqRsTuVw","auth_method": {"object": "provider.capabilities.auth_method","id": "pam_2mNpQrStUvWxYzAb","type": "oauth","key": "oauth2","name": "OAuth 2.0","description": "Authenticate using OAuth 2.0","capabilities": {},"input_schema": {"type": "json_schema","schema": {}},"output_schema": {"type": "json_schema","schema": {}},"scopes": [{"object": "provider.capabilities.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": {"object": "provider.deployment#preview","id": "pde_1aBcDeFgHjKlMnPq","name": "Production","description": "Production deployment","metadata": {},"provider_id": "pro_5gHjKlMnPqRsTuVw","created_at": "2025-09-15T10:30:00.000Z","updated_at": "2026-01-10T14:45:00.000Z"},"credentials": {"object": "provider.auth_credentials","id": "par_4sTuVwXyZaBcDeFg","type": "oauth","is_default": true,"name": "GitHub OAuth","description": "OAuth credentials for GitHub API","metadata": {"app_name": "My GitHub App","created_by": "[email protected]"},"provider_id": "pro_5gHjKlMnPqRsTuVw","created_at": "2025-09-15T10:30:00.000Z","updated_at": "2026-01-10T14:45:00.000Z"},"auth_config": {"object": "provider.auth_config","id": "pac_8pQrStUvWxYzAbCd","type": "manual","source": "manual","status": "active","provider_id": "pro_5gHjKlMnPqRsTuVw","name": "GitHub OAuth Token","description": "OAuth token for GitHub API access","metadata": {"connected_by": "[email protected]","purpose": "ci-pipeline"},"deployment_preview": {"object": "provider.deployment#preview","id": "pde_1aBcDeFgHjKlMnPq","name": "Production","description": "Production deployment","metadata": {},"provider_id": "pro_5gHjKlMnPqRsTuVw","created_at": "2025-09-15T10:30:00.000Z","updated_at": "2026-01-10T14:45:00.000Z"},"credentials": {"object": "provider.auth_credentials","id": "par_4sTuVwXyZaBcDeFg","type": "oauth","is_default": true,"name": "GitHub OAuth","description": "OAuth credentials for GitHub API","metadata": {"app_name": "My GitHub App","created_by": "[email protected]"},"provider_id": "pro_5gHjKlMnPqRsTuVw","created_at": "2025-09-15T10:30:00.000Z","updated_at": "2026-01-10T14:45:00.000Z"},"auth_method": {"object": "provider.capabilities.auth_method","id": "pam_2mNpQrStUvWxYzAb","type": "oauth","key": "oauth2","name": "OAuth 2.0","description": "Authenticate using OAuth 2.0","capabilities": {},"input_schema": {"type": "json_schema","schema": {}},"output_schema": {"type": "json_schema","schema": {}},"scopes": [{"object": "provider.capabilities.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"},"created_at": "2025-09-15T10:30:00.000Z","updated_at": "2026-01-10T14:45:00.000Z"},"config": {"object": "provider.config","id": "pcf_7dEfGhJkLmNpQrSt","name": "Production Config","description": "Configuration for production environment","metadata": {"label": "primary","notes": "Default production config"},"provider_id": "pro_5gHjKlMnPqRsTuVw","specification_id": "psp_9gHjKlMnPqRsTuVw","deployment": {"object": "provider.deployment#preview","id": "pde_1aBcDeFgHjKlMnPq","name": "Production","description": "Production deployment","metadata": {},"provider_id": "pro_5gHjKlMnPqRsTuVw","created_at": "2025-09-15T10:30:00.000Z","updated_at": "2026-01-10T14:45:00.000Z"},"from_vault": {"object": "provider.config_vault","id": "pcvt_3bCdEfGhJkLmNpQr","name": "Production Secrets","description": "Secure storage for production credentials","metadata": {"owner": "platform-team","sensitivity": "high"},"provider_id": "pro_5gHjKlMnPqRsTuVw","deployment": {"object": "provider.deployment#preview","id": "pde_1aBcDeFgHjKlMnPq","name": "Production","description": "Production deployment","metadata": {},"provider_id": "pro_5gHjKlMnPqRsTuVw","created_at": "2025-09-15T10:30:00.000Z","updated_at": "2026-01-10T14:45:00.000Z"},"created_at": "2025-09-15T10:30:00.000Z","updated_at": "2026-01-10T14:45:00.000Z"},"created_at": "2025-09-15T10:30:00.000Z","updated_at": "2026-01-10T14:45:00.000Z"},"ui_mode": "redirect","redirect_url": "https://app.example.com/callback","created_at": "2025-09-15T10:30:00.000Z","updated_at": "2026-01-10T14:45:00.000Z","expires_at": "2025-09-15T11:30:00.000Z"}
List provider setup sessions
Returns a paginated list of provider setup sessions.
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
id
UnionOptionalFilter by setup session ID(s)
provider_id
UnionOptionalFilter by provider ID(s)
provider_deployment_id
UnionOptionalFilter by provider deployment ID(s)
provider_auth_method_id
UnionOptionalFilter by auth method ID(s)
provider_auth_config_id
UnionOptionalFilter by provider auth config ID(s)
provider_auth_credentials_id
UnionOptionalFilter by provider auth credentials ID(s)
status
UnionOptionalFilter by session status (archived, failed, completed, expired, pending)
curl -X GET "https://api.metorial.com/provider-setup-sessions" \-H "Authorization: Bearer metorial_sk_..."
Get provider setup session
Retrieves a specific provider setup session by ID.
URL Parameters
provider_setup_session_id
StringThe unique identifier for the provider_setup_session
curl -X GET "https://api.metorial.com/provider-setup-sessions/pro_Rm4Mnheq2bfEPhBhP7SY" \-H "Authorization: Bearer metorial_sk_..."
Create provider setup session
Creates a new provider setup session for OAuth authentication.
Request Body
provider_id
StringThe provider ID
provider_deployment_id
StringOptionalOptional provider deployment ID
name
StringOptionaldescription
StringOptionalmetadata
ObjectOptionalCustom key-value pairs for storing additional information
provider_auth_method_id
StringOptionalThe authentication method to use (e.g., OAuth flow)
provider_auth_credentials_id
StringOptionalOptional OAuth app credentials to use instead of defaults
redirect_url
StringOptionalcurl -X POST "https://api.metorial.com/provider-setup-sessions" \-H "Content-Type: application/json" \-H "Authorization: Bearer metorial_sk_..." \-d '{"provider_id": "example_provider_id","provider_deployment_id": "example_provider_deployment_id","name": "example_name","description": "example_description","metadata": {},"provider_auth_method_id": "example_provider_auth_method_id","provider_auth_credentials_id": "example_provider_auth_credentials_id","redirect_url": "example_redirect_url"}'
Update provider setup session
Updates a specific provider setup session.
URL Parameters
provider_setup_session_id
StringThe unique identifier for the provider_setup_session
Request Body
name
StringOptionaldescription
StringOptionalmetadata
ObjectOptionalCustom key-value pairs for storing additional information
curl -X PATCH "https://api.metorial.com/provider-setup-sessions/pro_Rm4Mnheq2bfEPhBhP7SY" \-H "Content-Type: application/json" \-H "Authorization: Bearer metorial_sk_..." \-d '{"name": "example_name","description": "example_description","metadata": {}}'
Delete provider setup session
Deletes a provider setup session.
URL Parameters
provider_setup_session_id
StringThe unique identifier for the provider_setup_session
curl -X DELETE "https://api.metorial.com/provider-setup-sessions/pro_Rm4Mnheq2bfEPhBhP7SY" \-H "Authorization: Bearer metorial_sk_..."