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

# Add a specialisation to a curriculum container

POST https://unsw-v6-dev.advance-uac.com/institution-api/institution/catalogue/structures/{structureId}/specialisations
Content-Type: application/json

Adds a specialisation to this container, appended after the items already in it.

`itemType` says which kind: `Major`, `Minor`, `Honours`, `Specialisation` or `Research`.
Anything else is a 400, including `Course` — use the subjects endpoint for those.

The specialisation must already exist in the institution's specialisation catalogue for the
same year. A code we don't hold is a 400, so a typo can't become a dangling reference. 404 if
the container is unknown, 409 if the specialisation is already in it under any type.

Optionally assert the owner with `programCode` and `programYear`, or `specialisationCode` and `specialisationYear`. Supply one pair, not both.

Reference: https://docs-unsw-v6.advance-uac.com/unsw-advance-institution-api/catalogue/add-a-specialisation-to-a-curriculum-container

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

- `structureId` (string, required)

### Query parameters

- `programCode` (string, optional)
- `programYear` (integer, optional)
- `specialisationCode` (string, optional)
- `specialisationYear` (integer, optional)

### Body (application/json)

This endpoint expects an AddSpecialisationRequest.

- `code` (string, optional) — The specialisation code, e.g. "COMPBH".
- `year` (integer, optional) — Catalogue year of the specialisation, e.g. 2026.
- `itemType` (enum, optional) — Which kind of specialisation this is within the container.
  - Allowed values: `Major`, `Minor`, `Honours`, `Specialisation`, `Research`

## Response

### 201

The specialisation was added to the container.

- `id` (string, optional)
- `itemType` (string, optional) — Course | Major | Minor | Honours | Specialisation | Research. Only Course can be added through the API; the rest came from the handbook.
- `code` (string, optional)
- `year` (integer, optional)
- `name` (string, optional)
- `uoc` (integer, optional) — Credit points this entry contributes.
- `resolved` (boolean, optional) — False when the code isn't in our catalogue. Only ever the case for entries from the original handbook import, because subjects added through the API must resolve.

## Errors

### 400 Bad Request Error

The itemType isn't a specialisation kind, the specialisation isn't in the institution's catalogue for that year, or only half an owner pair was supplied.

- `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 container, or it isn't part of the asserted owner.

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

It already exists; use PUT to update it.

- `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",
  "itemType": "string",
  "code": "string",
  "year": 1,
  "name": "string",
  "uoc": 1,
  "resolved": true
}
```

**SDK Code**

```python
import requests

url = "https://unsw-v6-dev.advance-uac.com/institution-api/institution/catalogue/structures/structureId/specialisations"

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

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

print(response.json())
```

```javascript
const url = 'https://unsw-v6-dev.advance-uac.com/institution-api/institution/catalogue/structures/structureId/specialisations';
const options = {
  method: 'POST',
  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/structures/structureId/specialisations"

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

	req, _ := http.NewRequest("POST", 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/structures/structureId/specialisations")

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

request = Net::HTTP::Post.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.post("https://unsw-v6-dev.advance-uac.com/institution-api/institution/catalogue/structures/structureId/specialisations")
  .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('POST', 'https://unsw-v6-dev.advance-uac.com/institution-api/institution/catalogue/structures/structureId/specialisations', [
  '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/structures/structureId/specialisations");
var request = new RestRequest(Method.POST);
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/structures/structureId/specialisations")! as URL,
                                        cachePolicy: .useProtocolCachePolicy,
                                    timeoutInterval: 10.0)
request.httpMethod = "POST"
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()
```