# Update an existing keyresult

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

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

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

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

- `targetValue` (required)
  Type: number
  
  readOnly: true

- `initialValue` (required)
  Type: number
  
  readOnly: true

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

- `update` (required)
  Type: number
  
  readOnly: true

- `progress` (required)
  Type: number
  
  readOnly: true

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

- `hardDeadline` (required)
  Type: string, date-time
  
  readOnly: true

- `softDeadline` (required)
  Type: string, date-time
  
  readOnly: true

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

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

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

- `owner` (required)
  Type: object
  
  readOnly: true

- `lead` (required)
  Type: object
  
  readOnly: true

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

- `project` (required)
  Type: object
  
  readOnly: true

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

- `task` (required)
  Type: object
  
  readOnly: true

- `kpi` (required)
  Type: object
  
  readOnly: true

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

- `goal` (required)
  Type: object
  
  readOnly: true

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

- `updates` (required)
  Type: array
  
  readOnly: true
  
  Items:
    Type: object

Responses:

- 201: The keyresult has been successfully edited.

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

- 401: Unauthorized

- 403: Forbidden

- 404: Key Result not found

## Examples

### cURL

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

### JavaScript

```javascript
const response = await fetch('http://localhost:3000/api/key-results/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/key-results/string',
    data='{}'.encode('utf-8'),
    headers={
        'Authorization': 'Bearer YOUR_TOKEN',
        'Content-Type': 'application/json',
    },
)
print(response.text)
```
