Text

Update Text Note

PARAMETERS

If you want to update your customer unique medicalId key then you can pass as a string.

The difference between rawText and text

text: Text is an HTML field to display content on the editor. It helps users to identify bold, italic or any other editor functionality.

Important: If you don't have HTML editor in your application then you can pass normal text content.

rawText: This helps Speak Ai to analyze text notes.

remark: If you want to pass any remarks from the user to display on Speak and also in your application.

medicalId: String, // optional
name: String, // required,
description: string, // optional
tags: [], // optional
text: "HTML content", // see below
rawText: "raw text content", // see below
remark: "string", // optional

Request rules. The mediaId in the path is required and must belong to a note in your workspace that is not deleted. If it does not, you get a 404 before the controller runs. Body validation happens first, so a bad body returns a 400 before that check.

Nothing in the body is unconditionally required, but any property not listed below is rejected with a 400, so do not send extra keys.

Updating the note's text is an all-or-nothing operation, everything else is a partial update. Omit rawText entirely and the note's text, rawText, sentiment, and word/character counts are left completely unchanged — nothing else in the request affects them. If you include rawText at all (even as an empty string), this endpoint replaces rather than patches the text content: an empty or wordless rawText clears both rawText and text on the note and empties its stored sentiment. So: to update the note's text, always send the complete text and rawText you want to keep together in the same request; to update anything else (name, description, tags, remark, status, manageBy) without touching the note's content, leave rawText out entirely.

description, manageBy, remark, status and createdAt are only written when you send a value that is not empty. Sending an empty string for any of them leaves the current value in place instead of clearing it. tags behaves differently: an empty string leaves the current tags alone, but an empty array is written and clears them.

Omitting name leaves the stored title unchanged.

Set isAutoSave to true for background editor saves. That skips reanalysis and skips the in-app update notification. On a normal save, Speak reanalyzes the note only if it has not been processed before, and a note analyzed webhook is attempted when it does.

put/text/update/{mediaId}

Request

  • Base URL: https://api.speakai.co/v1
  • URL: https://api.speakai.co/v1/text/update/{mediaId}
  • Auth: API key in header x-speakai-key and API key in header x-access-token

Path parameters

mediaIdstring required

Request body

rawTextstring

Replaces the plain text that Speak analyzes. Omit this field entirely and the note's text, rawText, sentiment, and word/character counts are left completely unchanged, regardless of what else is in the request. If you include it at all — even as an empty string, or text with no words in it — this endpoint replaces rather than patches: Speak clears both the analyzed text and the display text on the note and empties its stored sentiment. If you're updating the note's text, always send the complete note body you want to keep. String. Empty string allowed (clears the note). Stored trimmed. The word count derived from this value decides whether text and rawText are stored or cleared, but only when this field is present in the request at all.

textstring

Replaces the display copy of the note, which can contain HTML so an editor keeps bold, italic and other formatting. Only takes effect when rawText is also present in the request — see rawText. If the rawText you send has no words, Speak clears this instead. If the rawText you send has words but you leave text out, the current display copy stays as it is. String. Empty string allowed. Stored trimmed. Cleared whenever the rawText you send has no words.

namestring

Replaces the note title. It also appears in the success message and in the in-app update notification. Leave it out and the current title stays as it is. String. Stored trimmed.

descriptionstring

Replaces the short summary shown alongside the note. An empty string leaves the current summary in place rather than clearing it. String. Empty string allowed but treated as no change. Stored trimmed.

tagsstring[]

Replaces the tags on the note. Send an array of strings. A comma separated string is accepted but is stored as one tag on this endpoint, so use the array form here. Leave it out to keep the existing tags, or send an empty array to remove them all. String or array. Stored as sent. An empty array clears the tags; an empty string is treated as no change.

remarkstring

Replaces the free text remark on the note. An empty string or null leaves the current remark in place rather than clearing it. String. Empty string and null allowed but treated as no change.

status'' | 'pending' | 'progress' | 'completed' | 'pendingPayment'

Sets the status recorded on the note. An empty string leaves the current status in place. String. Empty string allowed but treated as no change. Values outside the listed set are stored as sent but are not recognized anywhere in the product, so stay within the list.

manageBystring

Assigns the note to a user in your workspace, using that user's 24 character id. An empty string leaves the current assignee in place. String. Must be the 24 character id of a user. Empty string allowed but treated as no change. Any other value fails the update and returns a 500.

isAutoSaveboolean

Marks the request as a background save from an editor. Send true and Speak skips reanalyzing the note and skips the in-app update notification, which keeps frequent autosaves cheap. Send false or leave it out for a normal save. Boolean. Defaults to a normal save when absent.

countobject

Overrides the word and character counts stored on the note. Only takes effect when rawText is also present in the request. Send wordCount, characterCount and characterCountWithoutSpace. Leave rawText out and these counts are left unchanged regardless of what you send here; include rawText without this and Speak recounts from the rawText you sent. These numbers do not decide whether the body is kept: only the rawText you send does that. Object. Keys read: wordCount, characterCount, characterCountWithoutSpace, all numbers.

createdAtstring

Changes the creation date recorded on the note. Leave it out to keep the current date. Date. Accepts an ISO 8601 date string or a timestamp. Only written when present.

Response

Success

Changes

No recorded changes to this operation across all 2 revisions of this API.