OAuth Session

Manage provider OAuth session information

OAuth Session object

Attributes

object

String

id

String

The unique identifier for this OAuth session

status

Enum

The current state of the session

url

String

The URL where the user can complete the OAuth flow

connection

Object

metadata

Object

A key-value map of additional metadata for the session

redirect_uri

StringNullable

The URI to redirect to after the OAuth flow is complete

instance_id

String

The instance that this session belongs to

completed_at

DateNullable

Timestamp when the session was completed

created_at

Date

Timestamp when the session was created

updated_at

Date

Timestamp when the session was last updated

{
"object": "provider_oauth.session",
"status": "pending",
"connection": {
"object": "provider_oauth.connection",
"status": "active",
"metadata": {},
"provider": {
"name": "GitHub",
"url": "https://github.com",
"image_url": "https://camo.metorial.com/igu4hi54high"
},
"config": {
"type": "json",
"config": {},
"scopes": [
"repo",
"repo"
]
}
},
"metadata": {}
}

List provider OAuth sessions

List all provider OAuth sessions

Query Parameters

limit

NumberOptional

after

StringOptional

before

StringOptional

cursor

StringOptional

order

EnumOptional

session_id

UnionOptional

oauth_connection_id

UnionOptional
GEThttp://api.metorial.com/provider-oauth/sessions
curl -X GET "https://api.metorial.com/provider-oauth/sessions" \
-H "Authorization: Bearer metorial_sk_..."

Create provider OAuth session

Create a new provider OAuth session

Request Body

metadata

ObjectOptional

A key-value map

redirect_uri

StringOptional
Provide exactly one of the following:
These 3 fields are mutually exclusive - include only one in your request

server_deployment_id

String

connection_id

String

token_import_id

String
POSThttp://api.metorial.com/provider-oauth/sessions
curl -X POST "https://api.metorial.com/provider-oauth/sessions" \
-H "Content-Type: application/json" \
-H "Authorization: Bearer metorial_sk_..." \
-d '{
"metadata": {},
"redirect_uri": "example_redirect_uri",
"server_deployment_id": "example_server_deployment_id"
}'

Get provider OAuth session

Get information for a specific provider OAuth session

URL Parameters

oauth_session_id

String

The unique identifier for the oauth_session

GEThttp://api.metorial.com/provider-oauth/sessions/:oauth_session_id
curl -X GET "https://api.metorial.com/provider-oauth/sessions/oau_Rm4Mnheq2bfEPhBhP7SY" \
-H "Authorization: Bearer metorial_sk_..."

Delete provider OAuth session

Delete a provider OAuth session

URL Parameters

oauth_session_id

String

The unique identifier for the oauth_session

DELETEhttp://api.metorial.com/provider-oauth/sessions/:oauth_session_id
curl -X DELETE "https://api.metorial.com/provider-oauth/sessions/oau_Rm4Mnheq2bfEPhBhP7SY" \
-H "Authorization: Bearer metorial_sk_..."