> 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/section-enrollment/remove-a-section-enrollment-by-timestamp.md).

# Remove a section enrollment by timestamp

Use this endpoint instead of [`DELETE /planner/enrollment/section/{id}`](/stellic-partner-api/section-enrollment/remove-a-section-enrollment.md) if your institution runs timestamp-driven data sync; there, the other route returns a 400 with `Expected to receive timestamp.`, and elsewhere this one returns `Unexpectedly received timestamp.` The timestamp is your SIS's time for the drop, and a drop older than the enrollment's stored timestamp can be skipped, so a delayed or replayed drop doesn't undo a newer change.

## DELETE /planner/enrollment/section/{id}/{timestamp}

>

```json
{"openapi":"3.0.0","info":{"title":"Stellic for Developers","version":"1.0"},"tags":[{"name":"Section Enrollment"}],"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."}}},"paths":{"/planner/enrollment/section/{id}/{timestamp}":{"delete":{"tags":["Section Enrollment"],"parameters":[{"name":"id","in":"path","required":true,"description":"The `{id}` you assigned when you created the section enrollment. Matches only enrolled sections on plans of the primary plan type. Sections that are planned but not enrolled, and sections on other plan types, are treated as not found. An enrolled section can match even if it is also planned. May contain `/`: the final segment is read as `{timestamp}` only when it matches the timestamp route pattern. Avoid enrollment IDs whose slash-separated final segment matches that pattern, such as `SIS-ENR/2024-08-15T10:00:00`: GET and POST requests to `/planner/enrollment/section/{id}` for those literal IDs reach the DELETE-only timestamp route and return 405, so the follow-up GET cannot check them.","schema":{"type":"string"}},{"name":"timestamp","in":"path","required":true,"description":"Your SIS's time for the drop, in the same clock your SIS uses for `sis_update_timestamp`. Use either:\n- T-separated: `YYYY-MM-DDTHH:MM:SS`\n- Space-separated: `YYYY-MM-DD HH:MM:SS`\n\nOne- or two-digit month, day, hour, minute, and second fields are accepted. Values are compared with no time zone conversion. Fractional seconds and everything after the decimal point are discarded, including a trailing `Z` or UTC offset. A bare `Z` or UTC offset without a fractional tail, or the literal `null`, is treated as part of `{id}` rather than as a timestamp; at institutions using timestamp-driven data sync, these calls return 400 with `Expected to receive timestamp.` Send a real SIS change time in one of the formats above. Institutions without timestamp-driven data sync must use `DELETE /planner/enrollment/section/{id}` instead.","schema":{"type":"string"}}],"responses":{"200":{"description":"Enrollment removed, skipped, or not found: the response is the same in every case, so call `GET` afterward if you need to know. The section enrollment is removed unless its stored timestamp is newer than yours, in which case the drop can be skipped and nothing changes. If no other section remains on the course enrollment (planned sections included), it's removed the same way, compared against the course enrollment's own timestamp. The section can be removed while the course remains because the course's own timestamp is newer than yours.\n\nCommon causes:\n- Enrollment removed - returns `{success: true, errors: []}`\n- Timestamp older than the stored one - can return `{success: true, errors: []}` with no change applied\n- Enrollment not found - returns `{success: true, errors: []}`","content":{"application/json":{"schema":{"type":"object","properties":{"success":{"type":"boolean"},"errors":{"type":"array","items":{"type":"object"}}}}}}},"400":{"description":"Configuration mismatch, invalid timestamp, or archived student. `errors` is a plain string in the mismatch and invalid-timestamp cases and a list of `{message}` objects in the archived-student case.\n\nCommon causes:\n- Institution doesn't use timestamp-driven data sync - returns `Unexpectedly received timestamp.`; use `DELETE /planner/enrollment/section/{id}`\n- Timestamp matches the route pattern but cannot be parsed, such as `2024-13-15T10:00:00` - returns `Invalid timestamp {timestamp}.` before the enrollment lookup\n- Student is archived - returns ``Cannot delete section enrollment id = `{id}` linked to archived student: `{username}` ``"},"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":"Server error during the delete.\n\nCommon causes:\n- Server error during the delete - returns ``Couldn't delete section enrollment with id: `{id}`.``"}}}}}}
```

#### About `{timestamp}`

Send `YYYY-MM-DDTHH:MM:SS` (for example `2024-08-15T10:00:00`) in the same clock your SIS uses for `sis_update_timestamp`; values are compared as sent, with no time zone conversion.

#### What happens after the call

* The section enrollment is removed right away, unless the drop is skipped because its stored timestamp is newer than yours.
* If no other section remains on the course enrollment, the course enrollment is removed the same way. The section can be removed while the course remains because the course's own timestamp is newer than yours.
* When the section enrollment is removed, the removal appears in the student's activity history shortly after. A skipped stale drop adds no removal activity. If the course removal is skipped after the section is removed, a course-removal activity is still queued, so activity history alone is not proof that the course was removed.
* When the section enrollment is removed, the student's cached audit is invalidated in a background task, so audit and progress views reflect the change once it runs. A skipped stale drop does not schedule this task.

#### Notes

* **A skipped drop still returns 200.** The response is identical whether the enrollment was removed, skipped as older, or never existed. Call `GET` afterward: if the enrollment still comes back, the drop was skipped.
* **Send the SIS change time, not the time of the call.** Stamping the request with the current time defeats the comparison.

#### Related APIs

* [`DELETE /planner/enrollment/section/{id}`](/stellic-partner-api/section-enrollment/remove-a-section-enrollment.md) for institutions without timestamp-driven data sync.
* [`GET /planner/enrollment/section/{id}`](/stellic-partner-api/section-enrollment/get-a-section-enrollment.md) to check whether the enrollment is still there.
* [`POST /planner/enrollment/section/{id}`](/stellic-partner-api/section-enrollment/enroll-a-student-in-a-section.md) to create a section enrollment.
* [`PUT /planner/enrollment/course/{username}/{term_id}`](/stellic-partner-api/course-enrollments/replace-a-student-s-course-enrollments-for-a-term.md) to remove a whole course by leaving it out of the student's term.
