> ## Documentation Index
> Fetch the complete documentation index at: https://docs.dokstamp.com/llms.txt
> Use this file to discover all available pages before exploring further.

# Cohorts

> Manage cohorts — specific intakes or graduating classes within a course.

# Cohorts

A cohort represents a specific intake or graduating class for a course — for example, "Evening Class 2024/1" or "Remote Cohort — March 2025". Cohorts are optional but allow you to group enrollments and certificates by graduating class.

***

## The cohort object

```json theme={null}
{
  "uuid": "e5f6a7b8-c9d0-1234-efgh-345678901234",
  "code": "BCS-2024-EVE",
  "modality": "hybrid",
  "start_date": "2024-02-01T00:00:00.000000Z",
  "end_date": "2027-12-31T00:00:00.000000Z",
  "course": {
    "uuid": "c3d4e5f6-a7b8-9012-cdef-123456789012",
    "name": "Bachelor of Computer Science"
  }
}
```

| Field        | Type     | Description                           |
| ------------ | -------- | ------------------------------------- |
| `uuid`       | string   | Unique identifier                     |
| `code`       | string   | Unique cohort code                    |
| `modality`   | enum     | `presential`, `remote`, `hybrid`      |
| `start_date` | datetime | Cohort start date                     |
| `end_date`   | datetime | Cohort end date (expected graduation) |

***

## List cohorts

```http theme={null}
GET /cohorts
```

<CodeGroup>
  ```bash cURL theme={null}
  curl "https://api.dokstamp.com/cohorts?where[course_uuid]=c3d4e5f6-a7b8-9012-cdef-123456789012" \
    -H "Authorization: Bearer {TOKEN}" \
    -H "Accept: application/json" \
    -H "X-Tenant: {TENANT}"
  ```
</CodeGroup>

***

## Create a cohort

```http theme={null}
POST /cohorts
```

| Parameter     | Type     | Required | Description                      |
| ------------- | -------- | -------- | -------------------------------- |
| `course_uuid` | string   | Yes      | Parent course UUID               |
| `code`        | string   | Yes      | Unique cohort code               |
| `modality`    | enum     | No       | `presential`, `remote`, `hybrid` |
| `start_date`  | datetime | No       | Cohort start date                |
| `end_date`    | datetime | No       | Expected end/graduation date     |

<CodeGroup>
  ```bash cURL theme={null}
  curl -X POST https://api.dokstamp.com/cohorts \
    -H "Authorization: Bearer {TOKEN}" \
    -H "Accept: application/json" \
    -H "Content-Type: application/json" \
    -H "X-Tenant: {TENANT}" \
    -d '{
      "course_uuid": "c3d4e5f6-a7b8-9012-cdef-123456789012",
      "code": "BCS-2024-EVE",
      "modality": "hybrid",
      "start_date": "2024-02-01T00:00:00Z",
      "end_date": "2027-12-31T00:00:00Z"
    }'
  ```
</CodeGroup>

***

## Get, update, delete

```http theme={null}
GET    /cohorts/{uuid}
PATCH  /cohorts/{uuid}
PUT    /cohorts/{uuid}
DELETE /cohorts/{uuid}
DELETE /cohorts/batch/destroy
```
