GEThttps://core-api.heysadie.ai/turn-flags/calls/{callId}/lines
callId success data messageIndex role text audio startSeconds endSeconds flaggable notFlaggableReason flag id kind recording channels durationSeconds liveTranscriber name metadata timestamp version path error code message details fieldList a call's lines for flagging
Every caller and assistant line of a call, by `messageIndex`, with whether each can be flagged, why not, and the turn already on it. Call it to render a call transcript in flagging mode. - Offer a flag action on lines with `flaggable: true` and send their `messageIndex` to POST /turn-flags. - `flag` marks a line already flagged, or sampled as a control; edit it with PATCH /turn-flags/:id. - `liveTranscriber` is the transcriber the call ran on, whose text a flag scores as production. When it or `recording` is null, no line is flaggable. - To play a line, fetch GET /turn-flags/calls/:callId/recording-url. Errors: 404 RESOURCE_NOT_FOUND when the call is not in the organization.
Try it in the API ExplorerExample request
curl "https://core-api.heysadie.ai/turn-flags/calls/CALL_ID/lines" \
-H "Authorization: ApiKey YOUR_API_KEY"Authentication
Authenticate with an API key in the Authorization header using the ApiKey scheme. See Authentication for how keys work and where to get them.
AuthorizationstringrequiredAPI key in the ApiKey scheme: ApiKey YOUR_API_KEY. Tenant keys authorize their own tenant; organization keys can act on any tenant in the organization.
X-Tenant-Idstring (uuid)optionalRequired when authenticating with an organization key: it selects the tenant the request acts on. Omit with tenant keys.
Request
Path parameters
callIdstringrequiredA call of the organization
Responses
successbooleanrequiredtrue on every 2xx
dataobjectoptionalThe result
Show 3 child properties
dataobject[]requiredEvery caller and assistant line of the call's messages, by index. Empty once retention scrubs them (90 days)
Show 7 item properties
messageIndexstring (integer) | integerrequiredIndex in the call's messages. Send it to POST /turn-flags
roleenumrequireduser: the caller. bot: the assistant. Only caller lines can be flagged
"user""bot"textstringrequiredWhat the live transcriber wrote, or what the assistant said
audioobject | nullrequiredThe line's place in the recording. Null when the call stored none for it
Show 2 child properties
startSecondsnumberrequiredWhere the line starts, in seconds from the recording start
endSecondsnumberrequiredWhere the line ends, in seconds from the recording start
flaggablebooleanrequiredWhether POST /turn-flags accepts this line
notFlaggableReasonenum | nullrequiredNull when flaggable. Why a line cannot be flagged, the first that holds of: not_caller_line (an assistant line), no_recording (the call has no recording), transcriber_unknown (the call records no transcriber and its cost breakdown names none uniquely, so there is no live transcriber to score against), no_audio_bounds (the line has no start and end in the recording)
"not_caller_line""no_audio_bounds""no_recording""transcriber_unknown"flagobject | nullrequiredThe live turn on the line: its flag, else a control sampled on it. Null when none
Show 2 child properties
idstringrequiredThe turn's id, for PATCH or DELETE /turn-flags/:id
kindenumrequiredflagged: a person flagged the line. control: the system sampled it as a control for a flag on the same call
"flagged""control"recordingobject | nullrequiredThe call's recording. Null when it has none, and then no line is flaggable
Show 2 child properties
channelsenumrequiredstereo: agent left, caller right. mono: both mixed
"stereo""mono"durationSecondsnumber | nullrequiredThe call's length in seconds. Null when unknown
liveTranscriberobject | nullrequiredThe transcriber the call ran on: the one recorded on the call, else the only live catalogue row whose name equals the STT name in the call's cost breakdown. A flag scores this transcriber's stored text as production. Null when neither names one, and then no line is flaggable
Show 2 child properties
idstringrequiredTranscriber id, as GET /transcribers lists it
namestringrequiredThe transcriber's display name
metadataobjectoptionalRequest metadata
Show 3 child properties
timestampstringrequiredWhen the server answered, ISO 8601 UTC
versionstringrequiredAPI version
pathstringoptionalThe URL that was requested
400VALIDATION_ERROR: a path id, query parameter or body field broke a rule; `details` lists each `field` and its `message`. A body with a missing field or a JSON type the schema does not allow answers 400 with code INTERNAL_SERVER_ERROR and no `details` instead, so branch on the status
successbooleanrequiredfalse on every error
errorobjectoptionalWhat went wrong: a stable `code` to branch on and a human-readable `message`
Show 3 child properties
codeenumrequiredA parameter or body field broke a rule
"VALIDATION_ERROR"messagestringrequiredHuman-readable explanation. Do not parse it; branch on `code`
detailsobject[]optionalOne entry per field that failed
Show 2 item properties
fieldstringrequiredThe offending field
messagestringrequiredThe rule it broke
metadataobjectoptionalRequest metadata
Show 3 child properties
timestampstringrequiredWhen the server answered, ISO 8601 UTC
versionstringrequiredAPI version
pathstringoptionalThe URL that was requested
401UNAUTHORIZED: no valid credentials, or a dashboard token that names no organization. Send `Authorization: ApiKey <organization API key>`
successbooleanrequiredfalse on every error
errorobjectoptionalWhat went wrong: a stable `code` to branch on and a human-readable `message`
Show 2 child properties
codeenumrequiredNo valid credentials
"UNAUTHORIZED"messagestringrequiredHuman-readable explanation. Do not parse it; branch on `code`
metadataobjectoptionalRequest metadata
Show 3 child properties
timestampstringrequiredWhen the server answered, ISO 8601 UTC
versionstringrequiredAPI version
pathstringoptionalThe URL that was requested
403ORG_SCOPE_REQUIRED: transcriber testing is an organization feature. Use an organization API key without `X-Tenant-Id`, or a dashboard token scoped to the organization. A tenant API key, an organization key sent with `X-Tenant-Id` for one of its tenants, or a token carrying a tenant gets this 403. FORBIDDEN: an organization key sent `X-Tenant-Id` for a tenant outside its organization
successbooleanrequiredfalse on every error
errorobjectoptionalWhat went wrong: a stable `code` to branch on and a human-readable `message`
Show 2 child properties
codeenumrequiredORG_SCOPE_REQUIRED: the credentials carry a tenant scope. FORBIDDEN: an organization key sent `X-Tenant-Id` for a tenant outside its organization
"ORG_SCOPE_REQUIRED""FORBIDDEN"messagestringrequiredHuman-readable explanation. Do not parse it; branch on `code`
metadataobjectoptionalRequest metadata
Show 3 child properties
timestampstringrequiredWhen the server answered, ISO 8601 UTC
versionstringrequiredAPI version
pathstringoptionalThe URL that was requested
404RESOURCE_NOT_FOUND: an id in the path, query or body names nothing in the caller's organization. `message` names what, e.g. "Transcriber bank not found"
successbooleanrequiredfalse on every error
errorobjectoptionalWhat went wrong: a stable `code` to branch on and a human-readable `message`
Show 2 child properties
codeenumrequiredAn id names nothing the caller can see
"RESOURCE_NOT_FOUND"messagestringrequiredHuman-readable explanation. Do not parse it; branch on `code`
metadataobjectoptionalRequest metadata
Show 3 child properties
timestampstringrequiredWhen the server answered, ISO 8601 UTC
versionstringrequiredAPI version
pathstringoptionalThe URL that was requested
500An unexpected server error
successbooleanrequiredfalse on every error
errorobjectoptionalWhat went wrong: a stable `code` to branch on and a human-readable `message`
Show 2 child properties
codeenumrequiredAn unexpected server failure
"INTERNAL_SERVER_ERROR"messagestringrequiredHuman-readable explanation. Do not parse it; branch on `code`
metadataobjectoptionalRequest metadata
Show 3 child properties
timestampstringrequiredWhen the server answered, ISO 8601 UTC
versionstringrequiredAPI version
pathstringoptionalThe URL that was requested