REST API endpoints for {% data variables.product.prodname_classroom %}

Use the REST API to interact with GitHub Classroom.

Note

Most endpoints use Authorization: Bearer <YOUR-TOKEN> and Accept: application/vnd.github+json headers, plus X-GitHub-Api-Version: 2026-03-10. Curl examples below omit these standard headers for brevity.

Closing down - Get an assignment

GET /assignments/{assignment_id}

Warning

Closing down notice: This operation is closing down and will be removed on August 28, 2026.
For more information, see the GitHub Classroom sunset notice.

Gets a GitHub Classroom assignment. Assignment will only be returned if the current user is an administrator of the GitHub Classroom for the assignment.

Parameters

Headers

Path and query parameters

HTTP response status codes

Code examples

Example

Request:

curl -L \
  -X GET \
  https://api.github.com/assignments/ASSIGNMENT_ID

Response schema (Status: 200):

Closing down - List accepted assignments for an assignment

GET /assignments/{assignment_id}/accepted_assignments

Warning

Closing down notice: This operation is closing down and will be removed on August 28, 2026.
For more information, see the GitHub Classroom sunset notice.

Lists any assignment repositories that have been created by students accepting a GitHub Classroom assignment. Accepted assignments will only be returned if the current user is an administrator of the GitHub Classroom for the assignment.

Parameters

Headers

Path and query parameters

HTTP response status codes

Code examples

Example

Request:

curl -L \
  -X GET \
  https://api.github.com/assignments/ASSIGNMENT_ID/accepted_assignments

Response schema (Status: 200):

Array of Classroom Accepted Assignment:

Closing down - Get assignment grades

GET /assignments/{assignment_id}/grades

Warning

Closing down notice: This operation is closing down and will be removed on August 28, 2026.
For more information, see the GitHub Classroom sunset notice.

Gets grades for a GitHub Classroom assignment. Grades will only be returned if the current user is an administrator of the GitHub Classroom for the assignment.

Parameters

Headers

Path and query parameters

HTTP response status codes

Code examples

Example

Request:

curl -L \
  -X GET \
  https://api.github.com/assignments/ASSIGNMENT_ID/grades

Response schema (Status: 200):

Array of Classroom Assignment Grade:

Closing down - List classrooms

GET /classrooms

Warning

Closing down notice: This operation is closing down and will be removed on August 28, 2026.
For more information, see the GitHub Classroom sunset notice.

Lists GitHub Classroom classrooms for the current user. Classrooms will only be returned if the current user is an administrator of one or more GitHub Classrooms.

Parameters

Headers

Path and query parameters

HTTP response status codes

Code examples

Example

Request:

curl -L \
  -X GET \
  https://api.github.com/classrooms

Response schema (Status: 200):

Array of Simple Classroom:

Closing down - Get a classroom

GET /classrooms/{classroom_id}

Warning

Closing down notice: This operation is closing down and will be removed on August 28, 2026.
For more information, see the GitHub Classroom sunset notice.

Gets a GitHub Classroom classroom for the current user. Classroom will only be returned if the current user is an administrator of the GitHub Classroom.

Parameters

Headers

Path and query parameters

HTTP response status codes

Code examples

Example

Request:

curl -L \
  -X GET \
  https://api.github.com/classrooms/CLASSROOM_ID

Response schema (Status: 200):

Closing down - List assignments for a classroom

GET /classrooms/{classroom_id}/assignments

Warning

Closing down notice: This operation is closing down and will be removed on August 28, 2026.
For more information, see the GitHub Classroom sunset notice.

Lists GitHub Classroom assignments for a classroom. Assignments will only be returned if the current user is an administrator of the GitHub Classroom.

Parameters

Headers

Path and query parameters

HTTP response status codes

Code examples

Example

Request:

curl -L \
  -X GET \
  https://api.github.com/classrooms/CLASSROOM_ID/assignments

Response schema (Status: 200):

Array of Simple Classroom Assignment: