> 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.

# Update a catalogue subject

PUT https://unsw-v6-dev.advance-uac.com/institution-api/institution/catalogue/subjects/{code}/{year}
Content-Type: application/json

Replaces an existing subject, identified by the `code` and `year` in the path. Neither can be
changed, since together they identify it, and neither can `handbookData`.

Writable: `name`, `creditPoints`, `studyLevel`, `fieldOfEducation`, `facultyName`,
`schoolName`, `kind`, `complexity`, `description`, `learningOutcomes`, `discipline`,
`availability`, `conditions` and `externalIds`.

**Full-representation semantics:** each writable field is written as supplied, so omitting one
(or sending null / "") CLEARS it, so send the whole set. If you only want to change one field,
use `PATCH` instead, which leaves everything you omit alone.

`externalIds` is the exception: it merges per system, so a system you omit keeps its existing
id. 404 if there is no such subject, since this never creates one.

Reference: https://docs-unsw-v6.advance-uac.com/unsw-advance-institution-api/catalogue/update-a-catalogue-subject

## 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

- `code` (string, required)
- `year` (integer, required)

### Body (application/json)

This endpoint expects a SubjectUpdateRequest.

- `name` (string, optional)
- `creditPoints` (integer, optional) — Credit points (UOC) the subject is worth.
- `studyLevel` (string, optional)
- `fieldOfEducation` (string, optional) — Empty string and null both clear the stored value.
- `facultyName` (string, optional) — The owning faculty's name as your system records it. The matching group on our side is resolved separately, so this is a label, not a link.
- `schoolName` (string, optional)
- `kind` (string, optional) — Whether this row is a specific subject or an unspecified credit block (a placeholder used to grant credit without naming a subject).
- `complexity` (string, optional) — How advanced the subject is. Free text, but use the same vocabulary as the `studyLevel` recorded on applicants' subjects (introductory, intermediate, advanced), because credit matching compares the two and a mismatch fails to match silently rather than erroring.
- `description` (string, optional) — Summary of what the subject covers. Shown in the UI, and intended as input to similarity matching later, so prose is more useful here than keywords.
- `learningOutcomes` (string, optional) — What a student can do on completing the subject. Same purpose as `description`: display now, similarity matching later.
- `discipline` (string, optional) — Discipline code for the subject. Lets a structure group by discipline directly instead of parsing a prefix out of the subject code, which breaks as soon as a code doesn't follow the usual pattern.
- `availability` (string, optional) — When the subject can be studied. Carried into outcome reporting for international students, who need to know which terms are offered.
- `conditions` (string, optional) — Prerequisites, equivalents, exclusions and anything else that affects whether credit can be granted for this subject. Displayed to whoever is assessing an RPL claim, not evaluated automatically.
- `externalIds` (map from string to string, optional) — Your own identifiers for this subject, keyed by system name. Merged per system: a system you omit keeps its existing id. An id already used for a different subject is rejected.

## Response

### 200

The subject was replaced.

- `id` (string, optional) — Our stable id for the subject, unchanged by an update.
- `code` (string, optional)
- `year` (integer, optional)
- `status` (string, optional) — created | updated.

## Errors

### 400 Bad Request Error

Invalid fields, or an `externalIds` value already registered against a different subject.

- `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 subject for that code and year. This endpoint never creates one.

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

## Examples

**Request**

```json
{}
```

**Response**

```json
{
  "id": "string",
  "code": "string",
  "year": 1,
  "status": "string"
}
```

**SDK Code**

```python
import requests

url = "https://unsw-v6-dev.advance-uac.com/institution-api/institution/catalogue/subjects/code/1"

payload = {}
headers = {
    "Authorization": "Bearer <token>",
    "Content-Type": "application/json"
}

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

print(response.json())
```

```javascript
const url = 'https://unsw-v6-dev.advance-uac.com/institution-api/institution/catalogue/subjects/code/1';
const options = {
  method: 'PUT',
  headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
  body: '{}'
};

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://unsw-v6-dev.advance-uac.com/institution-api/institution/catalogue/subjects/code/1"

	payload := strings.NewReader("{}")

	req, _ := http.NewRequest("PUT", 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://unsw-v6-dev.advance-uac.com/institution-api/institution/catalogue/subjects/code/1")

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

request = Net::HTTP::Put.new(url)
request["Authorization"] = 'Bearer <token>'
request["Content-Type"] = 'application/json'
request.body = "{}"

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.put("https://unsw-v6-dev.advance-uac.com/institution-api/institution/catalogue/subjects/code/1")
  .header("Authorization", "Bearer <token>")
  .header("Content-Type", "application/json")
  .body("{}")
  .asString();
```

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

$client = new \GuzzleHttp\Client();

$response = $client->request('PUT', 'https://unsw-v6-dev.advance-uac.com/institution-api/institution/catalogue/subjects/code/1', [
  'body' => '{}',
  'headers' => [
    'Authorization' => 'Bearer <token>',
    'Content-Type' => 'application/json',
  ],
]);

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

```csharp
using RestSharp;

var client = new RestClient("https://unsw-v6-dev.advance-uac.com/institution-api/institution/catalogue/subjects/code/1");
var request = new RestRequest(Method.PUT);
request.AddHeader("Authorization", "Bearer <token>");
request.AddHeader("Content-Type", "application/json");
request.AddParameter("application/json", "{}", ParameterType.RequestBody);
IRestResponse response = client.Execute(request);
```

```swift
import Foundation

let headers = [
  "Authorization": "Bearer <token>",
  "Content-Type": "application/json"
]
let parameters = [] 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/catalogue/subjects/code/1")! as URL,
                                        cachePolicy: .useProtocolCachePolicy,
                                    timeoutInterval: 10.0)
request.httpMethod = "PUT"
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()
```