TypeScript SDK: Healthcare
The methods of the TypeScript client under Healthcare. The business associate agreement an eligible team signs, and the guardrails it unlocks: protected health information replaced in everything an agent or a system is given, held or refused on the way out, and custom guardrails. Every operation answers 404 until the deployment switches the capability on.
client.inboxes.guardrails.get
client.inboxes.guardrails.get(inboxId: string): Promise<GuardrailSettings>Sends inboxes.guardrails.get: GET /v1/inboxes/{inboxId}/guardrails
The guardrails in force for one inbox (inherited says whether it follows the account's).
Access account: an account-scoped key or a console session; an inbox-scoped key gets 403 forbidden. App tokens are refused.
client.inboxes.guardrails.update
client.inboxes.guardrails.update(inboxId: string, body: UpdateGuardrailPolicy): Promise<GuardrailSettings>Sends inboxes.guardrails.update: PATCH /v1/inboxes/{inboxId}/guardrails
Give an inbox guardrails of its own.
Access account: an account-scoped key or a console session; an inbox-scoped key gets 403 forbidden. App tokens are refused.
client.inboxes.guardrails.reset
client.inboxes.guardrails.reset(inboxId: string): Promise<void>Sends inboxes.guardrails.reset: DELETE /v1/inboxes/{inboxId}/guardrails
Remove the inbox's own guardrails so it follows the account's again.
Access account: an account-scoped key or a console session; an inbox-scoped key gets 403 forbidden. App tokens are refused.
client.messages.original
client.messages.original(messageId: string): Promise<Message>Sends messages.original: GET /v1/messages/{messageId}/original
The message as it arrived, where healthcare guardrails redact every other read (ADR-027). A console session whose member holds phi:read; each read of a message that carries findings is recorded.
Access session: a console session only; an API key gets 403 session_required. App tokens are refused.
client.baa.get
client.baa.get(): Promise<BaaStanding>Sends baa.get: GET /v1/baa
Where the account stands: whether it may sign, whether someone has, and whether guardrails apply.
Access account: an account-scoped key or a console session; an inbox-scoped key gets 403 forbidden. App tokens are refused.
client.baa.document
client.baa.document(): Promise<BaaDocument>Sends baa.document: GET /v1/baa/document
The current text with its version and SHA-256, which a signature names.
Access account: an account-scoped key or a console session; an inbox-scoped key gets 403 forbidden. App tokens are refused.
client.baa.sign
client.baa.sign(body: SignBaa): Promise<BaaStanding>Sends baa.sign: POST /v1/baa/sign
Sign the current text. A console session only: no key and no app signs.
Access session: a console session only; an API key gets 403 session_required. App tokens are refused.
client.baa.terminate
client.baa.terminate(): Promise<BaaStanding>Sends baa.terminate: POST /v1/baa/terminate
End the agreement. Guardrails stop applying at once. A console session only.
Access session: a console session only; an API key gets 403 session_required. App tokens are refused.
client.guardrails.get
client.guardrails.get(): Promise<GuardrailSettings>Sends guardrails.get: GET /v1/guardrails
The account's guardrails, and whether they are in force.
Access account: an account-scoped key or a console session; an inbox-scoped key gets 403 forbidden. App tokens are refused.
client.guardrails.update
client.guardrails.update(body: UpdateGuardrailPolicy): Promise<GuardrailSettings>Sends guardrails.update: PATCH /v1/guardrails
Change single values. Taking protection away needs a session unless allowed.
Access account: an account-scoped key or a console session; an inbox-scoped key gets 403 forbidden. App tokens are refused.
client.guardrails.preview
client.guardrails.preview(body: GuardrailPreviewRequest): Promise<GuardrailPreview>Sends guardrails.preview: POST /v1/guardrails/preview
Run the guardrails, or a draft of them, over a text of your own. Nothing is stored.
Access account: an account-scoped key or a console session; an inbox-scoped key gets 403 forbidden. App tokens are refused.
client.guardrails.rules.list
client.guardrails.rules.list(params: ListGuardrailRulesParams = {}): Promise<GuardrailRuleList>Sends guardrails.rules.list: GET /v1/guardrails/rules
The custom guardrails, oldest first. value is null for a caller that may not change guardrails.
Access account: an account-scoped key or a console session; an inbox-scoped key gets 403 forbidden. App tokens are refused.
client.guardrails.rules.create
client.guardrails.rules.create(body: CreateGuardrailRule): Promise<GuardrailRule>Sends guardrails.rules.create: POST /v1/guardrails/rules
A term or a pattern, with what a match does in each direction. A pattern is a mask, not a regular expression.
Access account: an account-scoped key or a console session; an inbox-scoped key gets 403 forbidden. App tokens are refused.
client.guardrails.rules.update
client.guardrails.rules.update(guardrailId: string, body: UpdateGuardrailRule): Promise<GuardrailRule>Sends guardrails.rules.update: PATCH /v1/guardrails/rules/{guardrailId}
Change its name, its actions or whether it applies. Taking protection away needs a session unless allowed.
Access account: an account-scoped key or a console session; an inbox-scoped key gets 403 forbidden. App tokens are refused.
client.guardrails.rules.delete
client.guardrails.rules.delete(guardrailId: string): Promise<void>Sends guardrails.rules.delete: DELETE /v1/guardrails/rules/{guardrailId}
Remove it. What it matched is no longer redacted, held or refused.
Access account: an account-scoped key or a console session; an inbox-scoped key gets 403 forbidden. App tokens are refused.

