> ## Documentation Index
> Fetch the complete documentation index at: https://docs.apinizer.com/llms.txt
> Use this file to discover all available pages before exploring further.

# Update API Proxy Group

> Updates an existing API Proxy Group. The name cannot be changed (it is used as the identifier). All other fields can be updated. Optionally, the group can be deployed to a specified environment after the update.

## Endpoint

```plaintext theme={null}
PUT /apiops/projects/{projectName}/apiProxyGroups/
```

## Authentication

Requires a Personal API Access Token.

### Header

```plaintext theme={null}
Authorization: Bearer YOUR_TOKEN
```

## Request

### Headers

| Header        | Value            | Required |
| ------------- | ---------------- | -------- |
| Authorization | Bearer {token}   | Yes      |
| Content-Type  | application/json | Yes      |

### Path Parameters

| Parameter   | Type   | Required | Description  |
| ----------- | ------ | -------- | ------------ |
| projectName | string | Yes      | Project name |

### Request Body

Same structure as Create API Proxy Group, with an additional optional `environmentName` field. See [Create API Proxy Group](/api-reference/api-proxy-groups/crud/create-api-proxy-group) for field descriptions.

#### Full JSON Body Example

```json theme={null}
{
  "name": "PaymentAPIGroup",
  "description": "Updated Payment API Group",
  "clientRoute": {
    "relativePathList": [
      "/api/v2/payment"
    ],
    "methodList": ["GET", "POST", "PUT", "DELETE"],
    "bufferRequest": true,
    "bufferResponse": true
  }
}
```

#### Full JSON Body Example - With Deployment

```json theme={null}
{
  "name": "PaymentAPIGroup",
  "description": "Updated Payment API Group",
  "environmentName": "production",
  "clientRoute": {
    "relativePathList": [
      "/api/v2/payment"
    ],
    "methodList": ["GET", "POST", "PUT", "DELETE"],
    "bufferRequest": true,
    "bufferResponse": true
  }
}
```

#### Request Body Fields

| Field           | Type   | Required | Default | Description                                                                                                                                           |
| --------------- | ------ | -------- | ------- | ----------------------------------------------------------------------------------------------------------------------------------------------------- |
| name            | string | Yes      | -       | Existing API Proxy Group name (cannot be changed)                                                                                                     |
| description     | string | No       | -       | API Proxy Group description                                                                                                                           |
| clientRoute     | object | Yes      | -       | Client route configuration. See [Create API Proxy Group](/api-reference/api-proxy-groups/crud/create-api-proxy-group#client-route-object-clientroute) |
| environmentName | string | No       | -       | Environment name to deploy after update. If provided, the API Proxy Group is automatically deployed to the specified environment                      |

### Important Notes

* `name` must match the existing API Proxy Group name (cannot be changed)
* `clientRoute` can be updated
* Existing environment deployments are preserved (updating does not remove existing deployments)
* If `environmentName` is provided, the group is deployed to that environment after the update

## Response

### Success Response (200 OK)

Without `environmentName`:

```json theme={null}
{
  "success": true
}
```

With `environmentName` (includes deployment result):

```json theme={null}
{
  "success": true,
  "deploymentResult": {
    "success": true,
    "responseTime": 150,
    "detailList": [
      {
        "envName": "production",
        "podName": "worker-abc123",
        "podIp": "10.0.0.1",
        "success": true,
        "responseTime": 150
      }
    ]
  }
}
```

### Error Response (400 Bad Request)

```json theme={null}
{
  "error": "bad_request",
  "error_description": "API Proxy Group (PaymentAPIGroup) is not found or user does not have privilege to access it!"
}
```

or

```json theme={null}
{
  "error": "bad_request",
  "error_description": "Environment (staging) is not found!"
}
```

## cURL Example

### Example 1: Update API Proxy Group

```bash theme={null}
curl -X PUT \
  "https://demo.apinizer.com/apiops/projects/MyProject/apiProxyGroups/" \
  -H "Authorization: Bearer YOUR_TOKEN" \
  -H "Content-Type: application/json" \
  -d '{
    "name": "PaymentAPIGroup",
    "description": "Updated Payment API Group",
    "clientRoute": {
      "relativePathList": [
        "/api/v2/payment"
      ],
      "methodList": ["GET", "POST", "PUT", "DELETE"],
      "bufferRequest": true,
      "bufferResponse": true
    }
  }'
```

### Example 2: Update and Deploy

```bash theme={null}
curl -X PUT \
  "https://demo.apinizer.com/apiops/projects/MyProject/apiProxyGroups/" \
  -H "Authorization: Bearer YOUR_TOKEN" \
  -H "Content-Type: application/json" \
  -d '{
    "name": "PaymentAPIGroup",
    "description": "Updated Payment API Group",
    "environmentName": "production",
    "clientRoute": {
      "relativePathList": [
        "/api/v2/payment"
      ],
      "methodList": ["GET", "POST", "PUT", "DELETE"],
      "bufferRequest": true,
      "bufferResponse": true
    }
  }'
```

## Permissions

* User must have **`API_MANAGEMENT` + `MANAGE`** permission in the project
* If `environmentName` is provided, user must also have **`API_MANAGEMENT` + `DEPLOY_UNDEPLOY`** permission

## Notes and Warnings

* **Name Cannot Change**:
  * Name is used as identifier and cannot be changed
  * Use the existing name in the request

* **All Fields Required**:
  * All fields must be provided (same as create)

* **Group Must Exist**:
  * API Proxy Group with specified name must exist

* **Environment Deployments Preserved**:
  * Updating the group does not remove existing environment deployments
  * Use the separate undeploy endpoint to remove deployments

* **Automatic Deployment**:
  * If `environmentName` is provided, deployment is triggered after update
  * Environment must exist and user must have deployment permissions

## Related Documentation

* [Create API Proxy Group](/api-reference/api-proxy-groups/crud/create-api-proxy-group) - Create a new API Proxy Group
* [Delete API Proxy Group](/api-reference/api-proxy-groups/crud/delete-api-proxy-group) - Delete an API Proxy Group
* [Deploy API Proxy Group](/api-reference/api-proxy-groups/deployment/deploy-api-proxy-group) - Deploy to an environment
