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

# Update Plugin-Instance by Id

PUT https://control-plane.example.com/api/v1/{tenant}/plugin-instances/{id}
Content-Type: application/json

Reference: https://docs.fabricgateway.ai/reference/admin-api/plugin-instances/update-plugin-instance-by-id

## Authentication

- `fg-tenant-api-key` header (required) — API Key authentication via header

## Request

### Path parameters

- `tenant` (string, required)
- `id` (string, required)

### Body (application/json)

This endpoint expects an object.

- `name` (string, optional)
- `plugin_id` (string, optional)
- `scope` (ApiV1TenantPluginInstancesIdPutRequestBodyContentApplicationJsonSchemaScope, optional)
- `config` (ApiV1TenantPluginInstancesIdPutRequestBodyContentApplicationJsonSchemaConfig, optional)
- `enabled` (boolean, optional)
- `on_error` (string, optional)

## Response

### 200

200- plugin instance updated

- `name` (string, optional)
- `plugin_id` (string, optional)
- `scope` (ApiV1TenantPluginInstancesIdPutResponsesContentApplicationJsonSchemaScope, optional)
- `when` (ApiV1TenantPluginInstancesIdPutResponsesContentApplicationJsonSchemaWhen, optional)
- `config` (ApiV1TenantPluginInstancesIdPutResponsesContentApplicationJsonSchemaConfig, optional)
- `enabled` (boolean, optional)

## Errors

### 500 Internal Server Error

Server Error

## Types

### ApiV1TenantPluginInstancesIdPutRequestBodyContentApplicationJsonSchemaScope

- `kind` (string, optional)
- `name` (string, optional)

### ApiV1TenantPluginInstancesIdPutRequestBodyContentApplicationJsonSchemaConfig

- `limit` (string, optional)

### ApiV1TenantPluginInstancesIdPutResponsesContentApplicationJsonSchemaScope

- `kind` (string, optional)
- `name` (string, optional)

### ApiV1TenantPluginInstancesIdPutResponsesContentApplicationJsonSchemaWhen

### ApiV1TenantPluginInstancesIdPutResponsesContentApplicationJsonSchemaConfig

- `rules` (list of ApiV1TenantPluginInstancesIdPutResponsesContentApplicationJsonSchemaConfigRulesItems, optional)

### ApiV1TenantPluginInstancesIdPutResponsesContentApplicationJsonSchemaConfigRulesItems

- `service` (string, optional)

## Examples

**Request**

```json
{
  "name": "example-plugin-instance",
  "plugin_id": "example-id",
  "scope": {
    "kind": "example",
    "name": "example-plugin-instance-scope"
  },
  "config": {
    "limit": "1"
  },
  "enabled": false,
  "on_error": "example"
}
```

**Response**

```json
{
  "name": "example-instance",
  "plugin_id": "access-control",
  "scope": {
    "kind": "service",
    "name": "example-service"
  },
  "when": {},
  "config": {
    "rules": [
      {
        "service": "example-service"
      }
    ]
  },
  "enabled": false
}
```

**SDK Code**

```python Plugin instances_updatePluginInstanceById_example
import requests

url = "https://control-plane.example.com/api/v1/acme/plugin-instances/example-id"

payload = {
    "name": "example-plugin-instance",
    "plugin_id": "example-id",
    "scope": {
        "kind": "example",
        "name": "example-plugin-instance-scope"
    },
    "config": { "limit": "1" },
    "enabled": False,
    "on_error": "example"
}
headers = {
    "fg-tenant-api-key": "<apiKey>",
    "Content-Type": "application/json"
}

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

print(response.json())
```

```javascript Plugin instances_updatePluginInstanceById_example
const url = 'https://control-plane.example.com/api/v1/acme/plugin-instances/example-id';
const options = {
  method: 'PUT',
  headers: {'fg-tenant-api-key': '<apiKey>', 'Content-Type': 'application/json'},
  body: '{"name":"example-plugin-instance","plugin_id":"example-id","scope":{"kind":"example","name":"example-plugin-instance-scope"},"config":{"limit":"1"},"enabled":false,"on_error":"example"}'
};

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

```go Plugin instances_updatePluginInstanceById_example
package main

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

func main() {

	url := "https://control-plane.example.com/api/v1/acme/plugin-instances/example-id"

	payload := strings.NewReader("{\n  \"name\": \"example-plugin-instance\",\n  \"plugin_id\": \"example-id\",\n  \"scope\": {\n    \"kind\": \"example\",\n    \"name\": \"example-plugin-instance-scope\"\n  },\n  \"config\": {\n    \"limit\": \"1\"\n  },\n  \"enabled\": false,\n  \"on_error\": \"example\"\n}")

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

	req.Header.Add("fg-tenant-api-key", "<apiKey>")
	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 Plugin instances_updatePluginInstanceById_example
require 'uri'
require 'net/http'

url = URI("https://control-plane.example.com/api/v1/acme/plugin-instances/example-id")

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

request = Net::HTTP::Put.new(url)
request["fg-tenant-api-key"] = '<apiKey>'
request["Content-Type"] = 'application/json'
request.body = "{\n  \"name\": \"example-plugin-instance\",\n  \"plugin_id\": \"example-id\",\n  \"scope\": {\n    \"kind\": \"example\",\n    \"name\": \"example-plugin-instance-scope\"\n  },\n  \"config\": {\n    \"limit\": \"1\"\n  },\n  \"enabled\": false,\n  \"on_error\": \"example\"\n}"

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

```java Plugin instances_updatePluginInstanceById_example
import com.mashape.unirest.http.HttpResponse;
import com.mashape.unirest.http.Unirest;

HttpResponse<String> response = Unirest.put("https://control-plane.example.com/api/v1/acme/plugin-instances/example-id")
  .header("fg-tenant-api-key", "<apiKey>")
  .header("Content-Type", "application/json")
  .body("{\n  \"name\": \"example-plugin-instance\",\n  \"plugin_id\": \"example-id\",\n  \"scope\": {\n    \"kind\": \"example\",\n    \"name\": \"example-plugin-instance-scope\"\n  },\n  \"config\": {\n    \"limit\": \"1\"\n  },\n  \"enabled\": false,\n  \"on_error\": \"example\"\n}")
  .asString();
```

```php Plugin instances_updatePluginInstanceById_example
<?php
require_once('vendor/autoload.php');

$client = new \GuzzleHttp\Client();

$response = $client->request('PUT', 'https://control-plane.example.com/api/v1/acme/plugin-instances/example-id', [
  'body' => '{
  "name": "example-plugin-instance",
  "plugin_id": "example-id",
  "scope": {
    "kind": "example",
    "name": "example-plugin-instance-scope"
  },
  "config": {
    "limit": "1"
  },
  "enabled": false,
  "on_error": "example"
}',
  'headers' => [
    'Content-Type' => 'application/json',
    'fg-tenant-api-key' => '<apiKey>',
  ],
]);

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

```csharp Plugin instances_updatePluginInstanceById_example
using RestSharp;

var client = new RestClient("https://control-plane.example.com/api/v1/acme/plugin-instances/example-id");
var request = new RestRequest(Method.PUT);
request.AddHeader("fg-tenant-api-key", "<apiKey>");
request.AddHeader("Content-Type", "application/json");
request.AddParameter("application/json", "{\n  \"name\": \"example-plugin-instance\",\n  \"plugin_id\": \"example-id\",\n  \"scope\": {\n    \"kind\": \"example\",\n    \"name\": \"example-plugin-instance-scope\"\n  },\n  \"config\": {\n    \"limit\": \"1\"\n  },\n  \"enabled\": false,\n  \"on_error\": \"example\"\n}", ParameterType.RequestBody);
IRestResponse response = client.Execute(request);
```

```swift Plugin instances_updatePluginInstanceById_example
import Foundation

let headers = [
  "fg-tenant-api-key": "<apiKey>",
  "Content-Type": "application/json"
]
let parameters = [
  "name": "example-plugin-instance",
  "plugin_id": "example-id",
  "scope": [
    "kind": "example",
    "name": "example-plugin-instance-scope"
  ],
  "config": ["limit": "1"],
  "enabled": false,
  "on_error": "example"
] as [String : Any]

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

let request = NSMutableURLRequest(url: NSURL(string: "https://control-plane.example.com/api/v1/acme/plugin-instances/example-id")! as URL,
                                        cachePolicy: .useProtocolCachePolicy,
                                    timeoutInterval: 10.0)
request.httpMethod = "PUT"
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()
```