# Update an existing record

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

- `contact` (optional)
  Type: object

- `appliedDate` (optional)
  Type: string, date-time

- `hiredDate` (optional)
  Type: string, date-time

- `candidateLevel` (optional)
  Type: string
  
  maxLength: 500

- `cvUrl` (optional)
  Type: string

Responses:

- 200: The record has been successfully edited.

- 400: Invalid input, The response body may contain clues as to what went wrong

- 401: Unauthorized

- 403: Forbidden

- 404: Record not found

## Examples

### cURL

```bash
curl -X PUT 'http://localhost:3000/api/candidate/string' \
  -H 'Authorization: Bearer YOUR_TOKEN' \
  -H 'Content-Type: application/json' \
  --data-raw '{
  "contact": {},
  "appliedDate": "2024-01-15T09:30:00Z",
  "hiredDate": "2024-01-15T09:30:00Z",
  "candidateLevel": "string",
  "cvUrl": "string"
}'
```

### JavaScript

```javascript
const body = `{
  "contact": {},
  "appliedDate": "2024-01-15T09:30:00Z",
  "hiredDate": "2024-01-15T09:30:00Z",
  "candidateLevel": "string",
  "cvUrl": "string"
}`;

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

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

### Python

```python
import requests

body = '''{
  "contact": {},
  "appliedDate": "2024-01-15T09:30:00Z",
  "hiredDate": "2024-01-15T09:30:00Z",
  "candidateLevel": "string",
  "cvUrl": "string"
}'''

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