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

# Quickstart

> From an API key to a learner taking a course, in a few calls.

This walkthrough creates a learner, puts them on a course, gives them a link to open hackU and
reads their progress. Use the [test environment](https://api-docs.hacku.com/en/environments.md) while you build.

**1. Check your key**

```bash theme={null}
curl "https://app.reinvented.education/api/clients/users/?limit=1" \
  --header "Authorization: Api-Key YOUR_API_KEY"
```

A `200` means the key works. A `403` means it is missing or invalid: see [Authentication](https://api-docs.hacku.com/en/authentication.md).

**2. Pick a course**

List your company's courses and their modules:

```bash theme={null}
curl https://app.reinvented.education/api/clients/routes/ \
  --header "Authorization: Api-Key YOUR_API_KEY"
```

Keep the course `id` and the `pk` of the module the user should start on (usually the first one in
`contentmoduleroute_set`).

If your company defines extra fields (area, region…), read which ones are required and their
allowed values with `GET /clients/{company_slug}/extra-fields/`.

**3. Create the user**

```bash theme={null}
curl https://app.reinvented.education/api/clients/users/ \
  --request POST \
  --header "Authorization: Api-Key YOUR_API_KEY" \
  --header "Content-Type: application/json" \
  --data '{
    "email": "ana.perez@example.com",
    "first_name": "Ana",
    "last_name": "Pérez",
    "friendly_name": "Ana",
    "phone_number": "+573001112233",
    "country": "colombia",
    "document_type": "CEDULA",
    "document_number": "1020304050",
    "hour": "08:00",
    "selected_days": ["monday", "wednesday", "friday"],
    "extra_fields": [{ "name": "area", "value": "tech" }]
  }'
```

```json theme={null}
{ "user_pk": 398807 }
```

`user_pk` is the user's id in every other call. The call is idempotent by email: posting the same
email again returns `200` with the same `user_pk` instead of creating a duplicate.

`hour` and `selected_days` set when the user receives content. The user is activated on creation;
add `send_welcome_message: true` to also send the WhatsApp welcome message, or `silent_creation: true`
to create them without activating them yet.

**4. Put them on the course**

```bash theme={null}
curl https://app.reinvented.education/api/clients/users/398807/set-module/ \
  --request POST \
  --header "Authorization: Api-Key YOUR_API_KEY" \
  --header "Content-Type: application/json" \
  --data '{ "route_pk": 731, "module_pk": 5120 }'
```

To enroll them in a pensum (a learning path of several courses) instead, see [Enrollment](https://api-docs.hacku.com/en/guides/enrollment.md).

**5. Open hackU for them**

```bash theme={null}
curl https://app.reinvented.education/api/clients/users/398807/magic-link/ \
  --header "Authorization: Api-Key YOUR_API_KEY"
```

```json theme={null}
{ "url": "https://app.hacku.co/?token=…" }
```

The URL logs the user in without a password. Send it only to that user, for example from your
intranet. It works as a credential: do not log it or share it.

**6. Read their progress**

```bash theme={null}
curl https://app.reinvented.education/api/clients/users/398807/routes/ \
  --header "Authorization: Api-Key YOUR_API_KEY"
```

Each course comes with its `progress_percentage` and `finish_date`. Evaluations, surveys and
certificates have their own endpoints under `/clients/users/{user_id}/`.


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.