# Update an expense category by ID

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

Authentication (security requirement alternatives):

```json
[
  {
    "bearer": []
  }
]
```

- bearer: http (bearer), header JWT. Enter JWT token

Parameters:

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

Request body: application/json (required)

Type: object

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

- `id` (required)
  Type: string
  
  readOnly: true

Responses:

- 200: Expense category successfully updated

- 401: Unauthorized

- 403: Forbidden

- 404: Expense category not found

## Examples

### cURL

```bash
curl -X PUT 'http://localhost:3000/api/expense-categories/string' \
  -H 'Authorization: Bearer YOUR_TOKEN' \
  -H 'Content-Type: application/json' \
  --data-raw '{}'
```

### JavaScript

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

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

### Python

```python
import requests

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