---
title: "Attach Students To Class"
method: POST
path: "/admin/classes/{class_id}/attach-students"
tags: ["admin"]
---

# Attach Students To Class

`POST /admin/classes/{class_id}/attach-students`

Attach already-registered student accounts to a class: link, roster row
marked joined, and (by default) an email telling the student which
account to sign in with. Bad entries are skipped, the rest go through.

## Path parameters

- `class_id` string, required

## Request body

- AdminAttachStudentsRequest
  - `students` AdminAttachStudent[], required
    - `user_id` string, required
    - `first_name` string, required
    - `last_name` string, required
    - `roster_email` string, email, nullable
  - `notify` boolean

## Response `200`

Successful Response

- AdminAttachStudentsResponse
  - `class_id` string, required
  - `name` string, required
  - `attached` integer, required
  - `already_linked` integer, required
  - `skipped` integer, required
  - `emails_sent` integer, required
  - `results` AdminAttachStudentResult[], required
    - `user_id` string, required
    - `outcome` 'attached' | 'already_linked' | 'skipped', required
    - `reason` string, nullable
    - `account_email` string, nullable
    - `pending_student_id` string, nullable
    - `email_sent` boolean

## Other responses

- `422` — Validation Error

## Changes

- **2026-09-05** `6608cf59dfaf` — 1 info
  - endpoint added

[Change history](https://skmtc.dev/excellence-ai/apis/excellence-learning/changes/admin/classes/:class_id/attach-students/post.md)

---

[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.dev/excellence-ai/apis/excellence-learning/revisions/e75413b9576a?raw)
