> For the complete documentation index, see [llms.txt](https://docs.suggestic.com/graphql/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.suggestic.com/graphql/query/queries/assessments/user-assessment-history.md).

# User Assessment History

Use the `userAssessmentHistory` query to retrieve the history of answers a user has submitted within an assessment.

### Available Arguments

|                |          |                                                                                                        |
| -------------- | -------- | ------------------------------------------------------------------------------------------------------ |
| **Argument**   | **Type** | **Description**                                                                                        |
| `assessmentId` | ID!      | Id of Assessment.                                                                                      |
| `after`        | String   | See [pagination](https://docs.suggestic.com/graphql/start-here/tutorials-and-walkthroughs/pagination). |
| `before`       | String   | See [pagination](https://docs.suggestic.com/graphql/start-here/tutorials-and-walkthroughs/pagination). |
| `first`        | Int      | Retrieves the first results from the list.                                                             |
| `last`         | Int      | See [pagination](https://docs.suggestic.com/graphql/start-here/tutorials-and-walkthroughs/pagination). |

### Available Fields

|                 |                    |                                                                                                                                                 |
| --------------- | ------------------ | ----------------------------------------------------------------------------------------------------------------------------------------------- |
| **Field**       | **Type**           | **Description**                                                                                                                                 |
| `id`            | ID                 | Id of user’s answer to a specific question within an assessment attempt.                                                                        |
| `createdAt`     | DateTime!          | Assessment creation date `YYYY-MM-DDT hh:mm:ssZ`                                                                                                |
| `attempts`      | Int                | Number of times the user has completed or submitted the assessment.                                                                             |
| `finalQuestion` | AssessmentQuestion | Assessment final [question](https://app.gitbook.com/o/-LwqSh0rNboNaGEQruZQ/s/-LwqSnBDpAb6mFZYLsuB/~/changes/1878/objects/assessments/question). |
| `question`      | AssessmentQuestion | Assessment [Questions](https://app.gitbook.com/o/-LwqSh0rNboNaGEQruZQ/s/-LwqSnBDpAb6mFZYLsuB/~/changes/1878/objects/assessments/question).      |
| `answer`        | AssessmentAnswer   | Assessment [Answer](https://app.gitbook.com/o/-LwqSh0rNboNaGEQruZQ/s/-LwqSnBDpAb6mFZYLsuB/~/changes/1881/objects/assessments/answer).           |
| `updatedAt`     | DateTime!          | Assessment last update date `YYYY-MM-DDT hh:mm:ssZ`                                                                                             |

### Example with filter: "status"

{% tabs %}
{% tab title="Request" %}

```graphql
query{
    userAssessmentHistory(assessmentId: "QXNzZXNzvWVudDpmMTAxU2YwZC04MTIyLTQwMjctYmJiNi04ZTM1ODFlNWRhY2Q=") {
      edges {
        node {
          id
          attempts
          answerText
          createdAt
          updatedAt
          answer {
            id
            text
          }
          question {
            id
            text
          }
        }
      }
    }
  }
```

{% endtab %}

{% tab title="Response" %}

```graphql
{
  "data": {
    "userAssessmentHistory": {
      "edges": [
        {
          "node": {
            "id": "VXNlckFuc3dlckhpc3Rvcnk6NzVhNGNhM2ItY2VkMi00MGFkLWFkMDktOGEyNzYyZmRjY2I5",
            "attempts": 3,
            "answerText": "",
            "createdAt": "2025-10-29T23:58:08.324452+00:00",
            "updatedAt": "2025-10-29T23:58:08.324458+00:00",
            "answer": {
              "id": "QXNzZXNzbWVudEFuc3dlcjozMDY0NWRjZi03MmJhLTQ3ZDMtYjgyZS0wMWFmOWY2YmZhM2Y=",
              "text": "I have trouble falling asleep"
            },
            "question": {
              "id": "QXNzZXNzbWVudFF1ZXN0aW9uOjFlMDgzOWM4LWRkMTctNDllZi04ZGQyLTRjNGJmNTgwMmE2OQ==",
              "text": "How would you describe your sleep most nights?"
            }
          }
        },
        {
          "node": {
            "id": "VXNlckFuc3dlckhpc3Rvcnk6OTE4OWYwNDctMjdhYy00MWQ0LWIyNjQtY2ZjNzQ5ZThlOGQ5",
            "attempts": 3,
            "answerText": "",
            "createdAt": "2025-10-29T23:58:08.324372+00:00",
            "updatedAt": "2025-10-29T23:58:08.324377+00:00",
            "answer": {
              "id": "QXNzZXNzbWVudEFuc3dlcjoxMGYxNGI0NC0yNWIzLTQwY2MtYWFjZi1iNjhmYTk5ZTAwYTQ=",
              "text": "5–7 hours"
            },
            "question": {
              "id": "QXNzZXNzbWVudFF1ZXN0aW9uOjkzNzMzMjA3LTgxMDYtNGRlZS05ZjkyLWNmMjM3ZjMzZWQyZQ==",
              "text": "On average, how many hours do you sleep each night?"
            }
          }
        },
        {
          "node": {
            "id": "VXNlckFuc3dlckhpc3Rvcnk6ZjQ4ZGY3ZDItNTNhNC00OWI2LWEyMjYtZDVkOTUwNjAyZmM5",
            "attempts": 3,
            "answerText": "",
            "createdAt": "2025-10-29T23:58:08.324307+00:00",
            "updatedAt": "2025-10-29T23:58:08.324313+00:00",
            "answer": {
              "id": "QXNzZXNzbWVudEFuc3dlcjo2MDQwODQ0ZC01OWZkLTRjMTktYTA3YS05ZjJmMTRkNDkzOTk=",
              "text": "Between 10:00 p.m. and 12:00 a.m."
            },
            "question": {
              "id": "QXNzZXNzbWVudFF1ZXN0aW9uOmE1Y2Y3NTA0LWUxZDktNDg1MC05NDgyLTM0Y2FhMjA2ZmZlOQ==",
              "text": "What time do you usually go to bed?"
            }
          }
        },
        {
          "node": {
            "id": "VXNlckFuc3dlckhpc3Rvcnk6NTJkM2YyNjgtNWQ2ZC00M2EyLWEzYzAtYjMyZmQxNWY1MWY5",
            "attempts": 3,
            "answerText": "",
            "createdAt": "2025-10-29T23:58:08.324341+00:00",
            "updatedAt": "2025-10-29T23:58:08.324346+00:00",
            "answer": {
              "id": "QXNzZXNzbWVudEFuc3dlcjo5OTA0YzVhNC1iOGU3LTQ1MTEtOWQ5Yi1hMThlNzY0ZDViMWE=",
              "text": "8:00–9:59"
            },
            "question": {
              "id": "QXNzZXNzbWVudFF1ZXN0aW9uOmMzNmNhNTg5LTQ0NTMtNGEwNS04NWNhLTA5ODY0N2JjZTVkMg==",
              "text": "What time do you usually wake up?"
            }
          }
        },
        {
          "node": {
            "id": "VXNlckFuc3dlckhpc3Rvcnk6NmQxOWMxMmYtNDFjNS00NjFmLThlMjAtZDBkNDY2MjAzOTI5",
            "attempts": 3,
            "answerText": "",
            "createdAt": "2025-10-29T23:58:08.324403+00:00",
            "updatedAt": "2025-10-29T23:58:08.324407+00:00",
            "answer": {
              "id": "QXNzZXNzbWVudEFuc3dlcjo4M2M2ZGFlNS0zZWYwLTQ4OTQtYTdhNy1mYzgwZDI1MzdjOWY=",
              "text": "2–3 hours before"
            },
            "question": {
              "id": "QXNzZXNzbWVudFF1ZXN0aW9uOmNjMmU0NTUzLTkyM2MtNDNkOC1iMjY4LWI1NTZlYzBkZDk2MQ==",
              "text": "How long before sleeping do you usually have your last meal?"
            }
          }
        },
        {
          "node": {
            "id": "VXNlckFuc3dlckhpc3Rvcnk6ZjYzZjAwODMtZWIxZS00ZjNhLTg2NmQtZWIxOGI1ZWMyOGM5",
            "attempts": 3,
            "answerText": "",
            "createdAt": "2025-10-29T23:58:08.324254+00:00",
            "updatedAt": "2025-10-29T23:58:08.324275+00:00",
            "answer": {
              "id": "QXNzZXNzbWVudEFuc3dlcjpmNzMwNzQzNC0xMGRhLTQ2MmQtOWQ0MC1lYjlmNjMyNTBkN2Q=",
              "text": "Some nights"
            },
            "question": {
              "id": "QXNzZXNzbWVudFF1ZXN0aW9uOmQyN2FhNWRiLTA4ODgtNDRhMC1iODNlLTMxZTgwMGFiMjhjOQ==",
              "text": "Do you use your phone, TV, or computer in bed before sleeping?"
            }
          }
        },
        {
          "node": {
            "id": "VXNlckFuc3dlckhpc3Rvcnk6MDUwOGY3ZDMtMDg1My00YTAzLWI2YWEtMDIyYzcyNmQ3NTFl",
            "attempts": 2,
            "answerText": "",
            "createdAt": "2025-10-29T23:56:58.665105+00:00",
            "updatedAt": "2025-10-29T23:56:58.665112+00:00",
            "answer": {
              "id": "QXNzZXNzbWVudEFuc3dlcjozMDY0NWRjZi03MmJhLTQ3ZDMtYjgyZS0wMWFmOWY2YmZhM2Y=",
              "text": "I have trouble falling asleep"
            },
            "question": {
              "id": "QXNzZXNzbWVudFF1ZXN0aW9uOjFlMDgzOWM4LWRkMTctNDllZi04ZGQyLTRjNGJmNTgwMmE2OQ==",
              "text": "How would you describe your sleep most nights?"
            }
          }
        },
        {
          "node": {
            "id": "VXNlckFuc3dlckhpc3Rvcnk6N2RlN2Y5ZTMtMTMxMC00Y2MwLWE3ZjQtMWM3MzM0YjRmMmU2",
            "attempts": 2,
            "answerText": "",
            "createdAt": "2025-10-29T23:56:58.665025+00:00",
            "updatedAt": "2025-10-29T23:56:58.665031+00:00",
            "answer": {
              "id": "QXNzZXNzbWVudEFuc3dlcjplYTY3MjhiNC0xNGNhLTQxNDMtYjQ0MS1lNGEyOTQxMzU1NzI=",
              "text": ">9 hours"
            },
            "question": {
              "id": "QXNzZXNzbWVudFF1ZXN0aW9uOjkzNzMzMjA3LTgxMDYtNGRlZS05ZjkyLWNmMjM3ZjMzZWQyZQ==",
              "text": "On average, how many hours do you sleep each night?"
            }
          }
        },
        {
          "node": {
            "id": "VXNlckFuc3dlckhpc3Rvcnk6MzdlOThiZjMtZDIzNy00ZDc5LWIyOTAtZTU3ZjQxYWRhN2I5",
            "attempts": 2,
            "answerText": "",
            "createdAt": "2025-10-29T23:56:58.664944+00:00",
            "updatedAt": "2025-10-29T23:56:58.664951+00:00",
            "answer": {
              "id": "QXNzZXNzbWVudEFuc3dlcjo2MDQwODQ0ZC01OWZkLTRjMTktYTA3YS05ZjJmMTRkNDkzOTk=",
              "text": "Between 10:00 p.m. and 12:00 a.m."
            },
            "question": {
              "id": "QXNzZXNzbWVudFF1ZXN0aW9uOmE1Y2Y3NTA0LWUxZDktNDg1MC05NDgyLTM0Y2FhMjA2ZmZlOQ==",
              "text": "What time do you usually go to bed?"
            }
          }
        },
        {
          "node": {
            "id": "VXNlckFuc3dlckhpc3Rvcnk6YWNmNmY1ZTUtZDRjNi00NThjLTljZmUtOTk4ZDgwMmFmZjll",
            "attempts": 2,
            "answerText": "",
            "createdAt": "2025-10-29T23:56:58.664985+00:00",
            "updatedAt": "2025-10-29T23:56:58.664992+00:00",
            "answer": {
              "id": "QXNzZXNzbWVudEFuc3dlcjo5OTA0YzVhNC1iOGU3LTQ1MTEtOWQ5Yi1hMThlNzY0ZDViMWE=",
              "text": "8:00–9:59"
            },
            "question": {
              "id": "QXNzZXNzbWVudFF1ZXN0aW9uOmMzNmNhNTg5LTQ0NTMtNGEwNS04NWNhLTA5ODY0N2JjZTVkMg==",
              "text": "What time do you usually wake up?"
            }
          }
        },
        {
          "node": {
            "id": "VXNlckFuc3dlckhpc3Rvcnk6MGM2ZWU5NTEtYzkyNy00NTA1LWFkOWItMDcwYzg1NjBiYmFl",
            "attempts": 2,
            "answerText": "",
            "createdAt": "2025-10-29T23:56:58.665065+00:00",
            "updatedAt": "2025-10-29T23:56:58.665071+00:00",
            "answer": {
              "id": "QXNzZXNzbWVudEFuc3dlcjphNmRlNDA1Zi0zYjNkLTRlYzYtYjY3YS1lYzFlNWM4N2YyNTY=",
              "text": "Varies a lot"
            },
            "question": {
              "id": "QXNzZXNzbWVudFF1ZXN0aW9uOmNjMmU0NTUzLTkyM2MtNDNkOC1iMjY4LWI1NTZlYzBkZDk2MQ==",
              "text": "How long before sleeping do you usually have your last meal?"
            }
          }
        },
        {
          "node": {
            "id": "VXNlckFuc3dlckhpc3Rvcnk6MTNhNTliYzItNWY1Mi00NjcyLTkwYzUtMTI4N2UxNTc4YmI5",
            "attempts": 2,
            "answerText": "",
            "createdAt": "2025-10-29T23:56:58.664886+00:00",
            "updatedAt": "2025-10-29T23:56:58.664906+00:00",
            "answer": {
              "id": "QXNzZXNzbWVudEFuc3dlcjowYTg3MDhiMS1iMTBhLTQwYjAtOTczOS00ZWZhZTMzZDE4MjE=",
              "text": "Every night"
            },
            "question": {
              "id": "QXNzZXNzbWVudFF1ZXN0aW9uOmQyN2FhNWRiLTA4ODgtNDRhMC1iODNlLTMxZTgwMGFiMjhjOQ==",
              "text": "Do you use your phone, TV, or computer in bed before sleeping?"
            }
          }
        }
      ]
    }
  }
}
```

{% endtab %}
{% endtabs %}


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## Querying This Documentation
If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter, and the optional `goal` query parameter:

```
GET https://docs.suggestic.com/graphql/query/queries/assessments/user-assessment-history.md?ask=<question>&goal=<endgoal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is optional and describes the broader end goal you are ultimately trying to accomplish on behalf of the user. GitBook uses it to tailor the answer towards what is most useful for that goal.

The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
