Skip to content
Engine API

Settings

Settings endpoints of the MedHook engine API: 67 operations with parameters, schemas and a curl example for each.

On this page

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

  • 200The entries.
    Response fields

    application/json · object

    • entriesarray of object
      4 fields
      • idstring
      • cidrstring
      • labelstring | null
      • createdAtstring (date-time)
    • callerIpstring
  • 401No credential, or the token is invalid or expired.

    application/json · ApiError

  • 500Unexpected server error.

    application/json · ApiError

Example request

curl
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

  • cidrstringrequired
  • labelstring

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
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

NameInTypeDescription
idrequiredpathstring

Entry id.

Responses

  • 200Removed.

    application/json · object

  • 401No credential, or the token is invalid or expired.

    application/json · ApiError

  • 404Not found in the caller's workspace.

    application/json · ApiError

  • 500Unexpected server error.

    application/json · ApiError

Example request

curl
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

  • 200The settings.

    application/json · object

  • 401No credential, or the token is invalid or expired.

    application/json · ApiError

  • 500Unexpected server error.

    application/json · ApiError

Example request

curl
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

  • providerstring

    One of: "none", "datadog", "cloudwatch", "splunk"

  • datadogApiKeystring

    Datadog API key (write-only).

  • datadogSitestring

    A Datadog site, e.g. datadoghq.com.

  • datadogServicestring
  • cloudwatchRegionstring

    An AWS region, e.g. us-east-1.

  • cloudwatchLogGroupstring
  • cloudwatchLogStreamstring
  • awsAccessKeyIdstring

    AWS access key id (write-only).

  • awsSecretAccessKeystring

    AWS secret access key (write-only).

  • splunkHecUrlstring

    https URL, no user name or password.

  • splunkTokenstring

    Splunk HEC token (write-only).

  • splunkIndexstring
  • splunkSourcestring
  • testboolean

    Send 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
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
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

NameInTypeDescription
formatquerystring

zip for the signed .zip; JSON otherwise.

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
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

  • bundleobject

    A bundle from GET /api/settings/config-bundle.

  • zipstring

    A signed bundle .zip from GET /api/settings/config-bundle?format=zip, base64. Instead of bundle.

  • dryRunboolean

    Plan only; write nothing.

Responses

  • 200The plan, applied unless dryRun, and who signed the bundle.
    Response fields

    application/json · object

    • dryRunboolean
    • planobject

      The import plan.

    • signatureobject
      3 fields
      • signedbooleanrequired
      • keyIdstring

        The signing key's id (a .zip only).

      • thisEngineboolean

        The 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
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 object
    • errorsarray 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
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

    • okboolean
    • providerobject
  • 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
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

NameInTypeDescription
idrequiredquerystring

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
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

NameInTypeDescription
providerrequiredpathstring

Provider id (saml for the env provider).

Responses

  • 200SP metadata.

    application/samlmetadata+xml · string

  • 404Not found in the caller's workspace.

    application/json · ApiError

Example request

curl
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 | nullrequired
    • brandColorstring | nullrequired

      #rrggbb.

    • connectHoststring | nullrequired

      The shared link's white-label host: https://{connectHost}/t/{code}. Null: the engine's origin.

    • hasLogobooleanrequired
    • logoHashstring | nullrequired

      The 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
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 | null
  • brandColorstring | null
  • connectHoststring | null

    A 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 | nullrequired
    • brandColorstring | nullrequired

      #rrggbb.

    • connectHoststring | nullrequired

      The shared link's white-label host: https://{connectHost}/t/{code}. Null: the engine's origin.

    • hasLogobooleanrequired
    • logoHashstring | nullrequired

      The 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
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 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
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
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 | null
    • sourcestring | null

      One 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
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 | null
    • sourcestring | null

      One 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
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 object
      5 fields
      • idstring

        One of: "sso", "mfa", "backups", "support", "alerts", "secrets", "dirSync", "baa"

      • labelstring
      • okboolean
      • notestring
      • sectionstring

        The settings tab (/settings?tab=).

    • scoreinteger
    • totalinteger
    • textstring

      "{score}/{total}".

    • tonestring

      ok 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
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

    • rulesobjectrequired
      2 fields
      • blockRealPhiInSandboxbooleanrequired

        A 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 as sandbox.phi_rejected with the reason only.

      • requireSandboxRunbooleanrequired

        A deploy in a production workspace needs a passing run of the workflow's sandbox copy.

    • workspacesarray of objectrequired
      5 fields
      • idstring
      • namestring
      • slugstring
      • environmentstring

        One of: "production", "sandbox"

      • connectionsinteger

        Adapter 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
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

  • blockRealPhiInSandboxboolean
  • requireSandboxRunboolean
  • workspacesarray of object
    2 fields
    • idstringrequired
    • environmentstringrequired

      One of: "production", "sandbox"

Responses

  • 200The rules and the workspaces after the change.
    Response fields

    application/json · object

    • rulesobjectrequired
      2 fields
      • blockRealPhiInSandboxbooleanrequired

        A 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 as sandbox.phi_rejected with the reason only.

      • requireSandboxRunbooleanrequired

        A deploy in a production workspace needs a passing run of the workflow's sandbox copy.

    • workspacesarray of objectrequired
      5 fields
      • idstring
      • namestring
      • slugstring
      • environmentstring

        One of: "production", "sandbox"

      • connectionsinteger

        Adapter 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
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

    • policyobject
      3 fields
      • requireSsoboolean
      • directorySyncboolean
      • groupRolesarray of object
        2 fields
        • groupstringrequired

          A Google group's email address.

        • rolestringrequired

          One of: "admin", "operator", "viewer"

    • lastSyncAtstring

      ISO time of the newest directory sync, or null.

    • lastSyncobject

      { ok: true, added, roleChanged, disabled, members } (members per mapped group) or { ok: false, error }.

    • googleobject
      2 fields
      • configuredboolean
      • domainsarray 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
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

  • requireSsoboolean
  • directorySyncboolean
  • groupRolesarray of object
    2 fields
    • groupstringrequired

      A Google group's email address.

    • rolestringrequired

      One of: "admin", "operator", "viewer"

  • confirmboolean

    Must be true to turn Require SSO off.

Responses

  • 200The policy after the change.
    Response fields

    application/json · object

    • policyobject
      3 fields
      • requireSsoboolean
      • directorySyncboolean
      • groupRolesarray of object
        2 fields
        • groupstringrequired

          A Google group's email address.

        • rolestringrequired

          One of: "admin", "operator", "viewer"

    • lastSyncAtstring

      ISO time of the newest directory sync, or null.

    • lastSyncobject

      { ok: true, added, roleChanged, disabled, members } (members per mapped group) or { ok: false, error }.

    • googleobject
      2 fields
      • configuredboolean
      • domainsarray 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
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 object
      3 fields
      • groupstring
      • rolestring

        One 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
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 objectrequired
    2 fields
    • groupstringrequired

      A Google group's email address.

    • rolestringrequired

      One of: "admin", "operator", "viewer"

Responses

  • 200The table.
    Response fields

    application/json · object

    • groupsarray of object
      3 fields
      • groupstring
      • rolestring

        One 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
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
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

    • urlstring
    • authUrlstring
    • statestring
    • testIdstring
  • 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
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

  • 200The grants, rules and history.

    application/json · object

  • 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
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

    • actionstring

      One of: "grant", "revoke"

    • commandstring

      The terraform command an operator runs in Cloud Shell.

    • expiresAtstring

      RFC 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
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

    • actionstring

      One of: "grant", "revoke"

    • commandstring

      The terraform command an operator runs in Cloud Shell.

    • expiresAtstring

      RFC 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
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

    • actionstring

      One of: "grant", "revoke"

    • commandstring

      The terraform command an operator runs in Cloud Shell.

    • expiresAtstring

      RFC 3339, or null for a revoke.

    • daysinteger
    • signedOutinteger
    • signOutErrorstring
  • 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
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

    • rulesobject
      3 fields
      • maxDaysintegerrequired

        One of: 1, 3, 7, 30

      • allowPhibooleanrequired
      • secondAdminbooleanrequired
  • 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
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

  • maxDaysinteger

    One of: 1, 3, 7, 30

  • allowPhiboolean
  • secondAdminboolean

Responses

  • 200The rules after the change.
    Response fields

    application/json · object

    • rulesobject
      3 fields
      • maxDaysintegerrequired

        One of: 1, 3, 7, 30

      • allowPhibooleanrequired
      • secondAdminbooleanrequired
  • 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
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 object
      11 fields
      • idstring
      • emailstring
      • namestring | null
      • rolestring

        One of: "operator", "viewer"

      • daysinteger
      • phiboolean
      • statusstring

        One of: "pending", "active", "revoked", "expired"

      • requestedBystring
      • approvedBystring | null
      • grantedAtstring | null
      • endsAtstring | null
    • pendingarray of object
      11 fields
      • idstring
      • emailstring
      • namestring | null
      • rolestring

        One of: "operator", "viewer"

      • daysinteger
      • phiboolean
      • statusstring

        One of: "pending", "active", "revoked", "expired"

      • requestedBystring
      • approvedBystring | null
      • grantedAtstring | null
      • endsAtstring | 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
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

  • emailstringrequired
  • rolestringrequired

    One of: "operator", "viewer"

  • daysintegerrequired
  • phiboolean
  • reasonstring

    Why support needs PHI. Don't include patient details.

Responses

  • 201The grant.
    Response fields

    application/json · object

    • grantobject
      11 fields
      • idstring
      • emailstring
      • namestring | null
      • rolestring

        One of: "operator", "viewer"

      • daysinteger
      • phiboolean
      • statusstring

        One of: "pending", "active", "revoked", "expired"

      • requestedBystring
      • approvedBystring | null
      • grantedAtstring | null
      • endsAtstring | null
    • emailedboolean
    • linkstring

      A 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
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

NameInTypeDescription
idrequiredpathstring

The grant's id.

Responses

  • 200The grant.
    Response fields

    application/json · object

    • grantobject
      11 fields
      • idstring
      • emailstring
      • namestring | null
      • rolestring

        One of: "operator", "viewer"

      • daysinteger
      • phiboolean
      • statusstring

        One of: "pending", "active", "revoked", "expired"

      • requestedBystring
      • approvedBystring | null
      • grantedAtstring | null
      • endsAtstring | null
    • emailedboolean
    • linkstring

      A 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
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

NameInTypeDescription
idrequiredpathstring

The grant's id.

Responses

  • 200The ended grant.
    Response fields

    application/json · object

    • grantobject
      11 fields
      • idstring
      • emailstring
      • namestring | null
      • rolestring

        One of: "operator", "viewer"

      • daysinteger
      • phiboolean
      • statusstring

        One of: "pending", "active", "revoked", "expired"

      • requestedBystring
      • approvedBystring | null
      • grantedAtstring | null
      • endsAtstring | 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
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

    • keyIdstring

      Fingerprint of ENCRYPTION_MASTER_KEY; never key material.

    • previousKeysinteger

      Keys in ENCRYPTION_MASTER_KEY_PREVIOUS.

    • lastRotatedAtstring (date-time) | null

      The newest encryption.key_rotated event, or null.

    • runningboolean

      A rotation runs on any replica: read from the audit log (a start newer than any finish or failure, for up to 30 minutes).

    • lastobject

      The 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
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

  • confirmbooleanrequired

    Must be true.

Responses

  • 202Started.
    Response fields

    application/json · object

    • statusstring

      One 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
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

    • baaobject
      8 fields
      • signedboolean
      • signedAtstring (date-time) | null
      • signedBystring | null
      • sentAtstring (date-time) | null

        When the BAA went out for signature; null when not sent.

      • providerstring

        Who processes the prompts: Anthropic · Claude API or Google Vertex · Claude.

      • coversstring

        What the BAA covers: this deployment, project · region.

      • retentionstring

        Data retention: zero · not used for training.

      • documentobject | null

        The signed copy attached when the BAA was confirmed (never its bytes); null when none was attached.

        5 fields
        • idstring
        • filenamestring
        • sizeBytesinteger
        • sha256string

          SHA-256 of the PDF, hex.

        • uploadedAtstring (date-time)
    • featuresobject
      4 fields
      • agentboolean
      • mappingboolean

        Data map suggestions (mapping and condition suggest).

      • rewritesboolean

        Script rewrites (E4X and Rhapsody JavaScript).

      • auditAskboolean

        Ask the audit log.

    • envAllowsboolean

      AI_FEATURES_ENABLED lets AI run on this engine.

    • productionboolean
    • budgetobject

      Today's engine-wide AI budget (tokens and iterations).

    • monthlyobject | null

      This month's AI budget (G-settings-10); null when the spend can't be read.

      2 fields
      • budgetUsdnumber | null

        The monthly AI budget in US dollars; null is no cap.

      • usedUsdnumber

        Agent spend since 00:00 on the 1st in the workspace zone, priced from the provider price table.

    • effectiveobject

      What is on: AI_FEATURES_ENABLED allows AI, in production the BAA is signed, and the switch is on.

      4 fields
      • agentboolean
      • mappingboolean
      • rewritesboolean
      • auditAskboolean
  • 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
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

    • baaobject
      8 fields
      • signedboolean
      • signedAtstring (date-time) | null
      • signedBystring | null
      • sentAtstring (date-time) | null

        When the BAA went out for signature; null when not sent.

      • providerstring

        Who processes the prompts: Anthropic · Claude API or Google Vertex · Claude.

      • coversstring

        What the BAA covers: this deployment, project · region.

      • retentionstring

        Data retention: zero · not used for training.

      • documentobject | null

        The signed copy attached when the BAA was confirmed (never its bytes); null when none was attached.

        5 fields
        • idstring
        • filenamestring
        • sizeBytesinteger
        • sha256string

          SHA-256 of the PDF, hex.

        • uploadedAtstring (date-time)
    • featuresobject
      4 fields
      • agentboolean
      • mappingboolean

        Data map suggestions (mapping and condition suggest).

      • rewritesboolean

        Script rewrites (E4X and Rhapsody JavaScript).

      • auditAskboolean

        Ask the audit log.

    • envAllowsboolean

      AI_FEATURES_ENABLED lets AI run on this engine.

    • productionboolean
    • budgetobject

      Today's engine-wide AI budget (tokens and iterations).

    • monthlyobject | null

      This month's AI budget (G-settings-10); null when the spend can't be read.

      2 fields
      • budgetUsdnumber | null

        The monthly AI budget in US dollars; null is no cap.

      • usedUsdnumber

        Agent spend since 00:00 on the 1st in the workspace zone, priced from the provider price table.

    • effectiveobject

      What is on: AI_FEATURES_ENABLED allows AI, in production the BAA is signed, and the switch is on.

      4 fields
      • agentboolean
      • mappingboolean
      • rewritesboolean
      • auditAskboolean
  • 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
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

NameInTypeDescription
idquerystring

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
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)required

    The signed BAA, a PDF.

  • confirmstringrequired

    One of: "true"

Responses

  • 200The settings after the change.
    Response fields

    application/json · object

    • baaobject
      8 fields
      • signedboolean
      • signedAtstring (date-time) | null
      • signedBystring | null
      • sentAtstring (date-time) | null

        When the BAA went out for signature; null when not sent.

      • providerstring

        Who processes the prompts: Anthropic · Claude API or Google Vertex · Claude.

      • coversstring

        What the BAA covers: this deployment, project · region.

      • retentionstring

        Data retention: zero · not used for training.

      • documentobject | null

        The signed copy attached when the BAA was confirmed (never its bytes); null when none was attached.

        5 fields
        • idstring
        • filenamestring
        • sizeBytesinteger
        • sha256string

          SHA-256 of the PDF, hex.

        • uploadedAtstring (date-time)
    • featuresobject
      4 fields
      • agentboolean
      • mappingboolean

        Data map suggestions (mapping and condition suggest).

      • rewritesboolean

        Script rewrites (E4X and Rhapsody JavaScript).

      • auditAskboolean

        Ask the audit log.

    • envAllowsboolean

      AI_FEATURES_ENABLED lets AI run on this engine.

    • productionboolean
    • budgetobject

      Today's engine-wide AI budget (tokens and iterations).

    • monthlyobject | null

      This month's AI budget (G-settings-10); null when the spend can't be read.

      2 fields
      • budgetUsdnumber | null

        The monthly AI budget in US dollars; null is no cap.

      • usedUsdnumber

        Agent spend since 00:00 on the 1st in the workspace zone, priced from the provider price table.

    • effectiveobject

      What is on: AI_FEATURES_ENABLED allows AI, in production the BAA is signed, and the switch is on.

      4 fields
      • agentboolean
      • mappingboolean
      • rewritesboolean
      • auditAskboolean
  • 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
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 object
      9 fields
      • kindstringrequired

        One of: "email", "sms", "slack", "pagerduty", "teams", "webhook"

      • labelstringrequired

        Email, Text (SMS), Slack, PagerDuty, Microsoft Teams, Webhook.

      • viastringrequired

        The provider: SMTP, SendGrid, Twilio, MedHook app, …

      • connectedbooleanrequired
      • providerstring | null

        One of: "smtp", "sendgrid", "twilio", "slack", "pagerduty", "teams", "webhook"

      • linesarray of objectrequired

        What 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
        • kstring
        • vstring
      • secretHintstring | null

        The credential's last four characters, e.g. …WXYZ; null for a secret shorter than 12 characters or a secret URL (Teams).

      • connectedBystring | null
      • connectedAtstring (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
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

    • channelobject
      9 fields
      • kindstringrequired

        One of: "email", "sms", "slack", "pagerduty", "teams", "webhook"

      • labelstringrequired

        Email, Text (SMS), Slack, PagerDuty, Microsoft Teams, Webhook.

      • viastringrequired

        The provider: SMTP, SendGrid, Twilio, MedHook app, …

      • connectedbooleanrequired
      • providerstring | null

        One of: "smtp", "sendgrid", "twilio", "slack", "pagerduty", "teams", "webhook"

      • linesarray of objectrequired

        What 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
        • kstring
        • vstring
      • secretHintstring | null

        The credential's last four characters, e.g. …WXYZ; null for a secret shorter than 12 characters or a secret URL (Teams).

      • connectedBystring | null
      • connectedAtstring (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
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

NameInTypeDescription
kindrequiredpathstring

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

    • channelobject
      9 fields
      • kindstringrequired

        One of: "email", "sms", "slack", "pagerduty", "teams", "webhook"

      • labelstringrequired

        Email, Text (SMS), Slack, PagerDuty, Microsoft Teams, Webhook.

      • viastringrequired

        The provider: SMTP, SendGrid, Twilio, MedHook app, …

      • connectedbooleanrequired
      • providerstring | null

        One of: "smtp", "sendgrid", "twilio", "slack", "pagerduty", "teams", "webhook"

      • linesarray of objectrequired

        What 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
        • kstring
        • vstring
      • secretHintstring | null

        The credential's last four characters, e.g. …WXYZ; null for a secret shorter than 12 characters or a secret URL (Teams).

      • connectedBystring | null
      • connectedAtstring (date-time) | null
    • fallbackobject
      2 fields
      • tostring

        One 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
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

  • payloadstringrequired

    Slack'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
curl -X POST "$ENGINE_URL/api/notifications/slack/actions" \
  -H "Content-Type: application/x-www-form-urlencoded" \
  --data-binary @body

Send 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

    • tostring

      The caller's name, or email.

    • resultsarray of object
      8 fields
      • kindstringrequired

        One of: "email", "sms", "slack"

      • channelstring

        The same as kind.

        One of: "email", "sms", "slack"

      • labelstringrequired
      • okbooleanrequired
      • deliveredboolean

        The same as ok.

      • msintegerrequired
      • errorstring | null
      • skippedboolean
    • noteobject
      2 fields
      • textstring
      • tonestring

        One 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
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 object
      5 fields
      • eventstringrequired

        One of: "tunnel_down", "workflow_failing", "messages_waiting", "deploy_approval", "agent_asks", "audit_flag", "secret_expiring", "weekly_summary"

      • labelstringrequired

        e.g. Tunnel down 2 min.

      • goesTostringrequired

        e.g. owner + on-call.

      • prioritystringrequired

        One of: "P1", "P2", "P3"

      • cellsobjectrequired
        4 fields
        • emailobjectrequired
          2 fields
          • onbooleanrequired

            On and the channel connected: what is really sent.

          • availablebooleanrequired

            The channel is connected; a dot that isn't is inert.

        • smsobjectrequired
          2 fields
          • onbooleanrequired

            On and the channel connected: what is really sent.

          • availablebooleanrequired

            The channel is connected; a dot that isn't is inert.

        • slackobjectrequired
          2 fields
          • onbooleanrequired

            On and the channel connected: what is really sent.

          • availablebooleanrequired

            The channel is connected; a dot that isn't is inert.

        • pagerdutyobjectrequired
          2 fields
          • onbooleanrequired

            On and the channel connected: what is really sent.

          • availablebooleanrequired

            The 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
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 objectrequired
    5 fields
    • eventstringrequired

      One of: "tunnel_down", "workflow_failing", "messages_waiting", "deploy_approval", "agent_asks", "audit_flag", "secret_expiring", "weekly_summary"

    • emailboolean
    • smsboolean
    • slackboolean
    • pagerdutyboolean

Responses

  • 200The grid after the change.
    Response fields

    application/json · object

    • routesarray of object
      5 fields
      • eventstringrequired

        One of: "tunnel_down", "workflow_failing", "messages_waiting", "deploy_approval", "agent_asks", "audit_flag", "secret_expiring", "weekly_summary"

      • labelstringrequired

        e.g. Tunnel down 2 min.

      • goesTostringrequired

        e.g. owner + on-call.

      • prioritystringrequired

        One of: "P1", "P2", "P3"

      • cellsobjectrequired
        4 fields
        • emailobjectrequired
          2 fields
          • onbooleanrequired

            On and the channel connected: what is really sent.

          • availablebooleanrequired

            The channel is connected; a dot that isn't is inert.

        • smsobjectrequired
          2 fields
          • onbooleanrequired

            On and the channel connected: what is really sent.

          • availablebooleanrequired

            The channel is connected; a dot that isn't is inert.

        • slackobjectrequired
          2 fields
          • onbooleanrequired

            On and the channel connected: what is really sent.

          • availablebooleanrequired

            The channel is connected; a dot that isn't is inert.

        • pagerdutyobjectrequired
          2 fields
          • onbooleanrequired

            On and the channel connected: what is really sent.

          • availablebooleanrequired

            The 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
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

    • prefsobject
      8 fields
      • quietHoursbooleanrequired
      • quietStartstringrequired

        HH:MM, local.

      • quietEndstringrequired

        HH:MM, local.

      • timeZonestring | nullrequired

        IANA zone; null = the engine's.

      • smsOnlyP1booleanrequired
      • dailyDigestbooleanrequired
      • phonestring | nullrequired

        E.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
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

  • quietHoursboolean
  • quietStartstring

    HH:MM, local.

  • quietEndstring

    HH:MM, local.

  • timeZonestring | null

    IANA zone; null = the engine's.

  • smsOnlyP1boolean
  • dailyDigestboolean
  • phonestring | null

    E.164.

  • userIdstring

    Optional; must be the caller's own id (else 403).

Responses

  • 200Your preferences.
    Response fields

    application/json · object

    • prefsobject
      8 fields
      • quietHoursbooleanrequired
      • quietStartstringrequired

        HH:MM, local.

      • quietEndstringrequired

        HH:MM, local.

      • timeZonestring | nullrequired

        IANA zone; null = the engine's.

      • smsOnlyP1booleanrequired
      • dailyDigestbooleanrequired
      • phonestring | nullrequired

        E.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
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

    • prefsobject
      8 fields
      • quietHoursbooleanrequired
      • quietStartstringrequired

        HH:MM, local.

      • quietEndstringrequired

        HH:MM, local.

      • timeZonestring | nullrequired

        IANA zone; null = the engine's.

      • smsOnlyP1booleanrequired
      • dailyDigestbooleanrequired
      • phonestring | nullrequired

        E.164.

      • phoneVerifiedbooleanrequired
    • sentboolean

      Present 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
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

    • sentinteger
    • failedinteger
  • 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
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

    • onCallobject
      8 fields
      • quietHoldbooleanrequired

        Quiet hours for P2 and P3 are on.

      • quietStartstringrequired

        HH:MM, local to timezone.

      • quietEndstringrequired

        HH:MM, local to timezone.

      • timezonestringrequired

        IANA zone.

      • holdPrioritiesarray of stringrequired

        The priorities quiet hours hold (default P2 and P3). P1 always pages and is refused here.

      • quietSubstringrequired

        e.g. held until 07:00 CT; P1 always pages.

      • pagerdutyobjectrequired
        2 fields
        • connectedbooleanrequired

          Connected in Settings > Notifications.

        • substringrequired

          e.g. service “…” · schedule …, #channel · connected as MedHook, or not connected.

      • slackobjectrequired
        2 fields
        • connectedbooleanrequired

          Connected in Settings > Notifications.

        • substringrequired

          e.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
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

  • quietHoldboolean

    Quiet hours for P2 and P3 are on.

  • quietStartstring

    HH:MM, local to timezone.

  • quietEndstring

    HH:MM, local to timezone.

  • timezonestring

    IANA zone.

  • holdPrioritiesarray of string

    The priorities quiet hours hold (default P2 and P3). P1 always pages and is refused here.

  • quietHoursobject
    3 fields
    • fromstringrequired

      HH:MM, local to tz.

    • tostringrequired

      HH:MM, local to tz.

    • tzstring

      IANA zone; the saved zone when left out.

Responses

  • 200The block after the change.
    Response fields

    application/json · object

    • onCallobject
      8 fields
      • quietHoldbooleanrequired

        Quiet hours for P2 and P3 are on.

      • quietStartstringrequired

        HH:MM, local to timezone.

      • quietEndstringrequired

        HH:MM, local to timezone.

      • timezonestringrequired

        IANA zone.

      • holdPrioritiesarray of stringrequired

        The priorities quiet hours hold (default P2 and P3). P1 always pages and is refused here.

      • quietSubstringrequired

        e.g. held until 07:00 CT; P1 always pages.

      • pagerdutyobjectrequired
        2 fields
        • connectedbooleanrequired

          Connected in Settings > Notifications.

        • substringrequired

          e.g. service “…” · schedule …, #channel · connected as MedHook, or not connected.

      • slackobjectrequired
        2 fields
        • connectedbooleanrequired

          Connected in Settings > Notifications.

        • substringrequired

          e.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
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

  • channelstringrequired

    One of: "pagerduty", "slack"

Responses

  • 200Sent.
    Response fields

    application/json · object

    • okboolean
    • notestring
  • 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
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

    • backupsobject
      17 fields
      • managedbooleanrequired

        The engine's database is Cloud SQL.

      • readablebooleanrequired

        Cloud SQL answered.

      • reasonstring | nullrequired

        Why not, when not readable.

      • instancestring | nullrequired
      • nightlyobjectrequired
        2 fields
        • startTimestring | nullrequired

          HH:MM UTC.

        • lastRunobject | nullrequired
          3 fields
          • atstringrequired

            ISO start of the run.

          • durationMsinteger | nullrequired
          • sizeBytesinteger | nullrequired
      • pitrobjectrequired
        2 fields
        • enabledbooleanrequired
        • daysintegerrequired
      • pendingarray of objectrequired
        4 fields
        • requestIdstringrequired
        • atstringrequired

          The moment to restore to, RFC 3339 UTC.

        • requestedBystring | nullrequired
        • requestedAtstringrequired
      • timeZonestring

        The workspace's IANA time zone (UTC until set) the nightly row is shown in.

      • canBackupbooleanrequired

        The engine's service account holds cloudsql.backupRuns.create, so Back up now starts a backup run itself (G-settings-16).

      • canRestorebooleanrequired

        It holds cloudsql.instances.clone and point-in-time recovery is on, so an approved restore clones the instance itself.

      • restoreBlockedstring | nullrequired

        Why 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"

      • runbookobjectrequired
        2 fields
        • backupNowstring | nullrequired

          The gcloud command when the engine may not back up.

        • restorestring | nullrequired

          The gcloud clone command, with the moment to fill, when the engine may not restore (none while point-in-time recovery is off).

      • schedulestring | nullrequired

        The nightly window's start, HH:MM UTC.

      • lastRunAtstring | nullrequired

        The last nightly run's start.

      • durationMsinteger | nullrequired
      • sizeBytesinteger | nullrequired
      • pitrWindowDaysintegerrequired

        Days 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
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

    • commandstring
    • errorstring

      Why Cloud SQL didn't start the backup.

    • startedboolean
    • operationstring | 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
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

  • atstringrequired

    RFC 3339 UTC, within the last 7 days.

  • confirmbooleanrequired

    One of: true

Responses

  • 202Waiting for a second admin.
    Response fields

    application/json · object

    • statusstring

      One of: "pending"

    • requestIdstring
    • atstring
  • 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
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

    • atstring
    • notestring
    • startedboolean
    • cloneInstancestring
    • commandstring
    • errorstring

      Why 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
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

    • workspaceobjectrequired
      5 fields
      • workspaceIdstringrequired
      • timeZonestringrequired

        IANA time zone for schedules and reports; UTC until an admin sets one.

      • rotationReminderDaysintegerrequired

        A secret older than this many days shows as overdue (90 until set).

      • privacyOfficerstring | nullrequired

        Who "Goes to: privacy officer" notices reach: a person's id or an email address; null sends them to the active admins.

      • httpReachesTunnelsbooleanrequired

        HTTP 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
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

  • timeZonestring
  • rotationReminderDaysinteger

    One of: 30, 60, 90, 180, 365

  • privacyOfficerstring | null

    A person's id or an email address.

  • httpReachesTunnelsboolean

    HTTP adapters reach the workspace's live tunnel subnets.

Responses

  • 200The workspace's settings after the change.
    Response fields

    application/json · object

    • workspaceobjectrequired
      5 fields
      • workspaceIdstringrequired
      • timeZonestringrequired

        IANA time zone for schedules and reports; UTC until an admin sets one.

      • rotationReminderDaysintegerrequired

        A secret older than this many days shows as overdue (90 until set).

      • privacyOfficerstring | nullrequired

        Who "Goes to: privacy officer" notices reach: a person's id or an email address; null sends them to the active admins.

      • httpReachesTunnelsbooleanrequired

        HTTP 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
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

    • enabledbooleanrequired

      false on a non-GCP or local install (no GCP_PROJECT_ID, or no GKE metadata server).

    • reasonstring

      When enabled is false.

      One of: "not-gcp", "no-credentials"

    • messagestring

      When enabled is false.

    • projectIdstring
    • prefixstring

      The install's name prefix (GCP_VPN_NAME_PREFIX).

    • resourcesarray of object
      8 fields
      • kindstringrequired

        What 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"

      • typestringrequired

        The kind as the page shows it, e.g. VPN tunnel.

      • namestringrequired

        Its GCP name.

      • regionstringrequired

        Its region, a bucket's location, or global.

      • createdBystringrequired

        Who created it.

        One of: "engine", "terraform"

      • markerstringrequired

        How MedHook knows it is its own, e.g. name medhook-production-* and the engine's description.

      • consoleUrlstringrequired

        The Google Cloud console page for it.

      • parentstring

        The Cloud Router a BGP session, router interface or route policy is on.

    • gapsarray of object
      6 fields
      • kindstringrequired

        The 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"

      • typestringrequired
      • reasonstringrequired

        Why.

        One of: "permission", "api-disabled", "error"

      • permissionstringrequired

        The list permission, e.g. compute.firewalls.list.

      • rolestringrequired

        A read-only role that grants it.

      • messagestringrequired

        e.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
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).

  • errorstringrequired

    Human-readable error message.

  • codestring

    Machine-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"

  • detailsany

    Optional structured context about the error.