Administratorzy domen mogą bezpośrednio dodawać użytkowników z ich domeny jako nauczycieli do zajęć w ich domenie. Użytkownicy bez uprawnień administracyjnych powinni wysłać Invitation.
Ta metoda zwraca te kody błędów:
PERMISSION_DENIED jeśli użytkownik nie ma uprawnień do tworzenia nauczycieli w tym kursie lub w przypadku błędów dostępu.
NOT_FOUND, jeśli żądany identyfikator kursu nie istnieje.
FAILED_PRECONDITION jeśli konto użytkownika, którego dotyczy prośba, jest wyłączone, w przypadku tych błędów żądania:
CourseMemberLimitReached
CourseNotModifiable
CourseTeacherLimitReached
UserGroupsMembershipLimitReached
InactiveCourseOwner
ALREADY_EXISTS jeśli użytkownik jest już nauczycielem lub uczniem na zajęciach.
Żądanie HTTP
POST https://classroom.googleapis.com/v1/courses/{courseId}/teachers
[[["Łatwo zrozumieć","easyToUnderstand","thumb-up"],["Rozwiązało to mój problem","solvedMyProblem","thumb-up"],["Inne","otherUp","thumb-up"]],[["Brak potrzebnych mi informacji","missingTheInformationINeed","thumb-down"],["Zbyt skomplikowane / zbyt wiele czynności do wykonania","tooComplicatedTooManySteps","thumb-down"],["Nieaktualne treści","outOfDate","thumb-down"],["Problem z tłumaczeniem","translationIssue","thumb-down"],["Problem z przykładami/kodem","samplesCodeIssue","thumb-down"],["Inne","otherDown","thumb-down"]],["Ostatnia aktualizacja: 2025-07-25 UTC."],[],[],null,["- [HTTP request](#body.HTTP_TEMPLATE)\n- [Path parameters](#body.PATH_PARAMETERS)\n- [Request body](#body.request_body)\n- [Response body](#body.response_body)\n- [Authorization scopes](#body.aspect)\n- [Try it!](#try-it)\n\nCreates a teacher of a course.\n\nDomain administrators are permitted to [directly add](https://developers.google.com/workspace/classroom/guides/manage-users) users within their domain as teachers to courses within their domain. Non-admin users should send an `Invitation` instead.\n\nThis method returns the following error codes:\n\n- `PERMISSION_DENIED` if the requesting user is not permitted to create teachers in this course or for [access errors](/workspace/classroom/reference/Access.Errors).\n- `NOT_FOUND` if the requested course ID does not exist.\n- `FAILED_PRECONDITION` if the requested user's account is disabled, for the following [request errors](/workspace/classroom/reference/Request.Errors):\n - CourseMemberLimitReached\n - CourseNotModifiable\n - CourseTeacherLimitReached\n - UserGroupsMembershipLimitReached\n - InactiveCourseOwner\n- `ALREADY_EXISTS` if the user is already a teacher or student in the course.\n\nHTTP request\n\n`POST https://classroom.googleapis.com/v1/courses/{courseId}/teachers`\n\nThe URL uses [gRPC Transcoding](https://google.aip.dev/127) syntax.\n\nPath parameters\n\n| Parameters ||\n|------------|---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|\n| `courseId` | `string` Identifier of the course. This identifier can be either the Classroom-assigned identifier or an [alias](/workspace/classroom/reference/rest/v1/courses.aliases#CourseAlias). |\n\nRequest body\n\nThe request body contains an instance of [Teacher](/workspace/classroom/reference/rest/v1/courses.teachers#Teacher).\n\nResponse body\n\nIf successful, the response body contains a newly created instance of [Teacher](/workspace/classroom/reference/rest/v1/courses.teachers#Teacher).\n\nAuthorization scopes\n\nRequires one of the following OAuth scopes:\n\n- `https://www.googleapis.com/auth/classroom.rosters`\n- `\n https://www.googleapis.com/auth/classroom.profile.emails`\n- `\n https://www.googleapis.com/auth/classroom.profile.photos`\n\nFor more information, see the [Authorization guide](/workspace/guides/configure-oauth-consent)."]]