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

# Create a cohort

> Start a new run of a course for a group of students.

## Body

<ParamField body="course_id" type="string" required />

<ParamField body="name" type="string" required />

<ParamField body="code" type="string">Unique within the course.</ParamField>
<ParamField body="language" type="string">Defaults to the course's language.</ParamField>
<ParamField body="starts_at" type="string">ISO date.</ParamField>

<ParamField body="ends_at" type="string" />

<ParamField body="metadata" type="object" />

## Examples

<CodeGroup>
  ```ts TypeScript theme={null}
  const cohort = await hk.cohorts.create({
    course_id: "crs_123",
    name: "Fall 2026, Group A",
    code: "PHYS-201-FA26-A",
    starts_at: "2026-09-01",
    ends_at: "2026-12-15",
  });
  ```

  ```php PHP theme={null}
  $cohort = $hk->cohorts->create([
      'course_id' => 'crs_123',
      'name' => 'Fall 2026, Group A',
      'code' => 'PHYS-201-FA26-A',
      'starts_at' => '2026-09-01',
      'ends_at' => '2026-12-15',
  ]);
  ```
</CodeGroup>

## Returns

A new [Cohort](/api-reference/cohorts/object). The course's syllabus
tree is cloned into it.
