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
Stringstatus
StringSession status (pending, in_progress, completed, failed, expired)
name
StringNullableDisplay name
description
StringNullableDescription
metadata
ObjectNullableCustom key-value pairs for storing additional information
provider_id
StringProvider ID
provider_deployment_id
StringNullableDeployment ID
provider_auth_method_id
StringAuth method ID
redirect_url
StringNullableURL to redirect after setup
url
StringNullableURL where user completes authentication
created_at
DateTimestamp when created
updated_at
DateTimestamp when last updated
expires_at
DateNullableTimestamp when the session expires
auth_config
ObjectNullable{"object": "provider.setup_session","id": "pas_6eFgHjKlMnPqRsTu","type": "oauth","status": "pending","name": "GitHub OAuth Setup","description": "Connect your GitHub account","metadata": {"redirect_uri": "https://app.example.com/callback","requested_scopes": ["repo","user"]},"provider_id": "pro_5gHjKlMnPqRsTuVw","provider_deployment_id": "pde_1aBcDeFgHjKlMnPq","provider_auth_method_id": "pam_2mNpQrStUvWxYzAb","redirect_url": "https://app.example.com/callback","url": "https://provider.metorial.com/setup/pas_6eFgHjKlMnPqRsTu","created_at": "2025-09-15T10:30:00.000Z","updated_at": "2026-01-10T14:45:00.000Z","expires_at": "2025-09-15T11:30:00.000Z","auth_config": {"object": "provider.auth_config","id": "pac_8pQrStUvWxYzAbCd","type": "manual","name": "GitHub OAuth Token","description": "OAuth token for GitHub API access","metadata": {"connected_by": "alex@company.com","purpose": "ci-pipeline"},"provider_id": "pro_5gHjKlMnPqRsTuVw","provider_deployment_id": "pde_1aBcDeFgHjKlMnPq","provider_auth_method_id": "pam_2mNpQrStUvWxYzAb","created_at": "2025-09-15T10:30:00.000Z","updated_at": "2026-01-10T14:45:00.000Z"}}
List provider setup sessions
Returns a paginated list of provider setup sessions.
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
provider_auth_method_id
UnionOptionalFilter by auth method ID(s)
status
StringOptionalFilter by session status
curl -X GET "https://api.metorial.com/provider-deployments/pro_Rm4Mnheq2bfEPhBhP7SY/setup-sessions" \-H "Authorization: Bearer metorial_sk_..."
Get provider setup session
Retrieves a specific provider setup session by ID.
URL Parameters
provider_deployment_id
StringThe unique identifier for the provider_deployment
provider_setup_session_id
StringThe unique identifier for the provider_setup_session
curl -X GET "https://api.metorial.com/provider-deployments/pro_Rm4Mnheq2bfEPhBhP7SY/setup-sessions/pro_Rm4Mnheq2bfEPhBhP7SY" \-H "Authorization: Bearer metorial_sk_..."
Create provider setup session
Creates a new provider setup session for OAuth authentication.
URL Parameters
provider_deployment_id
StringThe unique identifier for the provider_deployment
Request Body
name
StringOptionaldescription
StringOptionalmetadata
ObjectOptionalCustom key-value pairs for storing additional information
providerAuthMethodId
StringThe authentication method to use (e.g., OAuth flow)
providerAuthCredentialsId
StringOptionalOptional OAuth app credentials to use instead of defaults
redirectUrl
StringOptionalcurl -X POST "https://api.metorial.com/provider-deployments/pro_Rm4Mnheq2bfEPhBhP7SY/setup-sessions" \-H "Content-Type: application/json" \-H "Authorization: Bearer metorial_sk_..." \-d '{"name": "example_name","description": "example_description","metadata": {},"providerAuthMethodId": "example_providerAuthMethodId","providerAuthCredentialsId": "example_providerAuthCredentialsId","redirectUrl": "example_redirectUrl"}'
Update provider setup session
Updates a specific provider setup session.
URL Parameters
provider_deployment_id
StringThe unique identifier for the provider_deployment
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-deployments/pro_Rm4Mnheq2bfEPhBhP7SY/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_deployment_id
StringThe unique identifier for the provider_deployment
provider_setup_session_id
StringThe unique identifier for the provider_setup_session
curl -X DELETE "https://api.metorial.com/provider-deployments/pro_Rm4Mnheq2bfEPhBhP7SY/setup-sessions/pro_Rm4Mnheq2bfEPhBhP7SY" \-H "Authorization: Bearer metorial_sk_..."