> ## 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 lesson

## Body

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

<ParamField body="unit_id" type="string">Optional grouping unit.</ParamField>

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

<ParamField body="type" type="enum" default="reading">`reading` | `video` | `practice` | `assessment`.</ParamField>

<ParamField body="position" type="integer" />

<ParamField body="evaluable" type="boolean" default="true" />

<ParamField body="optional" type="boolean" default="false" />

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

## Examples

<CodeGroup>
  ```ts TypeScript theme={null}
  const lesson = await hk.lessons.create({
    cohort_id: "coh_123",
    name: "The postulates of special relativity",
    type: "reading",
  });
  ```

  ```php PHP theme={null}
  $lesson = $hk->lessons->create([
      'cohort_id' => 'coh_123',
      'name' => 'The postulates of special relativity',
      'type' => 'reading',
  ]);
  ```
</CodeGroup>

## Returns

A [Lesson](/api-reference/lessons/object).
