# Update a Code

`PUT /lokta-lms/api/v1/codes/{codeId}`

Updates the details of a code if it is not system defined.

## Parameters
- `codeId` (path, integer, required): codeId

## Request body (application/json)
- `name` (string)

## Responses
- `200`: OK

## Response fields
- `changes` (PutCodesApichangesSwagger)
- `resourceId` (integer)

## Example request (cURL)
```bash
curl -X PUT \
  'http://localhost:8080/lokta-lms/api/v1/codes/{codeId}' \
  -u '{username}:{password}' \
  -H 'Tenant-Identifier: default' \
  -H 'Content-Type: application/json' \
  -d '{
  "name": "MyNewCode(changed)"
}'
```

## Example response
```json
{
  "changes": {
    "name": "MyNewCode(changed)"
  },
  "resourceId": 4
}
```

Interactive: https://developer.lokta.ai/reference.html#operation/updateCode
