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

# List courses

> Paginated list of courses in the current workspace.

## Query parameters

<ParamField query="limit" type="integer" default="20">Max 100.</ParamField>
<ParamField query="starting_after" type="string">Cursor.</ParamField>
<ParamField query="status" type="enum">`draft` | `pending` | `ready` | `error`.</ParamField>
<ParamField query="workspace_id" type="string">Restrict to a single workspace (default: current).</ParamField>

<ParamField query="expand" type="string[]" />

## Examples

<CodeGroup>
  ```ts TypeScript theme={null}
  const page = await hk.courses.list({ limit: 50, status: "ready" });

  for await (const c of hk.courses.list()) {
    console.log(c.id, c.name);
  }
  ```

  ```php PHP theme={null}
  $page = $hk->courses->list(['limit' => 50, 'status' => 'ready']);

  foreach ($hk->courses->list()->autoPagingIterator() as $c) {
      echo $c->id . ' ' . $c->name . "\n";
  }
  ```
</CodeGroup>

## Returns

```json theme={null}
{
  "object": "list",
  "data": [ /* Course[] */ ],
  "has_more": true,
  "next_cursor": "crs_01HX8..."
}
```
