Getting Started
Note Styles
Audio Transcriptions
Macros
Schemas
Utils
Transform Text to JSON
Transforms unstructured text into structured JSON according to a provided schema. This utility endpoint extracts specific data patterns from free-form content.
POST
/
v1
/
utils
/
text-to-json
curl --request POST \
--url https://api.sully.ai/v1/utils/text-to-json \
--header 'Content-Type: application/json' \
--header 'X-ACCOUNT-ID: <api-key>' \
--header 'X-API-KEY: <api-key>' \
--data '{
"text": "Patient is a 45-year-old male presenting with chest pain...",
"schema": {
"type": "object",
"properties": {
"patientInfo": {
"type": "object",
"properties": {
"age": {
"type": "number"
},
"gender": {
"type": "string"
},
"allergies": {
"type": [
"array",
"null"
],
"items": {
"type": "string"
}
}
},
"required": [
"age",
"gender",
"allergies"
]
},
"symptoms": {
"type": "array",
"items": {
"type": "string"
}
},
"diagnosis": {
"type": "array",
"items": {
"type": "string"
}
},
"severityLevel": {
"type": "string",
"enum": [
"mild",
"moderate",
"severe",
"critical"
]
},
"notes": {
"type": [
"string",
"null"
],
"description": "Optional clinical notes that might be null"
}
},
"required": [
"patientInfo",
"symptoms",
"diagnosis",
"severityLevel",
"notes"
]
}
}'
{
"data": {
"patientInfo": {
"age": 45,
"gender": "male",
"allergies": null
},
"symptoms": [
"chest pain"
],
"diagnosis": [],
"severityLevel": "moderate",
"notes": null
}
}
Body
application/json
Text and schema for transformation
Request payload for transforming unstructured text into structured JSON
Response
200
application/json
JSON data extracted from text
Response containing the structured JSON data extracted from text
curl --request POST \
--url https://api.sully.ai/v1/utils/text-to-json \
--header 'Content-Type: application/json' \
--header 'X-ACCOUNT-ID: <api-key>' \
--header 'X-API-KEY: <api-key>' \
--data '{
"text": "Patient is a 45-year-old male presenting with chest pain...",
"schema": {
"type": "object",
"properties": {
"patientInfo": {
"type": "object",
"properties": {
"age": {
"type": "number"
},
"gender": {
"type": "string"
},
"allergies": {
"type": [
"array",
"null"
],
"items": {
"type": "string"
}
}
},
"required": [
"age",
"gender",
"allergies"
]
},
"symptoms": {
"type": "array",
"items": {
"type": "string"
}
},
"diagnosis": {
"type": "array",
"items": {
"type": "string"
}
},
"severityLevel": {
"type": "string",
"enum": [
"mild",
"moderate",
"severe",
"critical"
]
},
"notes": {
"type": [
"string",
"null"
],
"description": "Optional clinical notes that might be null"
}
},
"required": [
"patientInfo",
"symptoms",
"diagnosis",
"severityLevel",
"notes"
]
}
}'
{
"data": {
"patientInfo": {
"age": 45,
"gender": "male",
"allergies": null
},
"symptoms": [
"chest pain"
],
"diagnosis": [],
"severityLevel": "moderate",
"notes": null
}
}
Assistant
Responses are generated using AI and may contain mistakes.