---
title: "Starts an attempt at a quiz, or resumes the open one, until the quiz is over: given up, its attempts used, or one attempt scored 100."
---

> Documentation Index
> Fetch the complete documentation index at: https://docs.sherpo.io/llms.txt
> Use this file to discover all available pages before exploring further.

Path: Sherpo customer API › quiz

`POST /v1/stores/{store}/products/{product}/entries/{entry}/quizzes/{quiz}/attempts`

## Authentication

- `bearer`, http, header `Authorization`, scopes: `quiz:write`

## Path parameters

- `store` (`startAttempt.path.store`; string, required) — A hostname of the store.
- `product` (`startAttempt.path.product`; string, required) — An id, or `slug:<slug>`.
  - minLength 1
- `entry` (`startAttempt.path.entry`; string, required)
  - minLength 1
- `quiz` (`startAttempt.path.quiz`; string, required)
  - minLength 1

## Request body

_Optional._

- `preview` (`startAttempt.preview`; string, optional) — A token a seller made for the quiz's product's page, which opens the quiz of a published entry of the product unpublished, or for the quiz's entry, which opens it unpublished too, gated as ever; with it, any quiz it does not open is `not_found` `preview`.
  - minLength 1; maxLength 128

## Example request

```json
{
  "preview": "string"
}
```

## Code samples

### cURL

```bash
curl --request POST \
  --url 'https://api.sherpo.io/customer/v1/stores/<store>/products/<product>/entries/<entry>/quizzes/<quiz>/attempts' \
  --header 'Authorization: Bearer <token>' \
  --header 'Content-Type: application/json' \
  --data '
{
  "preview": "string"
}
'
```

### TypeScript

```typescript
const url = 'https://api.sherpo.io/customer/v1/stores/<store>/products/<product>/entries/<entry>/quizzes/<quiz>/attempts';
const options = {
  method: 'POST',
  headers: {'Content-Type': 'application/json', Authorization: 'Bearer <token>'},
  body: JSON.stringify({preview: 'string'})
};

fetch(url, options)
  .then(res => res.json())
  .then(json => console.log(json))
  .catch(err => console.error(err));
```

### Python

```python
import requests

url = "https://api.sherpo.io/customer/v1/stores/<store>/products/<product>/entries/<entry>/quizzes/<quiz>/attempts"

payload = { "preview": "string" }
headers = {
    "Content-Type": "application/json",
    "Authorization": "Bearer <token>"
}

response = requests.post(url, json=payload, headers=headers)

print(response.text)
```

## Responses

### 200

Starts an attempt at a quiz, or resumes the open one, until the quiz is over: given up, its attempts used, or one attempt scored 100.

#### Example

```json
{
  "attempt": {
    "id": "string",
    "product_id": "string",
    "quiz_id": "string",
    "entry_id": "string",
    "attempt": 0,
    "status": "string",
    "score": 0,
    "correct": 0,
    "started_at": "string",
    "finished_at": "string",
    "access": "string"
  },
  "questions": [
    {
      "type": "string",
      "id": "string",
      "question": "string",
      "content": "string",
      "options": [
        {
          "id": "string",
          "text": "string"
        }
      ],
      "min": 0,
      "max": 0,
      "weight": 0,
      "hint": "string"
    }
  ],
  "attachments": [
    {
      "tracks": [
        {
          "id": "string",
          "label": "string",
          "language": "string",
          "generated": true
        }
      ],
      "outputs": [
        "string"
      ],
      "access": "string",
      "id": "string",
      "role": "string",
      "delivery": "string",
      "preview_only": true,
      "from_body": true,
      "position": 0,
      "asset": {
        "id": "string",
        "name": "string",
        "title": "string",
        "ext": "string",
        "description": "string",
        "mime": "string",
        "bytes": 0,
        "enforcement": "string",
        "locator": "string",
        "metadata": {
          "width": 0,
          "height": 0,
          "duration": 0,
          "pages": 0
        },
        "status": "string"
      }
    }
  ],
  "files": {
    "property1": {
      "id": "string",
      "kind": "string",
      "mime": "string",
      "name": "string",
      "bytes": 0,
      "width": 0,
      "height": 0,
      "duration": 0,
      "pages": 0,
      "status": "string",
      "url": "string",
      "resized": [
        {
          "width": 1,
          "avif": "string",
          "webp": "string"
        }
      ],
      "attachment_id": "string",
      "unlocks": [
        {
          "product_id": "string",
          "product_name": "string",
          "tier": {
            "id": "string",
            "name": "string",
            "rank": 0
          }
        }
      ],
      "video": {
        "attachment_id": "string",
        "tracks": [
          {
            "id": "string",
            "label": "string",
            "language": "string",
            "generated": true
          }
        ],
        "outputs": [
          "string"
        ]
      },
      "audio": {
        "waveform": "string",
        "attachment_id": "string",
        "tracks": [
          {
            "id": "string",
            "label": "string",
            "language": "string",
            "generated": true
          }
        ],
        "outputs": [
          "string"
        ]
      }
    },
    "property2": {
      "id": "string",
      "kind": "string",
      "mime": "string",
      "name": "string",
      "bytes": 0,
      "width": 0,
      "height": 0,
      "duration": 0,
      "pages": 0,
      "status": "string",
      "url": "string",
      "resized": [
        {
          "width": 1,
          "avif": "string",
          "webp": "string"
        }
      ],
      "attachment_id": "string",
      "unlocks": [
        {
          "product_id": "string",
          "product_name": "string",
          "tier": {
            "id": "string",
            "name": "string",
            "rank": 0
          }
        }
      ],
      "video": {
        "attachment_id": "string",
        "tracks": [
          {
            "id": "string",
            "label": "string",
            "language": "string",
            "generated": true
          }
        ],
        "outputs": [
          "string"
        ]
      },
      "audio": {
        "waveform": "string",
        "attachment_id": "string",
        "tracks": [
          {
            "id": "string",
            "label": "string",
            "language": "string",
            "generated": true
          }
        ],
        "outputs": [
          "string"
        ]
      }
    }
  },
  "answers": {
    "property1": true,
    "property2": true
  }
}
```

- `attempt` (`startAttempt.response.200.attempt`; object, required)
  - `id` (`startAttempt.response.200.attempt.id`; string, required)
  - `product_id` (`startAttempt.response.200.attempt.product_id`; string, required)
  - `quiz_id` (`startAttempt.response.200.attempt.quiz_id`; string, required)
  - `entry_id` (`startAttempt.response.200.attempt.entry_id`; string, required)
  - `attempt` (`startAttempt.response.200.attempt.attempt`; number, required)
  - `status` (`startAttempt.response.200.attempt.status`; string, required)
  - `score` (`startAttempt.response.200.attempt.score`; any of, required)
    - any of: `number`, `null`
  - `correct` (`startAttempt.response.200.attempt.correct`; any of, required)
    - any of: `number`, `null`
  - `started_at` (`startAttempt.response.200.attempt.started_at`; string, required)
  - `finished_at` (`startAttempt.response.200.attempt.finished_at`; any of, required)
    - any of: `string`, `null`
  - `access` (`startAttempt.response.200.attempt.access`; string, required)
- `questions` (`startAttempt.response.200.questions`; array<object>, required)
  - `type` (`startAttempt.response.200.questions.type`; string, required)
  - `id` (`startAttempt.response.200.questions.id`; string, required)
  - `question` (`startAttempt.response.200.questions.question`; any of, required)
    - any of: `string`, `null`
  - `content` (`startAttempt.response.200.questions.content`; any of, required) — A static text's text, in the rich text format as stored.
    - any of: `string`, `null`
  - `options` (`startAttempt.response.200.questions.options`; any of, required)
    - any of: `array<object>`, `null`
  - `min` (`startAttempt.response.200.questions.min`; any of, required)
    - any of: `number`, `null`
  - `max` (`startAttempt.response.200.questions.max`; any of, required)
    - any of: `number`, `null`
  - `weight` (`startAttempt.response.200.questions.weight`; any of, required)
    - any of: `number`, `null`
  - `hint` (`startAttempt.response.200.questions.hint`; any of, required)
    - any of: `string`, `null`
- `attachments` (`startAttempt.response.200.attachments`; array<object>, required)
  - `tracks` (`startAttempt.response.200.attachments.tracks`; array<object>, required)
    - `id` (`startAttempt.response.200.attachments.tracks.id`; string, required)
    - `label` (`startAttempt.response.200.attachments.tracks.label`; any of, required)
      - any of: `string`, `null`
    - `language` (`startAttempt.response.200.attachments.tracks.language`; any of, required)
      - any of: `string`, `null`
    - `generated` (`startAttempt.response.200.attachments.tracks.generated`; boolean, required) — Subtitles the store generated with AI from the video's audio.
  - `outputs` (`startAttempt.response.200.attachments.outputs`; array<string>, required) — The published AI outputs `getMediaOutputs` reads beside the video or audio file.
  - `access` (`startAttempt.response.200.attachments.access`; string, required)
  - `id` (`startAttempt.response.200.attachments.id`; string, required)
  - `role` (`startAttempt.response.200.attachments.role`; string, required)
  - `delivery` (`startAttempt.response.200.attachments.delivery`; string, required)
  - `preview_only` (`startAttempt.response.200.attachments.preview_only`; boolean, required)
  - `from_body` (`startAttempt.response.200.attachments.from_body`; boolean, required) — Named by its target's body text, rather than the target's own media (a lesson's video or slides).
  - `position` (`startAttempt.response.200.attachments.position`; number, required)
  - `asset` (`startAttempt.response.200.attachments.asset`; object, required)
    - `id` (`startAttempt.response.200.attachments.asset.id`; string, required)
    - `name` (`startAttempt.response.200.attachments.asset.name`; any of, required)
      - any of: `string`, `null`
    - `title` (`startAttempt.response.200.attachments.asset.title`; any of, required)
      - any of: `string`, `null`
    - `ext` (`startAttempt.response.200.attachments.asset.ext`; any of, required)
      - any of: `string`, `null`
    - `description` (`startAttempt.response.200.attachments.asset.description`; any of, required)
      - any of: `string`, `null`
    - `mime` (`startAttempt.response.200.attachments.asset.mime`; any of, required)
      - any of: `string`, `null`
    - `bytes` (`startAttempt.response.200.attachments.asset.bytes`; any of, required) — The file's size in bytes, null when it has none or is withheld.
      - any of: `number`, `null`
    - `enforcement` (`startAttempt.response.200.attachments.asset.enforcement`; string, required)
    - `locator` (`startAttempt.response.200.attachments.asset.locator`; any of, required)
      - any of: `string`, `null`
    - `metadata` (`startAttempt.response.200.attachments.asset.metadata`; object, required)
      - `width` (`startAttempt.response.200.attachments.asset.metadata.width`; any of, required)
        - any of: `number`, `null`
      - `height` (`startAttempt.response.200.attachments.asset.metadata.height`; any of, required)
        - any of: `number`, `null`
      - `duration` (`startAttempt.response.200.attachments.asset.metadata.duration`; any of, required)
        - any of: `number`, `null`
      - `pages` (`startAttempt.response.200.attachments.asset.metadata.pages`; any of, required)
        - any of: `number`, `null`
    - `status` (`startAttempt.response.200.attachments.asset.status`; string, required)
- `files` (`startAttempt.response.200.files`; map<object>, required)
- `answers` (`startAttempt.response.200.answers`; map<any of>, required)

### default

A problem; see https://api.sherpo.io/customer/docs/errors.

#### Example

```json
{
  "type": "http://example.com",
  "title": "string",
  "status": 0,
  "detail": "string",
  "code": "string",
  "context": {},
  "reached_core": true,
  "core_answer": "string"
}
```

- `type` (`startAttempt.response.default.type`; string, required)
  - format `uri`
- `title` (`startAttempt.response.default.title`; string, required)
- `status` (`startAttempt.response.default.status`; integer, required)
- `detail` (`startAttempt.response.default.detail`; string, required)
- `code` (`startAttempt.response.default.code`; string, optional)
- `context` (`startAttempt.response.default.context`; object, optional)
- `reached_core` (`startAttempt.response.default.reached_core`; boolean, optional)
- `core_answer` (`startAttempt.response.default.core_answer`; string, optional)


Source: https://docs.sherpo.io/customer-api/reference/start-attempt/index.md
