# Update an existing employee by ID

`PUT /api/employee/{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: [UpdateEmployeeDTO](https://sourcey-gauzy.pages.dev/api-reference/models/updateemployeedto/index.md)

- `acknowledgeAgentExitLogoutRestriction` (optional)
  Type: boolean

Responses:

- 202: The employee record has been successfully updated.

- 400: Invalid input. Check the request body for errors.

- 401: Unauthorized

- 403: Forbidden

- 404: Record not found

## Examples

### cURL

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

### JavaScript

```javascript
const body = `{
  "acknowledgeAgentExitLogoutRestriction": true
}`;

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

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

### Python

```python
import requests

body = '''{
  "acknowledgeAgentExitLogoutRestriction": true
}'''

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