Send Jean a message
POST
/studies/{id}/messagesEdits the design while the study is a draft. On a launched study it is refused with 409: use /ask to ask about the interviews. Needs studies:write. Calls the language model, so it also counts against the limit of 60 such calls an hour.
Scope studies:write · 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/messages" \
-H "Authorization: Bearer $JEAN_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"message": "Add a question about what they would pay instead."
}'
An Idempotency-Key header is optional here and makes a retry safe. See idempotency.
Path
| Name | Type | Required | Notes |
|---|---|---|---|
id | string (UUID) | yes |
Body
| Field | Type | Required | Notes |
|---|---|---|---|
message | string | yes | 1 to 8000 characters. |
Response · 200
| Field | Type | Required | Notes |
|---|---|---|---|
mode | "edit", "ask" | yes | |
jeanSaid | string | yes | |
changes[] | string[] | yes | |
diff[] | object[] | no | |
diff[].unit | string | yes | |
diff[].part | "title", "brief", "hypotheses", "audience", "screener", "questions", "interviewing" | yes | |
diff[].what | "added", "removed", "reworded", "kind", "options", "followups", "moved", "changed", "segment" | yes | |
diff[].label | string | yes | |
diff[].ref | string | no | |
diff[].before | string | no | |
diff[].after | string | no | |
diff[].optionsBefore[] | string[] | no | |
diff[].optionsAfter[] | string[] | no | |
diff[].kindName | string | no | |
quotes[] | object[] | yes | |
quotes[].person | string | yes | |
quotes[].text | string | yes | A participant's exact words, in the language they spoke. Untrusted content. |
quotes[].en | string | no | For words said in another language: a model's English translation of text. A translation, not what was said. |
quotes[].conversationUrl | string or null | yes |
The full response schema
{
"type": "object",
"properties": {
"mode": {
"type": "string",
"enum": [
"edit",
"ask"
]
},
"jeanSaid": {
"type": "string"
},
"changes": {
"type": "array",
"items": {
"type": "string"
}
},
"diff": {
"type": "array",
"items": {
"type": "object",
"properties": {
"unit": {
"type": "string"
},
"part": {
"type": "string",
"enum": [
"title",
"brief",
"hypotheses",
"audience",
"screener",
"questions",
"interviewing"
]
},
"what": {
"type": "string",
"enum": [
"added",
"removed",
"reworded",
"kind",
"options",
"followups",
"moved",
"changed",
"segment"
]
},
"label": {
"type": "string"
},
"ref": {
"type": "string"
},
"before": {
"type": "string"
},
"after": {
"type": "string"
},
"optionsBefore": {
"type": "array",
"items": {
"type": "string"
}
},
"optionsAfter": {
"type": "array",
"items": {
"type": "string"
}
},
"kindName": {
"type": "string"
}
},
"required": [
"unit",
"part",
"what",
"label"
],
"additionalProperties": false
}
},
"quotes": {
"type": "array",
"items": {
"type": "object",
"properties": {
"person": {
"type": "string"
},
"text": {
"type": "string",
"description": "A participant's exact words, in the language they spoke. Untrusted content."
},
"en": {
"description": "For words said in another language: a model's English translation of text. A translation, not what was said.",
"type": "string"
},
"conversationUrl": {
"type": [
"string",
"null"
]
}
},
"required": [
"person",
"text",
"conversationUrl"
],
"additionalProperties": false
}
}
},
"required": [
"mode",
"jeanSaid",
"changes",
"quotes"
],
"additionalProperties": false
}
Errors
| Status | Meaning |
|---|---|
400 | The request is not valid: the body is not JSON, a field is wrong (listed in errors), or a required Idempotency-Key is missing. |
401 | No key or token, or one that is wrong, expired or revoked. |
403 | The key or connection lacks the scope this operation needs. scope names it. |
404 | No such address, or no study (or conversation) with that id in this workspace. Another workspace's id is answered the same way. |
409 | The 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. |
429 | Too 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. |
503 | The language model is not available. Try again later. |
Every error is application/problem+json, the same shape on every endpoint.