# Questionnaire submissions

> Read a questionnaire a client filled in, such as an intake form, with their answers.

Source: https://hubfit.com/developers/api/questionnaire-submissions


A questionnaire submission is one questionnaire a client filled in, such as an intake form, with their answers. Check-ins, which repeat on a schedule, are separate: see Check-in submissions.

Endpoints:

- `GET /v1/questionnaire-submissions/{submissionId}`: [Get a questionnaire submission](https://hubfit.com/developers/api/questionnaire-submissions#get-questionnaire-submission)

## Questionnaire submission object

### Attributes

- `id` (string): Its unique ID.
- `name` (string): The questionnaire's name, as it was when the client filled it in.
- `client` (object)
  - `id` (string): Its unique ID.
  - `name` (string)
- `submittedAt` (timestamp)
- `answers` (array of objects): One shape per question type, told apart by `type`. `answer` is the answer as text, empty if there's none, as for uploads and signatures. New question types can appear, and one not listed here has `question`, `type` and `answer`.
  - `question` (string)
  - `type` (enum): The kind of question, which decides the other fields. New types can appear. Known values `text`, `number`, `one_to_ten`, `star_rating`, `metric`, `yes_no`, `date`, `multiple_choice`, `progress_photos`, `media`, `signature`.
  - `answer` (string)
  - `value` (number, nullable): The answer as a number, or `null` if it isn't one. Only when `type` is `number`, `one_to_ten`, `star_rating`, `metric`.
  - `unit` (string, nullable): `null` if the metric has no unit. Only when `type` is `metric`.
  - `metricId` (string, nullable): The metric the answer was saved to, for `GET /metrics/{metricId}/entries`. `null` if it wasn't saved, as with a blank answer. Only when `type` is `metric`.
  - `answeredYes` (boolean, nullable): `null` if unanswered. Only when `type` is `yes_no`.
  - `selectedOptions` (array of strings): Only when `type` is `multiple_choice`.
  - `fileCount` (integer): How many files the client uploaded. Only when `type` is `progress_photos`, `media`.
  - `signed` (boolean): Only when `type` is `signature`.

### Example

```json
{
  "id": "6ad6af70a4050c71a4069f72",
  "name": "New client questionnaire",
  "client": {
    "id": "6ad6af41d3199442d31b2743",
    "name": "Jordan Miller"
  },
  "submittedAt": "2026-10-26T14:32:05.000Z",
  "answers": [
    {
      "question": "What went well this week?",
      "type": "text",
      "answer": "Hit every session and slept better."
    },
    {
      "question": "How would you rate your energy, from 1 to 10?",
      "type": "one_to_ten",
      "answer": "8",
      "value": 8
    },
    {
      "question": "Your weight this morning",
      "type": "metric",
      "answer": "182.4",
      "value": 182.4,
      "unit": "lb",
      "metricId": "6ad6af776298037662967079"
    },
    {
      "question": "Did you hit your protein target every day?",
      "type": "yes_no",
      "answer": "Yes",
      "answeredYes": true
    }
  ]
}
```

## Get a questionnaire submission

`GET https://api.hubfit.com/v1/questionnaire-submissions/{submissionId}`

One questionnaire a client filled in, with every answer, such as the one a `questionnaire_submission.created` webhook names. Requires `clients:read`.

### Path parameters

- `submissionId` (string, required): The submission's `id`.

### Returns

The questionnaire submission.

### Example request

cURL:

```bash
curl https://api.hubfit.com/v1/questionnaire-submissions/6ad6af70a4050c71a4069f72 \
  -H "Authorization: Bearer $HUBFIT_API_KEY"
```

Node.js:

```javascript
const response = await fetch("https://api.hubfit.com/v1/questionnaire-submissions/6ad6af70a4050c71a4069f72", {
  headers: {
    Authorization: `Bearer ${process.env.HUBFIT_API_KEY}`,
  },
});

const { data } = await response.json();
```

Python:

```python
import os
import requests

response = requests.get(
    "https://api.hubfit.com/v1/questionnaire-submissions/6ad6af70a4050c71a4069f72",
    headers={"Authorization": f"Bearer {os.environ['HUBFIT_API_KEY']}"},
)

data = response.json()["data"]
```

### Example response (200 OK)

```json
{
  "data": {
    "id": "6ad6af70a4050c71a4069f72",
    "name": "New client questionnaire",
    "client": {
      "id": "6ad6af41d3199442d31b2743",
      "name": "Jordan Miller"
    },
    "submittedAt": "2026-10-26T14:32:05.000Z",
    "answers": [
      {
        "question": "What went well this week?",
        "type": "text",
        "answer": "Hit every session and slept better."
      },
      {
        "question": "How would you rate your energy, from 1 to 10?",
        "type": "one_to_ten",
        "answer": "8",
        "value": 8
      },
      {
        "question": "Your weight this morning",
        "type": "metric",
        "answer": "182.4",
        "value": 182.4,
        "unit": "lb",
        "metricId": "6ad6af776298037662967079"
      },
      {
        "question": "Did you hit your protein target every day?",
        "type": "yes_no",
        "answer": "Yes",
        "answeredYes": true
      }
    ]
  }
}
```

## Webhook events

- `questionnaire_submission.created`: A client submitted a questionnaire. Fetch the submission with `GET /questionnaire-submissions/{id}`.

An event carries the record's `id` and its `clientId`, not the record. See [Webhooks](https://hubfit.com/developers/webhooks).
