---
title: "Validate Class Code"
method: POST
path: "/public/validate-class-code"
tags: ["public"]
---

# Validate Class Code

`POST /public/validate-class-code`

Validate a class code without requiring authentication.
Returns details about the class if valid.
Supports both regular class codes and single-use codes.

## Request body

- ValidateClassCodeRequest
  - `class_code` string, required — The class code to validate

## Response `200`

Successful Response

- ValidateClassCodeResponse
  - `is_valid` boolean, required — Whether the class code is valid
  - `teacher_name` string, nullable — The name of the teacher who created the class
  - `class_name` string, nullable — The name of the class
  - `error_message` string, nullable — Error message if the class code is invalid
  - `has_pending_students` boolean — Whether the class has pending students
  - `pending_students` PendingStudentInfo[] — List of pending students in the class
    - `id` string, required
    - `name` string, required
    - `first_name` string, required
    - `last_name` string, required
  - `matched_pending_student` PendingStudentInfo
    - `id` string, required
    - `name` string, required
    - `first_name` string, required
    - `last_name` string, required

## Other responses

- `422` — Validation Error

---

[API](https://skmtc.dev/excellence-ai/apis/excellence-learning.md) · [All operations](https://skmtc.dev/excellence-ai/apis/excellence-learning/llms.txt) · [OpenAPI document](https://skmtc-service-production.skmtc.workers.dev/v1/apis/excellence-ai/excellence-learning/revisions/c407f3b5a05b/schema)
