Skip to content

Update an item

PATCH
/api/v1/questionnaires/{questionnaire_id}/questionnaire_items/{id}

aasm_state accepts only needs_input, auto_answered and approved; any other value is dropped silently and the rest of the update still applies. Supplying answer on an item with no answering user records the caller as that user.

NameType
questionnaire_id
required
string
Example
qu_1a2b

The questionnaire’s prefixed ID

id
required
string

The record’s prefixed ID

Media typeapplication/json
object
questionnaire_item
required
object
question
string
answer
string
rationale
string
guidance
string
applicable
boolean
category
string
sub_category
string
aasm_state
string
Allowed values: needs_input auto_answered approved

Other values are dropped silently

auto_answer
boolean
boolean_answer
string
Allowed values: yes no na
priority
integer
>= 1 <= 5
portal_markup
string

200

The updated item

Response body
Media typeapplication/json
object
id
string
web_link
string format: uri
question
string
answer
string | null
rationale
string | null

Why the answer was given

guidance
string | null

Guidance text supplied with the question

explanation
string | null

Markdown explanation of the question; see explain_question

explanation_formatted
string | null

explanation rendered as HTML

applicable
boolean | null
auto_answer
boolean
category
string | null
sub_category
string | null
state
string
Allowed values: new ready_to_answer references_fetched applicability_checked needs_input auto_answered approved
boolean_answer
string | null
Allowed values: yes no na

For yes/no questions

boolean_answer_human
string | null
Allowed values: Yes No N/A
confidence
string | null

0–1, encoded as a decimal string

confidence_as_percent
string | integer

Decimal string; 0 when there is no confidence

confidence_as_words
string
Allowed values: Excellent Very good Good Ok Low
confidence_rationale
string | null
requires_attention
boolean
attention_points
Array<string> | null
priority
integer | null
>= 1 <= 5
portal_markup
string | null

Answer formatted for pasting into a portal

sufficient_context
boolean | null
sufficient_context_response
string | null

Why the knowledge base was insufficient

created_at
string format: date-time
updated_at
string format: date-time
user
One of:

The member who owns or answered a record. id is the numeric database ID.

object
id
integer
name
string
email
string format: email
position
integer | null

1-based position in the questionnaire

total_questions
integer
references
Array<object>

A knowledge base item or source passage retrieved for an answer

object
id
integer

Numeric database ID

reference_type
string
Allowed values: KnowledgeBaseItem Embedding
reference_id
integer

Numeric database ID of the referenced record

relevance_score
number | null
<= 1
relevance_as_words
string
Allowed values: Excellent Very good Good Ok Low
distance
number | null

Vector distance from the question

search_method
string | null
Allowed values: vector keyword hybrid
cited_text
string | null

The passage quoted in the answer, when it was used

created_at
string format: date-time
reference
One of:

Present when reference_type is KnowledgeBaseItem

object
id
string
web_link
string format: uri
question
string
answer
string | null
state
string
Allowed values: new ready_to_answer applicability_checked references_fetched needs_input auto_answered approved

403

Insufficient scope, role, or credits

Response body
Media typeapplication/json
object
error
object
code
string

A stable machine-readable code

message
string
details
Array<string>

Present on validation errors; one entry per failed validation

404

No such record in this account

Response body
Media typeapplication/json
object
error
object
code
string

A stable machine-readable code

message
string
details
Array<string>

Present on validation errors; one entry per failed validation

422

The record could not be saved

Response body
Media typeapplication/json
object
error
object
code
string

A stable machine-readable code

message
string
details
Array<string>

Present on validation errors; one entry per failed validation