Settings
Settings endpoints of the MedHook engine API: 67 operations with parameters, schemas and a curl example for each.
On this page
- List IP allowlist entries
- Add an IP allowlist entry
- Remove an IP allowlist entry
- Read the log export settings
- Change the log export settings
- Clear the saved log export settings
- Export the engine configuration
- Import an engine configuration
- List identity providers
- Create or update an identity provider
- Delete an identity provider
- SAML service provider metadata
- Read the engineer link's branding
- Change the engineer link's branding
- Read the logo
- Upload the logo
- Remove the logo
- Read the workspace's privacy officer
- Set the workspace's privacy officer
- Read the timestamping service the daily audit anchor goes to
- Set the timestamping service the daily audit anchor goes to
- Setup health for this workspace
- Sandbox rules and each workspace's environment
- Change the sandbox rules or a workspace's environment
- Read the single sign-on policy
- Change the single sign-on policy
- Read the Google groups → roles table
- Replace the Google groups → roles table
- Read a Test sign-in report
- Start a Test sign-in with Google Workspace
- Read support access
- Generate a support access command
- Approve a support access grant
- Revoke support access now
- Read the rules for support access grants
- Change the rules for support access grants
- List support grants
- Grant a MedHook support person time-boxed access
- Approve a support grant (second admin)
- Revoke a support grant now
- Read the workspace encryption key status
- Re-encrypt every secret under the current key
- Read AI features & BAA
- Confirm the BAA, or change the AI feature switches and budget
- Open the signed BAA copy
- Confirm the BAA with its signed copy
- List notification channels
- Connect a notification channel
- Disconnect a notification channel
- Slack's Diagnose and Acknowledge buttons
- Send a test to me
- Who hears about what
- Turn routing dots on or off
- My notification preferences
- Change my notification preferences
- Verify my phone number
- Remind people to verify their phone number
- On-call routing
- Change on-call quiet hours
- Send an on-call test
- Backups
- Back up now
- Ask for a point-in-time restore
- Approve a point-in-time restore
- This workspace's own settings
- Change this workspace's time zone, secret reminder, privacy officer or tunnel reach
- Resources MedHook created in the GCP project
- Schemas
IP allowlist, log export and support access.
List IP allowlist entries
get/api/settings/ip-allowlist
The entries, and the caller's own address so a client can warn before locking itself out. An empty list allows every address.
Minimum role: admin.
Auth: Bearer token (how to get one) · Operation: listIpAllowlist
Responses
Example request
curl "$ENGINE_URL/api/settings/ip-allowlist" \
-H "Authorization: Bearer $TOKEN"Add an IP allowlist entry
post/api/settings/ip-allowlist
Adds an IPv4 address or CIDR range. A duplicate is a 409. Rate limited to 30 requests per minute.
Minimum role: admin.
Auth: Bearer token (how to get one) · Operation: addIpAllowlistEntry
Request body (required)
application/json · object
cidrstringrequiredlabelstring
Responses
- 201Added.
Response fields
application/json · object
entryobject
- 400The request is malformed or fails validation.
application/json · ApiError
- 401No credential, or the token is invalid or expired.
application/json · ApiError
- 409The request conflicts with the current state.
application/json · ApiError
- 429Rate limit exceeded (see the `Retry-After` header), or on the AI routes the daily AI budget is used up.
application/json · ApiError
- 500Unexpected server error.
application/json · ApiError
Example request
curl -X POST "$ENGINE_URL/api/settings/ip-allowlist" \
-H "Authorization: Bearer $TOKEN" \
-H "Content-Type: application/json" \
-d '{
"cidr": "203.0.113.0/24",
"label": "string"
}'Remove an IP allowlist entry
delete/api/settings/ip-allowlist/{id}
Removes one entry.
Minimum role: admin.
Auth: Bearer token (how to get one) · Operation: deleteIpAllowlistEntry
Parameters
| Name | In | Type | Description |
|---|---|---|---|
idrequired | path | string | Entry id. |
Responses
Example request
curl -X DELETE "$ENGINE_URL/api/settings/ip-allowlist/<id>" \
-H "Authorization: Bearer $TOKEN"Read the log export settings
get/api/settings/log-export
The provider and its non-secret settings. Keys and tokens are never returned; a ...Configured flag says whether one is set. saved is false when nothing is saved here; config is then the environment variables' config, which is what the engine runs on.
Minimum role: admin.
Auth: Bearer token (how to get one) · Operation: getLogExportSettings
Responses
Example request
curl "$ENGINE_URL/api/settings/log-export" \
-H "Authorization: Bearer $TOKEN"Change the log export settings
post/api/settings/log-export
Sets the provider (none, datadog, cloudwatch or splunk) and its settings, and applies them at once. Settings you leave out keep their stored value, so a saved credential is not wiped. Credentials are stored encrypted with the engine's master key and are never returned. Unknown fields are refused with 400. Each saved change is audited (field names only). Other engine replicas pick up a saved change within 30 seconds. With test: true it sends one test event straight to the provider using the stored settings merged with this body, and answers 200 when the provider accepted it or 502 {ok: false, error} with a status-only error. A test saves nothing and does not change what the engine is exporting with. splunkHecUrl must be https without a user name or password, datadogSite a Datadog site (datadoghq.com, us5.datadoghq.com, datadoghq.eu, ddog-gov.com, ...) and cloudwatchRegion an AWS region name, or 400. A test to a HEC host that resolves to a loopback, link-local, metadata or private address is refused with 400 before any request; add an on-prem HEC host to SSRF_ALLOWLIST to test it.
Minimum role: admin.
Auth: Bearer token (how to get one) · Operation: setLogExportSettings
Request body (required)
application/json · object
providerstringOne of: "none", "datadog", "cloudwatch", "splunk"
datadogApiKeystringDatadog API key (write-only).
datadogSitestringA Datadog site, e.g. datadoghq.com.
datadogServicestringcloudwatchRegionstringAn AWS region, e.g. us-east-1.
cloudwatchLogGroupstringcloudwatchLogStreamstringawsAccessKeyIdstringAWS access key id (write-only).
awsSecretAccessKeystringAWS secret access key (write-only).
splunkHecUrlstringhttps URL, no user name or password.
splunkTokenstringSplunk HEC token (write-only).
splunkIndexstringsplunkSourcestringtestbooleanSend one test event to this config and report delivery; save nothing.
Responses
- 200Saved, or the test event was delivered.
application/json · object
- 400The request is malformed or fails validation.
application/json · ApiError
- 401No credential, or the token is invalid or expired.
application/json · ApiError
- 500Unexpected server error.
application/json · ApiError
- 502Error.
application/json · ApiError
Example request
curl -X POST "$ENGINE_URL/api/settings/log-export" \
-H "Authorization: Bearer $TOKEN" \
-H "Content-Type: application/json" \
-d '{
"provider": "none",
"datadogApiKey": "string",
"datadogSite": "string",
"datadogService": "string",
"cloudwatchRegion": "string",
"cloudwatchLogGroup": "string",
"cloudwatchLogStream": "string",
"awsAccessKeyId": "string",
"awsSecretAccessKey": "string",
"splunkHecUrl": "string",
"splunkToken": "string",
"splunkIndex": "string",
"splunkSource": "string",
"test": true
}'Clear the saved log export settings
delete/api/settings/log-export
Deletes the settings saved here, credentials included, and applies the environment variables again (LOG_EXPORT_PROVIDER, DATADOG_API_KEY, SPLUNK_HEC_URL, ...) at once and after restarts. Returns the environment config with saved: false. Audited as settings.log_export_cleared when something was cleared. Admin only.
Minimum role: admin.
Auth: Bearer token (how to get one) · Operation: clearLogExportSettings
Responses
- 200Cleared; the environment config now applies.
application/json · object
- 401No credential, or the token is invalid or expired.
application/json · ApiError
- 403The caller's role, license or network address does not allow this. A signed-in person who is not a member of the requested workspace gets code `WORKSPACE_FORBIDDEN`; a viewer asking for message content gets `PHI_FORBIDDEN` (or `PHI_SEARCH_FORBIDDEN` for a search on message content).
application/json · ApiError
- 500Unexpected server error.
application/json · ApiError
Example request
curl -X DELETE "$ENGINE_URL/api/settings/log-export" \
-H "Authorization: Bearer $TOKEN"Export the engine configuration
get/api/settings/config-bundle
One JSON bundle with every workspace, workflow (triggers and every saved version), mapping set, code table, workspace variable, shared library, alert rule and adapter profile shell, every SSO identity provider saved in Settings > Single sign-on (non-secret settings and group-to-role map), and the migration bridge's incumbent connections and parallel-run settings, plus the Google SSO client ID and domains for the record. Never message content, PHI, users, API clients, VPN tunnels, parallel-run messages, capture tokens, correlation keys or secrets (OIDC client secrets, incumbent credentials): each secret is a named $secret:... placeholder listed in secrets. With format=zip (what Settings downloads, G-settings-16) the same bundle comes as a signed .zip: bundle.json plus bundle.json.sig, a detached Ed25519 signature { alg, keyId, publicKey, signature } made with the engine's signing key (derived from its master key). Audited as engine_config.exported (with signed and keyId).
Minimum role: admin.
Auth: Bearer token (how to get one) · Operation: exportEngineConfig
Parameters
| Name | In | Type | Description |
|---|---|---|---|
format | query | string |
|
Responses
- 200The bundle, as a download (JSON, or application/zip).
application/json · object
- 401No credential, or the token is invalid or expired.
application/json · ApiError
- 403The caller's role, license or network address does not allow this. A signed-in person who is not a member of the requested workspace gets code `WORKSPACE_FORBIDDEN`; a viewer asking for message content gets `PHI_FORBIDDEN` (or `PHI_SEARCH_FORBIDDEN` for a search on message content).
application/json · ApiError
- 500Unexpected server error.
application/json · ApiError
Example request
curl "$ENGINE_URL/api/settings/config-bundle" \
-H "Authorization: Bearer $TOKEN"Import an engine configuration
post/api/settings/config-bundle/import
With dryRun: true, returns the plan (create, update, skip or conflict for each record, by id, every secret to re-enter, and warnings) and writes nothing. Without it, applies the plan in one transaction. A record with any field outside the export's columns makes the whole bundle invalid (400, nothing read or written). Any conflict (a name held by another record, a missing workspace, a workflow or trigger failing the save checks) imports nothing and answers 409 with the plan. Secrets are never taken from the bundle: each keeps the record's own value or comes in as a random unset value. Workflows land disabled and undeployed unless the engine already holds the same content. Saved SSO providers land disabled with no client secret, and ssoReview lists each with the groups it maps to admin, to review before turning it on; a provider that was on and changes is turned off and listed in ssoTurnedOff; an import that would turn off the last way any admin signs in is a conflict, and so is a record whose id exists in another workspace (an import never moves records between workspaces), a reference into another workspace (a mapping set's or alert rule's workflow, a step's adapter profile), or a trigger id another workflow holds. Parallel runs land closed with no capture token. Bodies over 50 MB are refused (413). Google SSO (environment) is never imported. Send a signed .zip from the export as zip (base64) instead of bundle: its signature is checked first, and a bundle changed after it was exported is a 400 BUNDLE_TAMPERED (“This bundle was changed after it was exported”), one with no signature 400 BUNDLE_UNSIGNED, and anything else 400 NOT_A_ZIP, before anything is planned. The answer's signature says who signed it: { signed: true, keyId, thisEngine } for a .zip, { signed: false } for a bundle. The signature carries its own public key, so it shows the bundle is unchanged since that key signed it, not which engine exported it; thisEngine is whether the key is this engine's own. Audited as engine_config.import_previewed, engine_config.imported or engine_config.import_refused, with signed and keyId.
Minimum role: admin.
Auth: Bearer token (how to get one) · Operation: importEngineConfig
Request body (required)
application/json · object
bundleobjectA bundle from GET /api/settings/config-bundle.
zipstringA signed bundle .zip from GET /api/settings/config-bundle?format=zip, base64. Instead of bundle.
dryRunbooleanPlan only; write nothing.
Responses
- 200The plan, applied unless dryRun, and who signed the bundle.
Response fields
application/json · object
dryRunbooleanplanobjectThe import plan.
signatureobject3 fields
signedbooleanrequiredkeyIdstringThe signing key's id (a .zip only).
thisEnginebooleanThe key is this engine's own (a .zip only).
- 400The request is malformed or fails validation.
application/json · ApiError
- 401No credential, or the token is invalid or expired.
application/json · ApiError
- 403The caller's role, license or network address does not allow this. A signed-in person who is not a member of the requested workspace gets code `WORKSPACE_FORBIDDEN`; a viewer asking for message content gets `PHI_FORBIDDEN` (or `PHI_SEARCH_FORBIDDEN` for a search on message content).
application/json · ApiError
- 409The request conflicts with the current state.
application/json · ApiError
- 413The body is larger than the limit.
application/json · ApiError
- 500Unexpected server error.
application/json · ApiError
Example request
curl -X POST "$ENGINE_URL/api/settings/config-bundle/import" \
-H "Authorization: Bearer $TOKEN" \
-H "Content-Type: application/json" \
-d '{
"bundle": {},
"zip": "string",
"dryRun": true
}'List identity providers
get/api/settings/sso
Enterprise SSO identity providers: those from the environment (ENGINE_OIDC_*, ENGINE_SAML_*, source: env, read-only) and those saved here (source: settings). Each carries the URLs to register at the IdP (OIDC redirectUri; SAML acsUrl, spEntityId, metadataUrl). Client secrets are never returned; clientSecretConfigured says whether one is set. errors lists providers that are off because their settings don't parse. Admin only.
Minimum role: admin.
Auth: Bearer token (how to get one) · Operation: listSsoProviders
Responses
- 200The providers.
Response fields
application/json · object
providersarray of objecterrorsarray of string
- 401No credential, or the token is invalid or expired.
application/json · ApiError
- 403The caller's role, license or network address does not allow this. A signed-in person who is not a member of the requested workspace gets code `WORKSPACE_FORBIDDEN`; a viewer asking for message content gets `PHI_FORBIDDEN` (or `PHI_SEARCH_FORBIDDEN` for a search on message content).
application/json · ApiError
- 500Unexpected server error.
application/json · ApiError
Example request
curl "$ENGINE_URL/api/settings/sso" \
-H "Authorization: Bearer $TOKEN"Create or update an identity provider
put/api/settings/sso
Saves a generic OIDC (protocol: oidc) or SAML 2.0 (protocol: saml) identity provider. The OIDC client secret is stored encrypted with the engine's master key and is write-only; leave it out on an update to keep the stored one. The id (2-40 lowercase letters, digits or -; not oidc, saml or google) is part of the sign-in URLs and can't change protocol. Invalid settings (unknown role, http issuer, a certificate that doesn't load) are refused with 400 naming the field. Audited as settings.sso_provider_created or settings.sso_provider_updated with field names only, plus enabled: {from, to} when it is turned on or off; turning it on also writes settings.sso_provider_enabled. Admin only.
Minimum role: admin.
Auth: Bearer token (how to get one) · Operation: saveSsoProvider
Request body (required)
application/json · object | object
Responses
- 200Saved.
Response fields
application/json · object
okbooleanproviderobject
- 400The request is malformed or fails validation.
application/json · ApiError
- 401No credential, or the token is invalid or expired.
application/json · ApiError
- 403The caller's role, license or network address does not allow this. A signed-in person who is not a member of the requested workspace gets code `WORKSPACE_FORBIDDEN`; a viewer asking for message content gets `PHI_FORBIDDEN` (or `PHI_SEARCH_FORBIDDEN` for a search on message content).
application/json · ApiError
- 500Unexpected server error.
application/json · ApiError
Example request
curl -X PUT "$ENGINE_URL/api/settings/sso" \
-H "Authorization: Bearer $TOKEN" \
-H "Content-Type: application/json" \
-d '{
"id": "corp",
"protocol": "oidc",
"issuer": "string",
"clientId": "string",
"clientSecret": "string",
"scopes": [
"string"
],
"tokenAuthMethod": "client_secret_basic",
"groupsClaim": "string",
"label": "string",
"enabled": true,
"groupRoles": "string",
"defaultRole": "viewer",
"allowedDomains": [
"string"
],
"requireMfa": true,
"trustEmail": true
}'Delete an identity provider
delete/api/settings/sso
Deletes a saved identity provider. Users who signed in through it stay; they sign in another way. Env providers can't be deleted here. Audited as settings.sso_provider_deleted. Admin only.
Minimum role: admin.
Auth: Bearer token (how to get one) · Operation: deleteSsoProvider
Parameters
| Name | In | Type | Description |
|---|---|---|---|
idrequired | query | string | The provider id. |
Responses
- 200Deleted.
Response fields
application/json · object
okboolean
- 401No credential, or the token is invalid or expired.
application/json · ApiError
- 403The caller's role, license or network address does not allow this. A signed-in person who is not a member of the requested workspace gets code `WORKSPACE_FORBIDDEN`; a viewer asking for message content gets `PHI_FORBIDDEN` (or `PHI_SEARCH_FORBIDDEN` for a search on message content).
application/json · ApiError
- 404Not found in the caller's workspace.
application/json · ApiError
- 500Unexpected server error.
application/json · ApiError
Example request
curl -X DELETE "$ENGINE_URL/api/settings/sso?id=string" \
-H "Authorization: Bearer $TOKEN"SAML service provider metadata
get/api/auth/sso/{provider}/metadata
The SP metadata XML (entity ID, Assertion Consumer Service URL, signed assertions wanted) to upload to the IdP. 404 for an OIDC or unknown provider. Public: it holds no secret.
Auth: None, public route · Operation: getSamlSpMetadata
Parameters
| Name | In | Type | Description |
|---|---|---|---|
providerrequired | path | string | Provider id ( |
Responses
- 200SP metadata.
application/samlmetadata+xml · string
- 404Not found in the caller's workspace.
application/json · ApiError
Example request
curl "$ENGINE_URL/api/auth/sso/<provider>/metadata"Read the engineer link's branding
get/api/settings/branding
The workspace's brand name, colour and whether a logo is set, as the engineer link shows them.
Minimum role: viewer.
Auth: Bearer token (how to get one) · Operation: getWorkspaceBranding
Responses
- 200The branding.
Response fields
application/json · object
brandNamestring | nullrequiredbrandColorstring | nullrequired#rrggbb.
connectHoststring | nullrequiredThe shared link's white-label host: https://{connectHost}/t/{code}. Null: the engine's origin.
hasLogobooleanrequiredlogoHashstring | nullrequiredThe logo's content hash, its ETag. Null without a logo.
updatedAtstring (date-time) | nullrequired
- 401No credential, or the token is invalid or expired.
application/json · ApiError
- 500Unexpected server error.
application/json · ApiError
Example request
curl "$ENGINE_URL/api/settings/branding" \
-H "Authorization: Bearer $TOKEN"Change the engineer link's branding
put/api/settings/branding
brandName is 1 to 60 characters, brandColor is #rrggbb, connectHost a host name for the shared link's short URL. A missing key keeps the stored value; null clears it. Audited as settings.branding_updated.
Minimum role: admin.
Auth: Bearer token (how to get one) · Operation: updateWorkspaceBranding
Request body (required)
application/json · object
brandNamestring | nullbrandColorstring | nullconnectHoststring | nullA bare host name the workspace points at the engine, like connect.example.org (no scheme, port or path).
Responses
- 200The saved branding.
Response fields
application/json · object
brandNamestring | nullrequiredbrandColorstring | nullrequired#rrggbb.
connectHoststring | nullrequiredThe shared link's white-label host: https://{connectHost}/t/{code}. Null: the engine's origin.
hasLogobooleanrequiredlogoHashstring | nullrequiredThe logo's content hash, its ETag. Null without a logo.
updatedAtstring (date-time) | nullrequired
- 400The request is malformed or fails validation.
application/json · ApiError
- 401No credential, or the token is invalid or expired.
application/json · ApiError
- 403The caller's role, license or network address does not allow this. A signed-in person who is not a member of the requested workspace gets code `WORKSPACE_FORBIDDEN`; a viewer asking for message content gets `PHI_FORBIDDEN` (or `PHI_SEARCH_FORBIDDEN` for a search on message content).
application/json · ApiError
- 429Rate limit exceeded (see the `Retry-After` header), or on the AI routes the daily AI budget is used up.
application/json · ApiError
- 500Unexpected server error.
application/json · ApiError
Example request
curl -X PUT "$ENGINE_URL/api/settings/branding" \
-H "Authorization: Bearer $TOKEN" \
-H "Content-Type: application/json" \
-d '{
"brandName": "string",
"brandColor": "string",
"connectHost": "string"
}'Read the logo
get/api/settings/branding/logo
The uploaded logo, served as the image type its bytes are, with its content hash as the ETag and Cache-Control private, no-cache (the browser revalidates; 304 when If-None-Match names it).
Minimum role: viewer.
Auth: Bearer token (how to get one) · Operation: getWorkspaceLogo
Responses
Example request
curl "$ENGINE_URL/api/settings/branding/logo" \
-H "Authorization: Bearer $TOKEN"Upload the logo
post/api/settings/branding/logo
The raw image as the body: PNG, JPEG or WebP, at most 256 KB, and the bytes must be the type the Content-Type claims (SVG is refused). Stored in the database, never under the web root. Audited as settings.branding_logo_updated.
Minimum role: admin.
Auth: Bearer token (how to get one) · Operation: uploadWorkspaceLogo
Request body (required)
image/png · string (binary)
Responses
- 200Saved.
Response fields
application/json · object
hasLogobooleantypestringbytesinteger
- 401No credential, or the token is invalid or expired.
application/json · ApiError
- 403The caller's role, license or network address does not allow this. A signed-in person who is not a member of the requested workspace gets code `WORKSPACE_FORBIDDEN`; a viewer asking for message content gets `PHI_FORBIDDEN` (or `PHI_SEARCH_FORBIDDEN` for a search on message content).
application/json · ApiError
- 413The body is larger than the limit.
application/json · ApiError
- 415The body is not a supported media type.
application/json · ApiError
- 429Rate limit exceeded (see the `Retry-After` header), or on the AI routes the daily AI budget is used up.
application/json · ApiError
- 500Unexpected server error.
application/json · ApiError
Example request
curl -X POST "$ENGINE_URL/api/settings/branding/logo" \
-H "Authorization: Bearer $TOKEN" \
-H "Content-Type: image/png" \
--data-binary @bodyRemove the logo
delete/api/settings/branding/logo
Audited as settings.branding_logo_removed.
Minimum role: admin.
Auth: Bearer token (how to get one) · Operation: deleteWorkspaceLogo
Responses
- 200Removed.
Response fields
application/json · object
hasLogoboolean
- 401No credential, or the token is invalid or expired.
application/json · ApiError
- 403The caller's role, license or network address does not allow this. A signed-in person who is not a member of the requested workspace gets code `WORKSPACE_FORBIDDEN`; a viewer asking for message content gets `PHI_FORBIDDEN` (or `PHI_SEARCH_FORBIDDEN` for a search on message content).
application/json · ApiError
- 429Rate limit exceeded (see the `Retry-After` header), or on the AI routes the daily AI budget is used up.
application/json · ApiError
- 500Unexpected server error.
application/json · ApiError
Example request
curl -X DELETE "$ENGINE_URL/api/settings/branding/logo" \
-H "Authorization: Bearer $TOKEN"Read the workspace's privacy officer
get/api/settings/privacy-officer
The address the monthly HIPAA access report and incident notices go to, or null. Rate limited to 60 requests per minute.
Minimum role: viewer.
Auth: Bearer token (how to get one) · Operation: getPrivacyOfficer
Responses
- 200The address.
Response fields
application/json · object
emailstring | null
- 401No credential, or the token is invalid or expired.
application/json · ApiError
- 403The caller's role, license or network address does not allow this. A signed-in person who is not a member of the requested workspace gets code `WORKSPACE_FORBIDDEN`; a viewer asking for message content gets `PHI_FORBIDDEN` (or `PHI_SEARCH_FORBIDDEN` for a search on message content).
application/json · ApiError
- 429Rate limit exceeded (see the `Retry-After` header), or on the AI routes the daily AI budget is used up.
application/json · ApiError
- 500Unexpected server error.
application/json · ApiError
Example request
curl "$ENGINE_URL/api/settings/privacy-officer" \
-H "Authorization: Bearer $TOKEN"Set the workspace's privacy officer
put/api/settings/privacy-officer
An email address (trimmed, lower-cased, at most 254 characters), or null to clear it: then no HIPAA report or incident notice is emailed. Audited as settings.privacy_officer_updated with the domain only. 404 when the workspace doesn't exist. Rate limited to 20 requests per minute.
Minimum role: admin.
Auth: Bearer token (how to get one) · Operation: setPrivacyOfficer
Request body (required)
application/json · object
emailstring | null
Responses
- 200Saved.
Response fields
application/json · object
emailstring | null
- 400The request is malformed or fails validation.
application/json · ApiError
- 401No credential, or the token is invalid or expired.
application/json · ApiError
- 403The caller's role, license or network address does not allow this. A signed-in person who is not a member of the requested workspace gets code `WORKSPACE_FORBIDDEN`; a viewer asking for message content gets `PHI_FORBIDDEN` (or `PHI_SEARCH_FORBIDDEN` for a search on message content).
application/json · ApiError
- 404Not found in the caller's workspace.
application/json · ApiError
- 429Rate limit exceeded (see the `Retry-After` header), or on the AI routes the daily AI budget is used up.
application/json · ApiError
- 500Unexpected server error.
application/json · ApiError
Example request
curl -X PUT "$ENGINE_URL/api/settings/privacy-officer" \
-H "Authorization: Bearer $TOKEN" \
-H "Content-Type: application/json" \
-d '{
"email": "string"
}'Read the timestamping service the daily audit anchor goes to
get/api/settings/timestamping
The RFC 3161 timestamping service URL: the one saved here (source: saved), else AUDIT_TSA_URL (env), else null. Rate limited to 60 requests per minute.
Minimum role: admin.
Auth: Bearer token (how to get one) · Operation: getTimestampingService
Responses
- 200The service.
Response fields
application/json · object
urlstring | nullsourcestring | nullOne of: "saved", "env"
- 401No credential, or the token is invalid or expired.
application/json · ApiError
- 403The caller's role, license or network address does not allow this. A signed-in person who is not a member of the requested workspace gets code `WORKSPACE_FORBIDDEN`; a viewer asking for message content gets `PHI_FORBIDDEN` (or `PHI_SEARCH_FORBIDDEN` for a search on message content).
application/json · ApiError
- 429Rate limit exceeded (see the `Retry-After` header), or on the AI routes the daily AI budget is used up.
application/json · ApiError
- 500Unexpected server error.
application/json · ApiError
Example request
curl "$ENGINE_URL/api/settings/timestamping" \
-H "Authorization: Bearer $TOKEN"Set the timestamping service the daily audit anchor goes to
put/api/settings/timestamping
Once a day, at 00:00 UTC, the SHA-256 of the audit anchor is sent there as an RFC 3161 TimeStampReq; nothing else leaves the engine. url must be http or https without a user name or password (at most 2048 characters), and a host that resolves to a loopback, link-local, metadata or private address is refused with 400 (add an on-prem service to SSRF_ALLOWLIST). null clears the saved URL, so AUDIT_TSA_URL applies again. Audited as settings.timestamping_updated with the host only. Rate limited to 20 requests per minute.
Minimum role: admin.
Auth: Bearer token (how to get one) · Operation: setTimestampingService
Request body (required)
application/json · object
urlstring | null
Responses
- 200Saved.
Response fields
application/json · object
urlstring | nullsourcestring | nullOne of: "saved", "env"
- 400The request is malformed or fails validation.
application/json · ApiError
- 401No credential, or the token is invalid or expired.
application/json · ApiError
- 403The caller's role, license or network address does not allow this. A signed-in person who is not a member of the requested workspace gets code `WORKSPACE_FORBIDDEN`; a viewer asking for message content gets `PHI_FORBIDDEN` (or `PHI_SEARCH_FORBIDDEN` for a search on message content).
application/json · ApiError
- 429Rate limit exceeded (see the `Retry-After` header), or on the AI routes the daily AI budget is used up.
application/json · ApiError
- 500Unexpected server error.
application/json · ApiError
Example request
curl -X PUT "$ENGINE_URL/api/settings/timestamping" \
-H "Authorization: Bearer $TOKEN" \
-H "Content-Type: application/json" \
-d '{
"url": "string"
}'Setup health for this workspace
get/api/settings/health
The eight checks Settings > Overview shows (sso, mfa, backups, support, alerts, secrets, dirSync, baa), each with ok, a short note and the settings section that fixes it; the score as text ("6/8"); and the rail's attention dots (warn on secrets with overdue rotation or an unsigned BAA, accent on an active support grant). Read from engine users, SSO configuration, the workspace's alert rules and secrets, the support-access audit trail and AI_FEATURES_ENABLED; never message content. Rate limited to 60 requests per minute.
Minimum role: viewer.
Auth: Bearer token (how to get one) · Operation: getSettingsHealth
Responses
- 200The checks and the score.
Response fields
application/json · object
itemsarray of object5 fields
idstringOne of: "sso", "mfa", "backups", "support", "alerts", "secrets", "dirSync", "baa"
labelstringokbooleannotestringsectionstringThe settings tab (
/settings?tab=).
scoreintegertotalintegertextstring"{score}/{total}".
tonestringok at 7 or more, else warn.
One of: "ok", "warn"
dotsobject
- 401No credential, or the token is invalid or expired.
application/json · ApiError
- 403The caller's role, license or network address does not allow this. A signed-in person who is not a member of the requested workspace gets code `WORKSPACE_FORBIDDEN`; a viewer asking for message content gets `PHI_FORBIDDEN` (or `PHI_SEARCH_FORBIDDEN` for a search on message content).
application/json · ApiError
- 429Rate limit exceeded (see the `Retry-After` header), or on the AI routes the daily AI budget is used up.
application/json · ApiError
- 500Unexpected server error.
application/json · ApiError
Example request
curl "$ENGINE_URL/api/settings/health" \
-H "Authorization: Bearer $TOKEN"Sandbox rules and each workspace's environment
get/api/settings/environments
Sandbox and production are workspaces on the same engine. Answers the two engine-wide rules (both on until changed) and each workspace's environment with its connection count. A signed-in non-admin sees only the workspaces they are a member of. Rate limited to 60 requests per minute.
Minimum role: viewer.
Auth: Bearer token (how to get one) · Operation: getEnvironments
Responses
- 200The rules and the workspaces.
Response fields
application/json · object
rulesobjectrequired2 fields
blockRealPhiInSandboxbooleanrequiredA workflow that handles PHI in a sandbox workspace takes MLLP, webhook and manual-execute messages only when their PID-3 MRNs are the bundled samples' or synthetic (
TP-######). Any other message, and every run from a trigger that carries no message to check (batch runs, schedules, child workflows, topics, polling, SFTP, SOAP, JMS, X12, FHIR subscriptions), is refused (PHI_IN_SANDBOX) and audited assandbox.phi_rejectedwith the reason only.requireSandboxRunbooleanrequiredA deploy in a production workspace needs a passing run of the workflow's sandbox copy.
workspacesarray of objectrequired5 fields
idstringnamestringslugstringenvironmentstringOne of: "production", "sandbox"
connectionsintegerAdapter profiles in the workspace.
- 401No credential, or the token is invalid or expired.
application/json · ApiError
- 403The caller's role, license or network address does not allow this. A signed-in person who is not a member of the requested workspace gets code `WORKSPACE_FORBIDDEN`; a viewer asking for message content gets `PHI_FORBIDDEN` (or `PHI_SEARCH_FORBIDDEN` for a search on message content).
application/json · ApiError
- 429Rate limit exceeded (see the `Retry-After` header), or on the AI routes the daily AI budget is used up.
application/json · ApiError
- 500Unexpected server error.
application/json · ApiError
Example request
curl "$ENGINE_URL/api/settings/environments" \
-H "Authorization: Bearer $TOKEN"Change the sandbox rules or a workspace's environment
put/api/settings/environments
Admin only. Any of the two rules and a list of { id, environment } changes, applied in one transaction; an unknown workspace refuses the whole change (400, code UNKNOWN_WORKSPACE). The rule requireSandboxRun applies only while a sandbox workspace exists: then POST /api/workflows/{id}/deploy in a production workspace answers 409 with missing containing sandbox until the workflow's sandbox copy (same promotion key) has a passing run newer than its last save. Audited as settings.environments_updated with before and after (the rules and the sandbox workspace ids). Rate limited to 20 requests per minute.
Minimum role: admin.
Auth: Bearer token (how to get one) · Operation: updateEnvironments
Request body (required)
application/json · object
blockRealPhiInSandboxbooleanrequireSandboxRunbooleanworkspacesarray of object2 fields
idstringrequiredenvironmentstringrequiredOne of: "production", "sandbox"
Responses
- 200The rules and the workspaces after the change.
Response fields
application/json · object
rulesobjectrequired2 fields
blockRealPhiInSandboxbooleanrequiredA workflow that handles PHI in a sandbox workspace takes MLLP, webhook and manual-execute messages only when their PID-3 MRNs are the bundled samples' or synthetic (
TP-######). Any other message, and every run from a trigger that carries no message to check (batch runs, schedules, child workflows, topics, polling, SFTP, SOAP, JMS, X12, FHIR subscriptions), is refused (PHI_IN_SANDBOX) and audited assandbox.phi_rejectedwith the reason only.requireSandboxRunbooleanrequiredA deploy in a production workspace needs a passing run of the workflow's sandbox copy.
workspacesarray of objectrequired5 fields
idstringnamestringslugstringenvironmentstringOne of: "production", "sandbox"
connectionsintegerAdapter profiles in the workspace.
- 400The request is malformed or fails validation.
application/json · ApiError
- 401No credential, or the token is invalid or expired.
application/json · ApiError
- 403The caller's role, license or network address does not allow this. A signed-in person who is not a member of the requested workspace gets code `WORKSPACE_FORBIDDEN`; a viewer asking for message content gets `PHI_FORBIDDEN` (or `PHI_SEARCH_FORBIDDEN` for a search on message content).
application/json · ApiError
- 429Rate limit exceeded (see the `Retry-After` header), or on the AI routes the daily AI budget is used up.
application/json · ApiError
- 500Unexpected server error.
application/json · ApiError
Example request
curl -X PUT "$ENGINE_URL/api/settings/environments" \
-H "Authorization: Bearer $TOKEN" \
-H "Content-Type: application/json" \
-d '{
"blockRealPhiInSandbox": true,
"requireSandboxRun": true,
"workspaces": [
{
"id": "string",
"environment": "production"
}
]
}'Read the single sign-on policy
get/api/settings/sso/policy
Require SSO for everyone, Sync users from Google Workspace and the Google groups → roles map (all off and empty until changed), the newest directory sync's result, and whether Google Workspace sign-in is configured. Rate limited to 60 requests per minute.
Minimum role: admin.
Auth: Bearer token (how to get one) · Operation: getSsoPolicy
Responses
- 200The policy.
Response fields
application/json · object
policyobject3 fields
requireSsobooleandirectorySyncbooleangroupRolesarray of object2 fields
groupstringrequiredA Google group's email address.
rolestringrequiredOne of: "admin", "operator", "viewer"
lastSyncAtstringISO time of the newest directory sync, or null.
lastSyncobject{ ok: true, added, roleChanged, disabled, members }(members per mapped group) or{ ok: false, error }.googleobject2 fields
configuredbooleandomainsarray of string
- 401No credential, or the token is invalid or expired.
application/json · ApiError
- 403The caller's role, license or network address does not allow this. A signed-in person who is not a member of the requested workspace gets code `WORKSPACE_FORBIDDEN`; a viewer asking for message content gets `PHI_FORBIDDEN` (or `PHI_SEARCH_FORBIDDEN` for a search on message content).
application/json · ApiError
- 429Rate limit exceeded (see the `Retry-After` header), or on the AI routes the daily AI budget is used up.
application/json · ApiError
- 500Unexpected server error.
application/json · ApiError
Example request
curl "$ENGINE_URL/api/settings/sso/policy" \
-H "Authorization: Bearer $TOKEN"Change the single sign-on policy
put/api/settings/sso/policy
Admin only. requireSso: true turns password sign-in off for everyone but admins (break-glass); it needs Google Workspace sign-in or an identity provider (400 NO_SSO_METHOD). Turning it off needs confirm: true (400 CONFIRM_REQUIRED). directorySync: true needs Google Workspace sign-in (NO_GOOGLE), GOOGLE_DIRECTORY_ADMIN_EMAIL (DIRECTORY_NOT_CONFIGURED) and at least one group (NO_GROUPS); the job then runs every 15 minutes with the read-only Directory API scope admin.directory.group.member.readonly, adding people, keeping roles in step and disabling people who left every mapped group (never accounts with a password, never the last admin). Audited per change as sso.require_enabled, sso.require_disabled, sso.directory_sync_enabled, sso.directory_sync_disabled or sso.group_role_changed, with before and after. Rate limited to 20 requests per minute.
Minimum role: admin.
Auth: Bearer token (how to get one) · Operation: updateSsoPolicy
Request body (required)
application/json · object
requireSsobooleandirectorySyncbooleangroupRolesarray of object2 fields
groupstringrequiredA Google group's email address.
rolestringrequiredOne of: "admin", "operator", "viewer"
confirmbooleanMust be true to turn Require SSO off.
Responses
- 200The policy after the change.
Response fields
application/json · object
policyobject3 fields
requireSsobooleandirectorySyncbooleangroupRolesarray of object2 fields
groupstringrequiredA Google group's email address.
rolestringrequiredOne of: "admin", "operator", "viewer"
lastSyncAtstringISO time of the newest directory sync, or null.
lastSyncobject{ ok: true, added, roleChanged, disabled, members }(members per mapped group) or{ ok: false, error }.googleobject2 fields
configuredbooleandomainsarray of string
- 400The request is malformed or fails validation.
application/json · ApiError
- 401No credential, or the token is invalid or expired.
application/json · ApiError
- 403The caller's role, license or network address does not allow this. A signed-in person who is not a member of the requested workspace gets code `WORKSPACE_FORBIDDEN`; a viewer asking for message content gets `PHI_FORBIDDEN` (or `PHI_SEARCH_FORBIDDEN` for a search on message content).
application/json · ApiError
- 429Rate limit exceeded (see the `Retry-After` header), or on the AI routes the daily AI budget is used up.
application/json · ApiError
- 500Unexpected server error.
application/json · ApiError
Example request
curl -X PUT "$ENGINE_URL/api/settings/sso/policy" \
-H "Authorization: Bearer $TOKEN" \
-H "Content-Type: application/json" \
-d '{
"requireSso": true,
"directorySync": true,
"groupRoles": [
{
"group": "string",
"role": "admin"
}
],
"confirm": true
}'Read the Google groups → roles table
get/api/settings/sso/groups
Admin. Each mapped Google group with its role and members, the count the last directory sync read (null before one).
Minimum role: admin.
Auth: Bearer token (how to get one) · Operation: getSsoGroupRoles
Responses
- 200The table.
Response fields
application/json · object
groupsarray of object3 fields
groupstringrolestringOne of: "admin", "operator", "viewer"
membersinteger | null
- 401No credential, or the token is invalid or expired.
application/json · ApiError
- 403The caller's role, license or network address does not allow this. A signed-in person who is not a member of the requested workspace gets code `WORKSPACE_FORBIDDEN`; a viewer asking for message content gets `PHI_FORBIDDEN` (or `PHI_SEARCH_FORBIDDEN` for a search on message content).
application/json · ApiError
- 429Rate limit exceeded (see the `Retry-After` header), or on the AI routes the daily AI budget is used up.
application/json · ApiError
- 500Unexpected server error.
application/json · ApiError
Example request
curl "$ENGINE_URL/api/settings/sso/groups" \
-H "Authorization: Bearer $TOKEN"Replace the Google groups → roles table
put/api/settings/sso/groups
Admin. groups replaces the table: each group a Google group email (each once, at most 50), role admin, operator or viewer. With directory sync on, the last group can't be removed (400 NO_GROUPS). A change is audited as sso.group_role_changed with before and after. Rate limited to 20 requests per minute.
Minimum role: admin.
Auth: Bearer token (how to get one) · Operation: putSsoGroupRoles
Request body (required)
application/json · object
groupsarray of objectrequired2 fields
groupstringrequiredA Google group's email address.
rolestringrequiredOne of: "admin", "operator", "viewer"
Responses
- 200The table.
Response fields
application/json · object
groupsarray of object3 fields
groupstringrolestringOne of: "admin", "operator", "viewer"
membersinteger | null
- 400The request is malformed or fails validation.
application/json · ApiError
- 401No credential, or the token is invalid or expired.
application/json · ApiError
- 403The caller's role, license or network address does not allow this. A signed-in person who is not a member of the requested workspace gets code `WORKSPACE_FORBIDDEN`; a viewer asking for message content gets `PHI_FORBIDDEN` (or `PHI_SEARCH_FORBIDDEN` for a search on message content).
application/json · ApiError
- 429Rate limit exceeded (see the `Retry-After` header), or on the AI routes the daily AI budget is used up.
application/json · ApiError
- 500Unexpected server error.
application/json · ApiError
Example request
curl -X PUT "$ENGINE_URL/api/settings/sso/groups" \
-H "Authorization: Bearer $TOKEN" \
-H "Content-Type: application/json" \
-d '{
"groups": [
{
"group": "string",
"role": "admin"
}
]
}'Read a Test sign-in report
get/api/settings/sso/test
The report for id, for the admin who ran it: { status: "waiting" } until Google answers, then { status: "done", at, result } with ok, email, hd (the Workspace domain), groups (the mapped Google groups the account is in, when directory sync is set up), mfa (google: Google enforces it), domain, account (existing, new or disabled), role, or the reason a sign-in would be refused.
Minimum role: admin.
Auth: Bearer token (how to get one) · Operation: getSsoTest
Responses
- 200The report.
application/json · object
- 400The request is malformed or fails validation.
application/json · ApiError
- 401No credential, or the token is invalid or expired.
application/json · ApiError
- 403The caller's role, license or network address does not allow this. A signed-in person who is not a member of the requested workspace gets code `WORKSPACE_FORBIDDEN`; a viewer asking for message content gets `PHI_FORBIDDEN` (or `PHI_SEARCH_FORBIDDEN` for a search on message content).
application/json · ApiError
- 429Rate limit exceeded (see the `Retry-After` header), or on the AI routes the daily AI budget is used up.
application/json · ApiError
Example request
curl "$ENGINE_URL/api/settings/sso/test" \
-H "Authorization: Bearer $TOKEN"Start a Test sign-in with Google Workspace
post/api/settings/sso/test
Admin, signed in. Answers the Google URL to open in a new window (url, also as authUrl), its OAuth state and a test id, and sets the sign-in flow cookie marked as a test. The callback verifies what Google sends as for a real sign-in but signs nobody in and creates no account; it records the report as sso.test_signin, once: a replayed callback for the same test answers 410 SSO_TEST_USED. Audited as sso.test_started. 409 SSO_NOT_CONFIGURED without Google Workspace sign-in. Rate limited to 10 requests per minute.
Minimum role: admin.
Auth: Bearer token (how to get one) · Operation: startSsoTest
Responses
- 200Where to send the window.
Response fields
application/json · object
urlstringauthUrlstringstatestringtestIdstring
- 401No credential, or the token is invalid or expired.
application/json · ApiError
- 403The caller's role, license or network address does not allow this. A signed-in person who is not a member of the requested workspace gets code `WORKSPACE_FORBIDDEN`; a viewer asking for message content gets `PHI_FORBIDDEN` (or `PHI_SEARCH_FORBIDDEN` for a search on message content).
application/json · ApiError
- 409The request conflicts with the current state.
application/json · ApiError
- 429Rate limit exceeded (see the `Retry-After` header), or on the AI routes the daily AI budget is used up.
application/json · ApiError
Example request
curl -X POST "$ENGINE_URL/api/settings/sso/test" \
-H "Authorization: Bearer $TOKEN"Read support access
get/api/settings/support-access
The project's current conditional IAM grants for the support group, who granted the active one and when (grantedBy, grantedAt, grantPhi), the Rules for grants (rules), a grant waiting for a second admin (pending, with canApprove: whether this caller, a signed-in admin other than the requester, may approve it), and the engine's history of grant, request, approval and revoke events. Read-only: the engine never changes IAM.
Minimum role: admin.
Auth: Bearer token (how to get one) · Operation: getSupportAccess
Responses
Example request
curl "$ENGINE_URL/api/settings/support-access" \
-H "Authorization: Bearer $TOKEN"Generate a support access command
post/api/settings/support-access/command
Returns the Terraform command an operator runs in Cloud Shell to grant or revoke support access; the engine does not run it, because it must not raise its own privileges. A grant follows the Rules for grants: no longer than maxDays (400 OVER_MAX_DAYS), phi: true only when allowed (PHI_NOT_ALLOWED) and then with a reason (REASON_REQUIRED). With secondAdmin on, a grant answers 202 { status: "pending", requestId } instead (support_access.grant_requested); another admin approves it at /api/settings/support-access/approve. Generating a command is audited.
Minimum role: admin.
Auth: Bearer token (how to get one) · Operation: createSupportAccessCommand
Request body (required)
application/json · object | object
Responses
- 200The command (202 with a request id when a second admin must approve).
Response fields
application/json · object
actionstringOne of: "grant", "revoke"
commandstringThe terraform command an operator runs in Cloud Shell.
expiresAtstringRFC 3339, or null for a revoke.
daysinteger
- 400The request is malformed or fails validation.
application/json · ApiError
- 401No credential, or the token is invalid or expired.
application/json · ApiError
- 500Unexpected server error.
application/json · ApiError
Example request
curl -X POST "$ENGINE_URL/api/settings/support-access/command" \
-H "Authorization: Bearer $TOKEN" \
-H "Content-Type: application/json" \
-d '{
"action": "grant",
"days": 1,
"phi": true,
"reason": "string"
}'Approve a support access grant
post/api/settings/support-access/approve
A second admin, signed in to the engine, approves a grant request and gets the grant command. A bearer token or an unidentified (dev mode) caller can't approve, nor can anyone approve a request with no named requester (403 SECOND_ADMIN_REQUIRED); the admin who asked can't approve it (403 SAME_ADMIN). Rules for grants are checked again (400 OVER_MAX_DAYS, PHI_NOT_ALLOWED or REASON_REQUIRED). A request is approved once, under a lock on the request (409 ALREADY_DECIDED), within 24 hours (409 EXPIRED). Audited as support_access.grant_approved and support_access.grant_command; accounts a Revoke now disabled are turned back on. Rate limited to 20 requests per minute.
Minimum role: admin.
Auth: Bearer token (how to get one) · Operation: approveSupportAccess
Request body (required)
application/json · object
requestIdstringrequired
Responses
- 200The grant command.
Response fields
application/json · object
actionstringOne of: "grant", "revoke"
commandstringThe terraform command an operator runs in Cloud Shell.
expiresAtstringRFC 3339, or null for a revoke.
daysinteger
- 400The request is malformed or fails validation.
application/json · ApiError
- 401No credential, or the token is invalid or expired.
application/json · ApiError
- 403The caller's role, license or network address does not allow this. A signed-in person who is not a member of the requested workspace gets code `WORKSPACE_FORBIDDEN`; a viewer asking for message content gets `PHI_FORBIDDEN` (or `PHI_SEARCH_FORBIDDEN` for a search on message content).
application/json · ApiError
- 404Not found in the caller's workspace.
application/json · ApiError
- 409The request conflicts with the current state.
application/json · ApiError
- 429Rate limit exceeded (see the `Retry-After` header), or on the AI routes the daily AI budget is used up.
application/json · ApiError
- 503A dependency is not available.
application/json · ApiError
Example request
curl -X POST "$ENGINE_URL/api/settings/support-access/approve" \
-H "Authorization: Bearer $TOKEN" \
-H "Content-Type: application/json" \
-d '{
"requestId": "string"
}'Revoke support access now
post/api/settings/support-access/revoke
Needs confirm: true (400 CONFIRM_REQUIRED). Signs the support group's members out of the engine at once: the group is read through the Directory API (GOOGLE_DIRECTORY_ADMIN_EMAIL), and those members' engine accounts are disabled and their sessions end (never the last active admin). The next grant command or approval turns exactly those accounts back on. When the group can't be read, nobody is signed out and signOutError says why. Answers the revoke command that removes the IAM roles and signedOut, the accounts signed out. Audited as support_access.revoked with the disabled account ids. Rate limited to 20 requests per minute.
Minimum role: admin.
Auth: Bearer token (how to get one) · Operation: revokeSupportAccess
Request body (required)
application/json · object
confirmbooleanrequired
Responses
- 200The revoke command.
Response fields
application/json · object
actionstringOne of: "grant", "revoke"
commandstringThe terraform command an operator runs in Cloud Shell.
expiresAtstringRFC 3339, or null for a revoke.
daysintegersignedOutintegersignOutErrorstring
- 400The request is malformed or fails validation.
application/json · ApiError
- 401No credential, or the token is invalid or expired.
application/json · ApiError
- 403The caller's role, license or network address does not allow this. A signed-in person who is not a member of the requested workspace gets code `WORKSPACE_FORBIDDEN`; a viewer asking for message content gets `PHI_FORBIDDEN` (or `PHI_SEARCH_FORBIDDEN` for a search on message content).
application/json · ApiError
- 429Rate limit exceeded (see the `Retry-After` header), or on the AI routes the daily AI budget is used up.
application/json · ApiError
Example request
curl -X POST "$ENGINE_URL/api/settings/support-access/revoke" \
-H "Authorization: Bearer $TOKEN" \
-H "Content-Type: application/json" \
-d '{
"confirm": true
}'Read the rules for support access grants
get/api/settings/support-access/rules
The longest a grant can last (3 days by default), whether a grant may include PHI access (off) and whether a second admin approves grants (off). Rate limited to 60 requests per minute.
Minimum role: admin.
Auth: Bearer token (how to get one) · Operation: getSupportAccessRules
Responses
- 200The rules.
Response fields
application/json · object
rulesobject3 fields
maxDaysintegerrequiredOne of: 1, 3, 7, 30
allowPhibooleanrequiredsecondAdminbooleanrequired
- 401No credential, or the token is invalid or expired.
application/json · ApiError
- 403The caller's role, license or network address does not allow this. A signed-in person who is not a member of the requested workspace gets code `WORKSPACE_FORBIDDEN`; a viewer asking for message content gets `PHI_FORBIDDEN` (or `PHI_SEARCH_FORBIDDEN` for a search on message content).
application/json · ApiError
- 429Rate limit exceeded (see the `Retry-After` header), or on the AI routes the daily AI budget is used up.
application/json · ApiError
Example request
curl "$ENGINE_URL/api/settings/support-access/rules" \
-H "Authorization: Bearer $TOKEN"Change the rules for support access grants
put/api/settings/support-access/rules
Admin only. Any of the three rules. Audited as support_access.rules_updated with before and after. Rate limited to 20 requests per minute.
Minimum role: admin.
Auth: Bearer token (how to get one) · Operation: updateSupportAccessRules
Request body (required)
application/json · object
maxDaysintegerOne of: 1, 3, 7, 30
allowPhibooleansecondAdminboolean
Responses
- 200The rules after the change.
Response fields
application/json · object
rulesobject3 fields
maxDaysintegerrequiredOne of: 1, 3, 7, 30
allowPhibooleanrequiredsecondAdminbooleanrequired
- 400The request is malformed or fails validation.
application/json · ApiError
- 401No credential, or the token is invalid or expired.
application/json · ApiError
- 403The caller's role, license or network address does not allow this. A signed-in person who is not a member of the requested workspace gets code `WORKSPACE_FORBIDDEN`; a viewer asking for message content gets `PHI_FORBIDDEN` (or `PHI_SEARCH_FORBIDDEN` for a search on message content).
application/json · ApiError
- 429Rate limit exceeded (see the `Retry-After` header), or on the AI routes the daily AI budget is used up.
application/json · ApiError
- 500Unexpected server error.
application/json · ApiError
Example request
curl -X PUT "$ENGINE_URL/api/settings/support-access/rules" \
-H "Authorization: Bearer $TOKEN" \
-H "Content-Type: application/json" \
-d '{
"maxDays": 1,
"allowPhi": true,
"secondAdmin": true
}'List support grants
get/api/settings/support-access/grants
Admin. Active grants (not yet ended) and grants waiting for a second admin. Grants past their end are ended first.
Minimum role: admin.
Auth: Bearer token (how to get one) · Operation: listSupportGrants
Responses
- 200The grants.
Response fields
application/json · object
activearray of object11 fields
idstringemailstringnamestring | nullrolestringOne of: "operator", "viewer"
daysintegerphibooleanstatusstringOne of: "pending", "active", "revoked", "expired"
requestedBystringapprovedBystring | nullgrantedAtstring | nullendsAtstring | null
pendingarray of object11 fields
idstringemailstringnamestring | nullrolestringOne of: "operator", "viewer"
daysintegerphibooleanstatusstringOne of: "pending", "active", "revoked", "expired"
requestedBystringapprovedBystring | nullgrantedAtstring | nullendsAtstring | null
- 401No credential, or the token is invalid or expired.
application/json · ApiError
- 403The caller's role, license or network address does not allow this. A signed-in person who is not a member of the requested workspace gets code `WORKSPACE_FORBIDDEN`; a viewer asking for message content gets `PHI_FORBIDDEN` (or `PHI_SEARCH_FORBIDDEN` for a search on message content).
application/json · ApiError
- 429Rate limit exceeded (see the `Retry-After` header), or on the AI routes the daily AI budget is used up.
application/json · ApiError
- 500Unexpected server error.
application/json · ApiError
Example request
curl "$ENGINE_URL/api/settings/support-access/grants" \
-H "Authorization: Bearer $TOKEN"Grant a MedHook support person time-boxed access
post/api/settings/support-access/grants
Admin. A time-boxed engine-UI grant for one MedHook support person: role operator or viewer, days up to Rules for grants' maxDays (400 TOO_LONG). phi: true needs allowPhi (400 PHI_NOT_ALLOWED), a reason (400 REASON_REQUIRED) and a signed BAA (409 BAA_UNSIGNED), and tells the privacy officer (PHI-free; the reason is never sent). With secondAdmin on the grant is pending until another admin approves it. An email that already signs in here for any other reason is refused (409 USER_EXISTS). A new support account gets a one-time set-password link (emailed, or returned once as link). Audited support.grant_requested, then support.grant_granted.
Minimum role: admin.
Auth: Bearer token (how to get one) · Operation: createSupportGrant
Request body (required)
application/json · object
emailstringrequiredrolestringrequiredOne of: "operator", "viewer"
daysintegerrequiredphibooleanreasonstringWhy support needs PHI. Don't include patient details.
Responses
- 201The grant.
Response fields
application/json · object
grantobject11 fields
idstringemailstringnamestring | nullrolestringOne of: "operator", "viewer"
daysintegerphibooleanstatusstringOne of: "pending", "active", "revoked", "expired"
requestedBystringapprovedBystring | nullgrantedAtstring | nullendsAtstring | null
emailedbooleanlinkstringA new support account's one-time set-password link, when the engine can't email it.
- 400The request is malformed or fails validation.
application/json · ApiError
- 401No credential, or the token is invalid or expired.
application/json · ApiError
- 403The caller's role, license or network address does not allow this. A signed-in person who is not a member of the requested workspace gets code `WORKSPACE_FORBIDDEN`; a viewer asking for message content gets `PHI_FORBIDDEN` (or `PHI_SEARCH_FORBIDDEN` for a search on message content).
application/json · ApiError
- 409The request conflicts with the current state.
application/json · ApiError
- 429Rate limit exceeded (see the `Retry-After` header), or on the AI routes the daily AI budget is used up.
application/json · ApiError
- 500Unexpected server error.
application/json · ApiError
Example request
curl -X POST "$ENGINE_URL/api/settings/support-access/grants" \
-H "Authorization: Bearer $TOKEN" \
-H "Content-Type: application/json" \
-d '{
"email": "string",
"role": "operator",
"days": 0,
"phi": true,
"reason": "string"
}'Approve a support grant (second admin)
post/api/settings/support-access/grants/{id}/approve
Admin, signed in, not the one who asked (403 SAME_ADMIN, 403 SECOND_ADMIN_REQUIRED without a named admin). Rules and the BAA are checked again. Once only (409 ALREADY_DECIDED). Audited support.grant_approved and support.grant_granted.
Minimum role: admin.
Auth: Bearer token (how to get one) · Operation: approveSupportGrant
Parameters
| Name | In | Type | Description |
|---|---|---|---|
idrequired | path | string | The grant's id. |
Responses
- 200The grant.
Response fields
application/json · object
grantobject11 fields
idstringemailstringnamestring | nullrolestringOne of: "operator", "viewer"
daysintegerphibooleanstatusstringOne of: "pending", "active", "revoked", "expired"
requestedBystringapprovedBystring | nullgrantedAtstring | nullendsAtstring | null
emailedbooleanlinkstringA new support account's one-time set-password link, when the engine can't email it.
- 400The request is malformed or fails validation.
application/json · ApiError
- 401No credential, or the token is invalid or expired.
application/json · ApiError
- 403The caller's role, license or network address does not allow this. A signed-in person who is not a member of the requested workspace gets code `WORKSPACE_FORBIDDEN`; a viewer asking for message content gets `PHI_FORBIDDEN` (or `PHI_SEARCH_FORBIDDEN` for a search on message content).
application/json · ApiError
- 404Not found in the caller's workspace.
application/json · ApiError
- 409The request conflicts with the current state.
application/json · ApiError
- 429Rate limit exceeded (see the `Retry-After` header), or on the AI routes the daily AI budget is used up.
application/json · ApiError
- 500Unexpected server error.
application/json · ApiError
Example request
curl -X POST "$ENGINE_URL/api/settings/support-access/grants/<id>/approve" \
-H "Authorization: Bearer $TOKEN"Revoke a support grant now
post/api/settings/support-access/grants/{id}/revoke
Admin. Ends the grant at once: the support person's account is turned off and their sessions end (signedOut). A pending grant is withdrawn. Once only (409 ALREADY_DECIDED). Audited support.grant_revoked.
Minimum role: admin.
Auth: Bearer token (how to get one) · Operation: revokeSupportGrant
Parameters
| Name | In | Type | Description |
|---|---|---|---|
idrequired | path | string | The grant's id. |
Responses
- 200The ended grant.
Response fields
application/json · object
grantobject11 fields
idstringemailstringnamestring | nullrolestringOne of: "operator", "viewer"
daysintegerphibooleanstatusstringOne of: "pending", "active", "revoked", "expired"
requestedBystringapprovedBystring | nullgrantedAtstring | nullendsAtstring | null
signedOutinteger
- 401No credential, or the token is invalid or expired.
application/json · ApiError
- 403The caller's role, license or network address does not allow this. A signed-in person who is not a member of the requested workspace gets code `WORKSPACE_FORBIDDEN`; a viewer asking for message content gets `PHI_FORBIDDEN` (or `PHI_SEARCH_FORBIDDEN` for a search on message content).
application/json · ApiError
- 404Not found in the caller's workspace.
application/json · ApiError
- 409The request conflicts with the current state.
application/json · ApiError
- 429Rate limit exceeded (see the `Retry-After` header), or on the AI routes the daily AI budget is used up.
application/json · ApiError
- 500Unexpected server error.
application/json · ApiError
Example request
curl -X POST "$ENGINE_URL/api/settings/support-access/grants/<id>/revoke" \
-H "Authorization: Bearer $TOKEN"Read the workspace encryption key status
get/api/settings/workspace-key
Admin only. The current key's fingerprint, how many previous keys are kept for decryption, when the key last rotated and the rotation state, the same on every replica (from the audit log). Never key material.
Minimum role: admin.
Auth: Bearer token (how to get one) · Operation: getWorkspaceKey
Responses
- 200The status.
Response fields
application/json · object
keyIdstringFingerprint of ENCRYPTION_MASTER_KEY; never key material.
previousKeysintegerKeys in ENCRYPTION_MASTER_KEY_PREVIOUS.
lastRotatedAtstring (date-time) | nullThe newest encryption.key_rotated event, or null.
runningbooleanA rotation runs on any replica: read from the audit log (a start newer than any finish or failure, for up to 30 minutes).
lastobjectThe newest run's result, from the audit log:
{ ok, at, rotated, sealed }or{ ok: false, at, error }; null before one.
- 401No credential, or the token is invalid or expired.
application/json · ApiError
- 403The caller's role, license or network address does not allow this. A signed-in person who is not a member of the requested workspace gets code `WORKSPACE_FORBIDDEN`; a viewer asking for message content gets `PHI_FORBIDDEN` (or `PHI_SEARCH_FORBIDDEN` for a search on message content).
application/json · ApiError
- 429Rate limit exceeded (see the `Retry-After` header), or on the AI routes the daily AI budget is used up.
application/json · ApiError
Example request
curl "$ENGINE_URL/api/settings/workspace-key" \
-H "Authorization: Bearer $TOKEN"Re-encrypt every secret under the current key
post/api/settings/workspace-key/rotate
Admin only, confirm: true (400 CONFIRM_REQUIRED). Starts the rotate-master-key work in the background: every stored secret sealed with a key in ENCRYPTION_MASTER_KEY_PREVIOUS moves to ENCRYPTION_MASTER_KEY, all or nothing, while the engine keeps serving. Putting a new key in place stays the operator's step. 409 ROTATION_RUNNING while one runs on any replica. Audited as encryption.key_rotation_started before the work, then encryption.key_rotated naming the admin (when something moved) and encryption.key_rotation_finished (counts) or encryption.key_rotation_failed (the message). Rate limited to 5 requests per minute.
Minimum role: admin.
Auth: Bearer token (how to get one) · Operation: rotateWorkspaceKey
Request body (required)
application/json · object
confirmbooleanrequiredMust be true.
Responses
- 202Started.
Response fields
application/json · object
statusstringOne of: "started"
- 400The request is malformed or fails validation.
application/json · ApiError
- 401No credential, or the token is invalid or expired.
application/json · ApiError
- 403The caller's role, license or network address does not allow this. A signed-in person who is not a member of the requested workspace gets code `WORKSPACE_FORBIDDEN`; a viewer asking for message content gets `PHI_FORBIDDEN` (or `PHI_SEARCH_FORBIDDEN` for a search on message content).
application/json · ApiError
- 409The request conflicts with the current state.
application/json · ApiError
- 429Rate limit exceeded (see the `Retry-After` header), or on the AI routes the daily AI budget is used up.
application/json · ApiError
Example request
curl -X POST "$ENGINE_URL/api/settings/workspace-key/rotate" \
-H "Authorization: Bearer $TOKEN" \
-H "Content-Type: application/json" \
-d '{
"confirm": true
}'Read AI features & BAA
get/api/settings/ai
Whether an admin marked the BAA as signed (who and when) or when it went out for signature, the card's Provider, Covers and Data retention lines, the four feature switches (a missing one is on), what is on (effective), whether AI_FEATURES_ENABLED lets AI run, today's budget and this month's (monthly: the budget and the Agent's spend since the 1st in the workspace zone). In production AI runs only with AI_FEATURES_ENABLED=true and a signed BAA; each feature then follows its switch.
Minimum role: viewer.
Auth: Bearer token (how to get one) · Operation: getAiSettings
Responses
- 200The settings.
Response fields
application/json · object
baaobject8 fields
signedbooleansignedAtstring (date-time) | nullsignedBystring | nullsentAtstring (date-time) | nullWhen the BAA went out for signature; null when not sent.
providerstringWho processes the prompts:
Anthropic · Claude APIorGoogle Vertex · Claude.coversstringWhat the BAA covers: this deployment, project · region.
retentionstringData retention:
zero · not used for training.documentobject | nullThe signed copy attached when the BAA was confirmed (never its bytes); null when none was attached.
5 fields
idstringfilenamestringsizeBytesintegersha256stringSHA-256 of the PDF, hex.
uploadedAtstring (date-time)
featuresobject4 fields
agentbooleanmappingbooleanData map suggestions (mapping and condition suggest).
rewritesbooleanScript rewrites (E4X and Rhapsody JavaScript).
auditAskbooleanAsk the audit log.
envAllowsbooleanAI_FEATURES_ENABLED lets AI run on this engine.
productionbooleanbudgetobjectToday's engine-wide AI budget (tokens and iterations).
monthlyobject | nullThis month's AI budget (G-settings-10); null when the spend can't be read.
2 fields
budgetUsdnumber | nullThe monthly AI budget in US dollars; null is no cap.
usedUsdnumberAgent spend since 00:00 on the 1st in the workspace zone, priced from the provider price table.
effectiveobjectWhat is on: AI_FEATURES_ENABLED allows AI, in production the BAA is signed, and the switch is on.
4 fields
agentbooleanmappingbooleanrewritesbooleanauditAskboolean
- 401No credential, or the token is invalid or expired.
application/json · ApiError
- 429Rate limit exceeded (see the `Retry-After` header), or on the AI routes the daily AI budget is used up.
application/json · ApiError
Example request
curl "$ENGINE_URL/api/settings/ai" \
-H "Authorization: Bearer $TOKEN"Confirm the BAA, or change the AI feature switches and budget
put/api/settings/ai
Admin only. { monthlyBudgetUsd } (a number >= 0, at most 10,000,000, or null for no monthly cap) sets the monthly AI budget the Agent pauses at (0 pauses it at once); allowed while the BAA is unsigned; audited as ai.budget_changed with before and after. { baaSentAt } (ISO 8601, not in the future, or null) records when the BAA went out for signature; 409 BAA_ALREADY_SIGNED once signed; audited as ai.baa_sent with before and after. { baaSigned: true, confirm: true } records the BAA as signed by the caller without a signed copy (400 CONFIRM_REQUIRED without confirm); audited as ai.baa_confirmed with after.copyAttached: false, and the card warns that no signed copy is on file. Attach the copy through POST /api/settings/ai/baa. { features } changes switches; in production it is refused with 409 BAA_NOT_SIGNED until the BAA is signed (outside production AI runs without one, and so do the switches) (audited as ai.features_updated with before and after). A signed BAA never turns AI on without AI_FEATURES_ENABLED. Rate limited to 20 requests per minute.
Minimum role: admin.
Auth: Bearer token (how to get one) · Operation: updateAiSettings
Request body (required)
application/json · object | object | object | object
Responses
- 200The settings after the change.
Response fields
application/json · object
baaobject8 fields
signedbooleansignedAtstring (date-time) | nullsignedBystring | nullsentAtstring (date-time) | nullWhen the BAA went out for signature; null when not sent.
providerstringWho processes the prompts:
Anthropic · Claude APIorGoogle Vertex · Claude.coversstringWhat the BAA covers: this deployment, project · region.
retentionstringData retention:
zero · not used for training.documentobject | nullThe signed copy attached when the BAA was confirmed (never its bytes); null when none was attached.
5 fields
idstringfilenamestringsizeBytesintegersha256stringSHA-256 of the PDF, hex.
uploadedAtstring (date-time)
featuresobject4 fields
agentbooleanmappingbooleanData map suggestions (mapping and condition suggest).
rewritesbooleanScript rewrites (E4X and Rhapsody JavaScript).
auditAskbooleanAsk the audit log.
envAllowsbooleanAI_FEATURES_ENABLED lets AI run on this engine.
productionbooleanbudgetobjectToday's engine-wide AI budget (tokens and iterations).
monthlyobject | nullThis month's AI budget (G-settings-10); null when the spend can't be read.
2 fields
budgetUsdnumber | nullThe monthly AI budget in US dollars; null is no cap.
usedUsdnumberAgent spend since 00:00 on the 1st in the workspace zone, priced from the provider price table.
effectiveobjectWhat is on: AI_FEATURES_ENABLED allows AI, in production the BAA is signed, and the switch is on.
4 fields
agentbooleanmappingbooleanrewritesbooleanauditAskboolean
- 400The request is malformed or fails validation.
application/json · ApiError
- 401No credential, or the token is invalid or expired.
application/json · ApiError
- 403The caller's role, license or network address does not allow this. A signed-in person who is not a member of the requested workspace gets code `WORKSPACE_FORBIDDEN`; a viewer asking for message content gets `PHI_FORBIDDEN` (or `PHI_SEARCH_FORBIDDEN` for a search on message content).
application/json · ApiError
- 409The request conflicts with the current state.
application/json · ApiError
- 429Rate limit exceeded (see the `Retry-After` header), or on the AI routes the daily AI budget is used up.
application/json · ApiError
Example request
curl -X PUT "$ENGINE_URL/api/settings/ai" \
-H "Authorization: Bearer $TOKEN" \
-H "Content-Type: application/json" \
-d '{
"baaSigned": true,
"confirm": true
}'Open the signed BAA copy
get/api/settings/ai/baa
Admin only. The current signed copy, or with id the one an ai.baa_confirmed audit event names (after.documentId), as an application/pdf download (Content-Disposition: attachment, no-store). Each opening is audited as ai.baa_copy_opened with the copy's id. 404 when there is none. 500 BAA_COPY_INTEGRITY (logged) when the stored copy no longer decrypts or matches its recorded SHA-256. Rate limited to 30 requests per minute.
Minimum role: admin.
Auth: Bearer token (how to get one) · Operation: getAiBaaCopy
Parameters
| Name | In | Type | Description |
|---|---|---|---|
id | query | string | A signed copy's id from the audit event. |
Responses
- 200The signed BAA.
application/pdf · string (binary)
- 401No credential, or the token is invalid or expired.
application/json · ApiError
- 403The caller's role, license or network address does not allow this. A signed-in person who is not a member of the requested workspace gets code `WORKSPACE_FORBIDDEN`; a viewer asking for message content gets `PHI_FORBIDDEN` (or `PHI_SEARCH_FORBIDDEN` for a search on message content).
application/json · ApiError
- 404Not found in the caller's workspace.
application/json · ApiError
- 429Rate limit exceeded (see the `Retry-After` header), or on the AI routes the daily AI budget is used up.
application/json · ApiError
- 500Unexpected server error.
application/json · ApiError
Example request
curl "$ENGINE_URL/api/settings/ai/baa" \
-H "Authorization: Bearer $TOKEN"Confirm the BAA with its signed copy
post/api/settings/ai/baa
Admin only. Multipart: file, the signed BAA as a PDF (checked by its bytes, at most 10 MB), and confirm=true. Stores the copy AES-256-GCM encrypted with the workspace key, marks the BAA signed by the caller and audits ai.baa_confirmed with { before: { signed }, after: { signed, documentId, sha256, sizeBytes, copyAttached: true } } (never its bytes). 400 CONFIRM_REQUIRED or BAA_FILE_REQUIRED, 413 BAA_TOO_LARGE, 415 BAA_NOT_PDF. A signed BAA never turns AI on without AI_FEATURES_ENABLED. Rate limited to 10 requests per minute.
Minimum role: admin.
Auth: Bearer token (how to get one) · Operation: confirmAiBaaWithCopy
Request body (required)
multipart/form-data · object
filestring (binary)requiredThe signed BAA, a PDF.
confirmstringrequiredOne of: "true"
Responses
- 200The settings after the change.
Response fields
application/json · object
baaobject8 fields
signedbooleansignedAtstring (date-time) | nullsignedBystring | nullsentAtstring (date-time) | nullWhen the BAA went out for signature; null when not sent.
providerstringWho processes the prompts:
Anthropic · Claude APIorGoogle Vertex · Claude.coversstringWhat the BAA covers: this deployment, project · region.
retentionstringData retention:
zero · not used for training.documentobject | nullThe signed copy attached when the BAA was confirmed (never its bytes); null when none was attached.
5 fields
idstringfilenamestringsizeBytesintegersha256stringSHA-256 of the PDF, hex.
uploadedAtstring (date-time)
featuresobject4 fields
agentbooleanmappingbooleanData map suggestions (mapping and condition suggest).
rewritesbooleanScript rewrites (E4X and Rhapsody JavaScript).
auditAskbooleanAsk the audit log.
envAllowsbooleanAI_FEATURES_ENABLED lets AI run on this engine.
productionbooleanbudgetobjectToday's engine-wide AI budget (tokens and iterations).
monthlyobject | nullThis month's AI budget (G-settings-10); null when the spend can't be read.
2 fields
budgetUsdnumber | nullThe monthly AI budget in US dollars; null is no cap.
usedUsdnumberAgent spend since 00:00 on the 1st in the workspace zone, priced from the provider price table.
effectiveobjectWhat is on: AI_FEATURES_ENABLED allows AI, in production the BAA is signed, and the switch is on.
4 fields
agentbooleanmappingbooleanrewritesbooleanauditAskboolean
- 400The request is malformed or fails validation.
application/json · ApiError
- 401No credential, or the token is invalid or expired.
application/json · ApiError
- 403The caller's role, license or network address does not allow this. A signed-in person who is not a member of the requested workspace gets code `WORKSPACE_FORBIDDEN`; a viewer asking for message content gets `PHI_FORBIDDEN` (or `PHI_SEARCH_FORBIDDEN` for a search on message content).
application/json · ApiError
- 413The body is larger than the limit.
application/json · ApiError
- 415The body is not a supported media type.
application/json · ApiError
- 429Rate limit exceeded (see the `Retry-After` header), or on the AI routes the daily AI budget is used up.
application/json · ApiError
Example request
curl -X POST "$ENGINE_URL/api/settings/ai/baa" \
-H "Authorization: Bearer $TOKEN" \
-F 'file=@file' \
-F 'confirm=true'List notification channels
get/api/notifications/channels
The six channels in order (email, sms, slack, pagerduty, teams, webhook) and what each sends from or to. Credentials are never returned, at most a hint of their last four characters. Engine-wide. Rate limited to 60 requests per minute.
Minimum role: viewer.
Auth: Bearer token (how to get one) · Operation: listNotificationChannels
Responses
- 200The channels.
Response fields
application/json · object
channelsarray of object9 fields
kindstringrequiredOne of: "email", "sms", "slack", "pagerduty", "teams", "webhook"
labelstringrequiredEmail, Text (SMS), Slack, PagerDuty, Microsoft Teams, Webhook.
viastringrequiredThe provider: SMTP, SendGrid, Twilio, MedHook app, …
connectedbooleanrequiredproviderstring | nullOne of: "smtp", "sendgrid", "twilio", "slack", "pagerduty", "teams", "webhook"
linesarray of objectrequiredWhat the card shows: From and Domain (the From domain's SPF and DKIM state, checked from DNS at Connect:
SPF and DKIM verified,SPF verified · DKIM not found, …), From and Verified numbers ({n} of {m} people), Workspace (from Slack's auth.test at Connect) and Channels, Service and Schedule, the webhook's URL host. Never a credential.2 fields
kstringvstring
secretHintstring | nullThe credential's last four characters, e.g.
…WXYZ; null for a secret shorter than 12 characters or a secret URL (Teams).connectedBystring | nullconnectedAtstring (date-time) | null
- 401No credential, or the token is invalid or expired.
application/json · ApiError
- 403The caller's role, license or network address does not allow this. A signed-in person who is not a member of the requested workspace gets code `WORKSPACE_FORBIDDEN`; a viewer asking for message content gets `PHI_FORBIDDEN` (or `PHI_SEARCH_FORBIDDEN` for a search on message content).
application/json · ApiError
- 429Rate limit exceeded (see the `Retry-After` header), or on the AI routes the daily AI budget is used up.
application/json · ApiError
Example request
curl "$ENGINE_URL/api/notifications/channels" \
-H "Authorization: Bearer $TOKEN"Connect a notification channel
post/api/notifications/channels
Admin only. Connects (or replaces) one channel, chosen by provider. Fields are validated per provider; URLs and the SMTP host pass the SSRF rules (400 URL_NOT_ALLOWED). Credentials are stored AES-256-GCM encrypted with the workspace key and never returned. Audited as notification.channel_connected with the kind, provider and whether it replaced a connection. Rate limited to 20 requests per minute.
Minimum role: admin.
Auth: Bearer token (how to get one) · Operation: connectNotificationChannel
Request body (required)
application/json · object | object | object | object | object | object | object | object
Responses
- 201The channel as connected.
Response fields
application/json · object
channelobject9 fields
kindstringrequiredOne of: "email", "sms", "slack", "pagerduty", "teams", "webhook"
labelstringrequiredEmail, Text (SMS), Slack, PagerDuty, Microsoft Teams, Webhook.
viastringrequiredThe provider: SMTP, SendGrid, Twilio, MedHook app, …
connectedbooleanrequiredproviderstring | nullOne of: "smtp", "sendgrid", "twilio", "slack", "pagerduty", "teams", "webhook"
linesarray of objectrequiredWhat the card shows: From and Domain (the From domain's SPF and DKIM state, checked from DNS at Connect:
SPF and DKIM verified,SPF verified · DKIM not found, …), From and Verified numbers ({n} of {m} people), Workspace (from Slack's auth.test at Connect) and Channels, Service and Schedule, the webhook's URL host. Never a credential.2 fields
kstringvstring
secretHintstring | nullThe credential's last four characters, e.g.
…WXYZ; null for a secret shorter than 12 characters or a secret URL (Teams).connectedBystring | nullconnectedAtstring (date-time) | null
- 400The request is malformed or fails validation.
application/json · ApiError
- 401No credential, or the token is invalid or expired.
application/json · ApiError
- 403The caller's role, license or network address does not allow this. A signed-in person who is not a member of the requested workspace gets code `WORKSPACE_FORBIDDEN`; a viewer asking for message content gets `PHI_FORBIDDEN` (or `PHI_SEARCH_FORBIDDEN` for a search on message content).
application/json · ApiError
- 429Rate limit exceeded (see the `Retry-After` header), or on the AI routes the daily AI budget is used up.
application/json · ApiError
Example request
curl -X POST "$ENGINE_URL/api/notifications/channels" \
-H "Authorization: Bearer $TOKEN" \
-H "Content-Type: application/json" \
-d '{
"provider": "smtp",
"host": "string",
"port": 1,
"encryption": "starttls",
"username": "string",
"password": "string",
"from": "user@example.test"
}'Disconnect a notification channel
delete/api/notifications/channels/{kind}
Admin only. Body { confirm: true } (400 CONFIRM_REQUIRED without it). Drops the credentials; text alert rules (the only rules that send through a registry connection) are sent by email from then on, to whoever made the rule or else the admin who disconnected it, and fallback.rules counts them. Slack, PagerDuty, Teams and webhook rules carry their own target and keep it. 404 NOT_CONNECTED. Audited as notification.channel_disconnected. Rate limited to 20 requests per minute.
Minimum role: admin.
Auth: Bearer token (how to get one) · Operation: disconnectNotificationChannel
Parameters
| Name | In | Type | Description |
|---|---|---|---|
kindrequired | path | string | email, sms, slack, pagerduty, teams or webhook. |
Request body (required)
application/json · object
confirmbooleanrequired
Responses
- 200The channel, now not connected, and the fallback.
Response fields
application/json · object
channelobject9 fields
kindstringrequiredOne of: "email", "sms", "slack", "pagerduty", "teams", "webhook"
labelstringrequiredEmail, Text (SMS), Slack, PagerDuty, Microsoft Teams, Webhook.
viastringrequiredThe provider: SMTP, SendGrid, Twilio, MedHook app, …
connectedbooleanrequiredproviderstring | nullOne of: "smtp", "sendgrid", "twilio", "slack", "pagerduty", "teams", "webhook"
linesarray of objectrequiredWhat the card shows: From and Domain (the From domain's SPF and DKIM state, checked from DNS at Connect:
SPF and DKIM verified,SPF verified · DKIM not found, …), From and Verified numbers ({n} of {m} people), Workspace (from Slack's auth.test at Connect) and Channels, Service and Schedule, the webhook's URL host. Never a credential.2 fields
kstringvstring
secretHintstring | nullThe credential's last four characters, e.g.
…WXYZ; null for a secret shorter than 12 characters or a secret URL (Teams).connectedBystring | nullconnectedAtstring (date-time) | null
fallbackobject2 fields
tostringOne of: "email"
rulesinteger
- 400The request is malformed or fails validation.
application/json · ApiError
- 401No credential, or the token is invalid or expired.
application/json · ApiError
- 403The caller's role, license or network address does not allow this. A signed-in person who is not a member of the requested workspace gets code `WORKSPACE_FORBIDDEN`; a viewer asking for message content gets `PHI_FORBIDDEN` (or `PHI_SEARCH_FORBIDDEN` for a search on message content).
application/json · ApiError
- 404Not found in the caller's workspace.
application/json · ApiError
- 429Rate limit exceeded (see the `Retry-After` header), or on the AI routes the daily AI budget is used up.
application/json · ApiError
Example request
curl -X DELETE "$ENGINE_URL/api/notifications/channels/<kind>" \
-H "Authorization: Bearer $TOKEN" \
-H "Content-Type: application/json" \
-d '{
"confirm": true
}'Slack's Diagnose and Acknowledge buttons
post/api/notifications/slack/actions
Slack's interactivity request (application/x-www-form-urlencoded, a payload field) for the Diagnose and Acknowledge buttons on a tunnel-down message. No engine credential: the request must carry Slack's v0 signature (X-Slack-Signature, X-Slack-Request-Timestamp, at most 5 minutes old) made with the Slack connection's signing secret, else 401. The Slack person is matched to an engine user by the email Slack has for them; without a match the reply is an ephemeral "Link your MedHook account". diagnose is read-only: the tunnel diagnosis of POST /api/vpn-tunnels/{id}/diagnose without the MLLP round trip (the ordered checks, where it stopped and the explanation), audited as vpn_tunnel.diagnosed, replied ephemerally in the thread to the person who pressed it; without the GKE deployment or before the tunnel is ready, its state and last error. diagnose needs any role in the tunnel's workspace; acknowledge needs operator there, records who and when on the alert rule, and is audited as alert.acknowledged. Replies go to Slack's response_url (hooks.slack.com only). Human actions, never Agent actions. Rate limited to 60 requests per minute.
Auth: None, public route · Operation: slackActions
Request body (required)
application/x-www-form-urlencoded · object
payloadstringrequiredSlack's block_actions payload, as JSON.
Responses
- 200Handled; the reply goes to Slack's response_url.
Response fields
application/json · object
okboolean
- 400The request is malformed or fails validation.
application/json · ApiError
- 401No credential, or the token is invalid or expired.
application/json · ApiError
- 429Rate limit exceeded (see the `Retry-After` header), or on the AI routes the daily AI budget is used up.
application/json · ApiError
Example request
curl -X POST "$ENGINE_URL/api/notifications/slack/actions" \
-H "Content-Type: application/x-www-form-urlencoded" \
--data-binary @bodySend a test to me
post/api/notifications/test
Admin only. One test message (no PHI) to the caller by email (the Email channel, else the engine's mail transport), text (skipped without a verified number) and Slack DM (found by email), and the note the page shows. Audited as notification.test_sent with the outcome per channel. Rate limited to 5 requests per minute.
Minimum role: admin.
Auth: Bearer token (how to get one) · Operation: sendNotificationTest
Request body
application/json · object
Responses
- 200What was delivered.
Response fields
application/json · object
tostringThe caller's name, or email.
resultsarray of object8 fields
kindstringrequiredOne of: "email", "sms", "slack"
channelstringThe same as
kind.One of: "email", "sms", "slack"
labelstringrequiredokbooleanrequireddeliveredbooleanThe same as
ok.msintegerrequirederrorstring | nullskippedboolean
noteobject2 fields
textstringtonestringOne of: "ok", "warn"
- 400The request is malformed or fails validation.
application/json · ApiError
- 401No credential, or the token is invalid or expired.
application/json · ApiError
- 403The caller's role, license or network address does not allow this. A signed-in person who is not a member of the requested workspace gets code `WORKSPACE_FORBIDDEN`; a viewer asking for message content gets `PHI_FORBIDDEN` (or `PHI_SEARCH_FORBIDDEN` for a search on message content).
application/json · ApiError
- 429Rate limit exceeded (see the `Retry-After` header), or on the AI routes the daily AI budget is used up.
application/json · ApiError
Example request
curl -X POST "$ENGINE_URL/api/notifications/test" \
-H "Authorization: Bearer $TOKEN" \
-H "Content-Type: application/json" \
-d '{}'Who hears about what
get/api/notifications/routes
The routing grid: eight events (tunnel down, workflow failing, messages waiting, deploy waiting for approval, Agent asks first, suspicious audit flag, secret or PSK expiring, weekly summary) by Email, Text, Slack and Page, and who each goes to. A channel that isn't connected is available: false and its dots read as off. Engine-wide. Not used for delivery yet: the grid is saved, but no sender reads it; alerts go by each alert rule's own channel. Rate limited to 60 requests per minute.
Minimum role: viewer.
Auth: Bearer token (how to get one) · Operation: getNotificationRoutes
Responses
- 200The grid.
Response fields
application/json · object
routesarray of object5 fields
eventstringrequiredOne of: "tunnel_down", "workflow_failing", "messages_waiting", "deploy_approval", "agent_asks", "audit_flag", "secret_expiring", "weekly_summary"
labelstringrequirede.g. Tunnel down 2 min.
goesTostringrequirede.g. owner + on-call.
prioritystringrequiredOne of: "P1", "P2", "P3"
cellsobjectrequired4 fields
emailobjectrequired2 fields
onbooleanrequiredOn and the channel connected: what is really sent.
availablebooleanrequiredThe channel is connected; a dot that isn't is inert.
smsobjectrequired2 fields
onbooleanrequiredOn and the channel connected: what is really sent.
availablebooleanrequiredThe channel is connected; a dot that isn't is inert.
slackobjectrequired2 fields
onbooleanrequiredOn and the channel connected: what is really sent.
availablebooleanrequiredThe channel is connected; a dot that isn't is inert.
pagerdutyobjectrequired2 fields
onbooleanrequiredOn and the channel connected: what is really sent.
availablebooleanrequiredThe channel is connected; a dot that isn't is inert.
- 401No credential, or the token is invalid or expired.
application/json · ApiError
- 403The caller's role, license or network address does not allow this. A signed-in person who is not a member of the requested workspace gets code `WORKSPACE_FORBIDDEN`; a viewer asking for message content gets `PHI_FORBIDDEN` (or `PHI_SEARCH_FORBIDDEN` for a search on message content).
application/json · ApiError
- 429Rate limit exceeded (see the `Retry-After` header), or on the AI routes the daily AI budget is used up.
application/json · ApiError
Example request
curl "$ENGINE_URL/api/notifications/routes" \
-H "Authorization: Bearer $TOKEN"Turn routing dots on or off
put/api/notifications/routes
Admin only. Each entry names an event and the channels to turn on or off; the rest are kept. Turning a dot on for a channel that isn't connected answers 409 CHANNEL_NOT_CONNECTED and saves nothing; turning one off always works. The rows are saved in one transaction. Audited as notification.routes_updated with each dot whose saved value changed (turning off a dot saved on for a disconnected channel counts). Rate limited to 60 requests per minute.
Minimum role: admin.
Auth: Bearer token (how to get one) · Operation: updateNotificationRoutes
Request body (required)
application/json · object
routesarray of objectrequired5 fields
eventstringrequiredOne of: "tunnel_down", "workflow_failing", "messages_waiting", "deploy_approval", "agent_asks", "audit_flag", "secret_expiring", "weekly_summary"
emailbooleansmsbooleanslackbooleanpagerdutyboolean
Responses
- 200The grid after the change.
Response fields
application/json · object
routesarray of object5 fields
eventstringrequiredOne of: "tunnel_down", "workflow_failing", "messages_waiting", "deploy_approval", "agent_asks", "audit_flag", "secret_expiring", "weekly_summary"
labelstringrequirede.g. Tunnel down 2 min.
goesTostringrequirede.g. owner + on-call.
prioritystringrequiredOne of: "P1", "P2", "P3"
cellsobjectrequired4 fields
emailobjectrequired2 fields
onbooleanrequiredOn and the channel connected: what is really sent.
availablebooleanrequiredThe channel is connected; a dot that isn't is inert.
smsobjectrequired2 fields
onbooleanrequiredOn and the channel connected: what is really sent.
availablebooleanrequiredThe channel is connected; a dot that isn't is inert.
slackobjectrequired2 fields
onbooleanrequiredOn and the channel connected: what is really sent.
availablebooleanrequiredThe channel is connected; a dot that isn't is inert.
pagerdutyobjectrequired2 fields
onbooleanrequiredOn and the channel connected: what is really sent.
availablebooleanrequiredThe channel is connected; a dot that isn't is inert.
- 400The request is malformed or fails validation.
application/json · ApiError
- 401No credential, or the token is invalid or expired.
application/json · ApiError
- 403The caller's role, license or network address does not allow this. A signed-in person who is not a member of the requested workspace gets code `WORKSPACE_FORBIDDEN`; a viewer asking for message content gets `PHI_FORBIDDEN` (or `PHI_SEARCH_FORBIDDEN` for a search on message content).
application/json · ApiError
- 409The request conflicts with the current state.
application/json · ApiError
- 429Rate limit exceeded (see the `Retry-After` header), or on the AI routes the daily AI budget is used up.
application/json · ApiError
Example request
curl -X PUT "$ENGINE_URL/api/notifications/routes" \
-H "Authorization: Bearer $TOKEN" \
-H "Content-Type: application/json" \
-d '{
"routes": [
{
"event": "tunnel_down",
"email": true,
"sms": true,
"slack": true,
"pagerduty": true
}
]
}'My notification preferences
get/api/notifications/prefs
The signed-in person's own quiet hours, texts only for P1, daily digest and phone number (400 NO_USER for a token without a person). Defaults: quiet hours 22:00 to 07:00 on, texts only for P1 on, digest off. ?userId= naming anyone else is 403 (each person reads only their own). Rate limited to 60 requests per minute.
Minimum role: viewer.
Auth: Bearer token (how to get one) · Operation: getNotificationPrefs
Responses
- 200Your preferences.
Response fields
application/json · object
prefsobject8 fields
quietHoursbooleanrequiredquietStartstringrequiredHH:MM, local.
quietEndstringrequiredHH:MM, local.
timeZonestring | nullrequiredIANA zone; null = the engine's.
smsOnlyP1booleanrequireddailyDigestbooleanrequiredphonestring | nullrequiredE.164.
phoneVerifiedbooleanrequired
- 400The request is malformed or fails validation.
application/json · ApiError
- 401No credential, or the token is invalid or expired.
application/json · ApiError
- 403The caller's role, license or network address does not allow this. A signed-in person who is not a member of the requested workspace gets code `WORKSPACE_FORBIDDEN`; a viewer asking for message content gets `PHI_FORBIDDEN` (or `PHI_SEARCH_FORBIDDEN` for a search on message content).
application/json · ApiError
- 429Rate limit exceeded (see the `Retry-After` header), or on the AI routes the daily AI budget is used up.
application/json · ApiError
Example request
curl "$ENGINE_URL/api/notifications/prefs" \
-H "Authorization: Bearer $TOKEN"Change my notification preferences
put/api/notifications/prefs
Any of the signed-in person's own fields; every role may change theirs, and only theirs: a userId naming anyone else is 403. Delivery applies them: quiet hours hold P2 and P3 texts and Slack DMs until they end (pages and P1 always go through), texts only for P1 sends everything else by email or Slack, and the daily digest collects P3 emails into one a day, sent when quiet hours end. Settings sends the browser's timeZone with the first save when none is set; with none, the engine's zone is used. A new phone number needs verifying again. Audited as notification.prefs_updated with the field names only. Rate limited to 30 requests per minute.
Minimum role: viewer.
Auth: Bearer token (how to get one) · Operation: updateNotificationPrefs
Request body (required)
application/json · object
quietHoursbooleanquietStartstringHH:MM, local.
quietEndstringHH:MM, local.
timeZonestring | nullIANA zone; null = the engine's.
smsOnlyP1booleandailyDigestbooleanphonestring | nullE.164.
userIdstringOptional; must be the caller's own id (else 403).
Responses
- 200Your preferences.
Response fields
application/json · object
prefsobject8 fields
quietHoursbooleanrequiredquietStartstringrequiredHH:MM, local.
quietEndstringrequiredHH:MM, local.
timeZonestring | nullrequiredIANA zone; null = the engine's.
smsOnlyP1booleanrequireddailyDigestbooleanrequiredphonestring | nullrequiredE.164.
phoneVerifiedbooleanrequired
- 400The request is malformed or fails validation.
application/json · ApiError
- 401No credential, or the token is invalid or expired.
application/json · ApiError
- 403The caller's role, license or network address does not allow this. A signed-in person who is not a member of the requested workspace gets code `WORKSPACE_FORBIDDEN`; a viewer asking for message content gets `PHI_FORBIDDEN` (or `PHI_SEARCH_FORBIDDEN` for a search on message content).
application/json · ApiError
- 429Rate limit exceeded (see the `Retry-After` header), or on the AI routes the daily AI budget is used up.
application/json · ApiError
Example request
curl -X PUT "$ENGINE_URL/api/notifications/prefs" \
-H "Authorization: Bearer $TOKEN" \
-H "Content-Type: application/json" \
-d '{
"quietHours": true,
"quietStart": "string",
"quietEnd": "string",
"timeZone": "string",
"smsOnlyP1": true,
"dailyDigest": true,
"phone": "string",
"userId": "string"
}'Verify my phone number
post/api/notifications/prefs/phone
{ action: "send" } texts a 6-digit code to the signed-in person's number through the connected Text channel (400 NO_PHONE, 409 CHANNEL_NOT_CONNECTED); { action: "verify", code } checks it (400 CODE_INVALID or CODE_EXPIRED, 429 CODE_LOCKED after five tries; a try is claimed before the code is compared, so parallel guesses cannot pass five). The code lasts 10 minutes and is stored as its hash only. Audited as notification.phone_code_sent and notification.phone_verified. Rate limited to 10 requests per 10 minutes per address and per person.
Minimum role: viewer.
Auth: Bearer token (how to get one) · Operation: verifyNotificationPhone
Request body (required)
application/json · object | object
Responses
- 200Your preferences.
Response fields
application/json · object
prefsobject8 fields
quietHoursbooleanrequiredquietStartstringrequiredHH:MM, local.
quietEndstringrequiredHH:MM, local.
timeZonestring | nullrequiredIANA zone; null = the engine's.
smsOnlyP1booleanrequireddailyDigestbooleanrequiredphonestring | nullrequiredE.164.
phoneVerifiedbooleanrequired
sentbooleanPresent after a send.
- 400The request is malformed or fails validation.
application/json · ApiError
- 401No credential, or the token is invalid or expired.
application/json · ApiError
- 409The request conflicts with the current state.
application/json · ApiError
- 429Rate limit exceeded (see the `Retry-After` header), or on the AI routes the daily AI budget is used up.
application/json · ApiError
Example request
curl -X POST "$ENGINE_URL/api/notifications/prefs/phone" \
-H "Authorization: Bearer $TOKEN" \
-H "Content-Type: application/json" \
-d '{
"action": "send"
}'Remind people to verify their phone number
post/api/notifications/prefs/reminders
Admin only. Emails each person without a verified number a link to their preferences in Settings (no PHI), by the Email channel or the engine's mail transport. 409 CHANNEL_NOT_CONNECTED while Text (SMS) isn't connected, since the link leads to Send code, which needs it. Audited as notification.phone_reminders_sent with the counts. Rate limited to 3 requests per hour.
Minimum role: admin.
Auth: Bearer token (how to get one) · Operation: sendPhoneReminders
Request body
application/json · object
Responses
- 200How many went.
Response fields
application/json · object
sentintegerfailedinteger
- 401No credential, or the token is invalid or expired.
application/json · ApiError
- 403The caller's role, license or network address does not allow this. A signed-in person who is not a member of the requested workspace gets code `WORKSPACE_FORBIDDEN`; a viewer asking for message content gets `PHI_FORBIDDEN` (or `PHI_SEARCH_FORBIDDEN` for a search on message content).
application/json · ApiError
- 409The request conflicts with the current state.
application/json · ApiError
- 429Rate limit exceeded (see the `Retry-After` header), or on the AI routes the daily AI budget is used up.
application/json · ApiError
Example request
curl -X POST "$ENGINE_URL/api/notifications/prefs/reminders" \
-H "Authorization: Bearer $TOKEN" \
-H "Content-Type: application/json" \
-d '{}'On-call routing
get/api/alert-rules/on-call
Quiet hours for P2 and P3 alert rules, and the PagerDuty and Slack channels connected in Settings > Notifications (never a credential). Engine-wide. On by default (G-settings-15): 22:00 to 07:00 in the workspace's time zone, holding P2 and P3. Rate limited to 60 requests per minute.
Minimum role: viewer.
Auth: Bearer token (how to get one) · Operation: getAlertOnCall
Responses
- 200The block.
Response fields
application/json · object
onCallobject8 fields
quietHoldbooleanrequiredQuiet hours for P2 and P3 are on.
quietStartstringrequiredHH:MM, local to timezone.
quietEndstringrequiredHH:MM, local to timezone.
timezonestringrequiredIANA zone.
holdPrioritiesarray of stringrequiredThe priorities quiet hours hold (default P2 and P3). P1 always pages and is refused here.
quietSubstringrequirede.g. held until 07:00 CT; P1 always pages.
pagerdutyobjectrequired2 fields
connectedbooleanrequiredConnected in Settings > Notifications.
substringrequirede.g. service “…” · schedule …, #channel · connected as MedHook, or not connected.
slackobjectrequired2 fields
connectedbooleanrequiredConnected in Settings > Notifications.
substringrequirede.g. service “…” · schedule …, #channel · connected as MedHook, or not connected.
- 401No credential, or the token is invalid or expired.
application/json · ApiError
- 429Rate limit exceeded (see the `Retry-After` header), or on the AI routes the daily AI budget is used up.
application/json · ApiError
Example request
curl "$ENGINE_URL/api/alert-rules/on-call" \
-H "Authorization: Bearer $TOKEN"Change on-call quiet hours
put/api/alert-rules/on-call
Admin only. While quiet hours are on, a P2 or P3 rule's trigger waits until they end (the first evaluation after them sends it if the condition still holds; a tunnel_events rule's trigger events are kept and sent, in order, on the first watcher tick after them; its resolves (recovered, failback) are never held, and a resolve for a trigger still held in the same window drops both; a held event whose rule is disabled or changes kind is never sent); P1 always pages. Only the priorities in holdPriorities wait (P2 and P3 by default). The window may be sent as quietHours: { from, to, tz? } instead of quietStart / quietEnd / timezone (not both). Existing rules default to P2 (severity error), so quiet hours hold them unless they are set to P1. 400 with P1 always pages; hold only P2 or P3 when P1 is listed. Audited as alert_rule.on_call_updated with the changed fields. Rate limited to 30 requests per minute.
Minimum role: admin.
Auth: Bearer token (how to get one) · Operation: updateAlertOnCall
Request body (required)
application/json · object
quietHoldbooleanQuiet hours for P2 and P3 are on.
quietStartstringHH:MM, local to timezone.
quietEndstringHH:MM, local to timezone.
timezonestringIANA zone.
holdPrioritiesarray of stringThe priorities quiet hours hold (default P2 and P3). P1 always pages and is refused here.
quietHoursobject3 fields
fromstringrequiredHH:MM, local to tz.
tostringrequiredHH:MM, local to tz.
tzstringIANA zone; the saved zone when left out.
Responses
- 200The block after the change.
Response fields
application/json · object
onCallobject8 fields
quietHoldbooleanrequiredQuiet hours for P2 and P3 are on.
quietStartstringrequiredHH:MM, local to timezone.
quietEndstringrequiredHH:MM, local to timezone.
timezonestringrequiredIANA zone.
holdPrioritiesarray of stringrequiredThe priorities quiet hours hold (default P2 and P3). P1 always pages and is refused here.
quietSubstringrequirede.g. held until 07:00 CT; P1 always pages.
pagerdutyobjectrequired2 fields
connectedbooleanrequiredConnected in Settings > Notifications.
substringrequirede.g. service “…” · schedule …, #channel · connected as MedHook, or not connected.
slackobjectrequired2 fields
connectedbooleanrequiredConnected in Settings > Notifications.
substringrequirede.g. service “…” · schedule …, #channel · connected as MedHook, or not connected.
- 400The request is malformed or fails validation.
application/json · ApiError
- 401No credential, or the token is invalid or expired.
application/json · ApiError
- 403The caller's role, license or network address does not allow this. A signed-in person who is not a member of the requested workspace gets code `WORKSPACE_FORBIDDEN`; a viewer asking for message content gets `PHI_FORBIDDEN` (or `PHI_SEARCH_FORBIDDEN` for a search on message content).
application/json · ApiError
- 429Rate limit exceeded (see the `Retry-After` header), or on the AI routes the daily AI budget is used up.
application/json · ApiError
Example request
curl -X PUT "$ENGINE_URL/api/alert-rules/on-call" \
-H "Authorization: Bearer $TOKEN" \
-H "Content-Type: application/json" \
-d '{
"quietHold": true,
"quietStart": "string",
"quietEnd": "string",
"timezone": "string",
"holdPriorities": [
"P2"
],
"quietHours": {
"from": "string",
"to": "string",
"tz": "string"
}
}'Send an on-call test
post/api/alert-rules/on-call/test
Admin only. One test through the connected channel: PagerDuty gets a test trigger and its resolve at once, Slack one message. 409 CHANNEL_NOT_CONNECTED; 502 DELIVERY_FAILED with the sender's message. Audited as alert_rule.on_call_test_sent with the channel and whether it went. Rate limited to 10 requests per minute.
Minimum role: admin.
Auth: Bearer token (how to get one) · Operation: testAlertOnCall
Request body (required)
application/json · object
channelstringrequiredOne of: "pagerduty", "slack"
Responses
- 200Sent.
Response fields
application/json · object
okbooleannotestring
- 400The request is malformed or fails validation.
application/json · ApiError
- 401No credential, or the token is invalid or expired.
application/json · ApiError
- 403The caller's role, license or network address does not allow this. A signed-in person who is not a member of the requested workspace gets code `WORKSPACE_FORBIDDEN`; a viewer asking for message content gets `PHI_FORBIDDEN` (or `PHI_SEARCH_FORBIDDEN` for a search on message content).
application/json · ApiError
- 409The request conflicts with the current state.
application/json · ApiError
- 429Rate limit exceeded (see the `Retry-After` header), or on the AI routes the daily AI budget is used up.
application/json · ApiError
- 502Error.
application/json · ApiError
Example request
curl -X POST "$ENGINE_URL/api/alert-rules/on-call/test" \
-H "Authorization: Bearer $TOKEN" \
-H "Content-Type: application/json" \
-d '{
"channel": "pagerduty"
}'Backups
get/api/settings/backups
Admin only. The newest successful nightly (automated) Cloud SQL backup, the backup window and the point-in-time window, read from the Cloud SQL Admin API (needs roles/cloudsql.viewer; cached a minute), and the restores waiting for a second admin. Off Cloud SQL (GCP_PROJECT_ID and CLOUDSQL_INSTANCE unset) or without the role, readable is false and reason says why. Rate limited to 30 requests per minute.
Minimum role: admin.
Auth: Bearer token (how to get one) · Operation: getBackups
Responses
- 200Backup state.
Response fields
application/json · object
backupsobject17 fields
managedbooleanrequiredThe engine's database is Cloud SQL.
readablebooleanrequiredCloud SQL answered.
reasonstring | nullrequiredWhy not, when not readable.
instancestring | nullrequirednightlyobjectrequired2 fields
startTimestring | nullrequiredHH:MM UTC.
lastRunobject | nullrequired3 fields
atstringrequiredISO start of the run.
durationMsinteger | nullrequiredsizeBytesinteger | nullrequired
pitrobjectrequired2 fields
enabledbooleanrequireddaysintegerrequired
pendingarray of objectrequired4 fields
requestIdstringrequiredatstringrequiredThe moment to restore to, RFC 3339 UTC.
requestedBystring | nullrequiredrequestedAtstringrequired
timeZonestringThe workspace's IANA time zone (UTC until set) the nightly row is shown in.
canBackupbooleanrequiredThe engine's service account holds cloudsql.backupRuns.create, so Back up now starts a backup run itself (G-settings-16).
canRestorebooleanrequiredIt holds cloudsql.instances.clone and point-in-time recovery is on, so an approved restore clones the instance itself.
restoreBlockedstring | nullrequiredWhy the engine can't restore by itself: point-in-time recovery is off (no restore command then), its service account may not clone, or Cloud SQL didn't answer. Null when it can, or off Cloud SQL.
One of: "pitr-off", "no-permission", "unreadable"
runbookobjectrequired2 fields
backupNowstring | nullrequiredThe gcloud command when the engine may not back up.
restorestring | nullrequiredThe gcloud clone command, with the moment to fill, when the engine may not restore (none while point-in-time recovery is off).
schedulestring | nullrequiredThe nightly window's start, HH:MM UTC.
lastRunAtstring | nullrequiredThe last nightly run's start.
durationMsinteger | nullrequiredsizeBytesinteger | nullrequiredpitrWindowDaysintegerrequiredDays of point-in-time restore.
- 401No credential, or the token is invalid or expired.
application/json · ApiError
- 403The caller's role, license or network address does not allow this. A signed-in person who is not a member of the requested workspace gets code `WORKSPACE_FORBIDDEN`; a viewer asking for message content gets `PHI_FORBIDDEN` (or `PHI_SEARCH_FORBIDDEN` for a search on message content).
application/json · ApiError
- 429Rate limit exceeded (see the `Retry-After` header), or on the AI routes the daily AI budget is used up.
application/json · ApiError
Example request
curl "$ENGINE_URL/api/settings/backups" \
-H "Authorization: Bearer $TOKEN"Back up now
post/api/settings/backups
Admin only. When the engine's service account holds cloudsql.backupRuns.create (canBackup), writes backup.starting (it must be written: 503 AUDIT_UNAVAILABLE and nothing started otherwise), starts an on-demand Cloud SQL backup run and answers 202 { started: true, operation }, audited as backup.started. Otherwise, or when Cloud SQL refuses (then with error), returns the gcloud sql backups create command an operator runs, audited as backup.command. The engine never grants itself the permission. 409 NOT_CLOUD_SQL off Cloud SQL. Rate limited to 10 requests per minute.
Minimum role: admin.
Auth: Bearer token (how to get one) · Operation: backupNow
Request body
application/json · object
Responses
- 200The command (200), or the backup run started (202).
Response fields
application/json · object
commandstringerrorstringWhy Cloud SQL didn't start the backup.
startedbooleanoperationstring | null
- 400The request is malformed or fails validation.
application/json · ApiError
- 401No credential, or the token is invalid or expired.
application/json · ApiError
- 403The caller's role, license or network address does not allow this. A signed-in person who is not a member of the requested workspace gets code `WORKSPACE_FORBIDDEN`; a viewer asking for message content gets `PHI_FORBIDDEN` (or `PHI_SEARCH_FORBIDDEN` for a search on message content).
application/json · ApiError
- 409The request conflicts with the current state.
application/json · ApiError
- 429Rate limit exceeded (see the `Retry-After` header), or on the AI routes the daily AI budget is used up.
application/json · ApiError
Example request
curl -X POST "$ENGINE_URL/api/settings/backups" \
-H "Authorization: Bearer $TOKEN" \
-H "Content-Type: application/json" \
-d '{}'Ask for a point-in-time restore
post/api/settings/backups/restore
Admin only, signed in as a person (403 SECOND_ADMIN_REQUIRED for a token). It creates a new instance from that moment and the current one keeps running; confirm: true is still required (400 CONFIRM_REQUIRED); the moment must be in the last 7 days (400 OUT_OF_WINDOW). Answers 202 pending: another admin approves it at /api/settings/backups/restore/approve within 24 hours. 409 NOT_CLOUD_SQL off Cloud SQL. Audited as backup.restore_requested. Rate limited to 10 requests per minute.
Minimum role: admin.
Auth: Bearer token (how to get one) · Operation: requestRestore
Request body (required)
application/json · object
atstringrequiredRFC 3339 UTC, within the last 7 days.
confirmbooleanrequiredOne of: true
Responses
- 202Waiting for a second admin.
Response fields
application/json · object
statusstringOne of: "pending"
requestIdstringatstring
- 400The request is malformed or fails validation.
application/json · ApiError
- 401No credential, or the token is invalid or expired.
application/json · ApiError
- 403The caller's role, license or network address does not allow this. A signed-in person who is not a member of the requested workspace gets code `WORKSPACE_FORBIDDEN`; a viewer asking for message content gets `PHI_FORBIDDEN` (or `PHI_SEARCH_FORBIDDEN` for a search on message content).
application/json · ApiError
- 409The request conflicts with the current state.
application/json · ApiError
- 429Rate limit exceeded (see the `Retry-After` header), or on the AI routes the daily AI budget is used up.
application/json · ApiError
Example request
curl -X POST "$ENGINE_URL/api/settings/backups/restore" \
-H "Authorization: Bearer $TOKEN" \
-H "Content-Type: application/json" \
-d '{
"at": "string",
"confirm": true
}'Approve a point-in-time restore
post/api/settings/backups/restore/approve
A second admin, signed in as a person (403 SECOND_ADMIN_REQUIRED), not the one who asked (403 SAME_ADMIN), approves once (409 ALREADY_DECIDED) within 24 hours (409 EXPIRED) while the moment is still in the window (400 OUT_OF_WINDOW). The approval is audited as backup.restore_approved first. When the engine's service account holds cloudsql.instances.clone and point-in-time recovery is on (canRestore), the engine writes backup.restore_starting (it must be written: 503 AUDIT_UNAVAILABLE and nothing cloned otherwise), clones the instance at that moment itself and answers { started: true, cloneInstance, at, note }, audited as backup.restore_started. Otherwise, or when Cloud SQL refuses (then with error), it returns the gcloud sql instances clone --point-in-time command an operator runs. Either way the clone is a new instance at that moment; the running one is untouched (operator guide, section 6). Rate limited to 20 requests per minute.
Minimum role: admin.
Auth: Bearer token (how to get one) · Operation: approveRestore
Request body (required)
application/json · object
requestIdstringrequired
Responses
- 200The clone started, or the clone command.
Response fields
application/json · object
atstringnotestringstartedbooleancloneInstancestringcommandstringerrorstringWhy Cloud SQL didn't start the restore.
- 400The request is malformed or fails validation.
application/json · ApiError
- 401No credential, or the token is invalid or expired.
application/json · ApiError
- 403The caller's role, license or network address does not allow this. A signed-in person who is not a member of the requested workspace gets code `WORKSPACE_FORBIDDEN`; a viewer asking for message content gets `PHI_FORBIDDEN` (or `PHI_SEARCH_FORBIDDEN` for a search on message content).
application/json · ApiError
- 404Not found in the caller's workspace.
application/json · ApiError
- 409The request conflicts with the current state.
application/json · ApiError
- 429Rate limit exceeded (see the `Retry-After` header), or on the AI routes the daily AI budget is used up.
application/json · ApiError
- 503A dependency is not available.
application/json · ApiError
Example request
curl -X POST "$ENGINE_URL/api/settings/backups/restore/approve" \
-H "Authorization: Bearer $TOKEN" \
-H "Content-Type: application/json" \
-d '{
"requestId": "string"
}'This workspace's own settings
get/api/settings/workspace
The caller's workspace's time zone ("Time zone for schedules and reports") and secret rotation reminder. Schedules, quiet hours, the nightly backup row and reports read the zone when they have none of their own. Viewers and up. Rate limited to 60 requests per minute.
Minimum role: viewer.
Auth: Bearer token (how to get one) · Operation: getWorkspaceSettings
Responses
- 200The workspace's settings.
Response fields
application/json · object
workspaceobjectrequired5 fields
workspaceIdstringrequiredtimeZonestringrequiredIANA time zone for schedules and reports;
UTCuntil an admin sets one.rotationReminderDaysintegerrequiredA secret older than this many days shows as overdue (90 until set).
privacyOfficerstring | nullrequiredWho "Goes to: privacy officer" notices reach: a person's id or an email address; null sends them to the active admins.
httpReachesTunnelsbooleanrequiredHTTP adapters (Generic REST, FHIR, the EHR adapters) may reach private addresses inside the remote subnets of this workspace's live tunnels, as MLLP and SFTP do. On (true) until an admin turns it off; loopback, link-local / metadata and the engine's own ranges are never reachable either way.
- 401No credential, or the token is invalid or expired.
application/json · ApiError
- 403The caller's role, license or network address does not allow this. A signed-in person who is not a member of the requested workspace gets code `WORKSPACE_FORBIDDEN`; a viewer asking for message content gets `PHI_FORBIDDEN` (or `PHI_SEARCH_FORBIDDEN` for a search on message content).
application/json · ApiError
- 429Rate limit exceeded (see the `Retry-After` header), or on the AI routes the daily AI budget is used up.
application/json · ApiError
- 500Unexpected server error.
application/json · ApiError
Example request
curl "$ENGINE_URL/api/settings/workspace" \
-H "Authorization: Bearer $TOKEN"Change this workspace's time zone, secret reminder, privacy officer or tunnel reach
put/api/settings/workspace
Admin only. Any of: timeZone, an IANA name such as America/Chicago or UTC (abbreviations such as CST are refused, 400); rotationReminderDays (Secrets & variables "Remind owners after"), 30, 60, 90, 180 or 365, after which a secret's value is overdue; privacyOfficer, an active person's id or an email address, or null to send those notices to the admins (an unknown or disabled person is 400); httpReachesTunnels, whether HTTP adapters may reach the remote subnets of the workspace's live tunnels (off: only SSRF_ALLOWLIST opens a private address). A workspace that does not exist is 404. Audited as settings.workspace_updated with before and after; a request that changes nothing writes and audits nothing. Rate limited to 20 requests per minute.
Minimum role: admin.
Auth: Bearer token (how to get one) · Operation: updateWorkspaceSettings
Request body (required)
application/json · object
timeZonestringrotationReminderDaysintegerOne of: 30, 60, 90, 180, 365
privacyOfficerstring | nullA person's id or an email address.
httpReachesTunnelsbooleanHTTP adapters reach the workspace's live tunnel subnets.
Responses
- 200The workspace's settings after the change.
Response fields
application/json · object
workspaceobjectrequired5 fields
workspaceIdstringrequiredtimeZonestringrequiredIANA time zone for schedules and reports;
UTCuntil an admin sets one.rotationReminderDaysintegerrequiredA secret older than this many days shows as overdue (90 until set).
privacyOfficerstring | nullrequiredWho "Goes to: privacy officer" notices reach: a person's id or an email address; null sends them to the active admins.
httpReachesTunnelsbooleanrequiredHTTP adapters (Generic REST, FHIR, the EHR adapters) may reach private addresses inside the remote subnets of this workspace's live tunnels, as MLLP and SFTP do. On (true) until an admin turns it off; loopback, link-local / metadata and the engine's own ranges are never reachable either way.
- 400The request is malformed or fails validation.
application/json · ApiError
- 401No credential, or the token is invalid or expired.
application/json · ApiError
- 403The caller's role, license or network address does not allow this. A signed-in person who is not a member of the requested workspace gets code `WORKSPACE_FORBIDDEN`; a viewer asking for message content gets `PHI_FORBIDDEN` (or `PHI_SEARCH_FORBIDDEN` for a search on message content).
application/json · ApiError
- 404Not found in the caller's workspace.
application/json · ApiError
- 429Rate limit exceeded (see the `Retry-After` header), or on the AI routes the daily AI budget is used up.
application/json · ApiError
- 500Unexpected server error.
application/json · ApiError
Example request
curl -X PUT "$ENGINE_URL/api/settings/workspace" \
-H "Authorization: Bearer $TOKEN" \
-H "Content-Type: application/json" \
-d '{
"timeZone": "string",
"rotationReminderDays": 30,
"privacyOfficer": "string",
"httpReachesTunnels": true
}'Resources MedHook created in the GCP project
get/api/settings/resources
Read only. Every resource in the engine's GCP project (GCP_PROJECT_ID) that MedHook created, with its type, name, region, who created it (engine at runtime or terraform), the marker that shows it and a console link: Settings › Resources. The markers are the ones deploy/inventory.sh and deploy/uninstall.sh use: a runtime resource is the engine's only when its name starts with the install's prefix AND it carries the engine's description or label (managed-by=medhook); Terraform's carry the label app=medhook or, where GCP has no labels, the prefix. Lists: compute.vpnTunnels.list, compute.targetVpnGateways.list, compute.vpnGateways.list, compute.externalVpnGateways.list, compute.routers.list, compute.routes.list, compute.firewalls.list, compute.networks.list, compute.subnetworks.list, compute.addresses.list, compute.forwardingRules.list, storage.buckets.list, pubsub.topics.list, pubsub.subscriptions.list. A list the engine's service account can't read is a gaps entry naming the permission and a read-only role that grants it (or the API to turn on); the rest still list. A non-GCP or local install answers enabled: false. Always 200; cached 60 s.
Minimum role: admin.
Auth: Bearer token (how to get one) · Operation: listMedhookResources
Responses
- 200The resources.
Response fields
application/json · object
enabledbooleanrequiredfalse on a non-GCP or local install (no GCP_PROJECT_ID, or no GKE metadata server).
reasonstringWhen enabled is false.
One of: "not-gcp", "no-credentials"
messagestringWhen enabled is false.
projectIdstringprefixstringThe install's name prefix (GCP_VPN_NAME_PREFIX).
resourcesarray of object8 fields
kindstringrequiredWhat it is.
One of: "vpn-tunnel", "classic-vpn-gateway", "ha-vpn-gateway", "peer-vpn-gateway", "router", "route", "firewall-rule", "network", "subnetwork", "address", "forwarding-rule", "bucket", "pubsub-topic", "pubsub-subscription", "router-bgp-peer", "router-interface", "router-route-policy"
typestringrequiredThe kind as the page shows it, e.g. VPN tunnel.
namestringrequiredIts GCP name.
regionstringrequiredIts region, a bucket's location, or global.
createdBystringrequiredWho created it.
One of: "engine", "terraform"
markerstringrequiredHow MedHook knows it is its own, e.g. name medhook-production-* and the engine's description.
consoleUrlstringrequiredThe Google Cloud console page for it.
parentstringThe Cloud Router a BGP session, router interface or route policy is on.
gapsarray of object6 fields
kindstringrequiredThe kind the engine couldn't list.
One of: "vpn-tunnel", "classic-vpn-gateway", "ha-vpn-gateway", "peer-vpn-gateway", "router", "route", "firewall-rule", "network", "subnetwork", "address", "forwarding-rule", "bucket", "pubsub-topic", "pubsub-subscription", "router-bgp-peer", "router-interface", "router-route-policy"
typestringrequiredreasonstringrequiredWhy.
One of: "permission", "api-disabled", "error"
permissionstringrequiredThe list permission, e.g. compute.firewalls.list.
rolestringrequiredA read-only role that grants it.
messagestringrequirede.g. Needs compute.firewalls.list.
checkedAtstring (date-time)When the lists were read.
- 401No credential, or the token is invalid or expired.
application/json · ApiError
- 403The caller's role, license or network address does not allow this. A signed-in person who is not a member of the requested workspace gets code `WORKSPACE_FORBIDDEN`; a viewer asking for message content gets `PHI_FORBIDDEN` (or `PHI_SEARCH_FORBIDDEN` for a search on message content).
application/json · ApiError
Example request
curl "$ENGINE_URL/api/settings/resources" \
-H "Authorization: Bearer $TOKEN"Schemas
Named objects the operations above link to.
ApiError
The error body. error is always present. code is present on most errors and is the field to branch on; a few routes and the sign-in and role checks return only error (and sometimes detail).
errorstringrequiredHuman-readable error message.
codestringMachine-readable error code.
One of: "BAD_REQUEST", "INVALID_REQUEST", "UNAUTHORIZED", "UNAUTHENTICATED", "FORBIDDEN", "NOT_FOUND", "CONFLICT", "UNPROCESSABLE_ENTITY", "RATE_LIMITED", "INTERNAL_ERROR", "SERVICE_UNAVAILABLE", "NOT_CONFIGURED", "SIGNATURE_REQUIRED", "INVALID_SIGNATURE", "TIMESTAMP_REQUIRED", "TIMESTAMP_INVALID", "TIMESTAMP_OUT_OF_TOLERANCE", "INVALID_CREDENTIALS", "INVALID_TOKEN", "PAYLOAD_TOO_LARGE", "INVALID_NDJSON", "PHI_NOT_AUTHORIZED", "PHI_IN_SANDBOX", "IN_PROGRESS", "RETRY_SCHEDULED", "WORKFLOW_DISABLED", "CONFLICTING_SCOPE", "ALREADY_DELIVERED", "CHAIN_TOO_DEEP", "NO_FAILED_DESTINATION", "STALE_SCOPE", "UNKNOWN_DESTINATION", "NO_DESTINATIONS", "NOT_A_MESSAGE", "AI_FEATURES_DISABLED"
detailsanyOptional structured context about the error.