# Getting started

> Create an API key, check it works and create your first test, in five minutes.

Source: https://lernexa.com/docs/developers/language-test/getting-started

You need a staff account on the Language Test. Your school's admin can add you from the
**Users** page.

## 1. Create a key

In the staff app, open **Integrations** and press **Create a key**. Name it after what will use
it, such as `Zapier` or `CRM sync`, and copy the key the dialog shows. It starts with `ltk_` and is
shown only once.

:::caution
Treat the key like a password: whoever has it can create tests for your school. If it leaks,
revoke it on the same page and create another.
:::

## 2. Check it works

```sh title="Terminal"
export LERNEXA_KEY=ltk_…

curl https://api-language-test.lernexa.com/api/v1/organisation \
  -H "Authorization: Bearer $LERNEXA_KEY"
```

```json title="200 OK"
{ "id": "8d3f1c2e-6b4a-4f0e-9a51-2c7d0e9b1f34", "name": "Your School" }
```

## 3. Create a test

```sh title="Terminal"
curl https://api-language-test.lernexa.com/api/v1/tests \
  -H "Authorization: Bearer $LERNEXA_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "name": "Ana Torres",
    "email": "ana@example.com",
    "language": "French",
    "externalId": "booking-1042",
    "sendEmail": false
  }'
```

The answer is the test, with the candidate's link in `url`:

```json title="201 Created"
{
  "id": "5c0e7a52-0b2f-4a37-9a1e-3b1d7c2f9e10",
  "externalId": "booking-1042",
  "name": "Ana Torres",
  "email": "ana@example.com",
  "language": "French",
  "interfaceLanguage": "English",
  "skills": ["Use of language", "Reading", "Listening"],
  "status": "invited",
  "url": "https://language-test.lernexa.com/t/La1MQ-W6bBQgwR_PciQXKjv8N4bYGKZk",
  "staffUrl": "https://language-test.lernexa.com/tests/5c0e7a52-0b2f-4a37-9a1e-3b1d7c2f9e10",
  "createdAt": "2026-10-29T09:00:00.000Z",
  "openedAt": null,
  "completedAt": null,
  "result": null
}
```

With `sendEmail: false` nobody is emailed: send the `url` to the candidate yourself. Leave it out
and the candidate gets an invitation from your school.

The test also appears in the staff app's **Tests** list, created by your key's name.

## 4. Get the result

Once the candidate finishes, look the test up by the id you gave it:

```sh title="Terminal"
curl https://api-language-test.lernexa.com/api/v1/tests/booking-1042 \
  -H "Authorization: Bearer $LERNEXA_KEY"
```

`status` is now `completed`, and `result.levelText` holds the level to record, such as `B1 High`.
Rather than asking again and again, set up a [webhook](https://lernexa.com/docs/developers/language-test/webhooks)
and be told.

## Next

- [Creating tests](https://lernexa.com/docs/developers/language-test/creating-tests): every field, and retrying safely.
- [Reading results](https://lernexa.com/docs/developers/language-test/results): what each level means.
- [Zapier guide](https://lernexa.com/docs/developers/language-test/zapier): the same without code.
