> For clean Markdown of any page, append .md to the page URL.
> For a complete documentation index, see https://developer.jelliu.co/llms.txt.
> For AI client integration (Claude Code, Cursor, etc.), connect to the MCP server at https://developer.jelliu.co/_mcp/server.

# Update an MCP server

PATCH https://api.jelliu.co/api/mcp-servers/{mcpServerId}
Content-Type: application/json

Partial update: only the fields you send change, and at least one must be sent. Use it to
rotate a token, change the approval policy or per-tool decisions, or fix a wrong transport.

Changing `serverUrl`, `name`, `description` or `transport` re-registers the server with the
voice engine (the provider cannot edit those in place): a new registration is created, every
agent that uses the server is repointed, the old registration is deleted, and every per-tool
decision is re-applied. Its voice-engine registration id changes; the Jelliu `id` and the agent
assignments do not. Changing only `secretToken`, `customHeaders` or `approvalMode` updates
the existing registration.

For a server on a hosted provider's host, a different `transport` and a `null` `secretToken`
are refused with 400; a token pasted in a provider URL is moved into the secret, and a wrong
stored transport is corrected. `toolOverrides` replaces all per-tool decisions and follows the
create rules, checked against the state the server will end up in: switching `approvalMode`
away from `fine_grained` while decisions remain is refused. Only one change per server runs at
a time; a concurrent update gets 409. Per-agent gateway rows managed by the platform answer 404.

**Side effects.** Updates or re-registers the server in the voice engine before
recording anything, repoints agents on re-registration, and pushes per-tool decisions. Writes
an `mcp.manage` audit entry.

**Idempotency.** Safe to retry with the same body: values equal to the stored ones do not
re-register. A retry after a `502` on per-tool decisions only re-pushes the decisions.

**Webhook events.** `audit.log_recorded` for the audit entry, if you subscribe to it. See [Webhooks](/webhooks).

**Access**
- **Required scope:** `write`. Any workspace role.
- **Rate limit:** General API — 120 (Starter), 200 (Growth), 300 (Business) or 600 (Enterprise) requests/min per workspace, checked by two counters of the same size. See [Rate limits](/rate-limits).
- **Plan:** Available on every plan.


Reference: https://developer.jelliu.co/api-reference/mcp-servers/patch-mcp-servers-by-mcp-server-id

## Authentication

- `Authorization` header (bearer token, required) — Workspace API key: `jl_` followed by 64 lowercase hex characters, created by the workspace owner in the dashboard (**Settings → API Keys**) and sent as `Authorization: Bearer jl_...`. The plaintext is shown once, at creation; Jelliu stores only a SHA-256 hash. A workspace can hold up to 25 active keys. | Scope | GET / HEAD | POST / PUT / PATCH / DELETE | Admin-only routes | | --- | --- | --- | --- | | `read` | Yes | No | No | | `write` | Yes | Yes | No | | `full` | Yes | Yes | Yes | Operations restricted to admins or owners reject keys without the `full` scope with `403`, and say so in their description. No key, whatever its scope, can mint or revoke API keys or rotate a webhook secret — that requires a signed-in owner session. A revoked key stops authenticating within about 10 seconds. See [Authentication](/authentication).

## Request

### Path parameters

- `mcpServerId` (string, required) — UUID of the MCP server registration. It must belong to the authenticated workspace; an id from another workspace answers `404`, exactly like an unknown one. Returned as `id` by `GET /api/mcp-servers`.

### Body (application/json)

This endpoint expects an object.

- `name` (string, optional) — New display name, trimmed. Re-registers the server.
- `description` (string, optional, nullable) — New agent-facing description; `null` clears it. Re-registers the server.
- `serverUrl` (string, optional) — New MCP endpoint (`http`/`https`). Must not target private/internal addresses. Re-registers the server.
- `secretToken` (string, optional, nullable) — New credential, stored encrypted; `null` clears it (refused for hosted providers).
- `customHeaders` (map from string to string, optional) — Replaces all custom headers (at most 20). Stored encrypted and never returned.
- `approvalMode` (enum, optional) — New approval policy (`always_ask`, `fine_grained` or `no_approval`).
  - Allowed values: `always_ask`, `fine_grained`, `no_approval`
- `transport` (enum, optional) — New transport (`SSE` or `STREAMABLE_HTTP`). Re-registers the server; hosted providers accept only theirs.
  - Allowed values: `SSE`, `STREAMABLE_HTTP`
- `toolOverrides` (map from string to enum, optional) — Replaces all per-tool decisions (`auto_approved` or `requires_approval`, keyed by tool name). Only with `fine_grained` (sent or stored); at most 50; `disabled` is rejected. Send `{}` to clear them.
  - Allowed values: `auto_approved`, `requires_approval`, `disabled`

## Response

### 200

Updated. `toolOverridesSync` is present when decisions were pushed or re-applied.

- `data` (object, required) — A single MCP server as returned by the create, retrieve and update endpoints: the summary fields plus `deleted_at` and the applied per-tool decisions. `secret_token` and `custom_headers` are never returned.
  - `id` (string, optional) — Unique identifier of the server.
  - `tenant_id` (string, optional) — The workspace that owns the server.
  - `agent_id` (string, optional, nullable) — `null` for workspace servers (always `null` in the workspace list, which excludes per-agent gateway rows). Can be set on `GET /api/mcp-servers/{mcpServerId}` for such a row.
  - `name` (string, optional) — Display name.
  - `description` (string, optional, nullable) — Agent-facing description of what the server's tools do.
  - `server_url` (string, optional) — The MCP endpoint. Tokens pasted in a provider URL are stripped before saving.
  - `approval_mode` (enum, optional) — Approval policy — `always_ask`, `fine_grained` or `no_approval`.
    - Allowed values: `always_ask`, `fine_grained`, `no_approval`
  - `transport` (enum, optional) — `SSE`, `STREAMABLE_HTTP`, or `null` when the voice engine's default (SSE) applies.
    - Allowed values: `SSE`, `STREAMABLE_HTTP`
  - `provider` (enum, optional) — Hosted provider recognised from the URL host (`zapier`, `alegra`, `make`); `null` for a custom server. Computed on every read, not stored.
    - Allowed values: `zapier`, `alegra`, `make`
  - `created_at` (datetime, optional) — When the server was created.
  - `updated_at` (datetime, optional) — Last change to the server.
  - `deleted_at` (datetime, optional, nullable) — Always `null` on these endpoints (deleted servers answer 404).
  - `toolOverrides` (map from string to enum, optional) — Per-tool approval decisions currently applied in the voice engine, keyed by tool name: `auto_approved` (runs without asking) or `requires_approval` (asks first). Only what actually landed is shown. Empty unless `approval_mode` is `fine_grained`.
    - Allowed values: `auto_approved`, `requires_approval`
- `toolOverridesSync` (object, optional) — What happened when per-tool decisions were pushed to the voice engine. Present only when decisions were sent, or re-applied after a re-registration or cleanup of legacy values.
  - `synced` (integer, optional) — Decisions applied in the voice engine.
  - `removed` (integer, optional) — Previously applied decisions that were withdrawn because they are no longer in the requested set.
  - `failed` (integer, optional) — Decisions that could not be applied or withdrawn. When greater than 0, create answers 207 and update answers 502.
  - `failures` (list of object, optional) — One entry per failed decision.
    - `tool` (string, optional) — The tool name the decision was for.
    - `stage` (enum, optional) — `push` (applying failed) or `retire` (withdrawing an old decision failed).
      - Allowed values: `push`, `retire`
    - `reason` (string, optional) — Why it failed, e.g. the server does not advertise the tool, or the voice engine's tool catalogue was unavailable.

## Errors

### 400 Bad Request Error

Invalid id or body, or a change the server's state does not allow. Schema failures carry `details`; provider and `toolOverrides` rule failures carry only the message.

- `error` (object, required) — The error object. Always has `code` and `message`.
  - `code` (string, required) — Stable machine-readable error code (for example `VALIDATION_FAILED`, `UNAUTHORIZED`, `FORBIDDEN`, `NOT_FOUND`, `BILLING_ERROR`, `COMPLIANCE_BLOCKED`, `RATE_LIMIT_EXCEEDED`, `INTERNAL_ERROR`). Switch on this, not on `message`. See [Errors](/errors).
  - `message` (string, required) — Human-readable explanation. English or Spanish depending on the route; may change without notice.
  - `details` (object or list of object, optional) — Present on `VALIDATION_FAILED` only. Its shape depends on how the route validates: * a field map, either Zod's `flatten()` output (`{ "formErrors": [], "fieldErrors": { "name": ["..."] } }`) or just its `fieldErrors` part (`{ "name": ["..."] }`); * an issue list, where each issue has at least `path`, `message` and `code`. `path` is a dot-separated string on routes that let the schema throw, and an array of keys on routes that forward Zod's raw issues (those also carry Zod's extra issue fields).
    - Field map
      - `formErrors` (list of string, optional)
      - `fieldErrors` (map from string to list of string, optional)
  - `metadata` (map from string to any, optional) — Structured detail exposed for a small allowlist of codes only — for example `BILLING_ERROR` carries `limit`, `current` and `tier` (resource caps) or `tier` and `feature` (feature gates).

### 401 Unauthorized Error

No usable credential. Either the `Authorization` header is missing or is not a well-formed `Bearer jl_…` key, or the key is unknown, revoked or expired. Do not retry with the same key. See [Authentication](/authentication#401-unauthorized).

- `error` (object, required) — The error object. Always has `code` and `message`.
  - `code` (string, required) — Stable machine-readable error code (for example `VALIDATION_FAILED`, `UNAUTHORIZED`, `FORBIDDEN`, `NOT_FOUND`, `BILLING_ERROR`, `COMPLIANCE_BLOCKED`, `RATE_LIMIT_EXCEEDED`, `INTERNAL_ERROR`). Switch on this, not on `message`. See [Errors](/errors).
  - `message` (string, required) — Human-readable explanation. English or Spanish depending on the route; may change without notice.
  - `details` (object or list of object, optional) — Present on `VALIDATION_FAILED` only. Its shape depends on how the route validates: * a field map, either Zod's `flatten()` output (`{ "formErrors": [], "fieldErrors": { "name": ["..."] } }`) or just its `fieldErrors` part (`{ "name": ["..."] }`); * an issue list, where each issue has at least `path`, `message` and `code`. `path` is a dot-separated string on routes that let the schema throw, and an array of keys on routes that forward Zod's raw issues (those also carry Zod's extra issue fields).
    - Field map
      - `formErrors` (list of string, optional)
      - `fieldErrors` (map from string to list of string, optional)
  - `metadata` (map from string to any, optional) — Structured detail exposed for a small allowlist of codes only — for example `BILLING_ERROR` carries `limit`, `current` and `tier` (resource caps) or `tier` and `feature` (feature gates).

### 403 Forbidden Error

The API key lacks `write`, or the workspace is suspended.

- `error` (object, required) — The error object. Always has `code` and `message`.
  - `code` (string, required) — Stable machine-readable error code (for example `VALIDATION_FAILED`, `UNAUTHORIZED`, `FORBIDDEN`, `NOT_FOUND`, `BILLING_ERROR`, `COMPLIANCE_BLOCKED`, `RATE_LIMIT_EXCEEDED`, `INTERNAL_ERROR`). Switch on this, not on `message`. See [Errors](/errors).
  - `message` (string, required) — Human-readable explanation. English or Spanish depending on the route; may change without notice.
  - `details` (object or list of object, optional) — Present on `VALIDATION_FAILED` only. Its shape depends on how the route validates: * a field map, either Zod's `flatten()` output (`{ "formErrors": [], "fieldErrors": { "name": ["..."] } }`) or just its `fieldErrors` part (`{ "name": ["..."] }`); * an issue list, where each issue has at least `path`, `message` and `code`. `path` is a dot-separated string on routes that let the schema throw, and an array of keys on routes that forward Zod's raw issues (those also carry Zod's extra issue fields).
    - Field map
      - `formErrors` (list of string, optional)
      - `fieldErrors` (map from string to list of string, optional)
  - `metadata` (map from string to any, optional) — Structured detail exposed for a small allowlist of codes only — for example `BILLING_ERROR` carries `limit`, `current` and `tier` (resource caps) or `tier` and `feature` (feature gates).

### 404 Not Found Error

No server with this id in the workspace, a platform-managed per-agent row, or it was deleted during the update.

- `error` (object, required) — The error object. Always has `code` and `message`.
  - `code` (string, required) — Stable machine-readable error code (for example `VALIDATION_FAILED`, `UNAUTHORIZED`, `FORBIDDEN`, `NOT_FOUND`, `BILLING_ERROR`, `COMPLIANCE_BLOCKED`, `RATE_LIMIT_EXCEEDED`, `INTERNAL_ERROR`). Switch on this, not on `message`. See [Errors](/errors).
  - `message` (string, required) — Human-readable explanation. English or Spanish depending on the route; may change without notice.
  - `details` (object or list of object, optional) — Present on `VALIDATION_FAILED` only. Its shape depends on how the route validates: * a field map, either Zod's `flatten()` output (`{ "formErrors": [], "fieldErrors": { "name": ["..."] } }`) or just its `fieldErrors` part (`{ "name": ["..."] }`); * an issue list, where each issue has at least `path`, `message` and `code`. `path` is a dot-separated string on routes that let the schema throw, and an array of keys on routes that forward Zod's raw issues (those also carry Zod's extra issue fields).
    - Field map
      - `formErrors` (list of string, optional)
      - `fieldErrors` (map from string to list of string, optional)
  - `metadata` (map from string to any, optional) — Structured detail exposed for a small allowlist of codes only — for example `BILLING_ERROR` carries `limit`, `current` and `tier` (resource caps) or `tier` and `feature` (feature gates).

### 409 Conflict Error

Another change to this server is in progress. Retry in a moment.

- `error` (object, required) — The error object. Always has `code` and `message`.
  - `code` (string, required) — Stable machine-readable error code (for example `VALIDATION_FAILED`, `UNAUTHORIZED`, `FORBIDDEN`, `NOT_FOUND`, `BILLING_ERROR`, `COMPLIANCE_BLOCKED`, `RATE_LIMIT_EXCEEDED`, `INTERNAL_ERROR`). Switch on this, not on `message`. See [Errors](/errors).
  - `message` (string, required) — Human-readable explanation. English or Spanish depending on the route; may change without notice.
  - `details` (object or list of object, optional) — Present on `VALIDATION_FAILED` only. Its shape depends on how the route validates: * a field map, either Zod's `flatten()` output (`{ "formErrors": [], "fieldErrors": { "name": ["..."] } }`) or just its `fieldErrors` part (`{ "name": ["..."] }`); * an issue list, where each issue has at least `path`, `message` and `code`. `path` is a dot-separated string on routes that let the schema throw, and an array of keys on routes that forward Zod's raw issues (those also carry Zod's extra issue fields).
    - Field map
      - `formErrors` (list of string, optional)
      - `fieldErrors` (map from string to list of string, optional)
  - `metadata` (map from string to any, optional) — Structured detail exposed for a small allowlist of codes only — for example `BILLING_ERROR` carries `limit`, `current` and `tier` (resource caps) or `tier` and `feature` (feature gates).

### 429 Too Many Requests Error

General API rate limit exceeded.

- `error` (object, required) — The error object. Always has `code` and `message`.
  - `code` (string, required) — Stable machine-readable error code (for example `VALIDATION_FAILED`, `UNAUTHORIZED`, `FORBIDDEN`, `NOT_FOUND`, `BILLING_ERROR`, `COMPLIANCE_BLOCKED`, `RATE_LIMIT_EXCEEDED`, `INTERNAL_ERROR`). Switch on this, not on `message`. See [Errors](/errors).
  - `message` (string, required) — Human-readable explanation. English or Spanish depending on the route; may change without notice.
  - `details` (object or list of object, optional) — Present on `VALIDATION_FAILED` only. Its shape depends on how the route validates: * a field map, either Zod's `flatten()` output (`{ "formErrors": [], "fieldErrors": { "name": ["..."] } }`) or just its `fieldErrors` part (`{ "name": ["..."] }`); * an issue list, where each issue has at least `path`, `message` and `code`. `path` is a dot-separated string on routes that let the schema throw, and an array of keys on routes that forward Zod's raw issues (those also carry Zod's extra issue fields).
    - Field map
      - `formErrors` (list of string, optional)
      - `fieldErrors` (map from string to list of string, optional)
  - `metadata` (map from string to any, optional) — Structured detail exposed for a small allowlist of codes only — for example `BILLING_ERROR` carries `limit`, `current` and `tier` (resource caps) or `tier` and `feature` (feature gates).

### 502 Bad Gateway Error

The voice engine rejected the change (nothing recorded), the server has no voice-engine registration to carry per-tool decisions, or some per-tool decisions could not be applied. In the last case everything else in the update WAS applied and the stored `toolOverrides` reflect what the voice engine has: `GET /api/mcp-servers/{mcpServerId}` and retry the missing decisions. The body carries a generic message.

- `error` (object, required) — The error object. Always has `code` and `message`.
  - `code` (string, required) — Stable machine-readable error code (for example `VALIDATION_FAILED`, `UNAUTHORIZED`, `FORBIDDEN`, `NOT_FOUND`, `BILLING_ERROR`, `COMPLIANCE_BLOCKED`, `RATE_LIMIT_EXCEEDED`, `INTERNAL_ERROR`). Switch on this, not on `message`. See [Errors](/errors).
  - `message` (string, required) — Human-readable explanation. English or Spanish depending on the route; may change without notice.
  - `details` (object or list of object, optional) — Present on `VALIDATION_FAILED` only. Its shape depends on how the route validates: * a field map, either Zod's `flatten()` output (`{ "formErrors": [], "fieldErrors": { "name": ["..."] } }`) or just its `fieldErrors` part (`{ "name": ["..."] }`); * an issue list, where each issue has at least `path`, `message` and `code`. `path` is a dot-separated string on routes that let the schema throw, and an array of keys on routes that forward Zod's raw issues (those also carry Zod's extra issue fields).
    - Field map
      - `formErrors` (list of string, optional)
      - `fieldErrors` (map from string to list of string, optional)
  - `metadata` (map from string to any, optional) — Structured detail exposed for a small allowlist of codes only — for example `BILLING_ERROR` carries `limit`, `current` and `tier` (resource caps) or `tier` and `feature` (feature gates).

## Examples

### MCP Servers_patchMcpServersByMcpServerId_example

**Request**

```json
undefined
```

**Response**

```json
{
  "data": {
    "id": "3c2b1a09-8f7e-4d6c-b5a4-938271605f4e",
    "tenant_id": "0e9d7c3b-8a1f-4c55-b7a2-3c4d5e6f7a8b",
    "agent_id": null,
    "name": "Zapier",
    "description": "Actions in the apps this business has connected through Zapier.",
    "server_url": "https://mcp.zapier.com/api/v1/connect",
    "approval_mode": "fine_grained",
    "transport": "STREAMABLE_HTTP",
    "provider": "zapier",
    "created_at": "2026-09-14T15:02:11.000Z",
    "updated_at": "2026-09-15T09:18:40.000Z",
    "deleted_at": null,
    "toolOverrides": {
      "execute_zapier_read_action": "auto_approved",
      "execute_zapier_write_action": "requires_approval"
    }
  },
  "toolOverridesSync": {
    "synced": 2,
    "removed": 0,
    "failed": 0,
    "failures": []
  }
}
```

**SDK Code**

```python MCP Servers_patchMcpServersByMcpServerId_example
import requests

url = "https://api.jelliu.co/api/mcp-servers/6b5a4c3d-2e1f-4a0b-9c8d-7e6f5a4b3c2d"

headers = {"Authorization": "Bearer <token>"}

response = requests.patch(url, headers=headers)

print(response.json())
```

```javascript MCP Servers_patchMcpServersByMcpServerId_example
const url = 'https://api.jelliu.co/api/mcp-servers/6b5a4c3d-2e1f-4a0b-9c8d-7e6f5a4b3c2d';
const options = {method: 'PATCH', headers: {Authorization: 'Bearer <token>'}};

try {
  const response = await fetch(url, options);
  const data = await response.json();
  console.log(data);
} catch (error) {
  console.error(error);
}
```

```go MCP Servers_patchMcpServersByMcpServerId_example
package main

import (
	"fmt"
	"net/http"
	"io"
)

func main() {

	url := "https://api.jelliu.co/api/mcp-servers/6b5a4c3d-2e1f-4a0b-9c8d-7e6f5a4b3c2d"

	req, _ := http.NewRequest("PATCH", url, nil)

	req.Header.Add("Authorization", "Bearer <token>")

	res, _ := http.DefaultClient.Do(req)

	defer res.Body.Close()
	body, _ := io.ReadAll(res.Body)

	fmt.Println(res)
	fmt.Println(string(body))

}
```

```ruby MCP Servers_patchMcpServersByMcpServerId_example
require 'uri'
require 'net/http'

url = URI("https://api.jelliu.co/api/mcp-servers/6b5a4c3d-2e1f-4a0b-9c8d-7e6f5a4b3c2d")

http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true

request = Net::HTTP::Patch.new(url)
request["Authorization"] = 'Bearer <token>'

response = http.request(request)
puts response.read_body
```

```java MCP Servers_patchMcpServersByMcpServerId_example
import com.mashape.unirest.http.HttpResponse;
import com.mashape.unirest.http.Unirest;

HttpResponse<String> response = Unirest.patch("https://api.jelliu.co/api/mcp-servers/6b5a4c3d-2e1f-4a0b-9c8d-7e6f5a4b3c2d")
  .header("Authorization", "Bearer <token>")
  .asString();
```

```php MCP Servers_patchMcpServersByMcpServerId_example
<?php
require_once('vendor/autoload.php');

$client = new \GuzzleHttp\Client();

$response = $client->request('PATCH', 'https://api.jelliu.co/api/mcp-servers/6b5a4c3d-2e1f-4a0b-9c8d-7e6f5a4b3c2d', [
  'headers' => [
    'Authorization' => 'Bearer <token>',
  ],
]);

echo $response->getBody();
```

```csharp MCP Servers_patchMcpServersByMcpServerId_example
using RestSharp;

var client = new RestClient("https://api.jelliu.co/api/mcp-servers/6b5a4c3d-2e1f-4a0b-9c8d-7e6f5a4b3c2d");
var request = new RestRequest(Method.PATCH);
request.AddHeader("Authorization", "Bearer <token>");
IRestResponse response = client.Execute(request);
```

```swift MCP Servers_patchMcpServersByMcpServerId_example
import Foundation

let headers = ["Authorization": "Bearer <token>"]

let request = NSMutableURLRequest(url: NSURL(string: "https://api.jelliu.co/api/mcp-servers/6b5a4c3d-2e1f-4a0b-9c8d-7e6f5a4b3c2d")! as URL,
                                        cachePolicy: .useProtocolCachePolicy,
                                    timeoutInterval: 10.0)
request.httpMethod = "PATCH"
request.allHTTPHeaderFields = headers

let session = URLSession.shared
let dataTask = session.dataTask(with: request as URLRequest, completionHandler: { (data, response, error) -> Void in
  if (error != nil) {
    print(error as Any)
  } else {
    let httpResponse = response as? HTTPURLResponse
    print(httpResponse)
  }
})

dataTask.resume()
```

### Rotate the token

**Request**

```json
{
  "secretToken": "sk_eltornillo_rotado_7a1d"
}
```

**Response**

```json
{
  "data": {
    "id": "3c2b1a09-8f7e-4d6c-b5a4-938271605f4e",
    "tenant_id": "0e9d7c3b-8a1f-4c55-b7a2-3c4d5e6f7a8b",
    "agent_id": null,
    "name": "Zapier",
    "description": "Actions in the apps this business has connected through Zapier.",
    "server_url": "https://mcp.zapier.com/api/v1/connect",
    "approval_mode": "fine_grained",
    "transport": "STREAMABLE_HTTP",
    "provider": "zapier",
    "created_at": "2026-09-14T15:02:11.000Z",
    "updated_at": "2026-09-15T09:18:40.000Z",
    "deleted_at": null,
    "toolOverrides": {
      "execute_zapier_read_action": "auto_approved",
      "execute_zapier_write_action": "requires_approval"
    }
  },
  "toolOverridesSync": {
    "synced": 2,
    "removed": 0,
    "failed": 0,
    "failures": []
  }
}
```

**SDK Code**

```python Rotate the token
import requests

url = "https://api.jelliu.co/api/mcp-servers/6b5a4c3d-2e1f-4a0b-9c8d-7e6f5a4b3c2d"

payload = { "secretToken": "sk_eltornillo_rotado_7a1d" }
headers = {
    "Authorization": "Bearer <token>",
    "Content-Type": "application/json"
}

response = requests.patch(url, json=payload, headers=headers)

print(response.json())
```

```javascript Rotate the token
const url = 'https://api.jelliu.co/api/mcp-servers/6b5a4c3d-2e1f-4a0b-9c8d-7e6f5a4b3c2d';
const options = {
  method: 'PATCH',
  headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
  body: '{"secretToken":"sk_eltornillo_rotado_7a1d"}'
};

try {
  const response = await fetch(url, options);
  const data = await response.json();
  console.log(data);
} catch (error) {
  console.error(error);
}
```

```go Rotate the token
package main

import (
	"fmt"
	"strings"
	"net/http"
	"io"
)

func main() {

	url := "https://api.jelliu.co/api/mcp-servers/6b5a4c3d-2e1f-4a0b-9c8d-7e6f5a4b3c2d"

	payload := strings.NewReader("{\n  \"secretToken\": \"sk_eltornillo_rotado_7a1d\"\n}")

	req, _ := http.NewRequest("PATCH", url, payload)

	req.Header.Add("Authorization", "Bearer <token>")
	req.Header.Add("Content-Type", "application/json")

	res, _ := http.DefaultClient.Do(req)

	defer res.Body.Close()
	body, _ := io.ReadAll(res.Body)

	fmt.Println(res)
	fmt.Println(string(body))

}
```

```ruby Rotate the token
require 'uri'
require 'net/http'

url = URI("https://api.jelliu.co/api/mcp-servers/6b5a4c3d-2e1f-4a0b-9c8d-7e6f5a4b3c2d")

http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true

request = Net::HTTP::Patch.new(url)
request["Authorization"] = 'Bearer <token>'
request["Content-Type"] = 'application/json'
request.body = "{\n  \"secretToken\": \"sk_eltornillo_rotado_7a1d\"\n}"

response = http.request(request)
puts response.read_body
```

```java Rotate the token
import com.mashape.unirest.http.HttpResponse;
import com.mashape.unirest.http.Unirest;

HttpResponse<String> response = Unirest.patch("https://api.jelliu.co/api/mcp-servers/6b5a4c3d-2e1f-4a0b-9c8d-7e6f5a4b3c2d")
  .header("Authorization", "Bearer <token>")
  .header("Content-Type", "application/json")
  .body("{\n  \"secretToken\": \"sk_eltornillo_rotado_7a1d\"\n}")
  .asString();
```

```php Rotate the token
<?php
require_once('vendor/autoload.php');

$client = new \GuzzleHttp\Client();

$response = $client->request('PATCH', 'https://api.jelliu.co/api/mcp-servers/6b5a4c3d-2e1f-4a0b-9c8d-7e6f5a4b3c2d', [
  'body' => '{
  "secretToken": "sk_eltornillo_rotado_7a1d"
}',
  'headers' => [
    'Authorization' => 'Bearer <token>',
    'Content-Type' => 'application/json',
  ],
]);

echo $response->getBody();
```

```csharp Rotate the token
using RestSharp;

var client = new RestClient("https://api.jelliu.co/api/mcp-servers/6b5a4c3d-2e1f-4a0b-9c8d-7e6f5a4b3c2d");
var request = new RestRequest(Method.PATCH);
request.AddHeader("Authorization", "Bearer <token>");
request.AddHeader("Content-Type", "application/json");
request.AddParameter("application/json", "{\n  \"secretToken\": \"sk_eltornillo_rotado_7a1d\"\n}", ParameterType.RequestBody);
IRestResponse response = client.Execute(request);
```

```swift Rotate the token
import Foundation

let headers = [
  "Authorization": "Bearer <token>",
  "Content-Type": "application/json"
]
let parameters = ["secretToken": "sk_eltornillo_rotado_7a1d"] as [String : Any]

let postData = JSONSerialization.data(withJSONObject: parameters, options: [])

let request = NSMutableURLRequest(url: NSURL(string: "https://api.jelliu.co/api/mcp-servers/6b5a4c3d-2e1f-4a0b-9c8d-7e6f5a4b3c2d")! as URL,
                                        cachePolicy: .useProtocolCachePolicy,
                                    timeoutInterval: 10.0)
request.httpMethod = "PATCH"
request.allHTTPHeaderFields = headers
request.httpBody = postData as Data

let session = URLSession.shared
let dataTask = session.dataTask(with: request as URLRequest, completionHandler: { (data, response, error) -> Void in
  if (error != nil) {
    print(error as Any)
  } else {
    let httpResponse = response as? HTTPURLResponse
    print(httpResponse)
  }
})

dataTask.resume()
```

### Switch to per-tool approvals

**Request**

```json
{
  "approvalMode": "fine_grained",
  "toolOverrides": {
    "execute_zapier_read_action": "auto_approved",
    "execute_zapier_write_action": "requires_approval"
  }
}
```

**Response**

```json
{
  "data": {
    "id": "3c2b1a09-8f7e-4d6c-b5a4-938271605f4e",
    "tenant_id": "0e9d7c3b-8a1f-4c55-b7a2-3c4d5e6f7a8b",
    "agent_id": null,
    "name": "Zapier",
    "description": "Actions in the apps this business has connected through Zapier.",
    "server_url": "https://mcp.zapier.com/api/v1/connect",
    "approval_mode": "fine_grained",
    "transport": "STREAMABLE_HTTP",
    "provider": "zapier",
    "created_at": "2026-09-14T15:02:11.000Z",
    "updated_at": "2026-09-15T09:18:40.000Z",
    "deleted_at": null,
    "toolOverrides": {
      "execute_zapier_read_action": "auto_approved",
      "execute_zapier_write_action": "requires_approval"
    }
  },
  "toolOverridesSync": {
    "synced": 2,
    "removed": 0,
    "failed": 0,
    "failures": []
  }
}
```

**SDK Code**

```python Switch to per-tool approvals
import requests

url = "https://api.jelliu.co/api/mcp-servers/6b5a4c3d-2e1f-4a0b-9c8d-7e6f5a4b3c2d"

payload = {
    "approvalMode": "fine_grained",
    "toolOverrides": {
        "execute_zapier_read_action": "auto_approved",
        "execute_zapier_write_action": "requires_approval"
    }
}
headers = {
    "Authorization": "Bearer <token>",
    "Content-Type": "application/json"
}

response = requests.patch(url, json=payload, headers=headers)

print(response.json())
```

```javascript Switch to per-tool approvals
const url = 'https://api.jelliu.co/api/mcp-servers/6b5a4c3d-2e1f-4a0b-9c8d-7e6f5a4b3c2d';
const options = {
  method: 'PATCH',
  headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
  body: '{"approvalMode":"fine_grained","toolOverrides":{"execute_zapier_read_action":"auto_approved","execute_zapier_write_action":"requires_approval"}}'
};

try {
  const response = await fetch(url, options);
  const data = await response.json();
  console.log(data);
} catch (error) {
  console.error(error);
}
```

```go Switch to per-tool approvals
package main

import (
	"fmt"
	"strings"
	"net/http"
	"io"
)

func main() {

	url := "https://api.jelliu.co/api/mcp-servers/6b5a4c3d-2e1f-4a0b-9c8d-7e6f5a4b3c2d"

	payload := strings.NewReader("{\n  \"approvalMode\": \"fine_grained\",\n  \"toolOverrides\": {\n    \"execute_zapier_read_action\": \"auto_approved\",\n    \"execute_zapier_write_action\": \"requires_approval\"\n  }\n}")

	req, _ := http.NewRequest("PATCH", url, payload)

	req.Header.Add("Authorization", "Bearer <token>")
	req.Header.Add("Content-Type", "application/json")

	res, _ := http.DefaultClient.Do(req)

	defer res.Body.Close()
	body, _ := io.ReadAll(res.Body)

	fmt.Println(res)
	fmt.Println(string(body))

}
```

```ruby Switch to per-tool approvals
require 'uri'
require 'net/http'

url = URI("https://api.jelliu.co/api/mcp-servers/6b5a4c3d-2e1f-4a0b-9c8d-7e6f5a4b3c2d")

http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true

request = Net::HTTP::Patch.new(url)
request["Authorization"] = 'Bearer <token>'
request["Content-Type"] = 'application/json'
request.body = "{\n  \"approvalMode\": \"fine_grained\",\n  \"toolOverrides\": {\n    \"execute_zapier_read_action\": \"auto_approved\",\n    \"execute_zapier_write_action\": \"requires_approval\"\n  }\n}"

response = http.request(request)
puts response.read_body
```

```java Switch to per-tool approvals
import com.mashape.unirest.http.HttpResponse;
import com.mashape.unirest.http.Unirest;

HttpResponse<String> response = Unirest.patch("https://api.jelliu.co/api/mcp-servers/6b5a4c3d-2e1f-4a0b-9c8d-7e6f5a4b3c2d")
  .header("Authorization", "Bearer <token>")
  .header("Content-Type", "application/json")
  .body("{\n  \"approvalMode\": \"fine_grained\",\n  \"toolOverrides\": {\n    \"execute_zapier_read_action\": \"auto_approved\",\n    \"execute_zapier_write_action\": \"requires_approval\"\n  }\n}")
  .asString();
```

```php Switch to per-tool approvals
<?php
require_once('vendor/autoload.php');

$client = new \GuzzleHttp\Client();

$response = $client->request('PATCH', 'https://api.jelliu.co/api/mcp-servers/6b5a4c3d-2e1f-4a0b-9c8d-7e6f5a4b3c2d', [
  'body' => '{
  "approvalMode": "fine_grained",
  "toolOverrides": {
    "execute_zapier_read_action": "auto_approved",
    "execute_zapier_write_action": "requires_approval"
  }
}',
  'headers' => [
    'Authorization' => 'Bearer <token>',
    'Content-Type' => 'application/json',
  ],
]);

echo $response->getBody();
```

```csharp Switch to per-tool approvals
using RestSharp;

var client = new RestClient("https://api.jelliu.co/api/mcp-servers/6b5a4c3d-2e1f-4a0b-9c8d-7e6f5a4b3c2d");
var request = new RestRequest(Method.PATCH);
request.AddHeader("Authorization", "Bearer <token>");
request.AddHeader("Content-Type", "application/json");
request.AddParameter("application/json", "{\n  \"approvalMode\": \"fine_grained\",\n  \"toolOverrides\": {\n    \"execute_zapier_read_action\": \"auto_approved\",\n    \"execute_zapier_write_action\": \"requires_approval\"\n  }\n}", ParameterType.RequestBody);
IRestResponse response = client.Execute(request);
```

```swift Switch to per-tool approvals
import Foundation

let headers = [
  "Authorization": "Bearer <token>",
  "Content-Type": "application/json"
]
let parameters = [
  "approvalMode": "fine_grained",
  "toolOverrides": [
    "execute_zapier_read_action": "auto_approved",
    "execute_zapier_write_action": "requires_approval"
  ]
] as [String : Any]

let postData = JSONSerialization.data(withJSONObject: parameters, options: [])

let request = NSMutableURLRequest(url: NSURL(string: "https://api.jelliu.co/api/mcp-servers/6b5a4c3d-2e1f-4a0b-9c8d-7e6f5a4b3c2d")! as URL,
                                        cachePolicy: .useProtocolCachePolicy,
                                    timeoutInterval: 10.0)
request.httpMethod = "PATCH"
request.allHTTPHeaderFields = headers
request.httpBody = postData as Data

let session = URLSession.shared
let dataTask = session.dataTask(with: request as URLRequest, completionHandler: { (data, response, error) -> Void in
  if (error != nil) {
    print(error as Any)
  } else {
    let httpResponse = response as? HTTPURLResponse
    print(httpResponse)
  }
})

dataTask.resume()
```

### Fix a wrong transport (re-registers)

**Request**

```json
{
  "transport": "STREAMABLE_HTTP"
}
```

**Response**

```json
{
  "data": {
    "id": "3c2b1a09-8f7e-4d6c-b5a4-938271605f4e",
    "tenant_id": "0e9d7c3b-8a1f-4c55-b7a2-3c4d5e6f7a8b",
    "agent_id": null,
    "name": "Zapier",
    "description": "Actions in the apps this business has connected through Zapier.",
    "server_url": "https://mcp.zapier.com/api/v1/connect",
    "approval_mode": "fine_grained",
    "transport": "STREAMABLE_HTTP",
    "provider": "zapier",
    "created_at": "2026-09-14T15:02:11.000Z",
    "updated_at": "2026-09-15T09:18:40.000Z",
    "deleted_at": null,
    "toolOverrides": {
      "execute_zapier_read_action": "auto_approved",
      "execute_zapier_write_action": "requires_approval"
    }
  },
  "toolOverridesSync": {
    "synced": 2,
    "removed": 0,
    "failed": 0,
    "failures": []
  }
}
```

**SDK Code**

```python Fix a wrong transport (re-registers)
import requests

url = "https://api.jelliu.co/api/mcp-servers/6b5a4c3d-2e1f-4a0b-9c8d-7e6f5a4b3c2d"

payload = { "transport": "STREAMABLE_HTTP" }
headers = {
    "Authorization": "Bearer <token>",
    "Content-Type": "application/json"
}

response = requests.patch(url, json=payload, headers=headers)

print(response.json())
```

```javascript Fix a wrong transport (re-registers)
const url = 'https://api.jelliu.co/api/mcp-servers/6b5a4c3d-2e1f-4a0b-9c8d-7e6f5a4b3c2d';
const options = {
  method: 'PATCH',
  headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
  body: '{"transport":"STREAMABLE_HTTP"}'
};

try {
  const response = await fetch(url, options);
  const data = await response.json();
  console.log(data);
} catch (error) {
  console.error(error);
}
```

```go Fix a wrong transport (re-registers)
package main

import (
	"fmt"
	"strings"
	"net/http"
	"io"
)

func main() {

	url := "https://api.jelliu.co/api/mcp-servers/6b5a4c3d-2e1f-4a0b-9c8d-7e6f5a4b3c2d"

	payload := strings.NewReader("{\n  \"transport\": \"STREAMABLE_HTTP\"\n}")

	req, _ := http.NewRequest("PATCH", url, payload)

	req.Header.Add("Authorization", "Bearer <token>")
	req.Header.Add("Content-Type", "application/json")

	res, _ := http.DefaultClient.Do(req)

	defer res.Body.Close()
	body, _ := io.ReadAll(res.Body)

	fmt.Println(res)
	fmt.Println(string(body))

}
```

```ruby Fix a wrong transport (re-registers)
require 'uri'
require 'net/http'

url = URI("https://api.jelliu.co/api/mcp-servers/6b5a4c3d-2e1f-4a0b-9c8d-7e6f5a4b3c2d")

http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true

request = Net::HTTP::Patch.new(url)
request["Authorization"] = 'Bearer <token>'
request["Content-Type"] = 'application/json'
request.body = "{\n  \"transport\": \"STREAMABLE_HTTP\"\n}"

response = http.request(request)
puts response.read_body
```

```java Fix a wrong transport (re-registers)
import com.mashape.unirest.http.HttpResponse;
import com.mashape.unirest.http.Unirest;

HttpResponse<String> response = Unirest.patch("https://api.jelliu.co/api/mcp-servers/6b5a4c3d-2e1f-4a0b-9c8d-7e6f5a4b3c2d")
  .header("Authorization", "Bearer <token>")
  .header("Content-Type", "application/json")
  .body("{\n  \"transport\": \"STREAMABLE_HTTP\"\n}")
  .asString();
```

```php Fix a wrong transport (re-registers)
<?php
require_once('vendor/autoload.php');

$client = new \GuzzleHttp\Client();

$response = $client->request('PATCH', 'https://api.jelliu.co/api/mcp-servers/6b5a4c3d-2e1f-4a0b-9c8d-7e6f5a4b3c2d', [
  'body' => '{
  "transport": "STREAMABLE_HTTP"
}',
  'headers' => [
    'Authorization' => 'Bearer <token>',
    'Content-Type' => 'application/json',
  ],
]);

echo $response->getBody();
```

```csharp Fix a wrong transport (re-registers)
using RestSharp;

var client = new RestClient("https://api.jelliu.co/api/mcp-servers/6b5a4c3d-2e1f-4a0b-9c8d-7e6f5a4b3c2d");
var request = new RestRequest(Method.PATCH);
request.AddHeader("Authorization", "Bearer <token>");
request.AddHeader("Content-Type", "application/json");
request.AddParameter("application/json", "{\n  \"transport\": \"STREAMABLE_HTTP\"\n}", ParameterType.RequestBody);
IRestResponse response = client.Execute(request);
```

```swift Fix a wrong transport (re-registers)
import Foundation

let headers = [
  "Authorization": "Bearer <token>",
  "Content-Type": "application/json"
]
let parameters = ["transport": "STREAMABLE_HTTP"] as [String : Any]

let postData = JSONSerialization.data(withJSONObject: parameters, options: [])

let request = NSMutableURLRequest(url: NSURL(string: "https://api.jelliu.co/api/mcp-servers/6b5a4c3d-2e1f-4a0b-9c8d-7e6f5a4b3c2d")! as URL,
                                        cachePolicy: .useProtocolCachePolicy,
                                    timeoutInterval: 10.0)
request.httpMethod = "PATCH"
request.allHTTPHeaderFields = headers
request.httpBody = postData as Data

let session = URLSession.shared
let dataTask = session.dataTask(with: request as URLRequest, completionHandler: { (data, response, error) -> Void in
  if (error != nil) {
    print(error as Any)
  } else {
    let httpResponse = response as? HTTPURLResponse
    print(httpResponse)
  }
})

dataTask.resume()
```