> For clean Markdown of any page, append .md to the page URL.
> For a complete documentation index, see https://docs.a1.uk.astutepayroll.in/llms.txt.
> For AI client integration (Claude Code, Cursor, etc.), connect to the MCP server at https://docs.a1.uk.astutepayroll.in/_mcp/server.

# Update Engagement

PATCH {{baseUrl}}/employees/{employeeUuid}/engagements/{engagementUuid}
Content-Type: application/json

Update an engagement record.

Reference: https://docs.a1.uk.astutepayroll.in/api-reference/employee/update-engagement

## Authentication

- `Authorization` header (bearer token, required) — Bearer authentication of the form `Bearer <token>`, where token is your auth token.

## Request

### Path parameters

- `employeeUuid` (string, required) — User id of the employee (not a UUID)
- `engagementUuid` (string, required) — UUID of the engagement to update

### Headers

- `vnd.a1.tenant-id` (string, optional) — Tenant identifier for multi-tenant environments

### Body (application/json)

This endpoint expects an object.

- `payType` (enum, optional) — Pay type for the engagement. Changing it to SUBCONTRACTOR clears `engagementType`.
  - Allowed values: `PAYE`, `SUBCONTRACTOR`
- `engagementType` (enum, optional) — Type of engagement (not applicable for SUBCONTRACTOR)
  - Allowed values: `FULL_TIME`, `CASUAL`, `PART_TIME`, `LABOUR_HIRE`
- `startDate` (date, optional) — Engagement start date — must not be later than any job's start date
- `payrollCompanyId` (string, optional) — UUID of the payroll company. Must be an existing company.
- `payCycleId` (string, optional) — UUID of the pay cycle. It is not checked, so send an existing pay cycle.
- `permissionGroup` (string, optional) — Permission group

## Response

### 200

Engagement updated successfully

- `id` (string, optional) — UUID of the engagement
- `userUuid` (string, optional)
- `eventJobId` (string, optional)

## Errors

### 400 Bad Request Error

Bad Request — e.g. startDate is later than a job's start date

- `any`

### 404 Not Found Error

Engagement not found

- `any`

## Examples

**Request**

```json
{
  "payType": "PAYE",
  "engagementType": "FULL_TIME",
  "startDate": "2024-01-15"
}
```

**Response**

```json
{
  "id": "8a4f3e2d-1b2c-3d4e-5f6a-7b8c9d0e1f2a",
  "userUuid": "rcjJX5K6v5XzoyNVWqHXS6",
  "eventJobId": "112"
}
```

**SDK Code**

```python
import requests

url = "https://{{baseurl}}/employees/axgZDy2kxi6mbvC9sNDL5dMs/engagements/8a4f3e2d-1b2c-3d4e-5f6a-7b8c9d0e1f2a"

payload = {
    "payType": "PAYE",
    "engagementType": "FULL_TIME",
    "startDate": "2024-01-15"
}
headers = {
    "Authorization": "Bearer <token>",
    "Content-Type": "application/json"
}

response = requests.patch(url, json=payload, headers=headers)

print(response.json())
```

```javascript
const url = 'https://{{baseurl}}/employees/axgZDy2kxi6mbvC9sNDL5dMs/engagements/8a4f3e2d-1b2c-3d4e-5f6a-7b8c9d0e1f2a';
const options = {
  method: 'PATCH',
  headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
  body: '{"payType":"PAYE","engagementType":"FULL_TIME","startDate":"2024-01-15"}'
};

try {
  const response = await fetch(url, options);
  const data = await response.json();
  console.log(data);
} catch (error) {
  console.error(error);
}
```

```go
package main

import (
	"fmt"
	"strings"
	"net/http"
	"io"
)

func main() {

	url := "https://{{baseurl}}/employees/axgZDy2kxi6mbvC9sNDL5dMs/engagements/8a4f3e2d-1b2c-3d4e-5f6a-7b8c9d0e1f2a"

	payload := strings.NewReader("{\n  \"payType\": \"PAYE\",\n  \"engagementType\": \"FULL_TIME\",\n  \"startDate\": \"2024-01-15\"\n}")

	req, _ := http.NewRequest("PATCH", url, payload)

	req.Header.Add("Authorization", "Bearer <token>")
	req.Header.Add("Content-Type", "application/json")

	res, _ := http.DefaultClient.Do(req)

	defer res.Body.Close()
	body, _ := io.ReadAll(res.Body)

	fmt.Println(res)
	fmt.Println(string(body))

}
```

```ruby
require 'uri'
require 'net/http'

url = URI("https://{{baseurl}}/employees/axgZDy2kxi6mbvC9sNDL5dMs/engagements/8a4f3e2d-1b2c-3d4e-5f6a-7b8c9d0e1f2a")

http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true

request = Net::HTTP::Patch.new(url)
request["Authorization"] = 'Bearer <token>'
request["Content-Type"] = 'application/json'
request.body = "{\n  \"payType\": \"PAYE\",\n  \"engagementType\": \"FULL_TIME\",\n  \"startDate\": \"2024-01-15\"\n}"

response = http.request(request)
puts response.read_body
```

```java
import com.mashape.unirest.http.HttpResponse;
import com.mashape.unirest.http.Unirest;

HttpResponse<String> response = Unirest.patch("https://{{baseurl}}/employees/axgZDy2kxi6mbvC9sNDL5dMs/engagements/8a4f3e2d-1b2c-3d4e-5f6a-7b8c9d0e1f2a")
  .header("Authorization", "Bearer <token>")
  .header("Content-Type", "application/json")
  .body("{\n  \"payType\": \"PAYE\",\n  \"engagementType\": \"FULL_TIME\",\n  \"startDate\": \"2024-01-15\"\n}")
  .asString();
```

```php
<?php
require_once('vendor/autoload.php');

$client = new \GuzzleHttp\Client();

$response = $client->request('PATCH', 'https://{{baseurl}}/employees/axgZDy2kxi6mbvC9sNDL5dMs/engagements/8a4f3e2d-1b2c-3d4e-5f6a-7b8c9d0e1f2a', [
  'body' => '{
  "payType": "PAYE",
  "engagementType": "FULL_TIME",
  "startDate": "2024-01-15"
}',
  'headers' => [
    'Authorization' => 'Bearer <token>',
    'Content-Type' => 'application/json',
  ],
]);

echo $response->getBody();
```

```csharp
using RestSharp;

var client = new RestClient("https://{{baseurl}}/employees/axgZDy2kxi6mbvC9sNDL5dMs/engagements/8a4f3e2d-1b2c-3d4e-5f6a-7b8c9d0e1f2a");
var request = new RestRequest(Method.PATCH);
request.AddHeader("Authorization", "Bearer <token>");
request.AddHeader("Content-Type", "application/json");
request.AddParameter("application/json", "{\n  \"payType\": \"PAYE\",\n  \"engagementType\": \"FULL_TIME\",\n  \"startDate\": \"2024-01-15\"\n}", ParameterType.RequestBody);
IRestResponse response = client.Execute(request);
```

```swift
import Foundation

let headers = [
  "Authorization": "Bearer <token>",
  "Content-Type": "application/json"
]
let parameters = [
  "payType": "PAYE",
  "engagementType": "FULL_TIME",
  "startDate": "2024-01-15"
] as [String : Any]

let postData = JSONSerialization.data(withJSONObject: parameters, options: [])

let request = NSMutableURLRequest(url: NSURL(string: "https://{{baseurl}}/employees/axgZDy2kxi6mbvC9sNDL5dMs/engagements/8a4f3e2d-1b2c-3d4e-5f6a-7b8c9d0e1f2a")! as URL,
                                        cachePolicy: .useProtocolCachePolicy,
                                    timeoutInterval: 10.0)
request.httpMethod = "PATCH"
request.allHTTPHeaderFields = headers
request.httpBody = postData as Data

let session = URLSession.shared
let dataTask = session.dataTask(with: request as URLRequest, completionHandler: { (data, response, error) -> Void in
  if (error != nil) {
    print(error as Any)
  } else {
    let httpResponse = response as? HTTPURLResponse
    print(httpResponse)
  }
})

dataTask.resume()
```