> For the complete documentation index, see [llms.txt](https://developers.jarsave.com/llms.txt)

# Test helpers

## The sandbox flow

In the sandbox, the test helpers play the parent, so you or your AI assistant can run the whole flow from code: make a link code, create the link, confirm it, then send items. They work with a sandbox key only; a live key gets `400`.

The dashboard's **Make a test link code** and **Confirm as parent** buttons do the same.

**Sandbox flow**

```sh
# 1. A code, as a parent makes it in JarSave
POST /v1/test_helpers/link_codes
# 2. The link, with that code
POST /v1/links
# 3. The parent confirms it
POST /v1/test_helpers/links/:id/confirm
# 4. Items arrive
POST /v1/links/:id/certificates
```

## Make a link code

`POST /v1/test_helpers/link_codes`

Makes a one-time link code for a test student, as a parent does in JarSave. It works once, for 24 hours.

### Returns

A link code object with the `code` to [create a link](https://developers.jarsave.com/links.md) with and its `expires_at`.

**Request**

```sh
curl -X POST https://api.jarsave.com/v1/test_helpers/link_codes \
  -H "Authorization: Bearer $JARSAVE_SECRET_KEY" \
  -H "JarSave-Version: 2026-10-29"
```

**Response**

```json
{
  "object": "link_code",
  "code": "K7PM-Q2XD",
  "expires_at": "2026-11-21T15:04:11+07:00"
}
```

## Confirm a link

`POST /v1/test_helpers/links/:id/confirm`

Confirms a pending sandbox link as the parent does, so the items you send to it are accepted. Confirming an active link again changes nothing.

### Returns

The link object, with status `active`. A revoked link returns `410`.

**Request**

```sh
curl -X POST https://api.jarsave.com/v1/test_helpers/links/lnk_8Gm2QxT4/confirm \
  -H "Authorization: Bearer $JARSAVE_SECRET_KEY" \
  -H "JarSave-Version: 2026-10-29"
```
