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.
quality.form.archiveFormTemplate
Section titled “quality.form.archiveFormTemplate”Retire a form template
POST /rpc/v1/quality.form.archiveFormTemplateArchives 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.
Request
Section titled “Request”| Field | Type | Required | Description |
|---|---|---|---|
id |
string | yes |
Example
Section titled “Example”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 '{}'quality.form.getFormTemplate
Section titled “quality.form.getFormTemplate”Get a form template
POST /rpc/v1/quality.form.getFormTemplateAlso 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.
Request
Section titled “Request”| Field | Type | Required | Description |
|---|---|---|---|
id |
string | yes |
Example
Section titled “Example”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 '{}'quality.form.listFormTemplates
Section titled “quality.form.listFormTemplates”List form templates
POST /rpc/v1/quality.form.listFormTemplatesAlso 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.
Request
Section titled “Request”| Field | Type | Required | Description |
|---|---|---|---|
filter |
object | no | |
page |
object | no |
Example
Section titled “Example”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 '{}'quality.form.saveFormTemplate
Section titled “quality.form.saveFormTemplate”Publish a form template
POST /rpc/v1/quality.form.saveFormTemplatePublishes 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.
Request
Section titled “Request”| 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 |
Example
Section titled “Example”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 '{}'