# Update plugin category

`PUT /api/plugin-categories/{id}`

Authentication: no security requirement declared for this operation.

Parameters:

- `id` (path, string, required)
  Type: string

Request body: application/json (required)

Type: object

Schema: [UpdatePluginCategoryDTO](https://sourcey-gauzy.pages.dev/api-reference/models/updateplugincategorydto/index.md)

- `name` (optional)
  Type: string
  
  Category name
  
  minLength: 2
  
  maxLength: 100
  
  Example:
  
  ```json
  "Authentication"
  ```

- `description` (optional)
  Type: string
  
  Category description
  
  maxLength: 500
  
  Example:
  
  ```json
  "Plugins for authentication and authorization"
  ```

- `slug` (optional)
  Type: string
  
  Category slug for URL-friendly identification
  
  pattern: "^[a-z0-9]+(?:-[a-z0-9]+)*$"
  
  Example:
  
  ```json
  "authentication"
  ```

- `color` (optional)
  Type: string
  
  Category color for UI representation
  
  pattern: "^#[0-9a-fA-F]{6}$"
  
  Example:
  
  ```json
  "#007bff"
  ```

- `icon` (optional)
  Type: string
  
  Category icon identifier
  
  maxLength: 50
  
  Example:
  
  ```json
  "fas fa-shield-alt"
  ```

- `order` (optional)
  Type: number
  
  Display order for sorting
  
  minimum: 0
  
  maximum: 9999
  
  Example:
  
  ```json
  1
  ```

- `isActive` (optional)
  Type: boolean
  
  Whether the category is active
  
  Example:
  
  ```json
  true
  ```

- `parentId` (optional)
  Type: string
  
  Parent category ID for hierarchical structure
  
  Example:
  
  ```json
  "uuid-string"
  ```

Responses:

- 200: Plugin category updated successfully

## Examples

### cURL

```bash
curl -X PUT 'http://localhost:3000/api/plugin-categories/string' \
  -H 'Content-Type: application/json' \
  --data-raw '{
  "name": "Authentication",
  "description": "Plugins for authentication and authorization",
  "slug": "authentication",
  "color": "#007bff",
  "icon": "fas fa-shield-alt",
  "order": 1,
  "isActive": true,
  "parentId": "uuid-string"
}'
```

### JavaScript

```javascript
const body = `{
  "name": "Authentication",
  "description": "Plugins for authentication and authorization",
  "slug": "authentication",
  "color": "#007bff",
  "icon": "fas fa-shield-alt",
  "order": 1,
  "isActive": true,
  "parentId": "uuid-string"
}`;

const response = await fetch('http://localhost:3000/api/plugin-categories/string', {
  method: 'PUT',
  headers: {
    'Content-Type': 'application/json',
  },
  body,
});

const data = await response.text();
```

### Python

```python
import requests

body = '''{
  "name": "Authentication",
  "description": "Plugins for authentication and authorization",
  "slug": "authentication",
  "color": "#007bff",
  "icon": "fas fa-shield-alt",
  "order": 1,
  "isActive": true,
  "parentId": "uuid-string"
}'''

response = requests.put(
    'http://localhost:3000/api/plugin-categories/string',
    data=body.encode('utf-8'),
    headers={
        'Content-Type': 'application/json',
    },
)
print(response.text)
```
