---
title: "Bulk-complete enrollments"
method: PATCH
path: "/v2/enrollments/completion"
tags: ["Enrollments"]
---

# Bulk-complete enrollments

`PATCH /v2/enrollments/completion`

Set or remove course completion on a batch of enrollments, each addressed by its id.

**Required OAuth scope:** `enrollments:write`

## Request body

- EnrollmentCompletionRequestEnvelope — JSON:API envelope for the bulk PATCH /v2/enrollments/completion update.
  - `send_notifications` boolean, required — Whether to send completion notification emails to students.
  - `data` EnrollmentCompletionData[], required — List of enrollment completion items to update.
    - `type` 'enrollments', required — Must be "enrollments".
    - `id` string, required — Opaque enrollment ID.
    - `attributes` EnrollmentCompletionAttributes, required — Updatable completion attributes for a bulk enrollment completion update. Omitted fields are left unchanged.
      - `completed_at` string, date-time, nullable — Timestamp when the course was completed. Null removes the completion.
      - `success_status` 'passed' | 'failed', nullable — Outcome of graded content: passed or failed. Null clears the status.

## Response `200`

OK

- BatchResultEnvelopeEnrollmentCompletionResource
  - `data` union[], required — Per-item results in request order.
    - union
      - BatchSucceededItemEnrollmentCompletionResource
        - `status` 'succeeded'
        - `id` string, nullable — Resource ID of the created or updated resource.
        - `result` EnrollmentCompletionResource, required — JSON:API resource object for an enrollment completion update.
          - `type` string — Always "enrollments".
          - `id` string, required — Opaque enrollment ID.
          - `attributes` EnrollmentCompletionWriteAttributes, required — Attributes of the completion write response resource.
            - `completed_at` string, date-time, nullable — Timestamp when the course was completed, or null.
            - `success_status` string, required — Derived success state: passed, failed, pending (graded content without an outcome yet), or not_applicable (no graded content).
      - BatchFailedItem — Wrapper for a failed item in a 207 batch response.
        - `status` 'failed'
        - `id` string, nullable — Echoed resource ID if the input identified a row.
        - `error` BatchItemError, required — Per-item error inside a 207 batch response. Aligned with JSON:API ``ErrorObject`` field naming (``code`` rather than ``reason``) so consumers can reuse error-handling logic across document-level errors (``ErrorObject`` in ``ErrorEnvelope``) and per-item errors (here). Differences from ``ErrorObject``: ``status``/``title`` are omitted because they're redundant for the 207-batch context (HTTP status is on the envelope, and the title is derivable from ``code``).
          - `code` 'duplicate_email' | 'duplicate_in_batch' | 'duplicate_name' | 'validation_error' | 'not_found' | 'internal_error' | 'not_in_domain' | 'already_enrolled' | 'already_published', required — Machine-readable error code.
          - `source` object, nullable — Pointer to the offending input slot, e.g. {"pointer": "/data/0/attributes/email"}.
          - `detail` string, nullable — Human-readable explanation of the error.
  - `summary` BatchSummary, required — Aggregate counts for a 207 batch response. Invariant: ``succeeded + failed == total``. Enforced by ``@model_validator``.
    - `total` integer, required — Total number of items submitted.
    - `succeeded` integer, required — Number of items that succeeded.
    - `failed` integer, required — Number of items that failed.

## Other responses

- `207` — Multi-Status
- `400` — Bad Request
- `401` — Unauthorized
- `403` — Forbidden
- `422` — Unprocessable Entity

---

[API](https://skmtc.net/skilljar/apis/skilljar-api-v2.md) · [All operations](https://skmtc.net/skilljar/apis/skilljar-api-v2/llms.txt) · [OpenAPI document](https://skmtc-service-staging.skmtc.workers.dev/v1/apis/skilljar/skilljar-api-v2/revisions/f8025de20169/schema)
