Skip to content

Student Management

Manage student master-data including class assignments and user accounts. Unlike OneRoster, this API returns all students regardless of whether they have assigned user accounts.

v3 Read & Write Endpoints: 4

Data sync

Synchronize student data from external school management systems.

User provisioning

Create student records and manage user accounts in bulk.


MethodOperation IDDescription
GETgetStudentV3Get a single student by ID
GETgetStudentsV3List all students
POSTcreateStudentsV3Create students (batch)
PUTupdateStudentsV3Update students (batch)

List all students for a school year. Construct the client with an access token obtained via Client Credentials.

UntisApiClient.java
9 collapsed lines
import org.springframework.http.HttpHeaders;
import org.springframework.http.HttpStatusCode;
import org.springframework.http.MediaType;
import org.springframework.util.StreamUtils;
import org.springframework.web.client.RestClient;
import org.springframework.web.util.UriComponentsBuilder;
import java.nio.charset.StandardCharsets;
import java.util.List;
public class UntisApiClient {
private final RestClient http;
public UntisApiClient(String apiUrl, String accessToken) {
this.http = RestClient.builder()
.baseUrl(apiUrl)
.defaultHeader(HttpHeaders.AUTHORIZATION, "Bearer " + accessToken)
.defaultHeader(HttpHeaders.ACCEPT, MediaType.APPLICATION_JSON_VALUE)
.build();
}
public StudentsResponse getStudents(int schoolYearId) {
String uri = UriComponentsBuilder
.fromPath("/WebUntis/api/rest/extern/v3/students")
.queryParam("schoolYearId", schoolYearId)
.build().toUriString();
return http.get()
.uri(uri)
.retrieve()
.onStatus(HttpStatusCode::is4xxClientError, (req, res) -> {
String body = StreamUtils.copyToString(res.getBody(), StandardCharsets.UTF_8);
throw new IllegalArgumentException(
"[" + res.getStatusCode().value() + "] " + req.getURI() + ": " + body);
})
.onStatus(HttpStatusCode::is5xxServerError, (req, res) -> {
String body = StreamUtils.copyToString(res.getBody(), StandardCharsets.UTF_8);
throw new RuntimeException(
"[" + res.getStatusCode().value() + "] " + req.getURI() + ": " + body);
})
.body(StudentsResponse.class);
}
public record StudentsResponse(List<Student> students) {
public record Student(int id, String forename, String lastName,
User user, List<ClassAssignment> classAssignments) {}
public record User(int id) {}
public record ClassAssignment(int classId, String className) {}
}
}

Usage:

UntisApiClient client = new UntisApiClient("https://api.integration.webuntis.dev", accessToken);
UntisApiClient.StudentsResponse response = client.getStudents(2025);
response.students().forEach(s ->
System.out.println(s.forename() + " " + s.lastName()));