---
title: "Disconnect Endpoint"
method: DELETE
path: "/gateways/mcps/endpoints/{endpoint_id}/connect"
tags: ["Gateway: MCP"]
---

# Disconnect Endpoint

`DELETE /gateways/mcps/endpoints/{endpoint_id}/connect`

Drop one connection's authorization and keep the connection itself.

The connection survives with its id, slug, name, URL and tool policy intact, so
every agent configured against it stays configured and one Connect reconnects
it. Deleting the endpoint is the other operation, and it is not this one.

Only this connection's grant goes. Another account at the same server keeps its
own, which is what the connection-keyed grant is for.

Idempotent: disconnecting something already disconnected returns the endpoint
and changes nothing, so a repeated click or a retried request is not an error.

## Path parameters

- `endpoint_id` string, uuid, required

## Response `200`

Successful Response

- MCPEndpointResponse
  - `count` integer
  - `endpoint` MCPEndpoint
    - `flags` MCPEndpointFlags
      - `is_active` boolean
      - `is_valid` boolean
    - `tags` object, nullable
    - `meta` object, nullable
    - `created_at` string, date-time, nullable
    - `updated_at` string, date-time, nullable
    - `deleted_at` string, date-time, nullable
    - `created_by_id` string, uuid, nullable
    - `updated_by_id` string, uuid, nullable
    - `deleted_by_id` string, uuid, nullable
    - `name` string, nullable
    - `description` string, nullable
    - `slug` string, nullable
    - `id` string, uuid, nullable
    - `auth_mode` 'oauth' | 'api_key' | 'none', required — How the gateway authenticates to an upstream.
    - `namespace` 'builtin' | 'standard' | 'custom' — Gateway route namespace.
    - `secret_id` string, uuid, nullable
    - `connection_id` string, uuid, nullable
    - `provider_key` string, nullable
    - `integration_key` string, nullable
    - `data` MCPEndpointData, required
      - `route` MCPEndpointRoute — Route for one MCP server. `credential_header` names the header an API-key endpoint's credential travels in, and nothing more: the value stays in the vault behind the endpoint's `secret_id`, so this field is configuration and is as readable as `base_url` is. It exists because an MCP server picks its own name for that header (`x-api-key`, `x-exa-api-key`, ...), which is what the agent config already expresses as `credentials.header_secret_refs`. None falls back to `Authorization: Bearer <key>`, and an OAuth endpoint ignores the field because a grant travels under the scheme its authorization server issued it with.
        - `base_url` string, nullable
        - `headers` object, nullable
        - `credential_header` string, nullable
      - `tools` GatewayEndpointFilter — Allowlist and denylist filter for models or tools.
        - `allowlist` string[], nullable
        - `denylist` string[], nullable
      - `settings` MCPEndpointSettings — MCP endpoint settings.
        - `timeout_seconds` number, nullable
      - `oauth` MCPOAuthData — Non-secret OAuth discovery metadata.
        - `resource` string, nullable
        - `authorization_server` string, nullable
        - `scopes_offered` string[]
    - `status` Status
      - `timestamp` string, date-time
      - `type` string, nullable
      - `code` string, nullable
      - `message` string, nullable
      - `stacktrace` string, nullable

## Other responses

- `422` — Validation Error

## Changes

- **2026-09-20** `7a4b57044657` — 1 info
  - endpoint added

[Change history](https://skmtc.dev/agenta-ai/apis/agenta-api/changes/gateways/mcps/endpoints/:endpoint_id/connect/delete.md)

---

[API](https://skmtc.dev/agenta-ai/apis/agenta-api.md) · [All operations](https://skmtc.dev/agenta-ai/apis/agenta-api/llms.txt) · [OpenAPI document](https://skmtc.dev/agenta-ai/apis/agenta-api/revisions/72f2feba8ccb?raw)
