Get a form with its questions
GET/api/public/forms/{formId}
Get one form including its full question set. Questions are grouped into steps: each entry of steps[] has a title and a fields[] array, and each field carries its label, fieldType, whether it is required, and its options where relevant. This is the endpoint that tells you what a trainee was actually asked; GET /forms only lists metadata.
Authentication
Requires an API key, sent as Authorization: Bearer cp_live_....
API keys carry scopes. Get the catalog of scopes and webhook events lists every scope.
Path parameters
| Name | Type | Description |
|---|---|---|
formIdrequired | string |
Request examples
curl --request GET \
--url 'https://api.coach-platform.com/api/public/forms/<formId>' \
--header 'Authorization: Bearer cp_live_...'const response = await fetch('https://api.coach-platform.com/api/public/forms/<formId>', {
method: 'GET',
headers: {
Authorization: 'Bearer cp_live_...',
},
});
const data = await response.json();Responses
200 OK
Successful response
{
"data": {
"id": "<string>",
"coach": "<string>",
"title": "<string>",
"description": "<string>",
"type": "registration",
"isActive": true,
"registrationOrder": 123,
"openAt": {
"date": "<date-time>",
"recurrence": "weekly",
"openDays": 123
},
"target": "allTrainees",
"targetLabels": [
{
"id": "<string>",
"text": "<string>",
"color": "<string>"
}
],
"createdAt": "<date-time>",
"steps": [
{
"fields": [
{
"id": "<string>",
"label": "<string>",
"fieldType": "<string>",
"isRequired": true,
"placeholder": "<string>",
"options": [
"<string>"
],
"multiple": true
}
]
}
]
}
}Response fields (27)
| Name | Type | Description |
|---|---|---|
data | object | A single form including its questions. Questions live under steps[].fields[], not at the top level. |
data.id | string | |
data.coach | string | |
data.title | string | |
data.description | string | |
data.type | string | registration = the join-time intake questionnaire. update = a recurring check-in form. |
data.isActive | boolean | |
data.registrationOrder | integer | Order this form is presented in during registration, when several registration forms exist. |
data.openAt | object | When and how often the form opens for trainees. |
data.openAt.date | string<date-time> | |
data.openAt.recurrence | string | How often the form reopens. |
data.openAt.openDays | integer | How many days the form stays open once it opens. |
data.target | string | Who the form is shown to. byLabels targets trainees carrying at least one of targetLabels. |
data.targetLabels | object[] | Labels this form targets. Only present when target is byLabels. |
data.targetLabels[].id | string | |
data.targetLabels[].text | string | |
data.targetLabels[].color | string | |
data.createdAt | string<date-time> | |
data.steps | object[] | The form’s pages, in order. Each holds the questions asked on that page. |
data.steps[].fields | object[] | |
data.steps[].fields[].id | string | |
data.steps[].fields[].label | string | The question text shown to the trainee. |
data.steps[].fields[].fieldType | string | How the question is answered, e.g. text, textarea, number, date, dropdown, checkbox, rating, slider, file, signature, weight, height, measurements, bodyFat, gender, dateOfBirth, activityLevel. contentBlock is not a question but static copy shown to the trainee. |
data.steps[].fields[].isRequired | boolean | |
data.steps[].fields[].placeholder | string | |
data.steps[].fields[].options | string[] | Selectable values, for dropdown and similar field types. |
data.steps[].fields[].multiple | boolean |
Error responses
400Bad Request401Unauthorized403Forbidden404Not Found409Conflict429Too Many Requests500Internal Server Error
These statuses share the same response body.
{
"error": {
"code": "<string>",
"message": "<string>",
"fix": "<string>",
"details": {},
"retryAfterMs": 123
}
}Error fields (6)
| Name | Type | Description |
|---|---|---|
error | object | |
error.code | string | |
error.message | string | |
error.fix | string | null | |
error.details | object | null | |
error.retryAfterMs | number | null |
More Forms endpoints
This page is also available as Markdown. Browse it in the interactive explorer or download the OpenAPI spec.