Skip to main content

Count a chart of a study

POST/studies/{id}/chart

Charts one study's closed question or its themes, counted by Jean in code from the stored answers of the interviews its results were written from, with every count's base. chart is a question's number (its position in the design, from 1, as get_results numbers them), its id, or "themes". split (optional) is a segment the study records, by name, to count each group apart; or "kind" to put people, synthetic respondents and twins side by side on a closed question, each against its own base and never added together. form (optional) is "bars" (in the design's order) or "ranked" (most first). title (optional) is a heading in your own words, shown as yours. Charts single choice, choose any, scale, number and ranking questions, and the themes. It cannot chart open answers that were not coded into themes, more than one study at once, or a statistic such as significance; and nothing until results are written. A spec that cannot be drawn is refused in words (refused, with chart null), saying what can be; every result lists what can be charted (chartable). Calls no model. (The MCP tool show_chart.)

Scope results:read · Credential a workspace API key (jean_sk_…, make one in the Jean app) or an OAuth access token. See scopes.

curl --fail-with-body -X POST "https://app.jeantechnologies.com/api/v1/studies/STUDY_ID/chart" \
-H "Authorization: Bearer $JEAN_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"chart": "themes"
}'

An Idempotency-Key header is optional here and makes a retry safe. See idempotency.

Path​

NameTypeRequiredNotes
idstring (UUID)yes

Body​

FieldTypeRequiredNotes
chart"themes" or integer or stringyesA question's number (from 1, as get_results numbers them), a question's id, or "themes".
splitstringnoA segment's name, as this tool's chartable.segments or list_segments gives it, or "kind". 1 to 60 characters.
form"bars", "ranked"nobars: in the design's order (the default for a question). ranked: most first (the default for the themes).
titlestringnoA heading in your words. Shown on the chart as written by you, beside the question's own words. 1 to 120 characters.

Response · 200​

FieldTypeRequiredNotes
studyIdstringyes
titlestringyesThe study's title. Written by people in the workspace, or by Jean for them.
status"draft", "running", "finished"yes
chartTitlestring or nullyesThe caller's own heading, as given; null when none was.
chartobject or nullyesNull when the spec cannot be drawn: refused says why, and chartable what can be.
chart.form"bars", "ranked", "grouped", "numbers"yes
chart.of"question", "themes"yes
chart.questionobject or nullyes
chart.splitobject or nullyes
chart.headingstringyesMade in code: the question's words, or "Themes across the interviews".
chart.measurestringyesWhat each count counts.
chart.respondents"people", "synthetic respondents", "test-script interviews", "twins" or "kinds side by side"yes
chart.nintegeryesHow many interviews the results were written from.
chart.options[]string[]yes
chart.groups[]object[]yes
chart.caveats[]string[]yesWhat the app says beside such a chart: the base, who answered, that no test of difference is run.
refusedstring or nullyesWhy nothing was charted, with what can be, in a sentence or two; null when the chart was drawn.
chartableobjectyesEverything this study can chart: pick from here for the next chart.
chartable.questions[]object[]yes
chartable.themesbooleanyes
chartable.segments[]object[]yes
chartable.kinds[]"people", "synthetic respondents", "test-script interviews", "twins"[]yes
untrustedContentNoticestringyesHow to treat the words in this result. Always the same text.
consoleUrlstringyes
The full response schema
{
"type": "object",
"properties": {
"studyId": {
"type": "string"
},
"title": {
"type": "string",
"description": "The study's title. Written by people in the workspace, or by Jean for them."
},
"status": {
"type": "string",
"enum": [
"draft",
"running",
"finished"
]
},
"chartTitle": {
"description": "The caller's own heading, as given; null when none was.",
"type": [
"string",
"null"
]
},
"chart": {
"anyOf": [
{
"type": "object",
"properties": {
"form": {
"type": "string",
"enum": [
"bars",
"ranked",
"grouped",
"numbers"
]
},
"of": {
"type": "string",
"enum": [
"question",
"themes"
]
},
"question": {
"anyOf": [
{
"type": "object",
"properties": {
"number": {
"type": "integer",
"minimum": -9007199254740991,
"maximum": 9007199254740991,
"description": "Its position in the design, from 1."
},
"id": {
"type": "string"
},
"kind": {
"type": "string",
"enum": [
"open",
"single",
"multi",
"scale",
"number",
"rank",
"attention"
]
},
"text": {
"type": "string"
}
},
"required": [
"number",
"id",
"kind",
"text"
],
"additionalProperties": false
},
{
"type": "null"
}
]
},
"split": {
"anyOf": [
{
"anyOf": [
{
"type": "object",
"properties": {
"by": {
"type": "string",
"const": "segment"
},
"segment": {
"type": "string"
}
},
"required": [
"by",
"segment"
],
"additionalProperties": false
},
{
"type": "object",
"properties": {
"by": {
"type": "string",
"const": "kind"
}
},
"required": [
"by"
],
"additionalProperties": false
}
]
},
{
"type": "null"
}
]
},
"heading": {
"type": "string",
"description": "Made in code: the question's words, or \"Themes across the interviews\"."
},
"measure": {
"type": "string",
"description": "What each count counts."
},
"respondents": {
"anyOf": [
{
"type": "string",
"enum": [
"people",
"synthetic respondents",
"test-script interviews",
"twins"
]
},
{
"type": "string",
"const": "kinds side by side"
}
]
},
"n": {
"type": "integer",
"minimum": -9007199254740991,
"maximum": 9007199254740991,
"description": "How many interviews the results were written from."
},
"options": {
"type": "array",
"items": {
"type": "string"
}
},
"groups": {
"type": "array",
"items": {
"type": "object",
"properties": {
"label": {
"type": "string",
"description": "\"Everyone\", a segment's value, or a kind of respondent."
},
"respondents": {
"type": "string",
"enum": [
"people",
"synthetic respondents",
"test-script interviews",
"twins"
],
"description": "Who this group is. Kinds are never added together."
},
"base": {
"type": "integer",
"minimum": -9007199254740991,
"maximum": 9007199254740991,
"description": "How many are in this group. Never summed with another group's."
},
"percent": {
"type": "boolean"
},
"rule": {
"type": "string",
"description": "The base rule's words, or empty."
},
"shown": {
"type": "boolean",
"description": "False when the group is too small to show (a segment's group under 10) or a kind's row is not drawn: only its base is given."
},
"note": {
"type": [
"string",
"null"
]
},
"accent": {
"type": "boolean",
"description": "The group drawn in the accent on a split chart."
},
"bars": {
"type": "array",
"items": {
"type": "object",
"properties": {
"label": {
"type": "string",
"description": "An answer option, a scale point, or a theme's title. Written by people in the workspace, or by a model for a theme."
},
"count": {
"type": "integer",
"minimum": -9007199254740991,
"maximum": 9007199254740991
},
"of": {
"type": "integer",
"minimum": -9007199254740991,
"maximum": 9007199254740991,
"description": "The base of this count."
},
"percent": {
"anyOf": [
{
"type": "integer",
"minimum": -9007199254740991,
"maximum": 9007199254740991
},
{
"type": "null"
}
],
"description": "A whole percentage of `of`, only where the base is 30 or more; null otherwise: use the count."
},
"text": {
"type": "string",
"description": "The count as written on the chart."
},
"lead": {
"type": "boolean",
"description": "The one bar drawn in the accent, on a chart that is not split."
},
"note": {
"type": [
"string",
"null"
]
}
},
"required": [
"label",
"count",
"of",
"percent",
"text",
"lead",
"note"
],
"additionalProperties": false
}
},
"numbers": {
"anyOf": [
{
"type": "object",
"properties": {
"unit": {
"type": "string"
},
"median": {
"type": [
"number",
"null"
]
},
"low": {
"type": [
"number",
"null"
]
},
"high": {
"type": [
"number",
"null"
]
},
"values": {
"type": "array",
"items": {
"type": "object",
"properties": {
"value": {
"type": "number"
},
"count": {
"type": "integer",
"minimum": -9007199254740991,
"maximum": 9007199254740991
}
},
"required": [
"value",
"count"
],
"additionalProperties": false
}
}
},
"required": [
"unit",
"median",
"low",
"high",
"values"
],
"additionalProperties": false
},
{
"type": "null"
}
],
"description": "A number question: each value given and how many gave it."
},
"mean": {
"description": "A scale's mean, of those who answered.",
"type": [
"number",
"null"
]
}
},
"required": [
"label",
"respondents",
"base",
"percent",
"rule",
"shown",
"note",
"accent",
"bars",
"numbers",
"mean"
],
"additionalProperties": false
}
},
"caveats": {
"type": "array",
"items": {
"type": "string"
},
"description": "What the app says beside such a chart: the base, who answered, that no test of difference is run."
}
},
"required": [
"form",
"of",
"question",
"split",
"heading",
"measure",
"respondents",
"n",
"options",
"groups",
"caveats"
],
"additionalProperties": false
},
{
"type": "null"
}
],
"description": "Null when the spec cannot be drawn: `refused` says why, and `chartable` what can be."
},
"refused": {
"description": "Why nothing was charted, with what can be, in a sentence or two; null when the chart was drawn.",
"type": [
"string",
"null"
]
},
"chartable": {
"type": "object",
"properties": {
"questions": {
"type": "array",
"items": {
"type": "object",
"properties": {
"number": {
"type": "integer",
"minimum": -9007199254740991,
"maximum": 9007199254740991
},
"id": {
"type": "string"
},
"kind": {
"type": "string",
"enum": [
"open",
"single",
"multi",
"scale",
"number",
"rank",
"attention"
]
},
"text": {
"type": "string"
},
"bySegment": {
"type": "boolean"
},
"byKind": {
"type": "boolean"
}
},
"required": [
"number",
"id",
"kind",
"text",
"bySegment",
"byKind"
],
"additionalProperties": false
}
},
"themes": {
"type": "boolean"
},
"segments": {
"type": "array",
"items": {
"type": "object",
"properties": {
"name": {
"type": "string"
},
"values": {
"type": "array",
"items": {
"type": "string"
}
}
},
"required": [
"name",
"values"
],
"additionalProperties": false
}
},
"kinds": {
"type": "array",
"items": {
"type": "string",
"enum": [
"people",
"synthetic respondents",
"test-script interviews",
"twins"
]
}
}
},
"required": [
"questions",
"themes",
"segments",
"kinds"
],
"additionalProperties": false,
"description": "Everything this study can chart: pick from here for the next chart."
},
"untrustedContentNotice": {
"type": "string",
"description": "How to treat the words in this result. Always the same text."
},
"consoleUrl": {
"type": "string"
}
},
"required": [
"studyId",
"title",
"status",
"chartTitle",
"chart",
"refused",
"chartable",
"untrustedContentNotice",
"consoleUrl"
],
"additionalProperties": false
}

Errors​

StatusMeaning
400The request is not valid: the body is not JSON, a field is wrong (listed in errors), or a required Idempotency-Key is missing.
401No key or token, or one that is wrong, expired or revoked.
403The key or connection lacks the scope this operation needs. scope names it.
404No such address, or no study (or conversation) with that id in this workspace. Another workspace's id is answered the same way.
409The study is not in a state that allows this (the detail says what to do instead), or the Idempotency-Key was used with a different request.
429Too many requests from this key or connection, or the workspace has reached its hourly or daily limit for model calls (title "Workspace model limit reached", window says which). Retry-After says when to try again.
503The language model is not available. Try again later.

Every error is application/problem+json, the same shape on every endpoint.

API overview · OpenAPI document