MetorialDocs

Provider Auth Imports

An auth import lets you bring in existing OAuth tokens or credentials from another system, so users don't need to re-authenticate to use Metorial.

The Provider Auth Import object

provider_auth_import.json
{
  "object": "provider.auth_import",
  "id": "paci_1vWxYzAbCdEfGhJk",
  "note": "Imported from previous environment",
  "ip": "192.168.1.1",
  "user_agent": "example_user_agent",
  "metadata": {},
  "auth_config": {
    "object": "provider.auth_config",
    "id": "pac_8pQrStUvWxYzAbCd",
    "type": "manual",
    "source": "manual",
    "status": "active",
    "is_default": false,
    "provider_id": "pro_5gHjKlMnPqRsTuVw",
    "name": "GitHub OAuth Token",
    "description": "OAuth token for GitHub API access",
    "metadata": {},
    "tool_filter": {
      "type": "allow_all",
      "ignore_parent_filters": false
    },
    "deployment": {
      "object": "provider.deployment#preview",
      "id": "pde_1aBcDeFgHjKlMnPq",
      "is_default": false,
      "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",
      "status": "active",
      "is_default": true,
      "is_managed": true,
      "name": "GitHub OAuth",
      "description": "OAuth credentials for GitHub API",
      "metadata": {},
      "scopes": [
        "example_scopes"
      ],
      "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"
        },
        {
          "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"
  },
  "provider_id": "pro_5gHjKlMnPqRsTuVw",
  "provider_deployment_id": "pde_1aBcDeFgHjKlMnPq",
  "auth_method_id": "pam_2mNpQrStUvWxYzAb",
  "credentials_id": "par_4sTuVwXyZaBcDeFg",
  "created_at": "2025-09-15T10:30:00.000Z",
  "expires_at": "2026-03-15T10:30:00.000Z"
}
object"provider.auth_import"required
idstringrequired
notestringrequired
ipstringrequirednullable
user_agentstringrequirednullable
metadataRecord<string, any>requirednullable
provider_idstringrequired
provider_deployment_idstringrequirednullable
auth_method_idstringrequired
credentials_idstringrequirednullable
created_atdaterequired
expires_atdaterequirednullable

Endpoints

List provider auth imports

GET/provider-auth-config-imports

Returns a paginated list of provider auth imports.

Query parameters

idstring or string[]optional

Filter by import ID(s)

provider_idstring or string[]optional

Filter by provider ID(s)

provider_auth_credentials_idstring or string[]optional

Filter by auth credentials ID(s)

provider_auth_config_idstring or string[]optional

Filter by auth config ID(s)

provider_deployment_idstring or string[]optional

Filter by provider deployment ID(s)

Example request

curl -X GET "https://api.metorial.com/provider-auth-config-imports" \
  -H "Authorization: Bearer metorial_sk_io2h4..."

Get provider auth import

GET/provider-auth-config-imports/:provider_auth_import_id

Retrieves a specific provider auth import by ID.

Path parameters

provider_auth_import_idstringrequired

The unique identifier for the provider_auth_import

Example request

curl -X GET "https://api.metorial.com/provider-auth-config-imports/pro_Rm4Mnheq2bfEPhBhP7SY" \
  -H "Authorization: Bearer metorial_sk_io2h4..."

Create provider auth import

POST/provider-auth-config-imports

Imports authentication credentials for a provider.

Request body

provider_idstringoptional
provider_deployment_idstringoptional
provider_auth_config_idstringoptional
provider_auth_method_idstringoptional

The authentication method used by these credentials

notestringrequired

A note describing the import source or reason

metadataRecord<string, any>optional

Custom key-value pairs for storing additional information

valueRecord<string, any>required

The credential data to import

Example request

curl -X POST "https://api.metorial.com/provider-auth-config-imports" \
  -H "Content-Type: application/json" \
  -H "Authorization: Bearer metorial_sk_io2h4..." \
  -d '{
  "provider_id": "pro_5gHjKlMnPqRsTuVw",
  "provider_deployment_id": "pdp_4dEfGhJkLmNpQrSt",
  "provider_auth_config_id": "pacf_4sTuVwXyZaBcDeFg",
  "provider_auth_method_id": "pam_3cDeFgHjKlMnPqRs",
  "note": "Migrated from legacy OAuth app",
  "metadata": {},
  "value": {}
}'

Get auth import schema

GET/provider-auth-config-imports/schema

Retrieves the JSON Schema for importing authentication credentials.

Query parameters

provider_idstringoptional
provider_deployment_idstringoptional
provider_auth_config_idstringoptional
provider_auth_method_idstringoptional

Example request

curl -X GET "https://api.metorial.com/provider-auth-config-imports/schema" \
  -H "Authorization: Bearer metorial_sk_io2h4..."