Skip to content

Form templates

The questions a roastery adds to a scoresheet on top of the standard ones. Editing publishes a new version and retires the old, so a sheet filled in last year still reads as it was filled.

4 operations in the quality.form namespace.

Retire a form template

POST /rpc/v1/quality.form.archiveFormTemplate

Archives rather than deletes, and returns it. Scores recorded against it stay readable, which is the whole reason versions exist.

Requires permission quality.form.write and the quality module on the organization’s plan.

Field Type Required Description
id string yes
Terminal window
curl -X POST https://api-staging.roastery.run/rpc/v1/quality.form.archiveFormTemplate \
-H "Authorization: Bearer $ROASTERY_API_KEY" \
-H "X-Roastery-Org: $ORG_ID" \
-H "Content-Type: application/json" \
-d '{}'

Get a form template

POST /rpc/v1/quality.form.getFormTemplate

Also available as GET with a URL-encoded input query parameter, so the response can be HTTP-cached.

Including an archived one. A score recorded against version 2 has to render against version 2, whatever version 5 says.

Requires permission quality.form.read and the quality module on the organization’s plan.

Field Type Required Description
id string yes
Terminal window
curl -X POST https://api-staging.roastery.run/rpc/v1/quality.form.getFormTemplate \
-H "Authorization: Bearer $ROASTERY_API_KEY" \
-H "X-Roastery-Org: $ORG_ID" \
-H "Content-Type: application/json" \
-d '{}'

List form templates

POST /rpc/v1/quality.form.listFormTemplates

Also available as GET with a URL-encoded input query parameter, so the response can be HTTP-cached.

Current versions only. Superseded ones stay readable by id.

Requires permission quality.form.read and the quality module on the organization’s plan.

Field Type Required Description
filter object no
page object no
Terminal window
curl -X POST https://api-staging.roastery.run/rpc/v1/quality.form.listFormTemplates \
-H "Authorization: Bearer $ROASTERY_API_KEY" \
-H "X-Roastery-Org: $ORG_ID" \
-H "Content-Type: application/json" \
-d '{}'

Publish a form template

POST /rpc/v1/quality.form.saveFormTemplate

Publishes a new version and archives the one it supersedes. Field KEYS are the keys in every stored response, so renaming a key orphans the answers already given to it — change the label instead.

Requires permission quality.form.write and the quality module on the organization’s plan.

Field Type Required Description
kind cupping_sheet | green_grading | roast_qc | brew_feedback | sample_intake yes
name string yes
fields object[] yes
id string no
isDefault boolean no
Terminal window
curl -X POST https://api-staging.roastery.run/rpc/v1/quality.form.saveFormTemplate \
-H "Authorization: Bearer $ROASTERY_API_KEY" \
-H "X-Roastery-Org: $ORG_ID" \
-H "Content-Type: application/json" \
-d '{}'