# Update a Client

`PUT /lokta-lms/api/v1/clients/{clientId}`

Note: You can update any of the basic attributes of a client (but not its associations) using this API.

Changing the relationship between a client and its office is not supported through this API. An API specific to handling transfers of clients between offices is available for the same.

The relationship between a client and a group must be removed through the Groups API.

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

## Request body (application/json)
- `externalId` (string)
- `firstname` (string)
- `lastname` (string)
- `resourceExternalId` (string)

## Responses
- `200`: OK

## Response fields
- `changes` (PutClientsClientIdRequest): PutClientsClientIdRequest
- `clientId` (integer)
- `officeId` (integer)
- `resourceExternalId` (string)
- `resourceId` (integer)

## Example request (cURL)
```bash
curl -X PUT \
  'http://localhost:8080/lokta-lms/api/v1/clients/{clientId}' \
  -u '{username}:{password}' \
  -H 'Tenant-Identifier: default' \
  -H 'Content-Type: application/json' \
  -d '{
  "externalId": "786444UUUYYH7",
  "firstname": "Client_FirstName",
  "lastname": "Client_LastName",
  "resourceExternalId": "123-456"
}'
```

## Example response
```json
{
  "changes": {
    "externalId": "786444UUUYYH7",
    "firstname": "Client_FirstName",
    "lastname": "Client_LastName",
    "resourceExternalId": "123-456"
  },
  "clientId": 1,
  "officeId": 1,
  "resourceExternalId": "123-456"
}
```

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