---
updatedAt: 2026-09-18T08:56:04.000Z
agentTools:
  projectIndex: https://docs.go.v7labs.com/llms.txt
---

# Revert an MCP integration to its template's OAuth client

Removes the user-supplied OAuth client credentials so the integration authenticates with the shared client configured on its template. Fails when the integration is not using its own client or the template has no client to fall back to. Resets auth state - the integration must complete OAuth afterwards.

# OpenAPI definition

```json
{
  "components": {
    "schemas": {
      "Common.APIErrorDetails": {
        "description": "Additional structured error context. Shape varies by error code.\n\n- For conflict errors: contains a `conflicts` array with conflicting resources\n- For other errors: may contain arbitrary error-specific context",
        "nullable": true,
        "oneOf": [
          {
            "$ref": "#/components/schemas/Common.ConflictErrorDetails"
          },
          {
            "additionalProperties": true,
            "description": "Generic error details for non-conflict errors",
            "type": "object",
            "x-struct": null,
            "x-validate": null
          }
        ],
        "title": "Common.APIErrorDetails",
        "x-struct": "Elixir.AgiDbWeb.Schemas.Common.APIErrorDetails",
        "x-validate": null
      },
      "Common.ConflictErrorDetails": {
        "additionalProperties": false,
        "description": "Details for conflict errors",
        "properties": {
          "conflicts": {
            "description": "List of conflicting resources",
            "items": {
              "additionalProperties": true,
              "type": "object",
              "x-struct": null,
              "x-validate": null
            },
            "type": "array",
            "x-struct": null,
            "x-validate": null
          }
        },
        "required": [
          "conflicts"
        ],
        "title": "Common.ConflictErrorDetails",
        "type": "object",
        "x-struct": "Elixir.AgiDbWeb.Schemas.Common.ConflictErrorDetails",
        "x-validate": null
      },
      "McpIntegrations.McpConnectErrorResponse": {
        "additionalProperties": false,
        "description": "Details of the last failed connection attempt",
        "properties": {
          "code": {
            "description": "Stable error code from the connect catalog",
            "type": "string",
            "x-struct": null,
            "x-validate": null
          },
          "failed_at": {
            "description": "When the failed connection attempt happened",
            "format": "date-time",
            "type": "string",
            "x-struct": null,
            "x-validate": null
          },
          "message": {
            "description": "Human-readable description of the failure",
            "type": "string",
            "x-struct": null,
            "x-validate": null
          },
          "remediation": {
            "description": "How the user (or agent) can fix the failure",
            "type": "string",
            "x-struct": null,
            "x-validate": null
          }
        },
        "required": [
          "code",
          "message",
          "remediation"
        ],
        "title": "McpIntegrations.McpConnectErrorResponse",
        "type": "object",
        "x-struct": "Elixir.AgiDbWeb.Schemas.McpIntegrations.McpConnectErrorResponse",
        "x-validate": null
      },
      "Common.UUID": {
        "example": "e23ff3f3-8f77-4e78-9e81-fdb25abfb781",
        "format": "uuid",
        "pattern": "^[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}$",
        "title": "Common.UUID",
        "type": "string",
        "x-struct": null,
        "x-validate": null
      },
      "McpIntegrations.McpIntegrationSharingPolicy": {
        "description": "Sharing policy for the MCP integration",
        "enum": [
          "restricted",
          "private",
          "public"
        ],
        "title": "McpIntegrations.McpIntegrationSharingPolicy",
        "type": "string",
        "x-struct": "Elixir.AgiDbWeb.Schemas.McpIntegrations.McpIntegrationSharingPolicy",
        "x-validate": null
      },
      "McpIntegrations.McpToolReadWrite": {
        "description": "Whether the MCP tool is treated as read-only or write-capable",
        "enum": [
          "read",
          "write"
        ],
        "title": "McpIntegrations.McpToolReadWrite",
        "type": "string",
        "x-struct": "Elixir.AgiDbWeb.Schemas.McpIntegrations.McpToolReadWrite",
        "x-validate": null
      },
      "McpIntegrations.McpIntegrationStatus": {
        "description": "Current authentication status of the MCP integration",
        "enum": [
          "unauthenticated",
          "authenticated",
          "disconnected"
        ],
        "title": "McpIntegrations.McpIntegrationStatus",
        "type": "string",
        "x-struct": "Elixir.AgiDbWeb.Schemas.McpIntegrations.McpIntegrationStatus",
        "x-validate": null
      },
      "McpIntegrations.McpToolResponse": {
        "additionalProperties": false,
        "properties": {
          "approval_state": {
            "$ref": "#/components/schemas/McpIntegrations.McpToolApprovalState"
          },
          "description": {
            "nullable": true,
            "type": "string",
            "x-struct": null,
            "x-validate": null
          },
          "estimated_max_tool_definition_tokens": {
            "description": "Conservative, approximate estimate of the input tokens this tool's definition (name, description, JSON schema) adds to each LLM turn while the tool is enabled. Per-tool, per-turn, input tokens only — it does not account for tool-call arguments or results. Computed locally and deterministically; null when estimation fails.",
            "minimum": 0,
            "nullable": true,
            "type": "integer",
            "x-struct": null,
            "x-validate": null
          },
          "name": {
            "type": "string",
            "x-struct": null,
            "x-validate": null
          },
          "read_write": {
            "$ref": "#/components/schemas/McpIntegrations.McpToolReadWrite"
          }
        },
        "required": [
          "name",
          "description",
          "read_write",
          "approval_state",
          "estimated_max_tool_definition_tokens"
        ],
        "title": "McpIntegrations.McpToolResponse",
        "type": "object",
        "x-struct": "Elixir.AgiDbWeb.Schemas.McpIntegrations.McpToolResponse",
        "x-validate": null
      },
      "Common.URL": {
        "example": "https://example.com",
        "pattern": "^http[s]?://(?:[a-zA-Z]|[0-9]|[$-_@.&+]|[!*\\(\\),]|(?:%[0-9a-fA-F][0-9a-fA-F]))+$",
        "title": "Common.URL",
        "type": "string",
        "x-struct": "Elixir.AgiDbWeb.Schemas.Common.URL",
        "x-validate": null
      },
      "McpIntegrations.McpToolApprovalState": {
        "description": "Approval policy used for the MCP tool",
        "enum": [
          "auto_approve",
          "human_approval",
          "disabled"
        ],
        "title": "McpIntegrations.McpToolApprovalState",
        "type": "string",
        "x-struct": "Elixir.AgiDbWeb.Schemas.McpIntegrations.McpToolApprovalState",
        "x-validate": null
      },
      "Common.DateTime": {
        "description": "DateTime in RFC3339 format",
        "example": "2020-01-20T14:00:00Z",
        "format": "date-time",
        "title": "Common.DateTime",
        "type": "string",
        "x-struct": "Elixir.AgiDbWeb.Schemas.Common.DateTime",
        "x-validate": null
      },
      "McpIntegrations.McpIntegrationResponse": {
        "additionalProperties": false,
        "description": "MCP integration",
        "properties": {
          "auth_config": {
            "additionalProperties": true,
            "type": "object",
            "x-struct": null,
            "x-validate": null
          },
          "auth_type": {
            "$ref": "#/components/schemas/McpIntegrations.McpIntegrationAuthType"
          },
          "connect_error": {
            "allOf": [
              {
                "$ref": "#/components/schemas/McpIntegrations.McpConnectErrorResponse"
              }
            ],
            "description": "Details of the last failed connection attempt. Cleared when the integration authenticates successfully.",
            "nullable": true,
            "x-struct": null,
            "x-validate": null
          },
          "disconnect_reason": {
            "description": "Reason for disconnection, only set when status is 'disconnected'",
            "enum": [
              "user_initiated",
              "token_expired",
              "token_revoked"
            ],
            "nullable": true,
            "type": "string",
            "x-struct": null,
            "x-validate": null
          },
          "has_client_credentials": {
            "description": "Whether a registered OAuth client (client_id + client_secret) is stored for this integration. Always false for non-registered auth types. The secret itself is never exposed.",
            "type": "boolean",
            "x-struct": null,
            "x-validate": null
          },
          "id": {
            "$ref": "#/components/schemas/Common.UUID"
          },
          "inserted_at": {
            "$ref": "#/components/schemas/Common.DateTime"
          },
          "metadata": {
            "additionalProperties": true,
            "type": "object",
            "x-struct": null,
            "x-validate": null
          },
          "name": {
            "type": "string",
            "x-struct": null,
            "x-validate": null
          },
          "oauth_client_source": {
            "description": "Which OAuth client a `registered` integration authenticates with: `template` (the shared client configured on its template) or `custom` (credentials the user supplied). Null for other auth types.",
            "enum": [
              "template",
              "custom"
            ],
            "nullable": true,
            "type": "string",
            "x-struct": null,
            "x-validate": null
          },
          "server_url": {
            "$ref": "#/components/schemas/Common.URL"
          },
          "sharing_policy": {
            "$ref": "#/components/schemas/McpIntegrations.McpIntegrationSharingPolicy"
          },
          "slug": {
            "description": "URL-safe identifier used in gateway hostname",
            "type": "string",
            "x-struct": null,
            "x-validate": null
          },
          "status": {
            "$ref": "#/components/schemas/McpIntegrations.McpIntegrationStatus"
          },
          "template_id": {
            "allOf": [
              {
                "$ref": "#/components/schemas/Common.UUID"
              }
            ],
            "nullable": true,
            "x-struct": null,
            "x-validate": null
          },
          "tools": {
            "description": "Populated only when include_tools=true was requested on the list endpoint. Null when tools could not be fetched (see tools_error).",
            "items": {
              "$ref": "#/components/schemas/McpIntegrations.McpToolResponse"
            },
            "nullable": true,
            "type": "array",
            "x-struct": null,
            "x-validate": null
          },
          "tools_error": {
            "allOf": [
              {
                "$ref": "#/components/schemas/McpIntegrations.McpToolsErrorResponse"
              }
            ],
            "description": "Populated only when include_tools=true was requested and fetching tools failed for this integration.",
            "nullable": true,
            "x-struct": null,
            "x-validate": null
          },
          "updated_at": {
            "$ref": "#/components/schemas/Common.DateTime"
          },
          "user_id": {
            "$ref": "#/components/schemas/Common.UUID"
          },
          "workspace_id": {
            "$ref": "#/components/schemas/Common.UUID"
          }
        },
        "required": [
          "id",
          "workspace_id",
          "user_id",
          "name",
          "slug",
          "template_id",
          "server_url",
          "auth_type",
          "auth_config",
          "status",
          "sharing_policy",
          "metadata",
          "has_client_credentials",
          "inserted_at",
          "updated_at"
        ],
        "title": "McpIntegrations.McpIntegrationResponse",
        "type": "object",
        "x-struct": "Elixir.AgiDbWeb.Schemas.McpIntegrations.McpIntegrationResponse",
        "x-validate": null
      },
      "Common.APIError": {
        "additionalProperties": false,
        "properties": {
          "code": {
            "example": "bad_request",
            "type": "string",
            "x-struct": null,
            "x-validate": null
          },
          "details": {
            "$ref": "#/components/schemas/Common.APIErrorDetails"
          },
          "message": {
            "example": "Bad Request",
            "type": "string",
            "x-struct": null,
            "x-validate": null
          }
        },
        "required": [
          "code",
          "message"
        ],
        "title": "Common.APIError",
        "type": "object",
        "x-struct": "Elixir.AgiDbWeb.Schemas.Common.APIError",
        "x-validate": null
      },
      "McpIntegrations.McpToolsErrorResponse": {
        "additionalProperties": false,
        "description": "Per-integration error returned when include_tools=true and tools could not be fetched",
        "properties": {
          "code": {
            "description": "Internal error code",
            "type": "string",
            "x-struct": null,
            "x-validate": null
          },
          "message": {
            "description": "Human-readable error message",
            "type": "string",
            "x-struct": null,
            "x-validate": null
          }
        },
        "required": [
          "code",
          "message"
        ],
        "title": "McpIntegrations.McpToolsErrorResponse",
        "type": "object",
        "x-struct": "Elixir.AgiDbWeb.Schemas.McpIntegrations.McpToolsErrorResponse",
        "x-validate": null
      },
      "McpIntegrations.McpIntegrationAuthType": {
        "description": "Authentication type used by the MCP integration",
        "enum": [
          "auto",
          "api_key",
          "registered"
        ],
        "title": "McpIntegrations.McpIntegrationAuthType",
        "type": "string",
        "x-struct": "Elixir.AgiDbWeb.Schemas.McpIntegrations.McpIntegrationAuthType",
        "x-validate": null
      }
    },
    "securitySchemes": {
      "ApiKeyAuth": {
        "in": "header",
        "name": "X-API-KEY",
        "type": "apiKey"
      },
      "BearerAuth": {
        "scheme": "bearer",
        "type": "http"
      }
    }
  },
  "info": {
    "title": "V7 Go API",
    "version": "0.1.0"
  },
  "openapi": "3.0.0",
  "paths": {
    "/api/workspaces/{workspace_id}/mcp-integrations/{id}/oauth-client": {
      "delete": {
        "callbacks": {},
        "description": "Removes the user-supplied OAuth client credentials so the integration authenticates with the shared client configured on its template. Fails when the integration is not using its own client or the template has no client to fall back to. Resets auth state - the integration must complete OAuth afterwards.",
        "operationId": "mcp-integrations-clear-oauth-client",
        "parameters": [
          {
            "description": "",
            "in": "path",
            "name": "workspace_id",
            "required": true,
            "schema": {
              "$ref": "#/components/schemas/Common.UUID"
            }
          },
          {
            "description": "",
            "in": "path",
            "name": "id",
            "required": true,
            "schema": {
              "$ref": "#/components/schemas/Common.UUID"
            }
          }
        ],
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/McpIntegrations.McpIntegrationResponse"
                }
              }
            },
            "description": "McpIntegrations.McpIntegrationResponse"
          },
          "400": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Common.APIError"
                }
              }
            },
            "description": "Common.APIError"
          },
          "401": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Common.APIError"
                }
              }
            },
            "description": "Common.APIError"
          },
          "403": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Common.APIError"
                }
              }
            },
            "description": "Common.APIError"
          },
          "404": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Common.APIError"
                }
              }
            },
            "description": "Common.APIError"
          },
          "409": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Common.APIError"
                }
              }
            },
            "description": "Common.APIError"
          },
          "422": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Common.APIError"
                }
              }
            },
            "description": "Common.APIError"
          },
          "500": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Common.APIError"
                }
              }
            },
            "description": "Common.APIError"
          }
        },
        "summary": "Revert an MCP integration to its template's OAuth client",
        "tags": [
          "McpIntegrations"
        ]
      }
    }
  },
  "security": [
    {
      "BearerAuth": []
    },
    {
      "ApiKeyAuth": []
    }
  ],
  "servers": [
    {
      "description": "EU",
      "url": "https://go.v7labs.com",
      "variables": {}
    },
    {
      "description": "US",
      "url": "https://go.us.v7labs.com",
      "variables": {}
    },
    {
      "description": "UAE",
      "url": "https://go.uae.v7labs.com",
      "variables": {}
    }
  ]
}
```