> For the complete documentation index, see [llms.txt](https://docs.stellic.com/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.stellic.com/stellic-partner-api/student/unlink-a-student-from-a-school.md).

# Unlink a student from a school

Use this endpoint to remove one school from a student without sending their whole profile. `{school_id}` is the school's short name, matched exactly. Unlinking a school the student doesn't have returns 200 with no change, and a short name that doesn't exist returns `No school exists with short_name: {school_id}`. The response is the student's profile, with their remaining schools and departments.

## DELETE /student/{student\_username}/school/{school\_id}

>

```json
{"openapi":"3.0.0","info":{"title":"Stellic for Developers","version":"1.0"},"tags":[{"name":"Student"}],"servers":[{"url":"https://{institution}.stellic.com/partnerapi/v1","variables":{"institution":{"default":"{institution}","description":"Your institution's Stellic subdomain: the part before `.stellic.com` in the URL you use to sign in. It becomes the host in every request, as in `https://{institution}.stellic.com/partnerapi/v1/...`. Replace the `{institution}` placeholder with your subdomain before sending."}}}],"security":[{"bearerAuth":[]}],"components":{"securitySchemes":{"bearerAuth":{"type":"http","scheme":"bearer","description":"Personal Access Token issued by your Stellic integration partner. Send it as `Authorization: Bearer <token>` on every request. One token per institution; do not share across environments."}},"schemas":{"StudentLinkResponseSuccess":{"type":"object","properties":{"status":{"type":"string"},"state":{"type":"object","properties":{"username":{"type":"string"},"first_name":{"type":"string"},"last_name":{"type":"string"},"photo_url":{"type":"string","nullable":true},"level":{"type":"integer"},"year_begin":{"type":"integer"},"campus":{"type":"string","nullable":true,"description":"The student's primary campus name, or `null` if no campus is set."},"schools":{"type":"array","items":{"type":"object","properties":{"campus":{"type":"object","nullable":true,"description":"The campus the school belongs to, or `null` if the school has no campus.","properties":{"id":{"type":"integer"},"name":{"type":"string"},"screen_name":{"type":"string"}}},"name":{"type":"string"},"short_name":{"type":"string"}}}},"departments":{"type":"array","description":"The student's departments. Each one carries its name and code but not its short name.","items":{"type":"object","properties":{"name":{"type":"string"},"code":{"type":"string","nullable":true,"description":"The department's first registered code, or `null` if the department has no codes."},"school":{"type":"object","properties":{"campus":{"type":"object","nullable":true,"description":"The campus the parent school belongs to, or `null` if the school has no campus.","properties":{"id":{"type":"integer"},"name":{"type":"string"},"screen_name":{"type":"string"}}},"name":{"type":"string"},"short_name":{"type":"string"}}}}}}}}}},"StudentLinkResponseFailure":{"allOf":[{"$ref":"#/components/schemas/GenericResponseFailure"},{"type":"object","properties":{"identifiers":{"type":"object","properties":{"student_username":{"type":"string"}}}}}]},"GenericResponseFailure":{"type":"object","properties":{"status":{"type":"string"},"message":{"type":"string"}}}}},"paths":{"/student/{student_username}/school/{school_id}":{"delete":{"tags":["Student"],"parameters":[{"name":"student_username","in":"path","required":true,"description":"Send the student's username as stored, including its casing. The endpoint does not lowercase it, and different casing may not match. Archived students and test accounts return `400`.","schema":{"type":"string"}},{"name":"school_id","in":"path","required":true,"description":"The school's short name, matched exactly (case- and whitespace-sensitive). Unknown and deleted schools return `400`, even though the student isn't linked to them.","schema":{"type":"string"}}],"responses":{"200":{"description":"School unlinked, or wasn't linked (no change). The student's departments in that school stay linked. Each remaining school appears once in `state.schools`, even if linked for several terms. This list includes schools linked with and without a term; entries don't include a term.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/StudentLinkResponseSuccess"}}}},"400":{"description":"Validation failure on the student or the school.\n\nCommon causes:\n- Student not found - returns `No student exists with username: {student_username}`\n- Student is archived - returns `Student with username {student_username} is archived`\n- Student is a test account - returns the same `No student exists with username: {student_username}` as a missing user\n- No school, or only a deleted one, has this short name - returns `No school exists with short_name: {school_id}`, even though the student isn't linked to it","content":{"application/json":{"schema":{"allOf":[{"$ref":"#/components/schemas/StudentLinkResponseFailure"},{"type":"object","properties":{"identifiers":{"type":"object","properties":{"student_username":{"type":"string"},"school_id":{"type":"string"}}}}}]}}}},"401":{"description":"Missing or invalid Bearer token."},"403":{"description":"Your IP address isn't on the allowlist for this endpoint. Contact Stellic to add it; the response includes the `client_ip` Stellic saw.","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"message":{"type":"string"},"client_ip":{"type":"string"}}}}}},"500":{"description":"Unhandled error while saving the link change; the change wasn't saved. Body is `{\"status\": \"failure\", \"identifiers\": {...}, \"errors\": [{\"message\": \"Stellic couldn't process your request\"}]}`, with `errors[]` in place of `message`."}}}}}}
```

#### What happens after the call

* The school is unlinked during the call. The student's departments in that school stay linked.
* Search is refreshed during the call when possible, but can still show the old school links after a successful response. Use `state.schools` to confirm the unlink rather than search results.
* When a school is unlinked, general requirements for plans of the primary plan type and advisor access are updated in background tasks. Secondary plans aren't included in the general requirements update. Cached audits for affected plans in that selection are marked for refresh.
* Depending on how Stellic has set up your institution, eligible automatically applied pathways are reconciled on the student's default plan after general requirements. Ask your Stellic Representative about your setup. If top-ranked eligible pathways for a major tie, an already applied tied pathway is kept. Otherwise, the choice is held instead of automatically applying a pathway. Automatic pathway removal can also remove content contributed only by that pathway, including unregistered courses and requirement slots. Pathways removed with an opt-out aren't automatically reapplied. A matching manually attached official pathway can be managed by automatic updates. An official pathway not managed automatically can also be removed if none of its programs remain among the student's matching programs, even if the student still has other programs. If the school wasn't linked, these updates aren't queued.

#### Notes

* **This removes the school across all terms.** It also removes links without a term. Use this call only when you want to remove every link to that school; you can't target one term.
* **Removing the primary school makes another school primary.** It's the remaining school that was added to Stellic first.
* **Your data sync can put the school back.** If your data sync sends student schools, the next run replaces them.
* **Send the username as stored, including its casing.** The endpoint does not lowercase it, and different casing may not match. Archived students return `Student with username {student_username} is archived`.

#### Related APIs

* [`POST /student/{student_username}/school/{school_id}`](/stellic-partner-api/student/link-a-student-to-a-school.md) to link a school.
* [`DELETE /student/{student_username}/department/{dept_id}`](/stellic-partner-api/student/unlink-a-student-from-a-department.md) to unlink a department.
