> For clean Markdown of any page, append .md to the page URL.
> For a complete documentation index, see https://docs-unsw-v6.advance-uac.com/llms.txt.
> For AI client integration (Claude Code, Cursor, etc.), connect to the MCP server at https://docs-unsw-v6.advance-uac.com/_mcp/server.

# Correct an applicant

PATCH https://unsw-v6-dev.advance-uac.com/institution-api/institution/applicants/{id}
Content-Type: application/json

Corrects an applicant, following JSON Merge Patch (RFC 7386): a field you omit is left alone, a
field you send as null is cleared, and an unknown field name is a 400.

`givenName1`, `familyName`, `dob` and `emailAddress` are what a person is created with, so they
can be changed but not cleared. `givenName2`, `phoneNumber`, `postalAddress`, `sourceName` and
`sourceRef` can be cleared, except that clearing `sourceName` while a `sourceRef` remains is
refused — an id with no system to interpret it is not findable.

Moving a `sourceRef` onto a pair another of your applicants already holds is a 409, naming the
applicant that holds it.

Identity really is mutable — a legal name change, a corrected typo, a new email address. That
is the argument for recording your own `sourceRef`: it goes on finding the person after any of
those.

Reference: https://docs-unsw-v6.advance-uac.com/unsw-advance-institution-api/applicants/correct-an-applicant

## Authentication

- `Authorization` header (bearer token, required) — Paste a Keycloak access token (no "Bearer " prefix)

## Servers

- `https://unsw-v6-dev.advance-uac.com/institution-api` (Dev, default)
- `https://unsw-v6-test.advance-uac.com/institution-api` (Test)

## Request

### Path parameters

- `id` (string, required)

### Body (application/json)

This endpoint expects an ApplicantPatch.

- `givenName1` (string, optional)
- `givenName2` (string, optional)
- `familyName` (string, optional)
- `dob` (string, optional) — Date of birth, ISO format YYYY-MM-DD.
- `emailAddress` (string, optional)
- `phoneNumber` (string, optional)
- `postalAddress` (string, optional)
- `sourceName` (string, optional) — The system this record was fed from, in your own vocabulary. Free text, and required whenever you send a sourceRef.
- `sourceRef` (string, optional) — Your own unique id for this person, e.g. a student number. Unique per `sourceName`.
- `sources` (list of SourceReference, optional) — Replaces ALL of your references for this record. Omit the field to leave them alone; send an empty array to remove them. `sourceName` and `sourceRef` still edit the FIRST reference on its own and leave any others untouched, so an existing integration is unaffected. If you send both forms, `sources` wins.

## Response

### 200

The supplied fields were applied; everything else is unchanged.

- `id` (string, optional)
- `givenName1` (string, optional)
- `givenName2` (string, optional)
- `givenNames` (string, optional)
- `familyName` (string, optional)
- `dob` (date, optional)
- `emailAddress` (string, optional)
- `phoneNumber` (string, optional)
- `postalAddress` (string, optional)
- `sourceName` (string, optional) — The system this record was fed from, in your own vocabulary. Free text, and required whenever you send a sourceRef.
- `sourceRef` (string, optional) — Your own unique id for this person, e.g. a student number. Unique per `sourceName`.
- `sources` (list of SourceReference, optional) — Your own references for this record, one per system you keep it in. A person or an application known by a different id in SITS than elsewhere carries both. Optional. `sourceName` and `sourceRef` still work exactly as before and count as the FIRST entry here, so nothing you have already built needs to change. Send both forms and they are combined, with duplicates collapsed. Order matters: the first entry is the one echoed back as `sourceRef`, and the one shown in lists and in the change feed.

## Errors

### 400 Bad Request Error

An unknown field name, a value of the wrong type, or an attempt to clear a field the applicant cannot do without.

- `status` (integer, optional) — Repeats the HTTP status code.
- `error` (string, optional) — What went wrong, in a form safe to show a developer.

### 404 Not Found Error

No such resource for this institution.

- `status` (integer, optional) — Repeats the HTTP status code.
- `error` (string, optional) — What went wrong, in a form safe to show a developer.

### 409 Conflict Error

That sourceRef is already recorded against another of your applicants.

- `status` (integer, optional) — Repeats the HTTP status code.
- `error` (string, optional) — What went wrong, in a form safe to show a developer.

## Types

### SourceReference

One of your own references for this person: the system it came from, and its id there.

- `sourceName` (string, optional) — The system this record was fed from, in your own vocabulary. Free text, and required whenever you send a sourceRef.
- `sourceRef` (string, optional) — Your own unique id for this person, e.g. a student number. Unique per `sourceName`.

## Examples

**Request**

```json
{
  "familyName": "Nguyen-Barrett",
  "emailAddress": "t.nguyen@student.example.edu.au"
}
```

**Response**

```json
{
  "id": "string",
  "givenName1": "string",
  "givenName2": "string",
  "givenNames": "string",
  "familyName": "string",
  "dob": "2022-03-10",
  "emailAddress": "string",
  "phoneNumber": "string",
  "postalAddress": "string",
  "sourceName": "SITS",
  "sourceRef": "z1234567",
  "sources": [
    {
      "sourceName": "SITS",
      "sourceRef": "z1234567"
    }
  ]
}
```

**SDK Code**

```python A name change, and drop the phone number
import requests

url = "https://unsw-v6-dev.advance-uac.com/institution-api/institution/applicants/id"

payload = {
    "familyName": "Nguyen-Barrett",
    "emailAddress": "t.nguyen@student.example.edu.au"
}
headers = {
    "Authorization": "Bearer <token>",
    "Content-Type": "application/json"
}

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

print(response.json())
```

```javascript A name change, and drop the phone number
const url = 'https://unsw-v6-dev.advance-uac.com/institution-api/institution/applicants/id';
const options = {
  method: 'PATCH',
  headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
  body: '{"familyName":"Nguyen-Barrett","emailAddress":"t.nguyen@student.example.edu.au"}'
};

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

```go A name change, and drop the phone number
package main

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

func main() {

	url := "https://unsw-v6-dev.advance-uac.com/institution-api/institution/applicants/id"

	payload := strings.NewReader("{\n  \"familyName\": \"Nguyen-Barrett\",\n  \"emailAddress\": \"t.nguyen@student.example.edu.au\"\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 A name change, and drop the phone number
require 'uri'
require 'net/http'

url = URI("https://unsw-v6-dev.advance-uac.com/institution-api/institution/applicants/id")

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  \"familyName\": \"Nguyen-Barrett\",\n  \"emailAddress\": \"t.nguyen@student.example.edu.au\"\n}"

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

```java A name change, and drop the phone number
import com.mashape.unirest.http.HttpResponse;
import com.mashape.unirest.http.Unirest;

HttpResponse<String> response = Unirest.patch("https://unsw-v6-dev.advance-uac.com/institution-api/institution/applicants/id")
  .header("Authorization", "Bearer <token>")
  .header("Content-Type", "application/json")
  .body("{\n  \"familyName\": \"Nguyen-Barrett\",\n  \"emailAddress\": \"t.nguyen@student.example.edu.au\"\n}")
  .asString();
```

```php A name change, and drop the phone number
<?php
require_once('vendor/autoload.php');

$client = new \GuzzleHttp\Client();

$response = $client->request('PATCH', 'https://unsw-v6-dev.advance-uac.com/institution-api/institution/applicants/id', [
  'body' => '{
  "familyName": "Nguyen-Barrett",
  "emailAddress": "t.nguyen@student.example.edu.au"
}',
  'headers' => [
    'Authorization' => 'Bearer <token>',
    'Content-Type' => 'application/json',
  ],
]);

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

```csharp A name change, and drop the phone number
using RestSharp;

var client = new RestClient("https://unsw-v6-dev.advance-uac.com/institution-api/institution/applicants/id");
var request = new RestRequest(Method.PATCH);
request.AddHeader("Authorization", "Bearer <token>");
request.AddHeader("Content-Type", "application/json");
request.AddParameter("application/json", "{\n  \"familyName\": \"Nguyen-Barrett\",\n  \"emailAddress\": \"t.nguyen@student.example.edu.au\"\n}", ParameterType.RequestBody);
IRestResponse response = client.Execute(request);
```

```swift A name change, and drop the phone number
import Foundation

let headers = [
  "Authorization": "Bearer <token>",
  "Content-Type": "application/json"
]
let parameters = [
  "familyName": "Nguyen-Barrett",
  "emailAddress": "t.nguyen@student.example.edu.au"
] as [String : Any]

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

let request = NSMutableURLRequest(url: NSURL(string: "https://unsw-v6-dev.advance-uac.com/institution-api/institution/applicants/id")! 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()
```