# Proxy Settings

**Page:** api/proxy-settings

[Download Raw Markdown](./api/proxy-settings.md)

---

{/* AUTO-GENERATED — Do not edit manually. Regenerate with: npm run docs:api:generate */}



## Proxy Settings

Container-wide proxy root settings control the proxy kill-switch (`enable_proxy`) and the default allow/deny policy applied to requests that have no explicit rule. These endpoints read and update the root record for a given container and use an `ETag` / `If-Match` header pair to support optimistic-concurrency updates.

---

### `GET /api/v1/containers/{id}/proxy/settings`

Returns the container's current proxy root settings along with the current `etag` and `file_version`. Pass the returned `etag` back as the `If-Match` header on subsequent `PATCH` calls to avoid overwriting concurrent changes.

#### Parameters

| Name | In | Type | Required | Description |
|------|-----|------|----------|-------------|
| `id` | path | string | Yes | Container ID |



```bash
curl -X GET https://api.hoody.com/api/v1/containers/container_abc123/proxy/settings \
  -H "Authorization: Bearer YOUR_API_TOKEN"
```


```javascript
const settings = await client.api.proxyDiscovery.getContainerProxySettings({
  id: "container_abc123"
});
```


```json
{
  "statusCode": 200,
  "message": "Proxy settings retrieved successfully",
  "data": {
    "enable_proxy": true,
    "default": "allow",
    "file_version": 2,
    "etag": "file:v2"
  }
}
```



---

### `PATCH /api/v1/containers/{id}/proxy/settings`

Updates one or both of `enable_proxy` and `default`. The request must include the `If-Match` header with the `etag` value returned by the most recent `GET` (formatted as `file:v`). At least one body field must be provided.


The `If-Match` header is required for safe concurrent updates. Requests that omit it, or supply a stale `etag`, will be rejected.


#### Parameters

| Name | In | Type | Required | Description |
|------|-----|------|----------|-------------|
| `id` | path | string | Yes | Container ID |
| `if-match` | header | string | No | Optimistic-concurrency precondition; pass the value `file:v` where N is the current file version |

#### Request Body

| Field | Type | Required | Description |
|-------|------|----------|-------------|
| `enable_proxy` | boolean | No | Global kill-switch for the container's proxy |
| `default` | string | No | Default policy when no explicit rule matches. Allowed values: `"allow"`, `"deny"` |



```bash
curl -X PATCH https://api.hoody.com/api/v1/containers/container_abc123/proxy/settings \
  -H "Authorization: Bearer YOUR_API_TOKEN" \
  -H "Content-Type: application/json" \
  -H "If-Match: file:v2" \
  -d '{
    "enable_proxy": true,
    "default": "deny"
  }'
```


```javascript
const updated = await client.api.proxyDiscovery.updateContainerProxySettings({
  id: "container_abc123",
  "if-match": "file:v2",
  data: {
    enable_proxy: true,
    default: "deny"
  }
});
```


```json
{
  "statusCode": 200,
  "message": "Proxy settings updated successfully",
  "data": {
    "enable_proxy": true,
    "default": "deny",
    "file_version": 3,
    "etag": "file:v3"
  }
}
```