Create

Creates a course

27 variables
27 variables

Creates a course.

The user specified in ownerId is the owner of the created course and added as a teacher.

This method returns the following error codes:

  • PERMISSION_DENIED if the requesting user is not permitted to create courses or for access errors.
  • NOT_FOUND if the primary teacher is not a valid user.
  • FAILED_PRECONDITION if the course owner's account is disabled or for the following request errors:
    • UserGroupsMembershipLimitReached
  • ALREADY_EXISTS if an alias was specified in the id and already exists

Authorization

To use this building block you will have to grant access to at least one of the following scopes:

  • Manage your Google Classroom classes

Input

This building block consumes 27 input parameters

  = Parameter name
  = Format

guardiansEnabled BOOLEAN

Whether or not guardian notifications are enabled for this course.

Read-only

ownerId STRING

The identifier of the owner of a course.

When specified as a parameter of a create course request, this field is required. The identifier can be one of the following:

  • the numeric identifier for the user
  • the email address of the user
  • the string literal "me", indicating the requesting user

This must be set in a create request. Admins can also specify this field in a patch course request to transfer ownership. In other contexts, it is read-only

courseState ENUMERATION

State of the course. If unspecified, the default state is PROVISIONED

description STRING

Optional description. For example, "We'll be learning about the structure of living creatures from a combination of textbooks, guest lectures, and lab work. Expect to be excited!" If set, this field must be a valid UTF-8 string and no longer than 30,000 characters

teacherGroupEmail STRING

The email address of a Google group containing all teachers of the course. This group does not accept email and can only be used for permissions.

Read-only

creationTime ANY

Creation time of the course. Specifying this field in a course update mask results in an error.

Read-only

name STRING

Name of the course. For example, "10th Grade Biology". The name is required. It must be between 1 and 750 characters and a valid UTF-8 string

teacherFolder OBJECT

Representation of a Google Drive folder

teacherFolder.title STRING

Title of the Drive folder.

Read-only

teacherFolder.alternateLink STRING

URL that can be used to access the Drive folder.

Read-only

teacherFolder.id STRING

Drive API resource ID

section STRING

Section of the course. For example, "Period 2". If set, this field must be a valid UTF-8 string and no longer than 2800 characters

id STRING

Identifier for this course assigned by Classroom.

When creating a course, you may optionally set this identifier to an alias string in the request to create a corresponding alias. The id is still assigned by Classroom and cannot be updated after the course is created.

Specifying this field in a course update mask results in an error

room STRING

Optional room location. For example, "301". If set, this field must be a valid UTF-8 string and no longer than 650 characters

courseGroupEmail STRING

The email address of a Google group containing all members of the course. This group does not accept email and can only be used for permissions.

Read-only

enrollmentCode STRING

Enrollment code to use when joining this course. Specifying this field in a course update mask results in an error.

Read-only

courseMaterialSets[] OBJECT

A set of materials that appears on the "About" page of the course. These materials might include a syllabus, schedule, or other background information relating to the course as a whole

courseMaterialSets[].title STRING

Title for this set

courseMaterialSets[].materials[] OBJECT

A material attached to a course as part of a material set

courseMaterialSets[].materials[].form OBJECT

Google Forms item

courseMaterialSets[].materials[].link OBJECT

URL item

courseMaterialSets[].materials[].driveFile OBJECT

Representation of a Google Drive file

courseMaterialSets[].materials[].youTubeVideo OBJECT

YouTube video item

descriptionHeading STRING

Optional heading for the description. For example, "Welcome to 10th Grade Biology." If set, this field must be a valid UTF-8 string and no longer than 3600 characters

updateTime ANY

Time of the most recent update to this course. Specifying this field in a course update mask results in an error.

Read-only

calendarId STRING

The Calendar ID for a calendar that all course members can see, to which Classroom adds events for course work and announcements in the course.

Read-only

alternateLink STRING

Absolute link to this course in the Classroom web UI.

Read-only

Output

This building block provides 27 output parameters

  = Parameter name
  = Format

guardiansEnabled BOOLEAN

Whether or not guardian notifications are enabled for this course.

Read-only

ownerId STRING

The identifier of the owner of a course.

When specified as a parameter of a create course request, this field is required. The identifier can be one of the following:

  • the numeric identifier for the user
  • the email address of the user
  • the string literal "me", indicating the requesting user

This must be set in a create request. Admins can also specify this field in a patch course request to transfer ownership. In other contexts, it is read-only

courseState ENUMERATION

State of the course. If unspecified, the default state is PROVISIONED

description STRING

Optional description. For example, "We'll be learning about the structure of living creatures from a combination of textbooks, guest lectures, and lab work. Expect to be excited!" If set, this field must be a valid UTF-8 string and no longer than 30,000 characters

teacherGroupEmail STRING

The email address of a Google group containing all teachers of the course. This group does not accept email and can only be used for permissions.

Read-only

creationTime ANY

Creation time of the course. Specifying this field in a course update mask results in an error.

Read-only

name STRING

Name of the course. For example, "10th Grade Biology". The name is required. It must be between 1 and 750 characters and a valid UTF-8 string

teacherFolder OBJECT

Representation of a Google Drive folder

teacherFolder.title STRING

Title of the Drive folder.

Read-only

teacherFolder.alternateLink STRING

URL that can be used to access the Drive folder.

Read-only

teacherFolder.id STRING

Drive API resource ID

section STRING

Section of the course. For example, "Period 2". If set, this field must be a valid UTF-8 string and no longer than 2800 characters

id STRING

Identifier for this course assigned by Classroom.

When creating a course, you may optionally set this identifier to an alias string in the request to create a corresponding alias. The id is still assigned by Classroom and cannot be updated after the course is created.

Specifying this field in a course update mask results in an error

room STRING

Optional room location. For example, "301". If set, this field must be a valid UTF-8 string and no longer than 650 characters

courseGroupEmail STRING

The email address of a Google group containing all members of the course. This group does not accept email and can only be used for permissions.

Read-only

enrollmentCode STRING

Enrollment code to use when joining this course. Specifying this field in a course update mask results in an error.

Read-only

courseMaterialSets[] OBJECT

A set of materials that appears on the "About" page of the course. These materials might include a syllabus, schedule, or other background information relating to the course as a whole

courseMaterialSets[].title STRING

Title for this set

courseMaterialSets[].materials[] OBJECT

A material attached to a course as part of a material set

courseMaterialSets[].materials[].form OBJECT

Google Forms item

courseMaterialSets[].materials[].link OBJECT

URL item

courseMaterialSets[].materials[].driveFile OBJECT

Representation of a Google Drive file

courseMaterialSets[].materials[].youTubeVideo OBJECT

YouTube video item

descriptionHeading STRING

Optional heading for the description. For example, "Welcome to 10th Grade Biology." If set, this field must be a valid UTF-8 string and no longer than 3600 characters

updateTime ANY

Time of the most recent update to this course. Specifying this field in a course update mask results in an error.

Read-only

calendarId STRING

The Calendar ID for a calendar that all course members can see, to which Classroom adds events for course work and announcements in the course.

Read-only

alternateLink STRING

Absolute link to this course in the Classroom web UI.

Read-only