---
title: "Saves the answers given so far to the open attempt, replacing those saved before, so it resumes on any device."
---

> 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}/attempts/{attempt}/save`

## Authentication

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

## Path parameters

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

## Request body

_Required._

- `answers` (`saveAttempt.answers`; map<any of>, required) — Each text answer at most 4000 characters; replaces the answers saved before.
- `preview` (`saveAttempt.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, a sitting on any quiz it does not open is `not_found` `preview`.
  - minLength 1; maxLength 128

## Example request

```json
{
  "answers": {
    "property1": true,
    "property2": true
  },
  "preview": "string"
}
```

## Code samples

### cURL

```bash
curl --request POST \
  --url 'https://api.sherpo.io/customer/v1/stores/<store>/products/<product>/attempts/<attempt>/save' \
  --header 'Authorization: Bearer <token>' \
  --header 'Content-Type: application/json' \
  --data '
{
  "answers": {
    "property1": true,
    "property2": true
  },
  "preview": "string"
}
'
```

### TypeScript

```typescript
const url = 'https://api.sherpo.io/customer/v1/stores/<store>/products/<product>/attempts/<attempt>/save';
const options = {
  method: 'POST',
  headers: {'Content-Type': 'application/json', Authorization: 'Bearer <token>'},
  body: JSON.stringify({answers: {property1: true, property2: true}, 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>/attempts/<attempt>/save"

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

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

print(response.text)
```

## Responses

### 200

Saves the answers given so far to the open attempt, replacing those saved before, so it resumes on any device.

#### 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"
  },
  "answers": {
    "property1": true,
    "property2": true
  }
}
```

- `attempt` (`saveAttempt.response.200.attempt`; object, required)
  - `id` (`saveAttempt.response.200.attempt.id`; string, required)
  - `product_id` (`saveAttempt.response.200.attempt.product_id`; string, required)
  - `quiz_id` (`saveAttempt.response.200.attempt.quiz_id`; string, required)
  - `entry_id` (`saveAttempt.response.200.attempt.entry_id`; string, required)
  - `attempt` (`saveAttempt.response.200.attempt.attempt`; number, required)
  - `status` (`saveAttempt.response.200.attempt.status`; string, required)
  - `score` (`saveAttempt.response.200.attempt.score`; any of, required)
    - any of: `number`, `null`
  - `correct` (`saveAttempt.response.200.attempt.correct`; any of, required)
    - any of: `number`, `null`
  - `started_at` (`saveAttempt.response.200.attempt.started_at`; string, required)
  - `finished_at` (`saveAttempt.response.200.attempt.finished_at`; any of, required)
    - any of: `string`, `null`
  - `access` (`saveAttempt.response.200.attempt.access`; string, required)
- `answers` (`saveAttempt.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` (`saveAttempt.response.default.type`; string, required)
  - format `uri`
- `title` (`saveAttempt.response.default.title`; string, required)
- `status` (`saveAttempt.response.default.status`; integer, required)
- `detail` (`saveAttempt.response.default.detail`; string, required)
- `code` (`saveAttempt.response.default.code`; string, optional)
- `context` (`saveAttempt.response.default.context`; object, optional)
- `reached_core` (`saveAttempt.response.default.reached_core`; boolean, optional)
- `core_answer` (`saveAttempt.response.default.core_answer`; string, optional)


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