VPN Tunnels
VPN Tunnels endpoints of the MedHook engine API: 66 operations with parameters, schemas and a curl example for each.
On this page
- List VPN tunnels
- Create VPN tunnel
- Get VPN tunnel, peer config or vendor config file
- Update VPN tunnel
- Delete VPN tunnel
- Add a backup tunnel (failover pair)
- Make a paired tunnel carry traffic
- Resume the tunnel watcher
- Test connectivity through a tunnel
- List tunnel requests on a FortiGate
- Ask to create a tunnel on a FortiGate
- Preview a FortiGate tunnel request
- Get a FortiGate tunnel request
- Change a FortiGate tunnel request
- Cancel a FortiGate tunnel request
- Approve or reject a FortiGate tunnel request
- Apply an approved FortiGate tunnel request
- List FortiGate connections
- Add a FortiGate connection
- Test a FortiGate connection
- Get a FortiGate connection
- Change a FortiGate connection
- Delete a FortiGate connection
- List the FortiGate's IPsec tunnels
- Track FortiGate tunnels
- List tracked FortiGate tunnels
- Rename a tracked tunnel or set its NATed subnets
- Stop tracking a FortiGate tunnel
- Test reachability through a FortiGate tunnel
- Diagnose a FortiGate tunnel
- Bring a FortiGate tunnel up
- IPsec sidecar configuration
- IPsec sidecar status
- Handoff packet
- Send a test HL7 message through a tunnel
- Check a tunnel's subnets before changing them
- VPN tunnels created outside MedHook
- VPN quota preflight
- Workflows using a tunnel
- Tunnel audit trail
- Tunnel traffic
- Diagnose a tunnel
- Read a tunnel's IKE log excerpt
- Read the tunnel's shared link
- Make a new shared link
- Copy the shared link
- Open the engineer page
- Download a firewall config
- Reveal the pre-shared key once
- Send a test message through the tunnel
- The brand's logo
- Refresh the live status strip
- Preview the engineer page
- Read the tunnel's settings
- Change the tunnel's settings
- Run a failover test
- Create a one-time key link
- Roll back to the previous pre-shared key for 24 h
- Rotate the pre-shared key (staged)
- Cancel a staged PSK rotation
- Apply a staged PSK now
- Read the tunnel's lab link
- Set the tunnel's lab link
- Clear the tunnel's lab link
- Read from the tunnel's lab
- Act on the tunnel's lab
- Schemas
Site-to-site IPsec tunnels (GKE / GCP Classic VPN). Workspace-scoped.
List VPN tunnels
get/api/vpn-tunnels
Site-to-site tunnels in the current workspace, with live GCP status. Filtering and paging happen after the workspace query. When the engine is not on GKE the response is { enabled: false, reason, tunnels: [], nextCursor: null }.
Auth: Bearer token (how to get one) · Operation: listVpnTunnels
Parameters
| Name | In | Type | Description |
|---|---|---|---|
q | query | string | Case-insensitive match on name, peer IP or any remote subnet. |
state | query | string | Comma-separated stored states: provisioning, ready, failed, deleting, updating. |
health | query | string | Comma-separated live health: established, degraded, connecting, down, unknown. |
limit | query | integer | |
cursor | query | string | Tunnel id from a previous page's |
view | query | string |
|
Responses
- 200Tunnel page. With `view=health`, each tunnel is `{ id, name, health }` and there is no `gateway`.
Response fields
application/json · object
enabledbooleanreasonstringgatewayobject3 fields
ipstringregionstringlocalSubnetsarray of string
statusErrorstring | nullSet when live GCP status could not be read; the list is still returned.
totalintegerMatches across all pages.
tunnelsarray of VpnTunnelnextCursorstring | null
- 400Invalid q / state / health / limit / view.
application/json · ApiError
Example request
curl "$ENGINE_URL/api/vpn-tunnels" \
-H "Authorization: Bearer $TOKEN"Create VPN tunnel
post/api/vpn-tunnels
Creates the record and provisions the GCP tunnel in the background. The pre-shared key is returned once here. When the handoff names the network engineer's email (not Interconnect), also makes the tunnel's shared link (audited vpn_tunnel.share_link_created) and emails it through the engine's email channel (audited vpn_tunnel.share_emailed with the recipient's domain only), answered as share. The remote subnets are checked against the VPN tunnels created outside MedHook in the engine's GCP project (GET /api/vpn-tunnels/external): an overlap is answered in warnings and doesn't stop the create; a subnet identical to a range such a tunnel already routes at the same or a better priority than the new tunnel's routes (1000) is a 400, since GCP would split or keep its traffic. When the tunnels can't be listed, warnings says the check couldn't run. A remote subnet overlapping another MedHook tunnel's or the cluster's ranges is a 409 SUBNET_OVERLAP whose nat offers per-tunnel NAT: sent again with nat: true, the remote subnets are the organization's real ranges, MedHook assigns each a unique translated range of the same size (VPN_NAT_POOL, default 100.64.0.0/10) that GCP routes and the organization's firewall maps 1:1 onto, and the overlap is answered in warnings; the tunnel's natMappings lists the pairs and destinations use the translated addresses. Before anything is created the project's VPN quotas are read (GET /api/vpn-tunnels/quota): a tunnel that would pass one is a 409 QUOTA_EXCEEDED naming it with the Cloud console link; the answer's quota carries what was read. Rate limited: 10 req / 60 s.
Auth: Bearer token (how to get one) · Operation: createVpnTunnel
Request body (required)
application/json · object
namestringrequiredpeerIpstringrequiredPublic IPv4 address of the healthcare organization's VPN gateway.
remoteSubnetsarray of stringrequiredHealthcare organization side IPv4 network CIDRs, /8 to /32.
localSubnetsarray of stringThe MedHook side's protected networks for this tunnel (Classic and HA; ignored for Interconnect). Omitted or
[]: the deployment's default, the node subnet plus Terraform'svpn_extra_local_ranges. Use it to carry your other applications' networks: Classic puts them in the local traffic selector, HA advertises exactly them on the tunnel's BGP sessions, and the partner's firewall configs and connection packet list them. Changing it re-creates the tunnel. A range that overlaps the tunnel's own remote subnets is a 400; overlaps with other tunnels, the cluster's pod or service ranges or VPN tunnels created outside MedHook are answered inwarnings.ikeVersionintegerOne of: 1, 2
sharedSecretstringPre-shared key. Generated when omitted.
peerAsnintegerHA VPN only: the healthcare organization's BGP ASN. New tunnel sends 64512.
bgpRangesarray of stringHA VPN only: one link-local /30 per interface. Omitted: the server allocates the first pair no HA tunnel on the shared Cloud Router holds.
descriptionstringnatbooleanPer-tunnel NAT (Classic and HA):
remoteSubnetsare the organization's real ranges, which may overlap another organization's. MedHook assigns each a unique translated range of the same size; GCP routes those, the organization's firewall maps its real range 1:1 onto them, and destinations use the translated addresses. See the tunnel'snatMappings.One of: true
handoffobjectOptional handoff packet details stored with the tunnel. Unknown fields are refused. The created audit row records only whether one was sent.
7 fields
hospitalstringThe healthcare organization's name.
cutoverWindowstringWhen senders move over, e.g. Sat 02:00-04:00.
legacyHoststringThe interface engine senders use today.
legacyEnginestringThat engine's kind; unset or "other" keeps the packet neutral.
One of: "rhapsody", "mirth", "other"
deviceConfigstringTheir firewall, e.g. pfSense.
sendersarray of objectDefaults to [].
3 fields
namestringrequiredfromstringrequiredWhere the sender sends today.
tostringrequiredWhere it sends after cutover.
contactsarray of objectDefaults to [].
2 fields
rolestringrequiredvaluestringrequiredAn email or phone. The network engineer's email gets the shared link.
Responses
- 202Provisioning started.
Response fields
application/json · object
peerConfigVpnPeerConfigWhat the healthcare organization's network engineer enters on their firewall.
sharedSecretappears only when it was just generated orreveal=1was passed.shareobject | nullThe new tunnel's shared link, made when the handoff names the network engineer's email (not for Interconnect); null otherwise, or when making it failed (New link on the Config tab makes one).
4 fields
urlstringrequiredThe shared link's short URL, https://{connect host}/t/{code}, for the network engineer.
expiresAtstring (date-time)requiredrecipientstringrequiredThe handoff packet's first email contact.
emailedbooleanrequiredEmailed to the recipient through the engine's email channel. False when the engine has none or the send failed: copy the link and send it yourself.
warningsarray of objectOverlaps with VPN tunnels created outside MedHook in the engine's GCP project, which don't stop the change, or why they couldn't be checked. Empty when there is nothing to say. A subnet identical to a range such a tunnel already routes at the same or a better priority is a 400 instead (Classic tunnels only).
2 fields
patharray of string | integerrequired["remoteSubnets", i]for one subnet,["remoteSubnets"]for the whole list.messagestringrequiredNames the external tunnel, its region and the overlapping CIDRs; or that the check couldn't run (HA tunnels learn their ranges over BGP; a refused listing names roles/compute.networkViewer).
quotaobject | nullThe project's VPN quotas as read before provisioning (the
GET /api/vpn-tunnels/quotashape); null for Interconnect.
- 400Invalid tunnel.
application/json · ApiError
- 409A tunnel with that name already exists (CONFLICT), a remote subnet overlaps another tunnel or the cluster (SUBNET_OVERLAP, offers `nat`), a GCP quota has no room (QUOTA_EXCEEDED), or the NAT pool has no free range (NAT_POOL_EXHAUSTED).
application/json · ApiError
- 501`NOT_CONFIGURED` — the engine is not running on the GKE deployment (GCP_VPN_* env vars unset).
application/json · ApiError
Example request
curl -X POST "$ENGINE_URL/api/vpn-tunnels" \
-H "Authorization: Bearer $TOKEN" \
-H "Content-Type: application/json" \
-d '{
"name": "string",
"peerIp": "203.0.113.10",
"remoteSubnets": [
"10.20.0.0/24"
],
"localSubnets": [
"10.250.0.0/24"
],
"ikeVersion": 2,
"sharedSecret": "string",
"peerAsn": 64512,
"bgpRanges": [
"169.254.0.1/30"
],
"description": "string",
"nat": true,
"handoff": {
"hospital": "string",
"cutoverWindow": "string",
"legacyHost": "string",
"legacyEngine": "rhapsody",
"deviceConfig": "string",
"senders": [
{
"name": "string",
"from": "10.20.0.40:6661",
"to": "10.20.0.40:6661"
}
],
"contacts": [
{
"role": "Network engineer",
"value": "string"
}
]
}
}'Get VPN tunnel, peer config or vendor config file
get/api/vpn-tunnels/{id}
Returns the tunnel and its peer config. With format, returns a healthcare-organization-side config file as text/plain attachment instead. Without reveal=1 the key is written as <from the one-time link>. The PSK is included only with reveal=1, which is audited (vpn_tunnel.secret_revealed); while a PSK rollback is set (pskRollbackUntil) it is the held newer key, as one-time links hand out. Rate limited: 30 req / 60 s.
Auth: Bearer token (how to get one) · Operation: getVpnTunnel
Parameters
| Name | In | Type | Description |
|---|---|---|---|
idrequired | path | string | Tunnel id. |
reveal | query | string | Include the pre-shared key. |
format | query | string | Download a vendor config file. |
Responses
- 200Tunnel + peer config, or the config file when `format` is set.
application/json · VpnTunnelWithConfig
text/plain · string
- 400Unknown format.
application/json · ApiError
- 404Tunnel not found in this workspace.
application/json · ApiError
- 501`NOT_CONFIGURED` — the engine is not running on the GKE deployment (GCP_VPN_* env vars unset).
application/json · ApiError
Example request
curl "$ENGINE_URL/api/vpn-tunnels/<id>" \
-H "Authorization: Bearer $TOKEN"Update VPN tunnel
patch/api/vpn-tunnels/{id}
A rename returns 200. Changing peerIp, remoteSubnets, ikeVersion or sharedSecret, an HA tunnel's peerAsn or bgpRanges (400 on other types, or for a /30 another HA tunnel holds), rotateSecret: true, or retry: true re-creates the GCP tunnel in the background and returns 202 (409 if the tunnel is provisioning, updating or deleting). With rotateSecret, the new secret is returned once in peerConfig; during a PSK rollback rotateSecret puts back the held key instead (no secret returned, audited as vpn_tunnel.psk_rollback_ended) and sharedSecret is a 409. New remoteSubnets are checked against the VPN tunnels created outside MedHook as on create (warnings, or a 400 for a range already routed at the tunnel's route priority or better). Rate limited: 10 req / 60 s.
Auth: Bearer token (how to get one) · Operation: updateVpnTunnel
Parameters
| Name | In | Type | Description |
|---|---|---|---|
idrequired | path | string | Tunnel id. |
Request body (required)
application/json · object
namestringpeerIpstringPublic IPv4 address of the healthcare organization's VPN gateway.
remoteSubnetsarray of stringHealthcare organization side IPv4 network CIDRs, /8 to /32.
localSubnetsarray of stringThe MedHook side's protected networks for this tunnel (Classic and HA; ignored for Interconnect). Omitted or
[]: the deployment's default, the node subnet plus Terraform'svpn_extra_local_ranges. Use it to carry your other applications' networks: Classic puts them in the local traffic selector, HA advertises exactly them on the tunnel's BGP sessions, and the partner's firewall configs and connection packet list them. Changing it re-creates the tunnel. A range that overlaps the tunnel's own remote subnets is a 400; overlaps with other tunnels, the cluster's pod or service ranges or VPN tunnels created outside MedHook are answered inwarnings.ikeVersionintegerOne of: 1, 2
sharedSecretstringPre-shared key. Generated when omitted.
rotateSecretbooleanOne of: true
retrybooleanRe-create as-is (e.g. after a failed provision).
One of: true
proposalstringWith
rotateSecret: the signed proposal of the Agent card the rotation was opened from, auditedai.proposal.resolvedwith the key version the rotation goes to; the card reads it in progress until the tunnel is on that version, and failed if the background job fails. Not a tunnel field; alone it is nothing to update (400).peerAsnintegerHA VPN only: the healthcare organization's BGP ASN. New tunnel sends 64512. Changing it changes their side of the config: send the config again.
bgpRangesarray of stringHA VPN only: new link-local /30s, one per interface (each its own /30). The shared link shows the new values; a config or connection packet already downloaded keeps the old ones, so send the config again.
descriptionstringnatbooleanTurn per-tunnel NAT on. On a NAT tunnel,
remoteSubnetssent are the organization's real ranges; each keeps its translated range unless another tunnel now holds it.One of: true
handoffobjectOptional handoff packet details stored with the tunnel. Unknown fields are refused. The created audit row records only whether one was sent.
7 fields
hospitalstringThe healthcare organization's name.
cutoverWindowstringWhen senders move over, e.g. Sat 02:00-04:00.
legacyHoststringThe interface engine senders use today.
legacyEnginestringThat engine's kind; unset or "other" keeps the packet neutral.
One of: "rhapsody", "mirth", "other"
deviceConfigstringTheir firewall, e.g. pfSense.
sendersarray of objectDefaults to [].
3 fields
namestringrequiredfromstringrequiredWhere the sender sends today.
tostringrequiredWhere it sends after cutover.
contactsarray of objectDefaults to [].
2 fields
rolestringrequiredvaluestringrequiredAn email or phone. The network engineer's email gets the shared link.
Responses
- 200Renamed.
application/json · VpnTunnelWithConfig
- 202Re-creating in the background. With new `remoteSubnets`, `warnings` lists overlaps with VPN tunnels created outside MedHook.
Response fields
application/json · object
peerConfigVpnPeerConfigWhat the healthcare organization's network engineer enters on their firewall.
sharedSecretappears only when it was just generated orreveal=1was passed.warningsarray of objectOverlaps with VPN tunnels created outside MedHook in the engine's GCP project, which don't stop the change, or why they couldn't be checked. Empty when there is nothing to say. A subnet identical to a range such a tunnel already routes at the same or a better priority is a 400 instead (Classic tunnels only).
2 fields
patharray of string | integerrequired["remoteSubnets", i]for one subnet,["remoteSubnets"]for the whole list.messagestringrequiredNames the external tunnel, its region and the overlapping CIDRs; or that the check couldn't run (HA tunnels learn their ranges over BGP; a refused listing names roles/compute.networkViewer).
- 400Invalid update.
application/json · ApiError
- 404Tunnel not found in this workspace.
application/json · ApiError
- 409Name taken, or a re-create was requested while the tunnel is busy.
application/json · ApiError
- 501`NOT_CONFIGURED` — the engine is not running on the GKE deployment (GCP_VPN_* env vars unset).
application/json · ApiError
Example request
curl -X PATCH "$ENGINE_URL/api/vpn-tunnels/<id>" \
-H "Authorization: Bearer $TOKEN" \
-H "Content-Type: application/json" \
-d '{
"name": "string",
"peerIp": "203.0.113.10",
"remoteSubnets": [
"10.20.0.0/24"
],
"localSubnets": [
"10.250.0.0/24"
],
"ikeVersion": 1,
"sharedSecret": "string",
"rotateSecret": true,
"retry": true,
"proposal": "string",
"peerAsn": 64512,
"bgpRanges": [
"169.254.0.1/30"
],
"description": "string",
"nat": true,
"handoff": {
"hospital": "string",
"cutoverWindow": "string",
"legacyHost": "string",
"legacyEngine": "rhapsody",
"deviceConfig": "string",
"senders": [
{
"name": "string",
"from": "10.20.0.40:6661",
"to": "10.20.0.40:6661"
}
],
"contacts": [
{
"role": "Network engineer",
"value": "string"
}
]
}
}'Delete VPN tunnel
delete/api/vpn-tunnels/{id}
Sets state deleting and tears down the tunnel and routes in the background. While workflows listen through the tunnel the delete still goes ahead (the UI's Settings tab blocks it; the API is not tightened): the answer carries warning with code TUNNEL_IN_USE, a message and the workflows { id, name }, and the audit event records them as inUseBy. Rate limited: 10 req / 60 s.
Auth: Bearer token (how to get one) · Operation: deleteVpnTunnel
Parameters
| Name | In | Type | Description |
|---|---|---|---|
idrequired | path | string | Tunnel id. |
Responses
- 202Teardown started.
Response fields
application/json · object
warningobjectPresent when workflows listened through the tunnel.
3 fields
codestringrequiredOne of: "TUNNEL_IN_USE"
messagestringrequiredworkflowsarray of objectrequired2 fields
idstringrequirednamestringrequired
- 404Tunnel not found in this workspace.
application/json · ApiError
- 501`NOT_CONFIGURED` — the engine is not running on the GKE deployment (GCP_VPN_* env vars unset).
application/json · ApiError
Example request
curl -X DELETE "$ENGINE_URL/api/vpn-tunnels/<id>" \
-H "Authorization: Bearer $TOKEN"Add a backup tunnel (failover pair)
post/api/vpn-tunnels/{id}/backup
Adds a backup Classic tunnel to a ready Classic tunnel. The backup attaches to the second Classic gateway (Terraform vpn_secondary_gateway_enabled) and routes the primary's subnets at priority 200; the primary moves to 100 first. Subnets and IKE version follow the primary. The PSK is returned once. Admin only; audited (vpn_tunnel.created with pairedWith). Rate limited: 10 req / 60 s.
Auth: Bearer token (how to get one) · Operation: addVpnTunnelBackup
Parameters
| Name | In | Type | Description |
|---|---|---|---|
idrequired | path | string | Primary tunnel id. |
Request body
application/json · object
peerIpstringHealthcare organization peer for the backup; defaults to the primary's.
sharedSecretstring
Responses
- 202Backup row created; provisioning runs in the background.
application/json · VpnTunnelWithConfig
- 400Invalid body.
application/json · ApiError
- 404Tunnel not found in this workspace.
application/json · ApiError
- 409Not a ready Classic primary, already paired, name taken, or no second gateway.
application/json · ApiError
- 501`NOT_CONFIGURED` — the engine is not running on the GKE deployment (GCP_VPN_* env vars unset).
application/json · ApiError
Example request
curl -X POST "$ENGINE_URL/api/vpn-tunnels/<id>/backup" \
-H "Authorization: Bearer $TOKEN" \
-H "Content-Type: application/json" \
-d '{
"peerIp": "198.51.100.20",
"sharedSecret": "string"
}'Make a paired tunnel carry traffic
post/api/vpn-tunnels/{id}/promote
Moves a failover pair's routes to this tunnel (priority 100) and its partner to standby (200), the same idempotent swap the tunnel watcher uses. Admin only; audited once (vpn_tunnel.failover) on this tunnel, shown in both tunnels' events. Rate limited: 10 req / 60 s.
Auth: Bearer token (how to get one) · Operation: promoteVpnTunnel
Parameters
| Name | In | Type | Description |
|---|---|---|---|
idrequired | path | string | Tunnel id. |
Request body
application/json · object
reasonstringWhy, for the audit trail.
Responses
- 200Traffic is on this tunnel.
Response fields
application/json · object
changedbooleanFalse when it already carried traffic.
preferredTunnelIdstring
- 400Invalid body.
application/json · ApiError
- 404Tunnel not found in this workspace.
application/json · ApiError
- 409Unpaired, busy, or not ready.
application/json · ApiError
- 501`NOT_CONFIGURED` — the engine is not running on the GKE deployment (GCP_VPN_* env vars unset).
application/json · ApiError
Example request
curl -X POST "$ENGINE_URL/api/vpn-tunnels/<id>/promote" \
-H "Authorization: Bearer $TOKEN" \
-H "Content-Type: application/json" \
-d '{
"reason": "string"
}'Resume the tunnel watcher
post/api/vpn-tunnels/{id}/watch
Clears the watcher's pause on this tunnel (flapping, or more actions in an hour than allowed) so it acts on its next read. Body: { "action": "resume" }. Admin only; audited (vpn_tunnel.watch_resumed). Rate limited: 20 req / 60 s.
Auth: Bearer token (how to get one) · Operation: resumeVpnTunnelWatch
Parameters
| Name | In | Type | Description |
|---|---|---|---|
idrequired | path | string | Tunnel id. |
Request body (required)
application/json · object
actionstringrequiredOne of: "resume"
Responses
Example request
curl -X POST "$ENGINE_URL/api/vpn-tunnels/<id>/watch" \
-H "Authorization: Bearer $TOKEN" \
-H "Content-Type: application/json" \
-d '{
"action": "resume"
}'Test connectivity through a tunnel
post/api/vpn-tunnels/{id}/test
Opens a TCP connection from the engine to host:port (5 s timeout). host must be an IPv4 address inside the tunnel's remote subnets. Audited (vpn_tunnel.connectivity_tested). Rate limited: 20 req / 60 s.
Auth: Bearer token (how to get one) · Operation: testVpnTunnel
Parameters
| Name | In | Type | Description |
|---|---|---|---|
idrequired | path | string | Tunnel id. |
Request body (required)
application/json · object
hoststringrequiredportintegerrequired
Responses
- 200Probe result (a failed connection is still 200).
Response fields
application/json · object
hoststringportintegerreachablebooleanlatencyMsintegererrorstring
- 400Invalid body, or host outside the tunnel's remote subnets.
application/json · ApiError
- 404Tunnel not found in this workspace.
application/json · ApiError
- 409Tunnel is not `ready`.
application/json · ApiError
- 501`NOT_CONFIGURED` — the engine is not running on the GKE deployment (GCP_VPN_* env vars unset).
application/json · ApiError
Example request
curl -X POST "$ENGINE_URL/api/vpn-tunnels/<id>/test" \
-H "Authorization: Bearer $TOKEN" \
-H "Content-Type: application/json" \
-d '{
"host": "10.20.0.15",
"port": 6661
}'List tunnel requests on a FortiGate
get/api/fortigate/connections/{id}/provision
The connection's tunnel requests, newest first (50), each with its plan preview and what the caller may do. The pre-shared key is sealed at rest until the request is applied, rejected, cancelled or expires, then discarded (audited as fortigate.provision_psk_discarded); it is never returned or audited.
Minimum role: admin.
Auth: Bearer token (how to get one) · Operation: listFortigateProvisionRequests
Parameters
| Name | In | Type | Description |
|---|---|---|---|
idrequired | path | string | The id, in the caller's workspace. |
Responses
- 200The requests.
Response fields
application/json · object
allowWritesbooleandefaultTcpPortsarray of stringThe engine's MLLP listener ports (the services default).
requestsarray of object19 fields
idstringconnectionIdstringorgNamestringphase1Namestringspecobject17 fields
orgNamestringThe healthcare organization's name.
phase1NamestringThe phase 1 (tunnel interface) name, 15 characters at most; mh-<organization> by default.
peerIpstringThe healthcare organization's firewall (IPv4).
localSubnetsarray of stringYour side (CIDR), up to 16.
remoteSubnetsarray of stringThe healthcare organization's side (CIDR), up to 16.
ikeVersioninteger1 or 2 (default 2).
phase1Proposalsarray of stringDefault ["aes256-sha256"].
phase2Proposalsarray of stringDefault ["aes256-sha256"].
dhGroupsarray of stringDefault ["14"].
keylifeintegerPhase 1 key life, seconds (default 28800).
keylifeSecondsintegerPhase 2 key life, seconds (default 3600).
wanInterfacestringThe internet-facing interface (default "wan1").
lanInterfacestringThe interface your local subnets are on, for the policies (default "internal").
blackholeRoutebooleanAdd a blackhole route (distance 254) per remote subnet, so their traffic is dropped while the tunnel is down (default true).
servicesobjectWhat each policy allows, per direction: a custom service of these ports, or ALL (an explicit opt-in per direction; the preview says so). Both policies log all traffic.
2 fields
inboundobjectFrom the healthcare organization to your network (the
<phase1>-inpolicy, service<phase1>-svc-in). Default: the engine's MLLP listener ports.3 fields
allbooleanAllow every service (ALL) instead (default false).
tcparray of stringTCP ports or ranges, e.g. "2575" or "6661-6670".
udparray of stringUDP ports or ranges (default none).
outboundobjectFrom your network to theirs (the
<phase1>-outpolicy, service<phase1>-svc-out). Default:theirMllpPort.3 fields
allbooleanAllow every service (ALL) instead (default false).
tcparray of stringTCP ports or ranges, e.g. "2575" or "6661-6670".
udparray of stringUDP ports or ranges (default none).
theirMllpPortstringThe healthcare organization's MLLP port (or range), e.g. "6661": the outbound default. Required unless
services.outboundis given (e.g.{ all: true }).acknowledgedRoutesarray of stringThe route warnings the requester checked and wants the tunnel anyway, by key (the preview's
routeKeys): "<their subnet> via <route> <gateway/interface>" for an overlap with an active route, "<their subnet> wider than /16". Stored sorted and deduped; part of what the approval covers. Each current warning must be listed, at request time and again at apply.
specHashstringThe hash of the spec; an approval sends the one the approver reviewed.
statusstringOne of: "requested", "approved", "applying", "applied", "failed", "rejected", "expired", "cancelled"
hasKeybooleanA sealed key is held (only while requested or approved).
keyDiscardedAtstring | nullrequestedBystringapprovedBystring | nullrejectedBystring | nullappliedBystring | nullexpiresAtstringresultobject | null6 fields
okbooleanfailedAtstringrolledBackbooleanTrue only when every object the apply created was removed again.
interruptedbooleanThe engine stopped mid-apply; the watcher ended the request.
claimLostbooleanThe apply lost its hold on the request mid-way (the watcher ended it as too slow, or its progress couldn't be recorded in time): it sent no further changes and removed what it had created.
stepsarray of object10 fields
idstringlabelstringphasestringOne of: "apply", "rollback"
okbooleanskippedbooleanmkeystringerrorstringerrorCodestringmayExistbooleanThe write got no answer (a timeout, or the connection broke after sending): the FortiGate may hold the object.
notestringA remark on a step that worked, e.g. it was never created.
leftOnFortigatearray of objectObjects an apply created and couldn't remove (saved after every write): remove them on the FortiGate.
5 fields
idstringlabelstringmkeystring | nullundoPathstring | nullThe DELETE path; null when the entry's id is unknown.
mayExistbooleanThe write got no answer and the entry has no name to look up: check the FortiGate for it.
tunnelIdstring | nullThe tracked tunnel created by a successful apply.
planobject2 fields
stepsarray of object8 fields
idstringkindstringOne of: "address", "addrgrp", "phase1", "phase2", "service", "policy", "route", "blackhole"
labelstringmethodstringpathstringThe FortiOS REST path.
bodyobjectThe JSON body; psksecret masked.
clistringThe equivalent FortiOS CLI.
undoobject2 fields
methodstringpathstring
clistringEvery step's CLI, as one paste.
canobject4 fields
canEditbooleancanApprovebooleanapproveBlockedstringcanApplyboolean
- 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
Example request
curl "$ENGINE_URL/api/fortigate/connections/<id>/provision" \
-H "Authorization: Bearer $TOKEN"Ask to create a tunnel on a FortiGate
post/api/fortigate/connections/{id}/provision
Stores a request to create one healthcare organization's tunnel (address objects, phase 1 with explicit DPD and NAT-T, phase 2, policies both ways, static and blackhole routes). Nothing is written to the FortiGate: a second admin approves it, then an admin applies it. 403 WRITES_OFF unless the connection allows writes. Needs a signed-in person (403 for API tokens and unidentified callers). FortiGate reads are limited per connection (429 RATE_LIMITED). 409 ACK_REQUIRED (with unacknowledged) when a route overlap or subnet wider than /16 isn't in acknowledgedRoutes. The pre-shared key is sealed at rest until the request is applied, rejected, cancelled or expires, then discarded (audited as fortigate.provision_psk_discarded); it is never returned or audited. Audited as fortigate.provision_requested.
Minimum role: admin.
Auth: Bearer token (how to get one) · Operation: createFortigateProvisionRequest
Parameters
| Name | In | Type | Description |
|---|---|---|---|
idrequired | path | string | The id, in the caller's workspace. |
Request body (required)
application/json · object
orgNamestringrequiredThe healthcare organization's name.
phase1NamestringThe phase 1 (tunnel interface) name, 15 characters at most; mh-<organization> by default.
peerIpstringrequiredThe healthcare organization's firewall (IPv4).
localSubnetsarray of stringrequiredYour side (CIDR), up to 16.
remoteSubnetsarray of stringrequiredThe healthcare organization's side (CIDR), up to 16.
ikeVersioninteger1 or 2 (default 2).
phase1Proposalsarray of stringDefault ["aes256-sha256"].
phase2Proposalsarray of stringDefault ["aes256-sha256"].
dhGroupsarray of stringDefault ["14"].
keylifeintegerPhase 1 key life, seconds (default 28800).
keylifeSecondsintegerPhase 2 key life, seconds (default 3600).
wanInterfacestringThe internet-facing interface (default "wan1").
lanInterfacestringThe interface your local subnets are on, for the policies (default "internal").
blackholeRoutebooleanAdd a blackhole route (distance 254) per remote subnet, so their traffic is dropped while the tunnel is down (default true).
servicesobjectWhat each policy allows, per direction: a custom service of these ports, or ALL (an explicit opt-in per direction; the preview says so). Both policies log all traffic.
2 fields
inboundobjectFrom the healthcare organization to your network (the
<phase1>-inpolicy, service<phase1>-svc-in). Default: the engine's MLLP listener ports.3 fields
allbooleanAllow every service (ALL) instead (default false).
tcparray of stringTCP ports or ranges, e.g. "2575" or "6661-6670".
udparray of stringUDP ports or ranges (default none).
outboundobjectFrom your network to theirs (the
<phase1>-outpolicy, service<phase1>-svc-out). Default:theirMllpPort.3 fields
allbooleanAllow every service (ALL) instead (default false).
tcparray of stringTCP ports or ranges, e.g. "2575" or "6661-6670".
udparray of stringUDP ports or ranges (default none).
theirMllpPortstringThe healthcare organization's MLLP port (or range), e.g. "6661": the outbound default. Required unless
services.outboundis given (e.g.{ all: true }).acknowledgedRoutesarray of stringThe route warnings the requester checked and wants the tunnel anyway, by key (the preview's
routeKeys): "<their subnet> via <route> <gateway/interface>" for an overlap with an active route, "<their subnet> wider than /16". Stored sorted and deduped; part of what the approval covers. Each current warning must be listed, at request time and again at apply.pskstringrequiredThe pre-shared key (20-128 printable characters, no quotes, backslash or spaces).
Responses
- 201The request.
Response fields
application/json · object
idstringconnectionIdstringorgNamestringphase1Namestringspecobject17 fields
orgNamestringThe healthcare organization's name.
phase1NamestringThe phase 1 (tunnel interface) name, 15 characters at most; mh-<organization> by default.
peerIpstringThe healthcare organization's firewall (IPv4).
localSubnetsarray of stringYour side (CIDR), up to 16.
remoteSubnetsarray of stringThe healthcare organization's side (CIDR), up to 16.
ikeVersioninteger1 or 2 (default 2).
phase1Proposalsarray of stringDefault ["aes256-sha256"].
phase2Proposalsarray of stringDefault ["aes256-sha256"].
dhGroupsarray of stringDefault ["14"].
keylifeintegerPhase 1 key life, seconds (default 28800).
keylifeSecondsintegerPhase 2 key life, seconds (default 3600).
wanInterfacestringThe internet-facing interface (default "wan1").
lanInterfacestringThe interface your local subnets are on, for the policies (default "internal").
blackholeRoutebooleanAdd a blackhole route (distance 254) per remote subnet, so their traffic is dropped while the tunnel is down (default true).
servicesobjectWhat each policy allows, per direction: a custom service of these ports, or ALL (an explicit opt-in per direction; the preview says so). Both policies log all traffic.
2 fields
inboundobjectFrom the healthcare organization to your network (the
<phase1>-inpolicy, service<phase1>-svc-in). Default: the engine's MLLP listener ports.3 fields
allbooleanAllow every service (ALL) instead (default false).
tcparray of stringTCP ports or ranges, e.g. "2575" or "6661-6670".
udparray of stringUDP ports or ranges (default none).
outboundobjectFrom your network to theirs (the
<phase1>-outpolicy, service<phase1>-svc-out). Default:theirMllpPort.3 fields
allbooleanAllow every service (ALL) instead (default false).
tcparray of stringTCP ports or ranges, e.g. "2575" or "6661-6670".
udparray of stringUDP ports or ranges (default none).
theirMllpPortstringThe healthcare organization's MLLP port (or range), e.g. "6661": the outbound default. Required unless
services.outboundis given (e.g.{ all: true }).acknowledgedRoutesarray of stringThe route warnings the requester checked and wants the tunnel anyway, by key (the preview's
routeKeys): "<their subnet> via <route> <gateway/interface>" for an overlap with an active route, "<their subnet> wider than /16". Stored sorted and deduped; part of what the approval covers. Each current warning must be listed, at request time and again at apply.
specHashstringThe hash of the spec; an approval sends the one the approver reviewed.
statusstringOne of: "requested", "approved", "applying", "applied", "failed", "rejected", "expired", "cancelled"
hasKeybooleanA sealed key is held (only while requested or approved).
keyDiscardedAtstring | nullrequestedBystringapprovedBystring | nullrejectedBystring | nullappliedBystring | nullexpiresAtstringresultobject | null6 fields
okbooleanfailedAtstringrolledBackbooleanTrue only when every object the apply created was removed again.
interruptedbooleanThe engine stopped mid-apply; the watcher ended the request.
claimLostbooleanThe apply lost its hold on the request mid-way (the watcher ended it as too slow, or its progress couldn't be recorded in time): it sent no further changes and removed what it had created.
stepsarray of object10 fields
idstringlabelstringphasestringOne of: "apply", "rollback"
okbooleanskippedbooleanmkeystringerrorstringerrorCodestringmayExistbooleanThe write got no answer (a timeout, or the connection broke after sending): the FortiGate may hold the object.
notestringA remark on a step that worked, e.g. it was never created.
leftOnFortigatearray of objectObjects an apply created and couldn't remove (saved after every write): remove them on the FortiGate.
5 fields
idstringlabelstringmkeystring | nullundoPathstring | nullThe DELETE path; null when the entry's id is unknown.
mayExistbooleanThe write got no answer and the entry has no name to look up: check the FortiGate for it.
tunnelIdstring | nullThe tracked tunnel created by a successful apply.
planobject2 fields
stepsarray of object8 fields
idstringkindstringOne of: "address", "addrgrp", "phase1", "phase2", "service", "policy", "route", "blackhole"
labelstringmethodstringpathstringThe FortiOS REST path.
bodyobjectThe JSON body; psksecret masked.
clistringThe equivalent FortiOS CLI.
undoobject2 fields
methodstringpathstring
clistringEvery step's CLI, as one paste.
canobject4 fields
canEditbooleancanApprovebooleanapproveBlockedstringcanApplyboolean
warningsarray of stringconflictsarray of stringNames the FortiGate already has (null when it couldn't be read).
readErrorstring | nullrouteWarningsarray of stringActive routes (GET monitor/router/ipv4) their subnets overlap: "… overlaps existing route … via …".
ackRequiredbooleanA route overlap or a subnet wider than /16: each needs its key in acknowledgedRoutes.
routeKeysarray of stringThe key of each warning that needs acknowledging (overlaps and subnets wider than /16), to put in acknowledgedRoutes.
unacknowledgedarray of stringThe keys the request's acknowledgedRoutes doesn't list.
- 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
Example request
curl -X POST "$ENGINE_URL/api/fortigate/connections/<id>/provision" \
-H "Authorization: Bearer $TOKEN" \
-H "Content-Type: application/json" \
-d '{
"orgName": "string",
"phase1Name": "string",
"peerIp": "string",
"localSubnets": [
"string"
],
"remoteSubnets": [
"string"
],
"ikeVersion": 0,
"phase1Proposals": [
"string"
],
"phase2Proposals": [
"string"
],
"dhGroups": [
"string"
],
"keylife": 0,
"keylifeSeconds": 0,
"wanInterface": "string",
"lanInterface": "string",
"blackholeRoute": true,
"services": {
"inbound": {
"all": true,
"tcp": [
"string"
],
"udp": [
"string"
]
},
"outbound": {
"all": true,
"tcp": [
"string"
],
"udp": [
"string"
]
}
},
"theirMllpPort": "string",
"acknowledgedRoutes": [
"string"
],
"psk": "string"
}'Preview a FortiGate tunnel request
post/api/fortigate/connections/{id}/provision/preview
The ordered FortiOS REST calls (method, path, JSON body with the key masked) and the equivalent CLI, warnings, names the FortiGate already has, active routes their subnets overlap and whether the acknowledgement is needed. Stores nothing, writes nothing. FortiGate reads are limited per connection (429).
Minimum role: admin.
Auth: Bearer token (how to get one) · Operation: previewFortigateProvisionRequest
Parameters
| Name | In | Type | Description |
|---|---|---|---|
idrequired | path | string | The id, in the caller's workspace. |
Request body (required)
application/json · object
orgNamestringrequiredThe healthcare organization's name.
phase1NamestringThe phase 1 (tunnel interface) name, 15 characters at most; mh-<organization> by default.
peerIpstringrequiredThe healthcare organization's firewall (IPv4).
localSubnetsarray of stringrequiredYour side (CIDR), up to 16.
remoteSubnetsarray of stringrequiredThe healthcare organization's side (CIDR), up to 16.
ikeVersioninteger1 or 2 (default 2).
phase1Proposalsarray of stringDefault ["aes256-sha256"].
phase2Proposalsarray of stringDefault ["aes256-sha256"].
dhGroupsarray of stringDefault ["14"].
keylifeintegerPhase 1 key life, seconds (default 28800).
keylifeSecondsintegerPhase 2 key life, seconds (default 3600).
wanInterfacestringThe internet-facing interface (default "wan1").
lanInterfacestringThe interface your local subnets are on, for the policies (default "internal").
blackholeRoutebooleanAdd a blackhole route (distance 254) per remote subnet, so their traffic is dropped while the tunnel is down (default true).
servicesobjectWhat each policy allows, per direction: a custom service of these ports, or ALL (an explicit opt-in per direction; the preview says so). Both policies log all traffic.
2 fields
inboundobjectFrom the healthcare organization to your network (the
<phase1>-inpolicy, service<phase1>-svc-in). Default: the engine's MLLP listener ports.3 fields
allbooleanAllow every service (ALL) instead (default false).
tcparray of stringTCP ports or ranges, e.g. "2575" or "6661-6670".
udparray of stringUDP ports or ranges (default none).
outboundobjectFrom your network to theirs (the
<phase1>-outpolicy, service<phase1>-svc-out). Default:theirMllpPort.3 fields
allbooleanAllow every service (ALL) instead (default false).
tcparray of stringTCP ports or ranges, e.g. "2575" or "6661-6670".
udparray of stringUDP ports or ranges (default none).
theirMllpPortstringThe healthcare organization's MLLP port (or range), e.g. "6661": the outbound default. Required unless
services.outboundis given (e.g.{ all: true }).acknowledgedRoutesarray of stringThe route warnings the requester checked and wants the tunnel anyway, by key (the preview's
routeKeys): "<their subnet> via <route> <gateway/interface>" for an overlap with an active route, "<their subnet> wider than /16". Stored sorted and deduped; part of what the approval covers. Each current warning must be listed, at request time and again at apply.pskstringThe pre-shared key (20-128 printable characters, no quotes, backslash or spaces).
Responses
- 200The preview.
Response fields
application/json · object
specobject17 fields
orgNamestringThe healthcare organization's name.
phase1NamestringThe phase 1 (tunnel interface) name, 15 characters at most; mh-<organization> by default.
peerIpstringThe healthcare organization's firewall (IPv4).
localSubnetsarray of stringYour side (CIDR), up to 16.
remoteSubnetsarray of stringThe healthcare organization's side (CIDR), up to 16.
ikeVersioninteger1 or 2 (default 2).
phase1Proposalsarray of stringDefault ["aes256-sha256"].
phase2Proposalsarray of stringDefault ["aes256-sha256"].
dhGroupsarray of stringDefault ["14"].
keylifeintegerPhase 1 key life, seconds (default 28800).
keylifeSecondsintegerPhase 2 key life, seconds (default 3600).
wanInterfacestringThe internet-facing interface (default "wan1").
lanInterfacestringThe interface your local subnets are on, for the policies (default "internal").
blackholeRoutebooleanAdd a blackhole route (distance 254) per remote subnet, so their traffic is dropped while the tunnel is down (default true).
servicesobjectWhat each policy allows, per direction: a custom service of these ports, or ALL (an explicit opt-in per direction; the preview says so). Both policies log all traffic.
2 fields
inboundobjectFrom the healthcare organization to your network (the
<phase1>-inpolicy, service<phase1>-svc-in). Default: the engine's MLLP listener ports.3 fields
allbooleanAllow every service (ALL) instead (default false).
tcparray of stringTCP ports or ranges, e.g. "2575" or "6661-6670".
udparray of stringUDP ports or ranges (default none).
outboundobjectFrom your network to theirs (the
<phase1>-outpolicy, service<phase1>-svc-out). Default:theirMllpPort.3 fields
allbooleanAllow every service (ALL) instead (default false).
tcparray of stringTCP ports or ranges, e.g. "2575" or "6661-6670".
udparray of stringUDP ports or ranges (default none).
theirMllpPortstringThe healthcare organization's MLLP port (or range), e.g. "6661": the outbound default. Required unless
services.outboundis given (e.g.{ all: true }).acknowledgedRoutesarray of stringThe route warnings the requester checked and wants the tunnel anyway, by key (the preview's
routeKeys): "<their subnet> via <route> <gateway/interface>" for an overlap with an active route, "<their subnet> wider than /16". Stored sorted and deduped; part of what the approval covers. Each current warning must be listed, at request time and again at apply.
allowWritesbooleanplanobject2 fields
stepsarray of object8 fields
idstringkindstringOne of: "address", "addrgrp", "phase1", "phase2", "service", "policy", "route", "blackhole"
labelstringmethodstringpathstringThe FortiOS REST path.
bodyobjectThe JSON body; psksecret masked.
clistringThe equivalent FortiOS CLI.
undoobject2 fields
methodstringpathstring
clistringEvery step's CLI, as one paste.
warningsarray of stringconflictsarray of stringNames the FortiGate already has (null when it couldn't be read).
readErrorstring | nullrouteWarningsarray of stringActive routes (GET monitor/router/ipv4) their subnets overlap: "… overlaps existing route … via …".
ackRequiredbooleanA route overlap or a subnet wider than /16: each needs its key in acknowledgedRoutes.
routeKeysarray of stringThe key of each warning that needs acknowledging (overlaps and subnets wider than /16), to put in acknowledgedRoutes.
unacknowledgedarray of stringThe keys the request's acknowledgedRoutes doesn't list.
- 400The request is malformed or fails validation.
application/json · ApiError
- 401No credential, or the token is invalid or expired.
application/json · ApiError
- 403The caller's role, license or network address does not allow this. A signed-in person who is not a member of the requested workspace gets code `WORKSPACE_FORBIDDEN`; a viewer asking for message content gets `PHI_FORBIDDEN` (or `PHI_SEARCH_FORBIDDEN` for a search on message content).
application/json · ApiError
- 404Not found in the caller's workspace.
application/json · ApiError
- 429Rate limit exceeded (see the `Retry-After` header), or on the AI routes the daily AI budget is used up.
application/json · ApiError
Example request
curl -X POST "$ENGINE_URL/api/fortigate/connections/<id>/provision/preview" \
-H "Authorization: Bearer $TOKEN" \
-H "Content-Type: application/json" \
-d '{
"orgName": "string",
"phase1Name": "string",
"peerIp": "string",
"localSubnets": [
"string"
],
"remoteSubnets": [
"string"
],
"ikeVersion": 0,
"phase1Proposals": [
"string"
],
"phase2Proposals": [
"string"
],
"dhGroups": [
"string"
],
"keylife": 0,
"keylifeSeconds": 0,
"wanInterface": "string",
"lanInterface": "string",
"blackholeRoute": true,
"services": {
"inbound": {
"all": true,
"tcp": [
"string"
],
"udp": [
"string"
]
},
"outbound": {
"all": true,
"tcp": [
"string"
],
"udp": [
"string"
]
}
},
"theirMllpPort": "string",
"acknowledgedRoutes": [
"string"
],
"psk": "string"
}'Get a FortiGate tunnel request
get/api/fortigate/provision/{id}
The request, its plan, each applied and rolled-back step's outcome, and what the caller may do; for a waiting or approved request, routeCheck re-reads the FortiGate's routes. The pre-shared key is sealed at rest until the request is applied, rejected, cancelled or expires, then discarded (audited as fortigate.provision_psk_discarded); it is never returned or audited.
Minimum role: admin.
Auth: Bearer token (how to get one) · Operation: getFortigateProvisionRequest
Parameters
| Name | In | Type | Description |
|---|---|---|---|
idrequired | path | string | The id, in the caller's workspace. |
Responses
- 200The request.
Response fields
application/json · object
idstringconnectionIdstringorgNamestringphase1Namestringspecobject17 fields
orgNamestringThe healthcare organization's name.
phase1NamestringThe phase 1 (tunnel interface) name, 15 characters at most; mh-<organization> by default.
peerIpstringThe healthcare organization's firewall (IPv4).
localSubnetsarray of stringYour side (CIDR), up to 16.
remoteSubnetsarray of stringThe healthcare organization's side (CIDR), up to 16.
ikeVersioninteger1 or 2 (default 2).
phase1Proposalsarray of stringDefault ["aes256-sha256"].
phase2Proposalsarray of stringDefault ["aes256-sha256"].
dhGroupsarray of stringDefault ["14"].
keylifeintegerPhase 1 key life, seconds (default 28800).
keylifeSecondsintegerPhase 2 key life, seconds (default 3600).
wanInterfacestringThe internet-facing interface (default "wan1").
lanInterfacestringThe interface your local subnets are on, for the policies (default "internal").
blackholeRoutebooleanAdd a blackhole route (distance 254) per remote subnet, so their traffic is dropped while the tunnel is down (default true).
servicesobjectWhat each policy allows, per direction: a custom service of these ports, or ALL (an explicit opt-in per direction; the preview says so). Both policies log all traffic.
2 fields
inboundobjectFrom the healthcare organization to your network (the
<phase1>-inpolicy, service<phase1>-svc-in). Default: the engine's MLLP listener ports.3 fields
allbooleanAllow every service (ALL) instead (default false).
tcparray of stringTCP ports or ranges, e.g. "2575" or "6661-6670".
udparray of stringUDP ports or ranges (default none).
outboundobjectFrom your network to theirs (the
<phase1>-outpolicy, service<phase1>-svc-out). Default:theirMllpPort.3 fields
allbooleanAllow every service (ALL) instead (default false).
tcparray of stringTCP ports or ranges, e.g. "2575" or "6661-6670".
udparray of stringUDP ports or ranges (default none).
theirMllpPortstringThe healthcare organization's MLLP port (or range), e.g. "6661": the outbound default. Required unless
services.outboundis given (e.g.{ all: true }).acknowledgedRoutesarray of stringThe route warnings the requester checked and wants the tunnel anyway, by key (the preview's
routeKeys): "<their subnet> via <route> <gateway/interface>" for an overlap with an active route, "<their subnet> wider than /16". Stored sorted and deduped; part of what the approval covers. Each current warning must be listed, at request time and again at apply.
specHashstringThe hash of the spec; an approval sends the one the approver reviewed.
statusstringOne of: "requested", "approved", "applying", "applied", "failed", "rejected", "expired", "cancelled"
hasKeybooleanA sealed key is held (only while requested or approved).
keyDiscardedAtstring | nullrequestedBystringapprovedBystring | nullrejectedBystring | nullappliedBystring | nullexpiresAtstringresultobject | null6 fields
okbooleanfailedAtstringrolledBackbooleanTrue only when every object the apply created was removed again.
interruptedbooleanThe engine stopped mid-apply; the watcher ended the request.
claimLostbooleanThe apply lost its hold on the request mid-way (the watcher ended it as too slow, or its progress couldn't be recorded in time): it sent no further changes and removed what it had created.
stepsarray of object10 fields
idstringlabelstringphasestringOne of: "apply", "rollback"
okbooleanskippedbooleanmkeystringerrorstringerrorCodestringmayExistbooleanThe write got no answer (a timeout, or the connection broke after sending): the FortiGate may hold the object.
notestringA remark on a step that worked, e.g. it was never created.
leftOnFortigatearray of objectObjects an apply created and couldn't remove (saved after every write): remove them on the FortiGate.
5 fields
idstringlabelstringmkeystring | nullundoPathstring | nullThe DELETE path; null when the entry's id is unknown.
mayExistbooleanThe write got no answer and the entry has no name to look up: check the FortiGate for it.
tunnelIdstring | nullThe tracked tunnel created by a successful apply.
planobject2 fields
stepsarray of object8 fields
idstringkindstringOne of: "address", "addrgrp", "phase1", "phase2", "service", "policy", "route", "blackhole"
labelstringmethodstringpathstringThe FortiOS REST path.
bodyobjectThe JSON body; psksecret masked.
clistringThe equivalent FortiOS CLI.
undoobject2 fields
methodstringpathstring
clistringEvery step's CLI, as one paste.
canobject4 fields
canEditbooleancanApprovebooleanapproveBlockedstringcanApplyboolean
routeCheckobjectFor an open request: the routes their subnets overlap now, from a fresh read (best effort; counts toward the per-connection read limit).
6 fields
checkedbooleanFalse when the routes couldn't be read (see error).
atstringerrorstringrouteWarningsarray of stringrouteKeysarray of stringunacknowledgedarray of stringWarnings the request doesn't acknowledge: the apply would refuse them.
- 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
Example request
curl "$ENGINE_URL/api/fortigate/provision/<id>" \
-H "Authorization: Bearer $TOKEN"Change a FortiGate tunnel request
patch/api/fortigate/provision/{id}
The whole request again (psk omitted keeps the sealed key). Goes back to requested: a new approval is needed, and the one who changed it can't give it. 409 REQUEST_CLOSED once it has ended. Needs a signed-in person (403 for API tokens and unidentified callers). FortiGate reads are limited per connection (429 RATE_LIMITED). 409 ACK_REQUIRED (with unacknowledged) when a route overlap or subnet wider than /16 isn't in acknowledgedRoutes. Audited as fortigate.provision_changed.
Minimum role: admin.
Auth: Bearer token (how to get one) · Operation: updateFortigateProvisionRequest
Parameters
| Name | In | Type | Description |
|---|---|---|---|
idrequired | path | string | The id, in the caller's workspace. |
Request body (required)
application/json · object
orgNamestringrequiredThe healthcare organization's name.
phase1NamestringThe phase 1 (tunnel interface) name, 15 characters at most; mh-<organization> by default.
peerIpstringrequiredThe healthcare organization's firewall (IPv4).
localSubnetsarray of stringrequiredYour side (CIDR), up to 16.
remoteSubnetsarray of stringrequiredThe healthcare organization's side (CIDR), up to 16.
ikeVersioninteger1 or 2 (default 2).
phase1Proposalsarray of stringDefault ["aes256-sha256"].
phase2Proposalsarray of stringDefault ["aes256-sha256"].
dhGroupsarray of stringDefault ["14"].
keylifeintegerPhase 1 key life, seconds (default 28800).
keylifeSecondsintegerPhase 2 key life, seconds (default 3600).
wanInterfacestringThe internet-facing interface (default "wan1").
lanInterfacestringThe interface your local subnets are on, for the policies (default "internal").
blackholeRoutebooleanAdd a blackhole route (distance 254) per remote subnet, so their traffic is dropped while the tunnel is down (default true).
servicesobjectWhat each policy allows, per direction: a custom service of these ports, or ALL (an explicit opt-in per direction; the preview says so). Both policies log all traffic.
2 fields
inboundobjectFrom the healthcare organization to your network (the
<phase1>-inpolicy, service<phase1>-svc-in). Default: the engine's MLLP listener ports.3 fields
allbooleanAllow every service (ALL) instead (default false).
tcparray of stringTCP ports or ranges, e.g. "2575" or "6661-6670".
udparray of stringUDP ports or ranges (default none).
outboundobjectFrom your network to theirs (the
<phase1>-outpolicy, service<phase1>-svc-out). Default:theirMllpPort.3 fields
allbooleanAllow every service (ALL) instead (default false).
tcparray of stringTCP ports or ranges, e.g. "2575" or "6661-6670".
udparray of stringUDP ports or ranges (default none).
theirMllpPortstringThe healthcare organization's MLLP port (or range), e.g. "6661": the outbound default. Required unless
services.outboundis given (e.g.{ all: true }).acknowledgedRoutesarray of stringThe route warnings the requester checked and wants the tunnel anyway, by key (the preview's
routeKeys): "<their subnet> via <route> <gateway/interface>" for an overlap with an active route, "<their subnet> wider than /16". Stored sorted and deduped; part of what the approval covers. Each current warning must be listed, at request time and again at apply.pskstringThe pre-shared key (20-128 printable characters, no quotes, backslash or spaces).
Responses
- 200The request.
Response fields
application/json · object
idstringconnectionIdstringorgNamestringphase1Namestringspecobject17 fields
orgNamestringThe healthcare organization's name.
phase1NamestringThe phase 1 (tunnel interface) name, 15 characters at most; mh-<organization> by default.
peerIpstringThe healthcare organization's firewall (IPv4).
localSubnetsarray of stringYour side (CIDR), up to 16.
remoteSubnetsarray of stringThe healthcare organization's side (CIDR), up to 16.
ikeVersioninteger1 or 2 (default 2).
phase1Proposalsarray of stringDefault ["aes256-sha256"].
phase2Proposalsarray of stringDefault ["aes256-sha256"].
dhGroupsarray of stringDefault ["14"].
keylifeintegerPhase 1 key life, seconds (default 28800).
keylifeSecondsintegerPhase 2 key life, seconds (default 3600).
wanInterfacestringThe internet-facing interface (default "wan1").
lanInterfacestringThe interface your local subnets are on, for the policies (default "internal").
blackholeRoutebooleanAdd a blackhole route (distance 254) per remote subnet, so their traffic is dropped while the tunnel is down (default true).
servicesobjectWhat each policy allows, per direction: a custom service of these ports, or ALL (an explicit opt-in per direction; the preview says so). Both policies log all traffic.
2 fields
inboundobjectFrom the healthcare organization to your network (the
<phase1>-inpolicy, service<phase1>-svc-in). Default: the engine's MLLP listener ports.3 fields
allbooleanAllow every service (ALL) instead (default false).
tcparray of stringTCP ports or ranges, e.g. "2575" or "6661-6670".
udparray of stringUDP ports or ranges (default none).
outboundobjectFrom your network to theirs (the
<phase1>-outpolicy, service<phase1>-svc-out). Default:theirMllpPort.3 fields
allbooleanAllow every service (ALL) instead (default false).
tcparray of stringTCP ports or ranges, e.g. "2575" or "6661-6670".
udparray of stringUDP ports or ranges (default none).
theirMllpPortstringThe healthcare organization's MLLP port (or range), e.g. "6661": the outbound default. Required unless
services.outboundis given (e.g.{ all: true }).acknowledgedRoutesarray of stringThe route warnings the requester checked and wants the tunnel anyway, by key (the preview's
routeKeys): "<their subnet> via <route> <gateway/interface>" for an overlap with an active route, "<their subnet> wider than /16". Stored sorted and deduped; part of what the approval covers. Each current warning must be listed, at request time and again at apply.
specHashstringThe hash of the spec; an approval sends the one the approver reviewed.
statusstringOne of: "requested", "approved", "applying", "applied", "failed", "rejected", "expired", "cancelled"
hasKeybooleanA sealed key is held (only while requested or approved).
keyDiscardedAtstring | nullrequestedBystringapprovedBystring | nullrejectedBystring | nullappliedBystring | nullexpiresAtstringresultobject | null6 fields
okbooleanfailedAtstringrolledBackbooleanTrue only when every object the apply created was removed again.
interruptedbooleanThe engine stopped mid-apply; the watcher ended the request.
claimLostbooleanThe apply lost its hold on the request mid-way (the watcher ended it as too slow, or its progress couldn't be recorded in time): it sent no further changes and removed what it had created.
stepsarray of object10 fields
idstringlabelstringphasestringOne of: "apply", "rollback"
okbooleanskippedbooleanmkeystringerrorstringerrorCodestringmayExistbooleanThe write got no answer (a timeout, or the connection broke after sending): the FortiGate may hold the object.
notestringA remark on a step that worked, e.g. it was never created.
leftOnFortigatearray of objectObjects an apply created and couldn't remove (saved after every write): remove them on the FortiGate.
5 fields
idstringlabelstringmkeystring | nullundoPathstring | nullThe DELETE path; null when the entry's id is unknown.
mayExistbooleanThe write got no answer and the entry has no name to look up: check the FortiGate for it.
tunnelIdstring | nullThe tracked tunnel created by a successful apply.
planobject2 fields
stepsarray of object8 fields
idstringkindstringOne of: "address", "addrgrp", "phase1", "phase2", "service", "policy", "route", "blackhole"
labelstringmethodstringpathstringThe FortiOS REST path.
bodyobjectThe JSON body; psksecret masked.
clistringThe equivalent FortiOS CLI.
undoobject2 fields
methodstringpathstring
clistringEvery step's CLI, as one paste.
canobject4 fields
canEditbooleancanApprovebooleanapproveBlockedstringcanApplyboolean
warningsarray of stringconflictsarray of stringNames the FortiGate already has (null when it couldn't be read).
readErrorstring | nullrouteWarningsarray of stringActive routes (GET monitor/router/ipv4) their subnets overlap: "… overlaps existing route … via …".
ackRequiredbooleanA route overlap or a subnet wider than /16: each needs its key in acknowledgedRoutes.
routeKeysarray of stringThe key of each warning that needs acknowledging (overlaps and subnets wider than /16), to put in acknowledgedRoutes.
unacknowledgedarray of stringThe keys the request's acknowledgedRoutes doesn't list.
- 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
Example request
curl -X PATCH "$ENGINE_URL/api/fortigate/provision/<id>" \
-H "Authorization: Bearer $TOKEN" \
-H "Content-Type: application/json" \
-d '{
"orgName": "string",
"phase1Name": "string",
"peerIp": "string",
"localSubnets": [
"string"
],
"remoteSubnets": [
"string"
],
"ikeVersion": 0,
"phase1Proposals": [
"string"
],
"phase2Proposals": [
"string"
],
"dhGroups": [
"string"
],
"keylife": 0,
"keylifeSeconds": 0,
"wanInterface": "string",
"lanInterface": "string",
"blackholeRoute": true,
"services": {
"inbound": {
"all": true,
"tcp": [
"string"
],
"udp": [
"string"
]
},
"outbound": {
"all": true,
"tcp": [
"string"
],
"udp": [
"string"
]
}
},
"theirMllpPort": "string",
"acknowledgedRoutes": [
"string"
],
"psk": "string"
}'Cancel a FortiGate tunnel request
delete/api/fortigate/provision/{id}
Ends a waiting or approved request and discards its key. Audited as fortigate.provision_cancelled.
Minimum role: admin.
Auth: Bearer token (how to get one) · Operation: cancelFortigateProvisionRequest
Parameters
| Name | In | Type | Description |
|---|---|---|---|
idrequired | path | string | The id, in the caller's workspace. |
Responses
- 200Cancelled.
Response fields
application/json · object
cancelledboolean
- 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
Example request
curl -X DELETE "$ENGINE_URL/api/fortigate/provision/<id>" \
-H "Authorization: Bearer $TOKEN"Approve or reject a FortiGate tunnel request
post/api/fortigate/provision/{id}/decision
{ action: approve | reject, specHash, reason? }. Approve: a signed-in admin other than the requester (API tokens can't), on a waiting, unexpired request, sending the specHash of the request as reviewed (409 SPEC_CHANGED when it changed meanwhile); the approval holds 24 h, only for the request as it reads now and only for the FortiGate the connection points at now (a later change to the connection sends it back for a new approval, audited as fortigate.provision_approval_cleared). Reject ends it and discards the key. Audited as fortigate.provision_approved / fortigate.provision_rejected.
Minimum role: admin.
Auth: Bearer token (how to get one) · Operation: decideFortigateProvisionRequest
Parameters
| Name | In | Type | Description |
|---|---|---|---|
idrequired | path | string | The id, in the caller's workspace. |
Request body (required)
application/json · object
actionstringrequiredOne of: "approve", "reject"
specHashstringRequired to approve: the request's specHash.
reasonstring
Responses
- 200The request.
Response fields
application/json · object
idstringconnectionIdstringorgNamestringphase1Namestringspecobject17 fields
orgNamestringThe healthcare organization's name.
phase1NamestringThe phase 1 (tunnel interface) name, 15 characters at most; mh-<organization> by default.
peerIpstringThe healthcare organization's firewall (IPv4).
localSubnetsarray of stringYour side (CIDR), up to 16.
remoteSubnetsarray of stringThe healthcare organization's side (CIDR), up to 16.
ikeVersioninteger1 or 2 (default 2).
phase1Proposalsarray of stringDefault ["aes256-sha256"].
phase2Proposalsarray of stringDefault ["aes256-sha256"].
dhGroupsarray of stringDefault ["14"].
keylifeintegerPhase 1 key life, seconds (default 28800).
keylifeSecondsintegerPhase 2 key life, seconds (default 3600).
wanInterfacestringThe internet-facing interface (default "wan1").
lanInterfacestringThe interface your local subnets are on, for the policies (default "internal").
blackholeRoutebooleanAdd a blackhole route (distance 254) per remote subnet, so their traffic is dropped while the tunnel is down (default true).
servicesobjectWhat each policy allows, per direction: a custom service of these ports, or ALL (an explicit opt-in per direction; the preview says so). Both policies log all traffic.
2 fields
inboundobjectFrom the healthcare organization to your network (the
<phase1>-inpolicy, service<phase1>-svc-in). Default: the engine's MLLP listener ports.3 fields
allbooleanAllow every service (ALL) instead (default false).
tcparray of stringTCP ports or ranges, e.g. "2575" or "6661-6670".
udparray of stringUDP ports or ranges (default none).
outboundobjectFrom your network to theirs (the
<phase1>-outpolicy, service<phase1>-svc-out). Default:theirMllpPort.3 fields
allbooleanAllow every service (ALL) instead (default false).
tcparray of stringTCP ports or ranges, e.g. "2575" or "6661-6670".
udparray of stringUDP ports or ranges (default none).
theirMllpPortstringThe healthcare organization's MLLP port (or range), e.g. "6661": the outbound default. Required unless
services.outboundis given (e.g.{ all: true }).acknowledgedRoutesarray of stringThe route warnings the requester checked and wants the tunnel anyway, by key (the preview's
routeKeys): "<their subnet> via <route> <gateway/interface>" for an overlap with an active route, "<their subnet> wider than /16". Stored sorted and deduped; part of what the approval covers. Each current warning must be listed, at request time and again at apply.
specHashstringThe hash of the spec; an approval sends the one the approver reviewed.
statusstringOne of: "requested", "approved", "applying", "applied", "failed", "rejected", "expired", "cancelled"
hasKeybooleanA sealed key is held (only while requested or approved).
keyDiscardedAtstring | nullrequestedBystringapprovedBystring | nullrejectedBystring | nullappliedBystring | nullexpiresAtstringresultobject | null6 fields
okbooleanfailedAtstringrolledBackbooleanTrue only when every object the apply created was removed again.
interruptedbooleanThe engine stopped mid-apply; the watcher ended the request.
claimLostbooleanThe apply lost its hold on the request mid-way (the watcher ended it as too slow, or its progress couldn't be recorded in time): it sent no further changes and removed what it had created.
stepsarray of object10 fields
idstringlabelstringphasestringOne of: "apply", "rollback"
okbooleanskippedbooleanmkeystringerrorstringerrorCodestringmayExistbooleanThe write got no answer (a timeout, or the connection broke after sending): the FortiGate may hold the object.
notestringA remark on a step that worked, e.g. it was never created.
leftOnFortigatearray of objectObjects an apply created and couldn't remove (saved after every write): remove them on the FortiGate.
5 fields
idstringlabelstringmkeystring | nullundoPathstring | nullThe DELETE path; null when the entry's id is unknown.
mayExistbooleanThe write got no answer and the entry has no name to look up: check the FortiGate for it.
tunnelIdstring | nullThe tracked tunnel created by a successful apply.
planobject2 fields
stepsarray of object8 fields
idstringkindstringOne of: "address", "addrgrp", "phase1", "phase2", "service", "policy", "route", "blackhole"
labelstringmethodstringpathstringThe FortiOS REST path.
bodyobjectThe JSON body; psksecret masked.
clistringThe equivalent FortiOS CLI.
undoobject2 fields
methodstringpathstring
clistringEvery step's CLI, as one paste.
canobject4 fields
canEditbooleancanApprovebooleanapproveBlockedstringcanApplyboolean
- 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
Example request
curl -X POST "$ENGINE_URL/api/fortigate/provision/<id>/decision" \
-H "Authorization: Bearer $TOKEN" \
-H "Content-Type: application/json" \
-d '{
"action": "approve",
"specHash": "string",
"reason": "string"
}'Apply an approved FortiGate tunnel request
post/api/fortigate/provision/{id}/apply
Reads the FortiGate's names and active routes first (409 NAME_EXISTS when any the plan creates exists, 409 ACK_REQUIRED naming each current route warning not in acknowledgedRoutes, audited with them; 409 REQUEST_OUTDATED for a request made before the ports were split by direction; nothing written), then creates each object in order; on a failed step deletes what it created, in reverse; anything it couldn't remove is listed in leftOnFortigate (saved after every write, so it survives a restart; an apply that never finished is ended by the watcher, and an apply still running then stops writing and removes what it created: result.claimLost). A POST that gets no answer may have been applied: a named object is deleted by name in the rollback (a 404 means it was never created); a numbered one is listed with mayExist. 200 applied (the tunnel is tracked under "On your FortiGate"), 502 when a step failed (code FORTIGATE_WRITE_FORBIDDEN: the API profile needs read-write permission). Either way the key is discarded. 403 WRITES_OFF, 409 APPROVAL_REQUIRED. Every step and rollback step is audited (fortigate.provision_step, fortigate.provision_rollback_step).
Minimum role: admin.
Auth: Bearer token (how to get one) · Operation: applyFortigateProvisionRequest
Parameters
| Name | In | Type | Description |
|---|---|---|---|
idrequired | path | string | The id, in the caller's workspace. |
Responses
- 200The request with each step's outcome.
Response fields
application/json · object
idstringconnectionIdstringorgNamestringphase1Namestringspecobject17 fields
orgNamestringThe healthcare organization's name.
phase1NamestringThe phase 1 (tunnel interface) name, 15 characters at most; mh-<organization> by default.
peerIpstringThe healthcare organization's firewall (IPv4).
localSubnetsarray of stringYour side (CIDR), up to 16.
remoteSubnetsarray of stringThe healthcare organization's side (CIDR), up to 16.
ikeVersioninteger1 or 2 (default 2).
phase1Proposalsarray of stringDefault ["aes256-sha256"].
phase2Proposalsarray of stringDefault ["aes256-sha256"].
dhGroupsarray of stringDefault ["14"].
keylifeintegerPhase 1 key life, seconds (default 28800).
keylifeSecondsintegerPhase 2 key life, seconds (default 3600).
wanInterfacestringThe internet-facing interface (default "wan1").
lanInterfacestringThe interface your local subnets are on, for the policies (default "internal").
blackholeRoutebooleanAdd a blackhole route (distance 254) per remote subnet, so their traffic is dropped while the tunnel is down (default true).
servicesobjectWhat each policy allows, per direction: a custom service of these ports, or ALL (an explicit opt-in per direction; the preview says so). Both policies log all traffic.
2 fields
inboundobjectFrom the healthcare organization to your network (the
<phase1>-inpolicy, service<phase1>-svc-in). Default: the engine's MLLP listener ports.3 fields
allbooleanAllow every service (ALL) instead (default false).
tcparray of stringTCP ports or ranges, e.g. "2575" or "6661-6670".
udparray of stringUDP ports or ranges (default none).
outboundobjectFrom your network to theirs (the
<phase1>-outpolicy, service<phase1>-svc-out). Default:theirMllpPort.3 fields
allbooleanAllow every service (ALL) instead (default false).
tcparray of stringTCP ports or ranges, e.g. "2575" or "6661-6670".
udparray of stringUDP ports or ranges (default none).
theirMllpPortstringThe healthcare organization's MLLP port (or range), e.g. "6661": the outbound default. Required unless
services.outboundis given (e.g.{ all: true }).acknowledgedRoutesarray of stringThe route warnings the requester checked and wants the tunnel anyway, by key (the preview's
routeKeys): "<their subnet> via <route> <gateway/interface>" for an overlap with an active route, "<their subnet> wider than /16". Stored sorted and deduped; part of what the approval covers. Each current warning must be listed, at request time and again at apply.
specHashstringThe hash of the spec; an approval sends the one the approver reviewed.
statusstringOne of: "requested", "approved", "applying", "applied", "failed", "rejected", "expired", "cancelled"
hasKeybooleanA sealed key is held (only while requested or approved).
keyDiscardedAtstring | nullrequestedBystringapprovedBystring | nullrejectedBystring | nullappliedBystring | nullexpiresAtstringresultobject | null6 fields
okbooleanfailedAtstringrolledBackbooleanTrue only when every object the apply created was removed again.
interruptedbooleanThe engine stopped mid-apply; the watcher ended the request.
claimLostbooleanThe apply lost its hold on the request mid-way (the watcher ended it as too slow, or its progress couldn't be recorded in time): it sent no further changes and removed what it had created.
stepsarray of object10 fields
idstringlabelstringphasestringOne of: "apply", "rollback"
okbooleanskippedbooleanmkeystringerrorstringerrorCodestringmayExistbooleanThe write got no answer (a timeout, or the connection broke after sending): the FortiGate may hold the object.
notestringA remark on a step that worked, e.g. it was never created.
leftOnFortigatearray of objectObjects an apply created and couldn't remove (saved after every write): remove them on the FortiGate.
5 fields
idstringlabelstringmkeystring | nullundoPathstring | nullThe DELETE path; null when the entry's id is unknown.
mayExistbooleanThe write got no answer and the entry has no name to look up: check the FortiGate for it.
tunnelIdstring | nullThe tracked tunnel created by a successful apply.
planobject2 fields
stepsarray of object8 fields
idstringkindstringOne of: "address", "addrgrp", "phase1", "phase2", "service", "policy", "route", "blackhole"
labelstringmethodstringpathstringThe FortiOS REST path.
bodyobjectThe JSON body; psksecret masked.
clistringThe equivalent FortiOS CLI.
undoobject2 fields
methodstringpathstring
clistringEvery step's CLI, as one paste.
canobject4 fields
canEditbooleancanApprovebooleanapproveBlockedstringcanApplyboolean
- 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
- 502Error.
application/json · ApiError
Example request
curl -X POST "$ENGINE_URL/api/fortigate/provision/<id>/apply" \
-H "Authorization: Bearer $TOKEN"List FortiGate connections
get/api/fortigate/connections
The workspace's read-only connections to the customer's own FortiGates (several are allowed: one per box or VDOM). Never the API token.
Minimum role: operator.
Auth: Bearer token (how to get one) · Operation: listFortigateConnections
Responses
- 200The connections.
Response fields
application/json · object
connectionsarray of object15 fields
idstringnamestringkindstringfortigate (default: the FortiGate's own REST API) or fortimanager (FortiManager's JSON-RPC API: one connection for every FortiGate it manages, each read through its device proxy).
One of: "fortigate", "fortimanager"
baseUrlstringhttps://host[:port]
hoststringvdomstring | nulladomstring | nullFortiManager only.
authMethodstringFortiManager only: an API key or a login.
One of: "token", "password"
hasTokenbooleanA token is stored. It is never returned.
allowActionsbooleanOpt-in actions on the FortiGate: operators may bring a tracked tunnel up (POST /api/fortigate/tunnels/{id}/bring-up). Off by default; the REST API admin's profile must allow VPN writes too. Changing it is audited as
fortigate.connection_actions_changed.allowWritesbooleanAdmins may provision tunnels on this FortiGate (off by default), each previewed and approved by a second admin.
pinnedFingerprint256stringThe pinned certificate, when one is.
customCabooleanA CA was uploaded.
lastTestobject | null3 fields
atstringokbooleanmessagestring | null
systemobject | null4 fields
versionstringhostnamestringserialstringmodelstring
- 401No credential, or the token is invalid or expired.
application/json · ApiError
- 403The caller's role, license or network address does not allow this. A signed-in person who is not a member of the requested workspace gets code `WORKSPACE_FORBIDDEN`; a viewer asking for message content gets `PHI_FORBIDDEN` (or `PHI_SEARCH_FORBIDDEN` for a search on message content).
application/json · ApiError
Example request
curl "$ENGINE_URL/api/fortigate/connections" \
-H "Authorization: Bearer $TOKEN"Add a FortiGate connection
post/api/fortigate/connections
A connection to a FortiGate's REST API (FortiOS 7.0-7.4) with a read-only API token, or (kind fortimanager) to FortiManager's JSON-RPC API with an API key (7.2.2 and later) or a read-only admin's user name and password, and an optional ADOM. Credentials are sealed like adapter credentials and never returned. A private management address must be on SSRF_ALLOWLIST. Creating one sends nothing. Read only toward the FortiGate unless an admin allows it on the connection: allowActions (then only Bring tunnel up) or allowWrites (opt-in provisioning, each change approved by a second admin). Both are off by default and FortiGate only. MedHook never returns a PSK. Audited as fortigate.connection_created.
Minimum role: admin.
Auth: Bearer token (how to get one) · Operation: createFortigateConnection
Request body (required)
application/json · object
namestringrequiredbaseUrlstringrequiredhttps://host[:port]
apiTokenstringThe FortiGate's REST API token, or FortiManager's API key.
vdomstringkindstringfortigate (default: the FortiGate's own REST API) or fortimanager (FortiManager's JSON-RPC API: one connection for every FortiGate it manages, each read through its device proxy).
One of: "fortigate", "fortimanager"
usernamestringFortiManager only: a read-only admin to log in as, with password. Not with apiToken.
passwordstringFortiManager only: that admin's password. Never returned.
adomstringFortiManager only: the one ADOM to read; empty reads every FortiGate ADOM.
trustFingerprintstringThe management certificate's SHA-256 fingerprint ("AA:BB:…") to pin: the FortiGate's self-signed default. Check it on the FortiGate first.
caPemstringA CA certificate (PEM) to verify the management certificate against (host name included). Not with trustFingerprint.
allowActionsbooleanOpt-in actions on the FortiGate: operators may bring a tracked tunnel up (POST /api/fortigate/tunnels/{id}/bring-up). Off by default; the REST API admin's profile must allow VPN writes too. Changing it is audited as
fortigate.connection_actions_changed.
Responses
- 201The connection.
Response fields
application/json · object
idstringnamestringkindstringfortigate (default: the FortiGate's own REST API) or fortimanager (FortiManager's JSON-RPC API: one connection for every FortiGate it manages, each read through its device proxy).
One of: "fortigate", "fortimanager"
baseUrlstringhttps://host[:port]
hoststringvdomstring | nulladomstring | nullFortiManager only.
authMethodstringFortiManager only: an API key or a login.
One of: "token", "password"
hasTokenbooleanA token is stored. It is never returned.
allowActionsbooleanOpt-in actions on the FortiGate: operators may bring a tracked tunnel up (POST /api/fortigate/tunnels/{id}/bring-up). Off by default; the REST API admin's profile must allow VPN writes too. Changing it is audited as
fortigate.connection_actions_changed.allowWritesbooleanAdmins may provision tunnels on this FortiGate (off by default), each previewed and approved by a second admin.
pinnedFingerprint256stringThe pinned certificate, when one is.
customCabooleanA CA was uploaded.
lastTestobject | null3 fields
atstringokbooleanmessagestring | null
systemobject | null4 fields
versionstringhostnamestringserialstringmodelstring
- 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
Example request
curl -X POST "$ENGINE_URL/api/fortigate/connections" \
-H "Authorization: Bearer $TOKEN" \
-H "Content-Type: application/json" \
-d '{
"name": "string",
"baseUrl": "string",
"apiToken": "string",
"vdom": "string",
"kind": "fortigate",
"username": "string",
"password": "string",
"adom": "string",
"trustFingerprint": "string",
"caPem": "string",
"allowActions": true
}'Test a FortiGate connection
post/api/fortigate/connections/test
Reads GET /api/v2/monitor/system/status and the IPsec tunnels with an unsaved connection ({ baseUrl, apiToken, vdom?, trust }) or a saved one ({ connectionId }, optionally with changes). Always 200: ok with the FortiOS version, host name, serial and tunnel counts, or error { code, message, certificate? } (code CERT_UNTRUSTED carries the presented certificate to check and pin). A FortiManager ({ kind: "fortimanager", ... } or a saved one) answers its own version and host name, devices (each managed FortiGate, its tunnel count and whether it could be read) and unreadDevices. A saved connection tested as stored records the result. Read only toward the FortiGate unless an admin allows it on the connection: allowActions (then only Bring tunnel up) or allowWrites (opt-in provisioning, each change approved by a second admin). Both are off by default and FortiGate only. MedHook never returns a PSK. Audited as fortigate.connection_tested. Rate limited: 10 req / 60 s.
Minimum role: admin.
Auth: Bearer token (how to get one) · Operation: testFortigateConnection
Request body (required)
application/json · object
connectionIdstringbaseUrlstringapiTokenstringvdomstringkindstringfortigate (default: the FortiGate's own REST API) or fortimanager (FortiManager's JSON-RPC API: one connection for every FortiGate it manages, each read through its device proxy).
One of: "fortigate", "fortimanager"
usernamestringFortiManager only: a read-only admin to log in as, with password. Not with apiToken.
passwordstringFortiManager only: that admin's password. Never returned.
adomstringFortiManager only: the one ADOM to read; empty reads every FortiGate ADOM.
trustFingerprintstringThe management certificate's SHA-256 fingerprint ("AA:BB:…") to pin: the FortiGate's self-signed default. Check it on the FortiGate first.
caPemstringA CA certificate (PEM) to verify the management certificate against (host name included). Not with trustFingerprint.
Responses
- 200The outcome.
Response fields
application/json · object
okbooleankindstringsystemobject3 fields
versionstringhostnamestringserialstring
devicesarray of object7 fields
namestringadomstringhostnamestringversionstringconnectedbooleantunnelsintegerreadboolean
unreadDevicesarray of stringtunnelsintegerupintegererrorobject3 fields
codestringmessagestringcertificateobject6 fields
fingerprint256stringsubjectstringissuerstringvalidFromstringvalidTostringselfSignedboolean
- 400The request is malformed or fails validation.
application/json · ApiError
- 401No credential, or the token is invalid or expired.
application/json · ApiError
- 403The caller's role, license or network address does not allow this. A signed-in person who is not a member of the requested workspace gets code `WORKSPACE_FORBIDDEN`; a viewer asking for message content gets `PHI_FORBIDDEN` (or `PHI_SEARCH_FORBIDDEN` for a search on message content).
application/json · ApiError
- 404Not found in the caller's workspace.
application/json · ApiError
- 429Rate limit exceeded (see the `Retry-After` header), or on the AI routes the daily AI budget is used up.
application/json · ApiError
Example request
curl -X POST "$ENGINE_URL/api/fortigate/connections/test" \
-H "Authorization: Bearer $TOKEN" \
-H "Content-Type: application/json" \
-d '{
"connectionId": "string",
"baseUrl": "string",
"apiToken": "string",
"vdom": "string",
"kind": "fortigate",
"username": "string",
"password": "string",
"adom": "string",
"trustFingerprint": "string",
"caPem": "string"
}'Get a FortiGate connection
get/api/fortigate/connections/{id}
One connection, never the token.
Minimum role: operator.
Auth: Bearer token (how to get one) · Operation: getFortigateConnection
Parameters
| Name | In | Type | Description |
|---|---|---|---|
idrequired | path | string | The id, in the caller's workspace. |
Responses
- 200The connection.
Response fields
application/json · object
idstringnamestringkindstringfortigate (default: the FortiGate's own REST API) or fortimanager (FortiManager's JSON-RPC API: one connection for every FortiGate it manages, each read through its device proxy).
One of: "fortigate", "fortimanager"
baseUrlstringhttps://host[:port]
hoststringvdomstring | nulladomstring | nullFortiManager only.
authMethodstringFortiManager only: an API key or a login.
One of: "token", "password"
hasTokenbooleanA token is stored. It is never returned.
allowActionsbooleanOpt-in actions on the FortiGate: operators may bring a tracked tunnel up (POST /api/fortigate/tunnels/{id}/bring-up). Off by default; the REST API admin's profile must allow VPN writes too. Changing it is audited as
fortigate.connection_actions_changed.allowWritesbooleanAdmins may provision tunnels on this FortiGate (off by default), each previewed and approved by a second admin.
pinnedFingerprint256stringThe pinned certificate, when one is.
customCabooleanA CA was uploaded.
lastTestobject | null3 fields
atstringokbooleanmessagestring | null
systemobject | null4 fields
versionstringhostnamestringserialstringmodelstring
- 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
Example request
curl "$ENGINE_URL/api/fortigate/connections/<id>" \
-H "Authorization: Bearer $TOKEN"Change a FortiGate connection
patch/api/fortigate/connections/{id}
Any of name, baseUrl, apiToken (omitted keeps the stored one), vdom, allowActions and allowWrites (FortiGate only; opt-in Bring tunnel up and opt-in tunnel provisioning, which need a read-write API profile), and trustFingerprint, caPem or clearTrust: true. A FortiManager connection also takes adom, and username / password (a login instead of a key); its kind can't change. Audited as fortigate.connection_updated with the changed field names (never a credential) and allowWrites' new value; a change of allowActions also as fortigate.connection_actions_changed (the new and previous value).
Minimum role: admin.
Auth: Bearer token (how to get one) · Operation: updateFortigateConnection
Parameters
| Name | In | Type | Description |
|---|---|---|---|
idrequired | path | string | The id, in the caller's workspace. |
Request body (required)
application/json · object
namestringbaseUrlstringapiTokenstringvdomstringadomstringFortiManager only: the one ADOM to read; empty reads every FortiGate ADOM.
usernamestringFortiManager only: a read-only admin to log in as, with password. Not with apiToken.
passwordstringFortiManager only: that admin's password. Never returned.
trustFingerprintstringThe management certificate's SHA-256 fingerprint ("AA:BB:…") to pin: the FortiGate's self-signed default. Check it on the FortiGate first.
caPemstringA CA certificate (PEM) to verify the management certificate against (host name included). Not with trustFingerprint.
clearTrustbooleanallowActionsbooleanOpt-in actions on the FortiGate: operators may bring a tracked tunnel up (POST /api/fortigate/tunnels/{id}/bring-up). Off by default; the REST API admin's profile must allow VPN writes too. Changing it is audited as
fortigate.connection_actions_changed.allowWritesboolean
Responses
- 200The connection.
Response fields
application/json · object
idstringnamestringkindstringfortigate (default: the FortiGate's own REST API) or fortimanager (FortiManager's JSON-RPC API: one connection for every FortiGate it manages, each read through its device proxy).
One of: "fortigate", "fortimanager"
baseUrlstringhttps://host[:port]
hoststringvdomstring | nulladomstring | nullFortiManager only.
authMethodstringFortiManager only: an API key or a login.
One of: "token", "password"
hasTokenbooleanA token is stored. It is never returned.
allowActionsbooleanOpt-in actions on the FortiGate: operators may bring a tracked tunnel up (POST /api/fortigate/tunnels/{id}/bring-up). Off by default; the REST API admin's profile must allow VPN writes too. Changing it is audited as
fortigate.connection_actions_changed.allowWritesbooleanAdmins may provision tunnels on this FortiGate (off by default), each previewed and approved by a second admin.
pinnedFingerprint256stringThe pinned certificate, when one is.
customCabooleanA CA was uploaded.
lastTestobject | null3 fields
atstringokbooleanmessagestring | null
systemobject | null4 fields
versionstringhostnamestringserialstringmodelstring
- 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
Example request
curl -X PATCH "$ENGINE_URL/api/fortigate/connections/<id>" \
-H "Authorization: Bearer $TOKEN" \
-H "Content-Type: application/json" \
-d '{
"name": "string",
"baseUrl": "string",
"apiToken": "string",
"vdom": "string",
"adom": "string",
"username": "string",
"password": "string",
"trustFingerprint": "string",
"caPem": "string",
"clearTrust": true,
"allowActions": true,
"allowWrites": true
}'Delete a FortiGate connection
delete/api/fortigate/connections/{id}
Forgets the connection and its tracked tunnels. Nothing changes on the FortiGate. Audited as fortigate.connection_deleted.
Minimum role: admin.
Auth: Bearer token (how to get one) · Operation: deleteFortigateConnection
Parameters
| Name | In | Type | Description |
|---|---|---|---|
idrequired | path | string | The id, in the caller's workspace. |
Responses
- 200Deleted.
Response fields
application/json · object
deletedbooleantrackedinteger
- 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
Example request
curl -X DELETE "$ENGINE_URL/api/fortigate/connections/<id>" \
-H "Authorization: Bearer $TOKEN"List the FortiGate's IPsec tunnels
get/api/fortigate/connections/{id}/tunnels
Every phase 1 the FortiGate reports (status, peer, phase 2 subnets and traffic), each with tracked (the tracked tunnel's id, or null). Cached 30 s; refresh=1 reads again (at most every 5 s). A failed read answers 502 FORTIGATE_<code> (FORTIGATE_CERT_UNTRUSTED with details.certificate).
Minimum role: operator.
Auth: Bearer token (how to get one) · Operation: listFortigateDeviceTunnels
Parameters
| Name | In | Type | Description |
|---|---|---|---|
idrequired | path | string | The id, in the caller's workspace. |
refresh | query | string | 1 to read the FortiGate again now. |
Responses
- 200The tunnels.
Response fields
application/json · object
readAtstringtunnelsarray of object6 fields
namestringstatusstringremoteGatewaystringremoteSubnetsarray of stringphase2array of object8 fields
namestringstatusstringOne of: "up", "down"
localSubnetsarray of stringremoteSubnetsarray of stringincomingBytesintegeroutgoingBytesintegerremoteSourceobject5 fields
kindstringaddress-object: resolved from the named address or group; live-selectors: it couldn't be read or resolved, so the IPsec monitor's subnets are used.
One of: "address-object", "live-selectors"
namestringThe address object (address-object).
objectstringThe address object (live-selectors).
reasonstringWhy the live selectors are used.
skippedarray of object2 fields
namestringreasonstring
localSourceobject5 fields
kindstringaddress-object: resolved from the named address or group; live-selectors: it couldn't be read or resolved, so the IPsec monitor's subnets are used.
One of: "address-object", "live-selectors"
namestringThe address object (address-object).
objectstringThe address object (live-selectors).
reasonstringWhy the live selectors are used.
skippedarray of object2 fields
namestringreasonstring
trackedstring
- 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
- 500Unexpected server error.
application/json · ApiError
Example request
curl "$ENGINE_URL/api/fortigate/connections/<id>/tunnels" \
-H "Authorization: Bearer $TOKEN"Track FortiGate tunnels
post/api/fortigate/connections/{id}/tunnels
{ tunnels: [{ phase1Name, orgName? }] } (up to 200): each is tracked under its healthcare organization's name (the phase 1 name by default); already tracked ones are skipped. Audited as fortigate.tunnels_imported.
Minimum role: admin.
Auth: Bearer token (how to get one) · Operation: importFortigateTunnels
Parameters
| Name | In | Type | Description |
|---|---|---|---|
idrequired | path | string | The id, in the caller's workspace. |
Request body (required)
application/json · object
tunnelsarray of object2 fields
phase1NamestringThe phase 1 name as listed (through FortiManager "<device>/<phase 1>").
orgNamestring
Responses
- 201How many were added.
Response fields
application/json · object
importedinteger
- 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
- 500Unexpected server error.
application/json · ApiError
Example request
curl -X POST "$ENGINE_URL/api/fortigate/connections/<id>/tunnels" \
-H "Authorization: Bearer $TOKEN" \
-H "Content-Type: application/json" \
-d '{
"tunnels": [
{
"phase1Name": "string",
"orgName": "string"
}
]
}'List tracked FortiGate tunnels
get/api/fortigate/tunnels
The Tunnels page's "On your FortiGate": every connection with its last read's outcome, and every tracked tunnel with status, peer, subnets, phase 2s, traffic, last change, overlapping subnets and its latest tunnel alert. Status changes raise tunnel_events alerts (down after 2 min, degraded, recovered) through the same rules as MedHook tunnels; alert only, no failover. refresh=1 reads again (at most every 5 s per connection).
Minimum role: operator.
Auth: Bearer token (how to get one) · Operation: listFortigateTunnels
Parameters
| Name | In | Type | Description |
|---|---|---|---|
refresh | query | string | 1 to read the FortiGates again now. |
Responses
- 200The tunnels.
Response fields
application/json · object
connectionsarray of object6 fields
idstringnamestringhoststringkindstringtrackedintegerreadobject3 fields
okbooleanreadAtstringerrorobject3 fields
codestringmessagestringcertificateobject6 fields
fingerprint256stringsubjectstringissuerstringvalidFromstringvalidTostringselfSignedboolean
tunnelsarray of object19 fields
idstringorgNamestringThe healthcare organization's name (the phase 1 name by default).
phase1NamestringThe phase 1 name; through FortiManager "<device>/<phase 1>".
devicestring | nullThe managed FortiGate the tunnel lives on (FortiManager connections).
connectionobject2 fields
idstringnamestring
statusstringOne of: "up", "partial", "down", "missing", "unknown"
statusChangedAtstring | nulldownSincestring | nulllastReadAtstring | nullremoteSubnetsarray of stringThe phase 2 remote subnets the FortiGate reports.
seenSubnetsarray of stringThe subnets as the engine sees them (NAT); empty: remoteSubnets.
subnetsarray of stringWhat labels peers and bounds the reachability test.
peerstring | nullThe remote gateway.
phase2array of object8 fields
namestringstatusstringOne of: "up", "down"
localSubnetsarray of stringremoteSubnetsarray of stringincomingBytesintegeroutgoingBytesintegerremoteSourceobject5 fields
kindstringaddress-object: resolved from the named address or group; live-selectors: it couldn't be read or resolved, so the IPsec monitor's subnets are used.
One of: "address-object", "live-selectors"
namestringThe address object (address-object).
objectstringThe address object (live-selectors).
reasonstringWhy the live selectors are used.
skippedarray of object2 fields
namestringreasonstring
localSourceobject5 fields
kindstringaddress-object: resolved from the named address or group; live-selectors: it couldn't be read or resolved, so the IPsec monitor's subnets are used.
One of: "address-object", "live-selectors"
namestringThe address object (address-object).
objectstringThe address object (live-selectors).
reasonstringWhy the live selectors are used.
skippedarray of object2 fields
namestringreasonstring
incomingBytesinteger | nulloutgoingBytesinteger | nulluptimeSecondsinteger | nulloverlapsarray of objectSubnets another tunnel (FortiGate or MedHook-managed) also covers: peers there are labeled only when one subnet is more specific.
2 fields
subnetstringwitharray of object3 fields
idstringnamestringsourcestringfortigate for a tracked FortiGate tunnel.
alertobject | null6 fields
eventstringrulestringdueAtstringsentAtstringmutedReasonstringlastErrorstring
- 401No credential, or the token is invalid or expired.
application/json · ApiError
- 403The caller's role, license or network address does not allow this. A signed-in person who is not a member of the requested workspace gets code `WORKSPACE_FORBIDDEN`; a viewer asking for message content gets `PHI_FORBIDDEN` (or `PHI_SEARCH_FORBIDDEN` for a search on message content).
application/json · ApiError
- 500Unexpected server error.
application/json · ApiError
Example request
curl "$ENGINE_URL/api/fortigate/tunnels" \
-H "Authorization: Bearer $TOKEN"Rename a tracked tunnel or set its NATed subnets
patch/api/fortigate/tunnels/{id}
{ orgName?, seenSubnets? }: seenSubnets are the remote subnets as the engine sees them when the FortiGate NATs the organization's (IPv4 CIDRs, up to 32; [] goes back to the FortiGate's). Audited as fortigate.tunnel_updated.
Minimum role: admin.
Auth: Bearer token (how to get one) · Operation: updateFortigateTunnel
Parameters
| Name | In | Type | Description |
|---|---|---|---|
idrequired | path | string | The id, in the caller's workspace. |
Request body (required)
application/json · object
orgNamestringseenSubnetsarray of string
Responses
- 200The tunnel.
Response fields
application/json · object
idstringorgNamestringseenSubnetsarray 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
- 404Not found in the caller's workspace.
application/json · ApiError
Example request
curl -X PATCH "$ENGINE_URL/api/fortigate/tunnels/<id>" \
-H "Authorization: Bearer $TOKEN" \
-H "Content-Type: application/json" \
-d '{
"orgName": "string",
"seenSubnets": [
"string"
]
}'Stop tracking a FortiGate tunnel
delete/api/fortigate/tunnels/{id}
Nothing changes on the FortiGate. Audited as fortigate.tunnel_untracked.
Minimum role: admin.
Auth: Bearer token (how to get one) · Operation: untrackFortigateTunnel
Parameters
| Name | In | Type | Description |
|---|---|---|---|
idrequired | path | string | The id, in the caller's workspace. |
Responses
- 200Untracked.
Response fields
application/json · object
deletedboolean
- 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
Example request
curl -X DELETE "$ENGINE_URL/api/fortigate/tunnels/<id>" \
-H "Authorization: Bearer $TOKEN"Test reachability through a FortiGate tunnel
post/api/fortigate/tunnels/{id}/test
{ host, port }: a TCP connection from the engine to an IPv4 host inside the subnets the engine sees for the tunnel (anything else is a 400). Works when the engine's network routes the subnet to the FortiGate. Audited as fortigate.tunnel_connectivity_tested. Rate limited: 20 req / 60 s.
Minimum role: operator.
Auth: Bearer token (how to get one) · Operation: testFortigateTunnel
Parameters
| Name | In | Type | Description |
|---|---|---|---|
idrequired | path | string | The id, in the caller's workspace. |
Request body (required)
application/json · object
hoststringrequiredportintegerrequired
Responses
- 200The outcome.
Response fields
application/json · object
hoststringportintegerreachablebooleanlatencyMsintegererrorstring
- 400The request is malformed or fails validation.
application/json · ApiError
- 401No credential, or the token is invalid or expired.
application/json · ApiError
- 403The caller's role, license or network address does not allow this. A signed-in person who is not a member of the requested workspace gets code `WORKSPACE_FORBIDDEN`; a viewer asking for message content gets `PHI_FORBIDDEN` (or `PHI_SEARCH_FORBIDDEN` for a search on message content).
application/json · ApiError
- 404Not found in the caller's workspace.
application/json · ApiError
- 429Rate limit exceeded (see the `Retry-After` header), or on the AI routes the daily AI budget is used up.
application/json · ApiError
Example request
curl -X POST "$ENGINE_URL/api/fortigate/tunnels/<id>/test" \
-H "Authorization: Bearer $TOKEN" \
-H "Content-Type: application/json" \
-d '{
"host": "string",
"port": 0
}'Diagnose a FortiGate tunnel
post/api/fortigate/tunnels/{id}/diagnose
Ordered checks, stopping at the first failure: FortiGate answers, FortiGate reports phase 2 up, a route from the engine's network covers each remote subnet (when GCP_PROJECT_ID is set), TCP reachability to { host, port } when given. Audited as fortigate.tunnel_diagnosed. Rate limited: 10 req / 60 s.
Minimum role: operator.
Auth: Bearer token (how to get one) · Operation: diagnoseFortigateTunnel
Parameters
| Name | In | Type | Description |
|---|---|---|---|
idrequired | path | string | The id, in the caller's workspace. |
Request body
application/json · object
hoststringportinteger
Responses
- 200The checks.
Response fields
application/json · object
checksarray of object4 fields
keystringlabelstringstatusstringOne of: "passed", "failed", "skipped"
detailstring
likelyCausestring | 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
Example request
curl -X POST "$ENGINE_URL/api/fortigate/tunnels/<id>/diagnose" \
-H "Authorization: Bearer $TOKEN" \
-H "Content-Type: application/json" \
-d '{
"host": "string",
"port": 0
}'Bring a FortiGate tunnel up
post/api/fortigate/tunnels/{id}/bring-up
Asks the FortiGate to bring up the phase 2 named in phase2, else every phase 2 the last read saw down (all of them when none is), with FortiOS POST /api/v2/monitor/vpn/ipsec/tunnel_up { p1name, p2name }. Only when an admin allowed actions on the tunnel's connection: otherwise 403 FORTIGATE_ACTIONS_OFF. 409 FORTIGATE_PHASE2_UNKNOWN for a phase 2 the tunnel doesn't have (or one never read). The FortiGate refusing is 502: FORTIGATE_ACTION_REFUSED when the API admin's profile is read only for VPN (the message says what to change), FORTIGATE_ACTION_NOT_FOUND on its 404, FORTIGATE_AUTH on a rejected token. Audited as fortigate.tunnel_brought_up with the outcome (success or failure), the phase 2 names and the failure's code. Rate limited: 3 req / 60 s per tunnel and 6 req / 60 s per person (429 RATE_LIMITED).
Minimum role: operator.
Auth: Bearer token (how to get one) · Operation: bringUpFortigateTunnel
Parameters
| Name | In | Type | Description |
|---|---|---|---|
idrequired | path | string | The id, in the caller's workspace. |
Request body
application/json · object
phase2string
Responses
- 200Asked.
Response fields
application/json · object
okbooleanphase2array of stringmessagestring
- 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
- 502Error.
application/json · ApiError
Example request
curl -X POST "$ENGINE_URL/api/fortigate/tunnels/<id>/bring-up" \
-H "Authorization: Bearer $TOKEN" \
-H "Content-Type: application/json" \
-d '{
"phase2": "string"
}'IPsec sidecar configuration
get/api/ipsec
The tunnels set in VPN_TUNNELS for the Docker Compose IPsec container, without their pre-shared keys. For GKE tunnels use /api/vpn-tunnels.
Minimum role: viewer.
Auth: Bearer token (how to get one) · Operation: getIpsecConfig
Responses
- 200The configuration.
Response fields
application/json · object
enabledbooleantunnelsarray of object6 fields
namestringremoteGatewaystringremoteSubnetsarray of stringauthTypestringikeVersionintegerenabledboolean
- 401No credential, or the token is invalid or expired.
application/json · ApiError
- 500Unexpected server error.
application/json · ApiError
Example request
curl "$ENGINE_URL/api/ipsec" \
-H "Authorization: Bearer $TOKEN"IPsec sidecar status
get/api/ipsec/status
Whether the IPsec container is set up, from configuration. It does not report live tunnel state.
Minimum role: viewer.
Auth: Bearer token (how to get one) · Operation: getIpsecStatus
Responses
Example request
curl "$ENGINE_URL/api/ipsec/status" \
-H "Authorization: Bearer $TOKEN"Handoff packet
get/api/vpn-tunnels/{id}/packet
The packet you send to the healthcare organization's network engineer, as a PDF, or as JSON with format=json. It never contains the pre-shared key: it says the key arrives by a one-time link. PDF downloads are audited.
Minimum role: viewer.
Auth: Bearer token (how to get one) · Operation: getVpnTunnelPacket
Parameters
| Name | In | Type | Description |
|---|---|---|---|
idrequired | path | string | Tunnel id. |
format | query | string |
|
Responses
Example request
curl "$ENGINE_URL/api/vpn-tunnels/<id>/packet" \
-H "Authorization: Bearer $TOKEN"Send a test HL7 message through a tunnel
post/api/vpn-tunnels/{id}/test-mllp
Sends one synthetic ADT^A01 (MSH-11 is T, with a made-up patient) over MLLP to host:port and reports the ACK and round-trip time. Only IPv4 hosts inside the tunnel's subnets are allowed. Audited.
Minimum role: operator.
Auth: Bearer token (how to get one) · Operation: testVpnTunnelMllp
Parameters
| Name | In | Type | Description |
|---|---|---|---|
idrequired | path | string | Tunnel id. |
Request body (required)
application/json · object
hoststringrequiredportintegerrequired
Responses
- 200The result, as console lines.
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
- 404Not found in the caller's workspace.
application/json · ApiError
- 500Unexpected server error.
application/json · ApiError
Example request
curl -X POST "$ENGINE_URL/api/vpn-tunnels/<id>/test-mllp" \
-H "Authorization: Bearer $TOKEN" \
-H "Content-Type: application/json" \
-d '{
"host": "string",
"port": 0
}'Check a tunnel's subnets before changing them
post/api/vpn-tunnels/{id}/subnet-check
The overlap check a PATCH /api/vpn-tunnels/{id} with these remoteSubnets or localSubnets would get, without changing anything. blocking holds what PATCH would refuse: an overlap with another MedHook tunnel or the cluster's own ranges, a local range on both sides of the tunnel, or a range a VPN tunnel created outside MedHook already routes at this tunnel's priority or better. warnings holds what PATCH would warn about: overlaps with other tunnels' or external tunnels' ranges, the cluster's pod or service ranges, a local range list without the node subnet, or that the external tunnels couldn't be checked (naming roles/compute.networkViewer). Settings › Local ranges calls it while ranges are typed. Not audited. Rate limited: 60 requests per minute.
Minimum role: operator.
Auth: Bearer token (how to get one) · Operation: checkVpnTunnelSubnets
Parameters
| Name | In | Type | Description |
|---|---|---|---|
idrequired | path | string | Tunnel id. |
Request body (required)
application/json · object
remoteSubnetsarray of stringlocalSubnetsarray of string[]: the deployment's default local ranges.
Responses
- 200The check's findings.
Response fields
application/json · object
blockingarray of objectrequired2 fields
patharray of string | integerrequired["remoteSubnets", i]or["localSubnets", i]for one subnet; the field alone for the whole list.messagestringrequiredWhat overlaps what, worded for people.
warningsarray of objectrequired2 fields
patharray of string | integerrequired["remoteSubnets", i]or["localSubnets", i]for one subnet; the field alone for the whole list.messagestringrequiredWhat overlaps what, worded for people.
- 400The request is malformed or fails validation.
application/json · ApiError
- 401No credential, or the token is invalid or expired.
application/json · ApiError
- 403The caller's role, license or network address does not allow this. A signed-in person who is not a member of the requested workspace gets code `WORKSPACE_FORBIDDEN`; a viewer asking for message content gets `PHI_FORBIDDEN` (or `PHI_SEARCH_FORBIDDEN` for a search on message content).
application/json · ApiError
- 404Not found in the caller's workspace.
application/json · ApiError
- 429Rate limit exceeded (see the `Retry-After` header), or on the AI routes the daily AI budget is used up.
application/json · ApiError
Example request
curl -X POST "$ENGINE_URL/api/vpn-tunnels/<id>/subnet-check" \
-H "Authorization: Bearer $TOKEN" \
-H "Content-Type: application/json" \
-d '{
"remoteSubnets": [
"10.20.0.0/24"
],
"localSubnets": [
"10.250.0.0/24"
]
}'VPN tunnels created outside MedHook
get/api/vpn-tunnels/external
Read only. The Cloud VPN tunnels, Classic and HA, in every region of the engine's GCP project (GCP_PROJECT_ID) that MedHook didn't create, with their gateway, peer IP, remote ranges (Classic) or BGP session (HA): the Tunnels page's "Other VPN tunnels in this project". Tunnels MedHook created are left out: those its database knows (every workspace), those named with this engine's GCP_VPN_NAME_PREFIX, and those labelled managed-by=medhook or medhook-tunnel-id. Nothing here changes GCP. The engine's service account needs compute.vpnTunnels.list, compute.targetVpnGateways.list, compute.vpnGateways.list (all in roles/compute.networkViewer); compute.forwardingRules.list, compute.externalVpnGateways.list, compute.routes.list, compute.routers.list fill in gateway IPs, peer IPs, routes and BGP when granted. A 403 answers permission with the role to grant; any other failure answers error; both with status 200, so the page never fails on it. Cached 60 s per project.
Minimum role: operator.
Auth: Bearer token (how to get one) · Operation: listExternalVpnTunnels
Responses
- 200The tunnels.
Response fields
application/json · object
enabledbooleanrequiredFalse when GCP_PROJECT_ID is not set;
reasonsays so.reasonstringtunnelsarray of objectrequired13 fields
namestringrequiredThe GCP tunnel name.
regionstringrequiredThe GCP region, e.g. us-east1.
statusstringrequiredGCP's raw status, e.g. ESTABLISHED, NO_INCOMING_PACKETS.
healthstringrequiredOne of: "established", "degraded", "connecting", "down", "unknown"
detailedStatusstringGCP's detailed status text.
peerIpstring | nullrequiredThe peer's public IP.
typestringrequiredClassic VPN or HA VPN.
One of: "classic", "ha"
gatewayobjectrequired2 fields
namestringrequiredThe Classic target VPN gateway or the HA VPN gateway.
ipstring | nullrequiredThe gateway's public IP (Classic: its forwarding rule; HA: the tunnel's interface); null when it couldn't be read.
remoteRangesarray of stringrequiredClassic: the remote traffic selector and the static routes whose next hop is the tunnel. Empty for HA.
routesarray of objectrequiredClassic: the static routes whose next hop is the tunnel, with their priority (lower wins). Empty for HA.
2 fields
destRangestringrequiredpriorityintegerrequired
bgpobject | nullrequiredHA: the BGP session that carries the routes. Null for Classic.
3 fields
routerstringrequiredThe Cloud Router.
peerAsninteger | nullrequiredThe BGP peer's ASN on this tunnel.
routerAsninteger | nullrequiredThe Cloud Router's ASN.
ikeVersionintegerdescriptionstringThe tunnel's GCP description.
permissionobjectPresent when a required list answered 403.
3 fields
rolestringrequiredThe read-only role to grant: roles/compute.networkViewer.
missingarray of stringrequiredThe permissions the service account was refused.
hintstringrequiredWhat to grant, worded for people.
errorstringAny other failure reading the project; the list is empty.
- 401No credential, or the token is invalid or expired.
application/json · ApiError
- 403The caller's role, license or network address does not allow this. A signed-in person who is not a member of the requested workspace gets code `WORKSPACE_FORBIDDEN`; a viewer asking for message content gets `PHI_FORBIDDEN` (or `PHI_SEARCH_FORBIDDEN` for a search on message content).
application/json · ApiError
Example request
curl "$ENGINE_URL/api/vpn-tunnels/external" \
-H "Authorization: Bearer $TOKEN"VPN quota preflight
get/api/vpn-tunnels/quota
The engine's GCP project's VPN-related quotas (VPN tunnels, Classic and HA VPN gateways, static external IP addresses and Cloud Routers in the region; routes and peer VPN gateways in the project) against what one more Classic tunnel needs, read through the Compute API (regions.get, projects.get). POST /api/vpn-tunnels runs the same check for the tunnel it creates and answers 409 QUOTA_EXCEEDED when one would be passed. A quota that can't be read answers checked: false. Cloud Router BGP sessions are a per-router limit the API doesn't report, so they aren't listed.
Minimum role: viewer.
Auth: Bearer token (how to get one) · Operation: getVpnQuotaPreflight
Responses
- 200The quotas.
Response fields
application/json · object
enabledbooleanrequiredFalse when VPN management isn't configured.
quotaobject7 fields
checkedbooleanrequiredFalse when the quotas couldn't be read;
errorsays why.regionstringrequiredconsoleUrlstringrequiredThe Cloud console's quota page for the project.
linesarray of objectrequired7 fields
metricstringrequiredGCP quota metric, e.g. VPN_TUNNELS or ROUTES.
labelstringscopestringregion or project.
usageintegerrequiredlimitintegerrequiredneedintegerrequiredWhat one more tunnel adds.
messagestringrequirede.g. You have used 7 of 10 VPN tunnels in us-central1; request more in the Cloud console: <link>
blockingarray of objectrequiredQuotas the tunnel would pass: the create is refused (409).
7 fields
metricstringrequiredGCP quota metric, e.g. VPN_TUNNELS or ROUTES.
labelstringscopestringregion or project.
usageintegerrequiredlimitintegerrequiredneedintegerrequiredWhat one more tunnel adds.
messagestringrequirede.g. You have used 7 of 10 VPN tunnels in us-central1; request more in the Cloud console: <link>
warningsarray of objectrequiredQuotas the tunnel leaves at 80% or more.
7 fields
metricstringrequiredGCP quota metric, e.g. VPN_TUNNELS or ROUTES.
labelstringscopestringregion or project.
usageintegerrequiredlimitintegerrequiredneedintegerrequiredWhat one more tunnel adds.
messagestringrequirede.g. You have used 7 of 10 VPN tunnels in us-central1; request more in the Cloud console: <link>
errorstring
- 401No credential, or the token is invalid or expired.
application/json · ApiError
- 403The caller's role, license or network address does not allow this. A signed-in person who is not a member of the requested workspace gets code `WORKSPACE_FORBIDDEN`; a viewer asking for message content gets `PHI_FORBIDDEN` (or `PHI_SEARCH_FORBIDDEN` for a search on message content).
application/json · ApiError
Example request
curl "$ENGINE_URL/api/vpn-tunnels/quota" \
-H "Authorization: Bearer $TOKEN"Workflows using a tunnel
get/api/vpn-tunnels/{id}/used-by
Each workflow that sends through the tunnel (a host inside its subnets, directly or through an adapter profile) with its status and its runs in the last 24 h, for the Overview's Used by card. Counts are a bounded 24 h count per workflow; the answer is cached for 60 s per tunnel.
Minimum role: viewer.
Auth: Bearer token (how to get one) · Operation: listVpnTunnelUsedBy
Parameters
| Name | In | Type | Description |
|---|---|---|---|
idrequired | path | string | Tunnel id. |
Responses
- 200The workflows.
Response fields
application/json · object
workflowsarray of objectrequired4 fields
workflowIdstringrequirednamestringrequiredstatusstringrequiredThe workflow's status (active, failing, waiting, unapproved, draft, paused).
count24hintegerrequiredRuns in the last 24 h.
- 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
- 501Not available in this deployment.
application/json · ApiError
Example request
curl "$ENGINE_URL/api/vpn-tunnels/<id>/used-by" \
-H "Authorization: Bearer $TOKEN"Tunnel audit trail
get/api/vpn-tunnels/{id}/events
What happened to the tunnel (created, key rotated, tested, edited, the watcher's down and recovered), newest first, each with its kind: PSK, MLLP, CONFIG, TUNNEL, IKE or ROUTE. Only the newest diagnosis is listed, so repeated runs don't push out the rest.
Minimum role: viewer.
Auth: Bearer token (how to get one) · Operation: listVpnTunnelEvents
Parameters
| Name | In | Type | Description |
|---|---|---|---|
idrequired | path | string | Tunnel id. |
limit | query | integer | Events to return. |
Responses
- 200The events.
Response fields
application/json · object
eventsarray of object6 fields
idstringrequiredatstring (date-time)requiredWhen it happened.
textstringrequiredWhat happened, worded for people. Never a secret.
tonestringrequiredOne of: "tx", "mu", "ok", "err", "warn"
kindstringrequiredThe Events list's kind column. IKE is a tunnel diagnosis (POST /diagnose), and IKE log lines if the engine ever reads them. ROUTE is a failover, failback, failover test or a static route installed.
One of: "PSK", "MLLP", "CONFIG", "TUNNEL", "IKE", "ROUTE"
diagnosisobjectDiagnosis rows only: what that run found, so Explain words the event and not today's status.
2 fields
failedAtstring | nullrequiredThe check the run stopped at (peer, init, auth, selectors, mllp); null when it passed.
gcpStatusstring | nullrequiredGCP's status at that run.
- 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 "$ENGINE_URL/api/vpn-tunnels/<id>/events" \
-H "Authorization: Bearer $TOKEN"Tunnel traffic
get/api/vpn-tunnels/{id}/traffic
The last 24 hours of tunnel traffic (24 hourly bars, kbit/s) and uptime from Cloud Monitoring, the MLLP messages per hour through the tunnel (msgsHourly, peakMsgsPerHour, messages24h; only with messages=1, which the Traffic tab sends, otherwise absent; one bounded 24 h count cached 60 s per workflow set), the average MLLP test round trip and how long the current drop has lasted. When Monitoring is not reachable it answers { available: false, reason } with the same stats.
Minimum role: viewer.
Auth: Bearer token (how to get one) · Operation: getVpnTunnelTraffic
Parameters
| Name | In | Type | Description |
|---|---|---|---|
idrequired | path | string | Tunnel id. |
messages | query | string |
|
Responses
- 200The traffic.
Response fields
application/json · object
availablebooleanrequiredFalse when Cloud Monitoring has nothing to show;
reasonsays why.reasonstringbarsKbpsarray of number24 hourly bars.
peakKbpsnumbertotalBytesnumberuptimeSecondsinteger | nullmessages24hinteger | nullWorkflow runs that used the tunnel in 24 h (the sum of msgsHourly); null when the counts couldn't be read.
msgsHourlyarray of integer | nullMLLP messages per hour through the tunnel, oldest first (24; the last is the current hour): the runs of the workflows that listen through it. The Traffic bars. Null when the counts couldn't be read.
peakMsgsPerHourinteger | nullThe largest hour of msgsHourly.
avgRoundTripMsinteger | nullrequiredMean round trip of the ok MLLP tests (POST /test-mllp) in the last 24 h; null without one.
dropSecondsinteger | nullrequiredHow long the current outage has lasted, from the tunnel watcher; 0 while healthy, null while the tunnel isn't ready.
- 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
- 501Not available in this deployment.
application/json · ApiError
Example request
curl "$ENGINE_URL/api/vpn-tunnels/<id>/traffic" \
-H "Authorization: Bearer $TOKEN"Diagnose a tunnel
post/api/vpn-tunnels/{id}/diagnose
Runs the ordered checks on the tunnel's live GCP status (Peer reachable, IKE SA_INIT, IKE AUTH, Traffic selectors or BGP sessions, MLLP round trip) and stops at the first failure; the rest are skipped. The MLLP round trip sends one synthetic ADT^A01 (MSH-11 = T) to target only when every IPsec check passed; the target must be inside the tunnel's subnets. Answers the plain-language explanation too. Never the pre-shared key. Audited as vpn_tunnel.diagnosed.
Minimum role: operator.
Auth: Bearer token (how to get one) · Operation: diagnoseVpnTunnel
Parameters
| Name | In | Type | Description |
|---|---|---|---|
idrequired | path | string | Tunnel id. |
Request body
application/json · object
targetobject2 fields
hoststringrequiredIPv4 host inside the tunnel's subnets.
portintegerrequired
Responses
- 200The checks and the explanation.
Response fields
application/json · object
checksarray of objectrequired4 fields
idstringrequiredThe check.
One of: "peer", "init", "auth", "selectors", "mllp"
labelstringrequiredPeer reachable, IKE SA_INIT, IKE AUTH, Traffic selectors (BGP sessions on HA) or MLLP round trip.
resultstringrequiredskip: not run, because an earlier check failed.
One of: "ok", "err", "skip"
detailstringrequiredWhat it saw, for example the GCP status and why.
failedAtstring | nullrequiredThe check that failed; null when none did.
One of: "peer", "init", "auth", "selectors", "mllp"
explanationobjectrequired5 fields
statestringrequiredOne of: "established", "degraded", "connecting", "down", "not_ready", "unknown"
phasestringOne of: "ike-phase1", "ike-phase2", "bgp", "traffic"
likelyCausestringpartnerSideFixstringnextStepstringrequired
statusobjectrequired2 fields
gcpStatusstring | nulldetailedStatusstring | null
- 400The request is malformed or fails validation.
application/json · ApiError
- 401No credential, or the token is invalid or expired.
application/json · ApiError
- 404Not found in the caller's workspace.
application/json · ApiError
- 409The request conflicts with the current state.
application/json · ApiError
- 500Unexpected server error.
application/json · ApiError
- 501Not available in this deployment.
application/json · ApiError
Example request
curl -X POST "$ENGINE_URL/api/vpn-tunnels/<id>/diagnose" \
-H "Authorization: Bearer $TOKEN" \
-H "Content-Type: application/json" \
-d '{
"target": {
"host": "string",
"port": 1
}
}'Read a tunnel's IKE log excerpt
get/api/vpn-tunnels/{id}/ike-log
At most 20 lines of the tunnel's IKE log from Cloud Logging (the Cloud VPN gateway's IKE exchanges), oldest first, between the watcher's downSince minus 30 minutes and now (the last 24 h while the tunnel is not down), filtered to this tunnel by the log entries' tunnel_id label (its GCP names and peer IPs, as whole tokens, in unlabeled entries' text as a fallback). An HA tunnel's lines say their interface and its peer. GCP as initiator and as responder. Each line is rebuilt from known IKE wording, so it never carries the pre-shared key or any other log text; GCP's AUTHENTICATION_FAILED reads AUTHORIZATION_ERROR. Cached 60 s per tunnel. 501 when the install has no Cloud Logging read: the engine's service account needs roles/logging.viewer. Audited as vpn_tunnel.ike_log_read (line count only).
Minimum role: operator.
Auth: Bearer token (how to get one) · Operation: getVpnTunnelIkeLog
Parameters
| Name | In | Type | Description |
|---|---|---|---|
idrequired | path | string | Tunnel id. |
Responses
- 200The excerpt and its window.
Response fields
application/json · object
linesarray of objectrequired6 fields
tsstringrequiredWhen the gateway logged it (ISO 8601).
directionstringrequiredout: MedHook sent it; in: the answer.
One of: "out", "in"
exchangestringrequiredOne of: "IKE_SA_INIT", "IKE_AUTH", "CREATE_CHILD_SA", "INFORMATIONAL"
textstringrequiredFor example
AUTHORIZATION_ERROR (24),accepted,PSK v3(the version, never the key) orproposal AES256/SHA256/MODP2048.ifacestringHA tunnels only: the interface the line belongs to (by its tunnel_id label, else the name or peer IP it carries).
One of: "if0", "if1"
peerstringThe peer IP of the line's interface (peerIp2 for an HA tunnel's if1), when the line could be placed.
sincestringrequiredStart of the window (ISO 8601).
untilstringrequiredEnd of the window (ISO 8601).
- 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
- 501Not available in this deployment.
application/json · ApiError
Example request
curl "$ENGINE_URL/api/vpn-tunnels/<id>/ike-log" \
-H "Authorization: Bearer $TOKEN"Read the tunnel's shared link
get/api/vpn-tunnels/{id}/share
The newest shared link for the healthcare organization's network engineer: its status, recipient, expiry and open count, and the tunnel's access log (an open and a config download within 10 minutes read as one row). Never the token or the URL. To an admin it also answers copyable: whether Copy link can hand out the live link's white-label short URL /t/{code} again. Reading it is not audited; the URL comes only from Copy link's POST /share/copy, which is.
Minimum role: viewer.
Auth: Bearer token (how to get one) · Operation: getVpnTunnelShareLink
Parameters
| Name | In | Type | Description |
|---|---|---|---|
idrequired | path | string | Tunnel id. |
Responses
- 200The link and its access log.
Response fields
application/json · object
statusstringrequirednone: no link was ever made for this tunnel.
One of: "none", "active", "expired", "revoked"
recipientstring | nullrequiredThe engineer's email; null when the packet names none.
expiresAtstring (date-time) | nullrequiredcreatedAtstring (date-time) | nullrequiredopenCountintegerrequiredHow often the newest link was opened.
accessarray of objectrequiredThe tunnel's access log across its links, newest first (50 rows).
3 fields
atstring (date-time)requiredWhen, ISO 8601.
actionstringrequiredOne of: "created", "opened", "config_downloaded", "psk_revealed", "mllp_tested"
textstringrequiredThe access in words, for example "Downloaded Cisco ASA config" or "Pre-shared key revealed (once)".
emailedbooleanThe newest link was emailed to its recipient (G-tunnels-13). False with no email channel, no recipient or a failed send.
keyLinkbooleanThe newest link is a key link (One-time PSK link, Rotate PSK, Resend link), which is never emailed; the Overview's share notice skips it.
urlHoststringrequiredThe host the link is on: the workspace's connect host, else the engine's. Not a credential, so every role gets it, for the masked link.
copyablebooleanAdmins (tunnel.manage) only: whether Copy link can hand out the live link's short URL (POST /share/copy). False when it can't be copied again (none live, or made before its token was kept). Absent for viewers and operators. The URL itself is never in this response.
- 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
- 501Not available in this deployment.
application/json · ApiError
Example request
curl "$ENGINE_URL/api/vpn-tunnels/<id>/share" \
-H "Authorization: Bearer $TOKEN"Make a new shared link
post/api/vpn-tunnels/{id}/share
Makes a link for the healthcare organization's network engineer (config, the key once, live status and an MLLP test) and revokes the tunnel's old link and its short code. The token is stored AES-256-GCM encrypted beside its SHA-256; the short code only as its SHA-256. The link expires after 7 days. Audited as vpn_tunnel.share_link_created with the recipient's domain only. With a recipient, the link is emailed through the engine's email channel: a PHI-free template, subject "{Brand} · Secure network setup", carrying only the URL and the expiry; audited as vpn_tunnel.share_emailed (or vpn_tunnel.share_email_failed) with the recipient's domain only. Never the pre-shared key.
Minimum role: admin.
Auth: Bearer token (how to get one) · Operation: createVpnTunnelShareLink
Parameters
| Name | In | Type | Description |
|---|---|---|---|
idrequired | path | string | Tunnel id. |
Request body
application/json · object
recipientstring (email)The engineer's email. Defaults to the handoff packet's first email contact.
Responses
- 201The new link, shown once.
Response fields
application/json · object
urlstringrequiredThe short URL, https://{connect host}/t/{code}: the workspace's branding connectHost, else the engine's origin. /t/{code} redirects to the engineer page.
expiresAtstring (date-time)requiredrecipientstring | nullrequiredrevokedintegerrequiredHow many live links this one revoked (0 or 1).
emailedbooleanrequiredEmailed to the recipient. False with no email channel, no recipient or a failed send: copy it and send it yourself.
- 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
- 501Not available in this deployment.
application/json · ApiError
Example request
curl -X POST "$ENGINE_URL/api/vpn-tunnels/<id>/share" \
-H "Authorization: Bearer $TOKEN" \
-H "Content-Type: application/json" \
-d '{
"recipient": "user@example.test"
}'Copy the shared link
post/api/vpn-tunnels/{id}/share/copy
Copy link on the Config tab: hands an admin the live link's short URL, the only place it is answered after the link was made, and audits it as vpn_tunnel.share_link_copied (the audit row never holds the URL or its code). Takes no body. 409 when the newest link can't be copied (none live, or made before its token was kept).
Minimum role: admin.
Auth: Bearer token (how to get one) · Operation: copyVpnTunnelShareLink
Parameters
| Name | In | Type | Description |
|---|---|---|---|
idrequired | path | string | Tunnel id. |
Responses
- 200The short URL, handed out and audited.
Response fields
application/json · object
urlstringrequiredhttps://{connect host}/t/{code}: the workspace's branding connectHost, else the engine's origin. /t/{code} redirects to the engineer page.
- 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
- 501Not available in this deployment.
application/json · ApiError
Example request
curl -X POST "$ENGINE_URL/api/vpn-tunnels/<id>/share/copy" \
-H "Authorization: Bearer $TOKEN"Open the engineer page
get/api/connect/{token}
Public: the shared link's token is the credential. The brand, the healthcare organization, live tunnel status and every vendor's firewall config, never the pre-shared key. Logs the open in the tunnel's access log. no-store, no-referrer, noindex; rate limited per IP.
Auth: None, public route · Operation: getConnectLink
Parameters
| Name | In | Type | Description |
|---|---|---|---|
tokenrequired | path | string | The shared link's token (from /connect/<token>). |
Responses
- 200The engineer page.
Response fields
application/json · object
statusstringrequiredOne of: "active"
previewbooleanSet on the engineer preview only.
brandobjectrequired4 fields
namestringrequiredThe workspace's brand name; "MedHook" when none is set.
colorstring | nullrequired#rrggbb, or null for the engine's accent.
hasLogobooleanrequiredA logo was uploaded (GET …/logo).
logoHashstring | nullrequiredThe logo's content hash (16 hex of its SHA-256), its ETag; the page asks for …/logo?v={logoHash}. Null without a logo.
organizationstring | nullrequiredThe healthcare organization, from the handoff packet.
recipientstring | nullrequiredThe engineer the link was sent to.
expiresAtstring (date-time) | nullrequiredtunnelobjectrequired3 fields
namestringrequiredtypestringrequiredtypeLabelstringrequiredFor example "Classic VPN".
liveobjectrequired5 fields
labelstringrequiredThe tunnel's status in words, for example "Up".
tonestringrequiredOne of: "ok", "err", "warn", "accent", "neutral"
lastHandshakeAtstring (date-time) | nullpeerIpstringrequiredTheir firewall's public IP.
reachesstring | nullMedHook's gateway IP.
vendorsarray of objectrequired2 fields
valuestringOne of: "asa", "strongswan", "pfsense", "fortinet", "ios", "junos", "paloalto"
labelstring
configsmap of stringrequiredEach vendor's config text, without the pre-shared key (it says <from the one-time link>).
keyobjectrequired4 fields
revealedbooleanrequiredThe key was already shown on this link.
revealedAtstring (date-time) | nullrequiredappliesAtstring (date-time)A staged rotation's key (G-tunnels-5): when MedHook applies it; enter it then. Absent otherwise.
keepVersionintegerWith appliesAt: the live PSK version the peer keeps until then.
targetHintstringTest target placeholder, for example "10.20.0.x:port".
- 404Not found in the caller's workspace.
application/json · ApiError
- 410The link is used, expired or replaced.
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
- 501Not available in this deployment.
application/json · ApiError
Example request
curl "$ENGINE_URL/api/connect/<token>"Download a firewall config
get/api/connect/{token}/config
One vendor's config as a file, without the pre-shared key. Logged as "Downloaded {vendor} config".
Auth: None, public route · Operation: downloadConnectConfig
Parameters
| Name | In | Type | Description |
|---|---|---|---|
tokenrequired | path | string | The shared link's token (from /connect/<token>). |
formatrequired | query | string | Vendor format. |
Responses
- 200The config file.
text/plain · string
- 400The request is malformed or fails validation.
application/json · ApiError
- 404Not found in the caller's workspace.
application/json · ApiError
- 410The link is used, expired or replaced.
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
- 501Not available in this deployment.
application/json · ApiError
Example request
curl "$ENGINE_URL/api/connect/<token>/config?format=asa"Reveal the pre-shared key once
post/api/connect/{token}/reveal
Answers the key once per link; a second call gets 410 with status revealed. Audited as vpn_tunnel.share_psk_revealed (never the key) and logged. 409 while the key is being rotated. 403 with ?preview=1, before anything is read, claimed or logged.
Auth: None, public route · Operation: revealConnectKey
Parameters
| Name | In | Type | Description |
|---|---|---|---|
tokenrequired | path | string | The shared link's token (from /connect/<token>). |
Responses
- 200The key, shown once.
Response fields
application/json · object
sharedSecretstringrequiredThe pre-shared key.
pskVersionintegerrequired
- 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
- 410The link is used, expired or replaced.
application/json · ApiError
- 429Rate limit exceeded (see the `Retry-After` header), or on the AI routes the daily AI budget is used up.
application/json · ApiError
- 500Unexpected server error.
application/json · ApiError
Example request
curl -X POST "$ENGINE_URL/api/connect/<token>/reveal"Send a test message through the tunnel
post/api/connect/{token}/test-mllp
Sends the synthetic test ADT^A01 (no real patient) to a host inside the tunnel's subnets and answers the console lines; any other host is 400. Logged and audited as vpn_tunnel.share_mllp_tested. 403 with ?preview=1, sending nothing.
Auth: None, public route · Operation: testConnectMllp
Parameters
| Name | In | Type | Description |
|---|---|---|---|
tokenrequired | path | string | The shared link's token (from /connect/<token>). |
Request body (required)
application/json · object
targetstringrequiredIPv4 host and port, for example 10.20.0.15:6661.
Responses
- 200The test's result.
Response fields
application/json · object
okbooleanroundTripMsinteger | nullackobject2 fields
codestringcontrolIdstring
linesarray of object2 fields
textstringtonestring
- 400The request is malformed or fails validation.
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
- 410The link is used, expired or replaced.
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
- 501Not available in this deployment.
application/json · ApiError
Example request
curl -X POST "$ENGINE_URL/api/connect/<token>/test-mllp" \
-H "Content-Type: application/json" \
-d '{
"target": "string"
}'The brand's logo
get/api/connect/{token}/logo
The workspace's logo for the brand bar, served only as the image type its bytes are (PNG, JPEG or WebP), nosniff, with its content hash as the ETag and Cache-Control private, no-cache (the browser revalidates; 304 when If-None-Match names it).
Auth: None, public route · Operation: getConnectLogo
Parameters
| Name | In | Type | Description |
|---|---|---|---|
tokenrequired | path | string | The shared link's token (from /connect/<token>). |
Responses
- 200The logo.
image/png · string (binary)
- 404Not found in the caller's workspace.
application/json · ApiError
- 410The link is used, expired or replaced.
application/json · ApiError
- 429Rate limit exceeded (see the `Retry-After` header), or on the AI routes the daily AI budget is used up.
application/json · ApiError
- 500Unexpected server error.
application/json · ApiError
Example request
curl "$ENGINE_URL/api/connect/<token>/logo"Refresh the live status strip
get/api/connect/{token}/status
Only the page's live status (tunnel, last handshake, peer, gateway). The page polls it every 20 s while visible; unlike GET /api/connect/{token} it logs no open. Rate limited per IP.
Auth: None, public route · Operation: getConnectStatus
Parameters
| Name | In | Type | Description |
|---|---|---|---|
tokenrequired | path | string | The shared link's token (from /connect/<token>). |
Responses
- 200The live status.
Response fields
application/json · object
liveobjectrequired5 fields
labelstringrequiredThe tunnel's status in words, for example "Up".
tonestringrequiredOne of: "ok", "err", "warn", "accent", "neutral"
lastHandshakeAtstring (date-time) | nullpeerIpstringrequiredTheir firewall's public IP.
reachesstring | nullMedHook's gateway IP.
- 404Not found in the caller's workspace.
application/json · ApiError
- 410The link is used, expired or replaced.
application/json · ApiError
- 429Rate limit exceeded (see the `Retry-After` header), or on the AI routes the daily AI budget is used up.
application/json · ApiError
- 500Unexpected server error.
application/json · ApiError
Example request
curl "$ENGINE_URL/api/connect/<token>/status"Preview the engineer page
get/api/vpn-tunnels/{id}/share/preview
The engineer page's view of this tunnel, as their network engineer sees it, with preview: true. No key, no token, and no access row.
Minimum role: viewer.
Auth: Bearer token (how to get one) · Operation: previewVpnTunnelShareLink
Parameters
| Name | In | Type | Description |
|---|---|---|---|
idrequired | path | string | Tunnel id. |
Responses
- 200The engineer page.
Response fields
application/json · object
statusstringrequiredOne of: "active"
previewbooleanSet on the engineer preview only.
brandobjectrequired4 fields
namestringrequiredThe workspace's brand name; "MedHook" when none is set.
colorstring | nullrequired#rrggbb, or null for the engine's accent.
hasLogobooleanrequiredA logo was uploaded (GET …/logo).
logoHashstring | nullrequiredThe logo's content hash (16 hex of its SHA-256), its ETag; the page asks for …/logo?v={logoHash}. Null without a logo.
organizationstring | nullrequiredThe healthcare organization, from the handoff packet.
recipientstring | nullrequiredThe engineer the link was sent to.
expiresAtstring (date-time) | nullrequiredtunnelobjectrequired3 fields
namestringrequiredtypestringrequiredtypeLabelstringrequiredFor example "Classic VPN".
liveobjectrequired5 fields
labelstringrequiredThe tunnel's status in words, for example "Up".
tonestringrequiredOne of: "ok", "err", "warn", "accent", "neutral"
lastHandshakeAtstring (date-time) | nullpeerIpstringrequiredTheir firewall's public IP.
reachesstring | nullMedHook's gateway IP.
vendorsarray of objectrequired2 fields
valuestringOne of: "asa", "strongswan", "pfsense", "fortinet", "ios", "junos", "paloalto"
labelstring
configsmap of stringrequiredEach vendor's config text, without the pre-shared key (it says <from the one-time link>).
keyobjectrequired4 fields
revealedbooleanrequiredThe key was already shown on this link.
revealedAtstring (date-time) | nullrequiredappliesAtstring (date-time)A staged rotation's key (G-tunnels-5): when MedHook applies it; enter it then. Absent otherwise.
keepVersionintegerWith appliesAt: the live PSK version the peer keeps until then.
targetHintstringTest target placeholder, for example "10.20.0.x:port".
- 401No credential, or the token is invalid or expired.
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
- 501Not available in this deployment.
application/json · ApiError
Example request
curl "$ENGINE_URL/api/vpn-tunnels/<id>/share/preview" \
-H "Authorization: Bearer $TOKEN"Read the tunnel's settings
get/api/vpn-tunnels/{id}/settings
Alerts, maintenance windows and failover for the tunnel. A failover pair's switches and last failover test are the pair's: a backup answers its primary's. Inside a maintenance window on either tunnel of a pair the watcher holds (no failover, re-establish or alert); an outage still there when it closes is alerted then.
Minimum role: viewer.
Auth: Bearer token (how to get one) · Operation: getVpnTunnelSettings
Parameters
| Name | In | Type | Description |
|---|---|---|---|
idrequired | path | string | Tunnel id. |
Responses
- 200The tunnel's settings.
Response fields
application/json · object
settingsobjectrequired4 fields
alertsobjectrequired4 fields
downboolean"Tunnel down for 2 min" (or as long as the watcher takes to confirm, if longer) and its recovery. Sent 2 min after the first bad read; a tunnel back before then never alerts.
flappingboolean"Flapping: {flapDrops} drops in {flapWindowMinutes} min": the watcher pausing a flapping tunnel (a pause for the hourly action cap always alerts).
bgpWithdrawnboolean"BGP route withdrawn" (one HA interface down).
pskAgeboolean"PSK older than 90 days": one alert per PSK version, checked hourly.
alertRulesobjectrequiredThe alert rules' fixed numbers.
4 fields
downobject1 field
minutesinteger2.
flappingobject2 fields
dropsinteger3.
windowMinutesinteger10.
bgpWithdrawnobjectpskAgeobject1 field
daysinteger90.
maintenanceWindowsarray of objectrequired9 fields
idstringrequiredUnique within the tunnel.
kindstringrequiredOne of: "weekly", "once"
dayintegerweekly: 0 = Sunday … 6 = Saturday.
datestring (date)once: the start date in the window's zone.
startstringrequiredHH:MM, wall clock in timeZone.
endstringrequiredHH:MM, exclusive. At or before start, the window runs past midnight.
timeZonestringrequiredIANA zone, for example America/Chicago.
notestringFor example "set by Demo Health IT".
enabledboolean
failoverobjectrequired4 fields
autoFailoverboolean"Fail over to the backup after {thresholds.downAfterSeconds} down".
failbackboolean"Fail back when the primary is stable for {failbackStableMinutes} min".
afterSecondsintegerHow long the watcher waits before failing over (60 by default): the live TUNNEL_WATCHER_* number, the same as thresholds.downAfterSeconds.
failbackStableMinutesintegerHow long the primary must be stable before failback (5 by default): the live number, the same as thresholds.failbackStableMinutes.
pairobject | nullrequiredThe failover pair; null when there is no backup.
2 fields
primarystringbackupstring
alertRoutesarray of stringrequiredWho hears the alerts: the workspace's tunnel_events alert rules, as "PagerDuty · Integrations on-call".
alertChannelsobjectrequiredWho hears each alert: every enabled Tunnel events rule of its kind (down → PagerDuty, flapping and BGP → Slack, PSK age → email), else every rule. The sender routes the same way.
4 fields
downobject2 fields
channelIdsarray of stringrequiredThe Tunnel events alert rules of the switch's kind it goes to, oldest first; empty: every rule (no rule of its kind).
labelstringrequiredEvery rule of its kind, joined with " · ": "PagerDuty · Integrations on-call", "#integrations · #ops". The every-rule fallback names the first 2 and "+N more".
flappingobject2 fields
channelIdsarray of stringrequiredThe Tunnel events alert rules of the switch's kind it goes to, oldest first; empty: every rule (no rule of its kind).
labelstringrequiredEvery rule of its kind, joined with " · ": "PagerDuty · Integrations on-call", "#integrations · #ops". The every-rule fallback names the first 2 and "+N more".
bgpWithdrawnobject2 fields
channelIdsarray of stringrequiredThe Tunnel events alert rules of the switch's kind it goes to, oldest first; empty: every rule (no rule of its kind).
labelstringrequiredEvery rule of its kind, joined with " · ": "PagerDuty · Integrations on-call", "#integrations · #ops". The every-rule fallback names the first 2 and "+N more".
pskAgeobject2 fields
channelIdsarray of stringrequiredThe Tunnel events alert rules of the switch's kind it goes to, oldest first; empty: every rule (no rule of its kind).
labelstringrequiredEvery rule of its kind, joined with " · ": "PagerDuty · Integrations on-call", "#integrations · #ops". The every-rule fallback names the first 2 and "+N more".
activeWindowstring | nullrequiredThe maintenance window open now, by id.
lastFailoverTestobject | nullrequired4 fields
atstring (date-time)requiredpassedbooleanrequiredsecondsintegerrequiredHow long the move there and back took.
errorstring | nullrequiredWhy it failed, and where the traffic is.
thresholdsobjectrequiredThe watcher's numbers, for the labels.
4 fields
downAfterSecondsintegerrequiredAbout how long until the watcher confirms an outage (TUNNEL_WATCHER_DOWN_READS × poll).
flapDropsintegerrequiredDrops in the flap window that pause the watcher.
flapWindowMinutesintegerrequiredfailbackStableMinutesintegerrequiredHow long a recovered primary must stay up before it takes traffic back.
- 401No credential, or the token is invalid or expired.
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
- 501Not available in this deployment.
application/json · ApiError
Example request
curl "$ENGINE_URL/api/vpn-tunnels/<id>/settings" \
-H "Authorization: Bearer $TOKEN"Change the tunnel's settings
put/api/vpn-tunnels/{id}/settings
Part of the alerts or failover switches, or the whole maintenance window list; the rules' numbers are fixed. Failover switches need a backup tunnel (409). Audited as vpn_tunnel.settings_updated with the field names only (alerts.flapping, failover.autoFailover, maintenanceWindows).
Minimum role: admin.
Auth: Bearer token (how to get one) · Operation: updateVpnTunnelSettings
Parameters
| Name | In | Type | Description |
|---|---|---|---|
idrequired | path | string | Tunnel id. |
Request body (required)
application/json · object
alertsobject4 fields
downboolean"Tunnel down for 2 min" (or as long as the watcher takes to confirm, if longer) and its recovery. Sent 2 min after the first bad read; a tunnel back before then never alerts.
flappingboolean"Flapping: {flapDrops} drops in {flapWindowMinutes} min": the watcher pausing a flapping tunnel (a pause for the hourly action cap always alerts).
bgpWithdrawnboolean"BGP route withdrawn" (one HA interface down).
pskAgeboolean"PSK older than 90 days": one alert per PSK version, checked hourly.
maintenanceWindowsarray of object9 fields
idstringrequiredUnique within the tunnel.
kindstringrequiredOne of: "weekly", "once"
dayintegerweekly: 0 = Sunday … 6 = Saturday.
datestring (date)once: the start date in the window's zone.
startstringrequiredHH:MM, wall clock in timeZone.
endstringrequiredHH:MM, exclusive. At or before start, the window runs past midnight.
timeZonestringrequiredIANA zone, for example America/Chicago.
notestringFor example "set by Demo Health IT".
enabledboolean
failoverobject2 fields
autoFailoverboolean"Fail over to the backup after {thresholds.downAfterSeconds} down".
failbackboolean"Fail back when the primary is stable for {failbackStableMinutes} min".
Responses
- 200The saved settings.
Response fields
application/json · object
settingsobjectrequired4 fields
alertsobjectrequired4 fields
downboolean"Tunnel down for 2 min" (or as long as the watcher takes to confirm, if longer) and its recovery. Sent 2 min after the first bad read; a tunnel back before then never alerts.
flappingboolean"Flapping: {flapDrops} drops in {flapWindowMinutes} min": the watcher pausing a flapping tunnel (a pause for the hourly action cap always alerts).
bgpWithdrawnboolean"BGP route withdrawn" (one HA interface down).
pskAgeboolean"PSK older than 90 days": one alert per PSK version, checked hourly.
alertRulesobjectrequiredThe alert rules' fixed numbers.
4 fields
downobject1 field
minutesinteger2.
flappingobject2 fields
dropsinteger3.
windowMinutesinteger10.
bgpWithdrawnobjectpskAgeobject1 field
daysinteger90.
maintenanceWindowsarray of objectrequired9 fields
idstringrequiredUnique within the tunnel.
kindstringrequiredOne of: "weekly", "once"
dayintegerweekly: 0 = Sunday … 6 = Saturday.
datestring (date)once: the start date in the window's zone.
startstringrequiredHH:MM, wall clock in timeZone.
endstringrequiredHH:MM, exclusive. At or before start, the window runs past midnight.
timeZonestringrequiredIANA zone, for example America/Chicago.
notestringFor example "set by Demo Health IT".
enabledboolean
failoverobjectrequired4 fields
autoFailoverboolean"Fail over to the backup after {thresholds.downAfterSeconds} down".
failbackboolean"Fail back when the primary is stable for {failbackStableMinutes} min".
afterSecondsintegerHow long the watcher waits before failing over (60 by default): the live TUNNEL_WATCHER_* number, the same as thresholds.downAfterSeconds.
failbackStableMinutesintegerHow long the primary must be stable before failback (5 by default): the live number, the same as thresholds.failbackStableMinutes.
pairobject | nullrequiredThe failover pair; null when there is no backup.
2 fields
primarystringbackupstring
alertRoutesarray of stringrequiredWho hears the alerts: the workspace's tunnel_events alert rules, as "PagerDuty · Integrations on-call".
alertChannelsobjectrequiredWho hears each alert: every enabled Tunnel events rule of its kind (down → PagerDuty, flapping and BGP → Slack, PSK age → email), else every rule. The sender routes the same way.
4 fields
downobject2 fields
channelIdsarray of stringrequiredThe Tunnel events alert rules of the switch's kind it goes to, oldest first; empty: every rule (no rule of its kind).
labelstringrequiredEvery rule of its kind, joined with " · ": "PagerDuty · Integrations on-call", "#integrations · #ops". The every-rule fallback names the first 2 and "+N more".
flappingobject2 fields
channelIdsarray of stringrequiredThe Tunnel events alert rules of the switch's kind it goes to, oldest first; empty: every rule (no rule of its kind).
labelstringrequiredEvery rule of its kind, joined with " · ": "PagerDuty · Integrations on-call", "#integrations · #ops". The every-rule fallback names the first 2 and "+N more".
bgpWithdrawnobject2 fields
channelIdsarray of stringrequiredThe Tunnel events alert rules of the switch's kind it goes to, oldest first; empty: every rule (no rule of its kind).
labelstringrequiredEvery rule of its kind, joined with " · ": "PagerDuty · Integrations on-call", "#integrations · #ops". The every-rule fallback names the first 2 and "+N more".
pskAgeobject2 fields
channelIdsarray of stringrequiredThe Tunnel events alert rules of the switch's kind it goes to, oldest first; empty: every rule (no rule of its kind).
labelstringrequiredEvery rule of its kind, joined with " · ": "PagerDuty · Integrations on-call", "#integrations · #ops". The every-rule fallback names the first 2 and "+N more".
activeWindowstring | nullrequiredThe maintenance window open now, by id.
lastFailoverTestobject | nullrequired4 fields
atstring (date-time)requiredpassedbooleanrequiredsecondsintegerrequiredHow long the move there and back took.
errorstring | nullrequiredWhy it failed, and where the traffic is.
thresholdsobjectrequiredThe watcher's numbers, for the labels.
4 fields
downAfterSecondsintegerrequiredAbout how long until the watcher confirms an outage (TUNNEL_WATCHER_DOWN_READS × poll).
flapDropsintegerrequiredDrops in the flap window that pause the watcher.
flapWindowMinutesintegerrequiredfailbackStableMinutesintegerrequiredHow long a recovered primary must stay up before it takes traffic back.
- 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
- 501Not available in this deployment.
application/json · ApiError
Example request
curl -X PUT "$ENGINE_URL/api/vpn-tunnels/<id>/settings" \
-H "Authorization: Bearer $TOKEN" \
-H "Content-Type: application/json" \
-d '{
"alerts": {
"down": true,
"flapping": true,
"bgpWithdrawn": true,
"pskAge": true
},
"maintenanceWindows": [
{
"id": "string",
"kind": "weekly",
"day": 0,
"date": "2026-01-01",
"start": "string",
"end": "string",
"timeZone": "string",
"note": "string",
"enabled": true
}
],
"failover": {
"autoFailover": true,
"failback": true
}
}'Run a failover test
post/api/vpn-tunnels/{id}/failover-test
Moves the pair's live traffic to the standby and back, under the pair's lock and the watcher's lease. A standby that is not established fails the test without moving anything; one that is not established once it has the traffic fails it, and the traffic goes back. A failed test answers 200 with the error. Audited as vpn_tunnel.failover_tested.
Minimum role: admin.
Auth: Bearer token (how to get one) · Operation: testVpnTunnelFailover
Parameters
| Name | In | Type | Description |
|---|---|---|---|
idrequired | path | string | Tunnel id. |
Request body
application/json · object
Responses
- 200The test's result.
Response fields
application/json · object
atstring (date-time)requiredpassedbooleanrequiredsecondsintegerrequiredHow long the move there and back took.
errorstring | nullrequiredWhy it failed, and where the traffic is.
- 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
- 501Not available in this deployment.
application/json · ApiError
- 502Error.
application/json · ApiError
Example request
curl -X POST "$ENGINE_URL/api/vpn-tunnels/<id>/failover-test" \
-H "Authorization: Bearer $TOKEN" \
-H "Content-Type: application/json" \
-d '{}'Create a one-time key link
post/api/vpn-tunnels/{id}/psk-link
Makes the link that shows the tunnel's pre-shared key once to the network engineer: since G-tunnels-8 the engineer page's shared link, opened as /t/{code} (path; url is absolute, on the workspace's connect host when one is set). It lives 24 h (PSK_LINK_TTL) and replaces the tunnel's live shared link. /psk/<token> links made before keep working until they expire. While a rotation is staged (pskStaged, G-tunnels-5) the link is for the waiting key; resend: true is the rotating banner's Resend link (audited as vpn_tunnel.psk_link_resent) and is a 409 with nothing staged. 409 while GCP applies a key. Audited.
Minimum role: admin.
Auth: Bearer token (how to get one) · Operation: createVpnPskLink
Parameters
| Name | In | Type | Description |
|---|---|---|---|
idrequired | path | string | Tunnel id. |
Request body
application/json · object
resendbooleanRe-mint the staged rotation's link; the previous unused one stops working.
Responses
- 201Created.
Response fields
application/json · object
pathstringrequiredThe short link's path.
urlstringrequiredThe absolute short URL.
expiresAtstring (date-time)required
- 400The request is malformed or fails validation.
application/json · ApiError
- 401No credential, or the token is invalid or expired.
application/json · ApiError
- 404Not found in the caller's workspace.
application/json · ApiError
- 409The request conflicts with the current state.
application/json · ApiError
- 500Unexpected server error.
application/json · ApiError
Example request
curl -X POST "$ENGINE_URL/api/vpn-tunnels/<id>/psk-link" \
-H "Authorization: Bearer $TOKEN" \
-H "Content-Type: application/json" \
-d '{
"resend": true
}'Roll back to the previous pre-shared key for 24 h
post/api/vpn-tunnels/{id}/psk-rollback
A rotation keeps the key it replaced, encrypted, for 24 h after GCP accepts the new one; the tunnel's pskRollbackVersion is that version (null when none is kept). This puts it back for 24 h: the tunnel is re-created with it in the background (202, state updating) and the newer key is held ready, so one-time links and the engineer link hand out the newer key. When the 24 h end (pskRollbackUntil) MedHook applies the newer key again and drops the old one. Never returns or logs a key. Audited as vpn_tunnel.psk_rolled_back (versions and end time). 409 when no previous key is kept, a rollback is already running, or the tunnel is busy; 400 for Interconnect.
Minimum role: admin.
Auth: Bearer token (how to get one) · Operation: rollbackVpnTunnelPsk
Parameters
| Name | In | Type | Description |
|---|---|---|---|
idrequired | path | string | Tunnel id. |
Request body
application/json · object
proposalstringThe signed proposal of the Agent card the rollback was opened from (tunnel.psk-rollback), audited ai.proposal.resolved with the version put back. Not a tunnel field: never stored or echoed.
Responses
- 202Rolling back: the tunnel with pskVersion set to the previous version and pskRollbackUntil.
Response fields
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
- 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
- 501Not available in this deployment.
application/json · ApiError
Example request
curl -X POST "$ENGINE_URL/api/vpn-tunnels/<id>/psk-rollback" \
-H "Authorization: Bearer $TOKEN" \
-H "Content-Type: application/json" \
-d '{
"proposal": "string"
}'Rotate the pre-shared key (staged)
post/api/vpn-tunnels/{id}/psk-rotation
Mints the next PSK version and keeps it, encrypted, while GCP keeps the live key for 72 h (pskStaged.overlapUntil); then MedHook applies it, or POST /psk-rotation/apply does it now. Returns the new key's link (path /t/{code}, url, expiresAt: the engineer page's shared link, G-tunnels-8), which replaces the tunnel's live shared link. GCP is not called. Never returns or logs a key. Audited as vpn_tunnel.secret_rotation_started (version, deadline). During a PSK rollback it puts back the held key (pskHeldVersion) the links handed out instead: 202 with reapplied, no new key and no link, the tunnel re-created in the background, audited as vpn_tunnel.psk_rollback_ended (early). 409 when a rotation is staged or the tunnel is busy; 400 for Interconnect.
Minimum role: admin.
Auth: Bearer token (how to get one) · Operation: startVpnTunnelPskRotation
Parameters
| Name | In | Type | Description |
|---|---|---|---|
idrequired | path | string | Tunnel id. |
Request body
application/json · object
proposalstringThe signed proposal of the Agent card the rotation was opened from, audited ai.proposal.resolved with the staged version; the card reads it in progress until the tunnel is on that version. Not a tunnel field: never stored or echoed.
Responses
- 201Staged: the tunnel with pskStaged, and the one-time link.
Response fields
application/json · object
pathstringrequiredThe short link's path.
urlstringrequiredThe absolute short URL.
expiresAtstring (date-time)required
- 202During a PSK rollback: the held key is live again (re-created in the background); no link.
Response fields
application/json · object
reappliedobjectrequired2 fields
versionintegerrequiredfromintegerrequired
- 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
- 501Not available in this deployment.
application/json · ApiError
Example request
curl -X POST "$ENGINE_URL/api/vpn-tunnels/<id>/psk-rotation" \
-H "Authorization: Bearer $TOKEN" \
-H "Content-Type: application/json" \
-d '{
"proposal": "string"
}'Cancel a staged PSK rotation
post/api/vpn-tunnels/{id}/psk-rotation/cancel
Drops the staged key and revokes the link the rotation sent if its key wasn't revealed yet (and any unused /psk link from before). The tunnel keeps the live key, which GCP never stopped using. Audited as vpn_tunnel.psk_rotation_cancelled. 409 with nothing staged.
Minimum role: admin.
Auth: Bearer token (how to get one) · Operation: cancelVpnTunnelPskRotation
Parameters
| Name | In | Type | Description |
|---|---|---|---|
idrequired | path | string | Tunnel id. |
Request body
application/json · object
Responses
- 200Cancelled: the tunnel with pskStaged null.
Response fields
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
- 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
- 501Not available in this deployment.
application/json · ApiError
Example request
curl -X POST "$ENGINE_URL/api/vpn-tunnels/<id>/psk-rotation/cancel" \
-H "Authorization: Bearer $TOKEN" \
-H "Content-Type: application/json" \
-d '{}'Apply a staged PSK now
post/api/vpn-tunnels/{id}/psk-rotation/apply
Gives GCP the staged key before its overlap ends: the tunnel is re-created with it in the background (202, state updating, pskRotationPending true) and the replaced key is kept 24 h for a rollback. The version moves once GCP accepts it. Audited as vpn_tunnel.psk_rotation_applied. 409 with nothing staged or while busy.
Minimum role: admin.
Auth: Bearer token (how to get one) · Operation: applyVpnTunnelPskRotation
Parameters
| Name | In | Type | Description |
|---|---|---|---|
idrequired | path | string | Tunnel id. |
Request body
application/json · object
Responses
- 202Applying: the tunnel being re-created.
Response fields
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
- 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
- 501Not available in this deployment.
application/json · ApiError
Example request
curl -X POST "$ENGINE_URL/api/vpn-tunnels/<id>/psk-rotation/apply" \
-H "Authorization: Bearer $TOKEN" \
-H "Content-Type: application/json" \
-d '{}'Read the tunnel's lab link
get/api/vpn-tunnels/{id}/lab
The HL7 lab this tunnel reaches, or null. Never the key: it is sealed at rest and only used for the lab calls.
Minimum role: admin.
Auth: Bearer token (how to get one) · Operation: getVpnTunnelLabLink
Parameters
| Name | In | Type | Description |
|---|---|---|---|
idrequired | path | string | Tunnel id. |
Responses
- 200The lab link.
Response fields
application/json · object
linkobject | nullrequired4 fields
hoststringrequiredThe lab's IPv4 address, inside the tunnel's remote subnets.
portintegerrequiredThe lab's engine access API port.
setAtstring (date-time)requiredWhen it was last set.
setBystring | nullrequiredWho set it (user id).
- 401No credential, or the token is invalid or expired.
application/json · ApiError
- 403The caller's role, license or network address does not allow this. A signed-in person who is not a member of the requested workspace gets code `WORKSPACE_FORBIDDEN`; a viewer asking for message content gets `PHI_FORBIDDEN` (or `PHI_SEARCH_FORBIDDEN` for a search on message content).
application/json · ApiError
- 404Not found in the caller's workspace.
application/json · ApiError
- 429Rate limit exceeded (see the `Retry-After` header), or on the AI routes the daily AI budget is used up.
application/json · ApiError
- 500Unexpected server error.
application/json · ApiError
Example request
curl "$ENGINE_URL/api/vpn-tunnels/<id>/lab" \
-H "Authorization: Bearer $TOKEN"Set the tunnel's lab link
put/api/vpn-tunnels/{id}/lab
Sets or replaces the lab link. host must be an IPv4 address inside the tunnel's remote subnets, and not loopback, link-local or the engine's own ranges (400). The key is the one the lab keeps the SHA-256 of; it is encrypted at rest and never returned. Audited as vpn_tunnel.lab_link_set, without the key.
Minimum role: admin.
Auth: Bearer token (how to get one) · Operation: setVpnTunnelLabLink
Parameters
| Name | In | Type | Description |
|---|---|---|---|
idrequired | path | string | Tunnel id. |
Request body (required)
application/json · object
hoststringrequiredIPv4 address inside the tunnel's remote subnets.
portintegerkeystringrequiredThe lab's engine key.
Responses
- 200The saved lab link.
Response fields
application/json · object
linkobject | nullrequired4 fields
hoststringrequiredThe lab's IPv4 address, inside the tunnel's remote subnets.
portintegerrequiredThe lab's engine access API port.
setAtstring (date-time)requiredWhen it was last set.
setBystring | nullrequiredWho set it (user id).
- 400The request is malformed or fails validation.
application/json · ApiError
- 401No credential, or the token is invalid or expired.
application/json · ApiError
- 403The caller's role, license or network address does not allow this. A signed-in person who is not a member of the requested workspace gets code `WORKSPACE_FORBIDDEN`; a viewer asking for message content gets `PHI_FORBIDDEN` (or `PHI_SEARCH_FORBIDDEN` for a search on message content).
application/json · ApiError
- 404Not found in the caller's workspace.
application/json · ApiError
- 429Rate limit exceeded (see the `Retry-After` header), or on the AI routes the daily AI budget is used up.
application/json · ApiError
- 500Unexpected server error.
application/json · ApiError
Example request
curl -X PUT "$ENGINE_URL/api/vpn-tunnels/<id>/lab" \
-H "Authorization: Bearer $TOKEN" \
-H "Content-Type: application/json" \
-d '{
"host": "string",
"port": 8090,
"key": "string"
}'Clear the tunnel's lab link
delete/api/vpn-tunnels/{id}/lab
Removes the lab link and its key. Audited as vpn_tunnel.lab_link_cleared.
Minimum role: admin.
Auth: Bearer token (how to get one) · Operation: clearVpnTunnelLabLink
Parameters
| Name | In | Type | Description |
|---|---|---|---|
idrequired | path | string | Tunnel id. |
Responses
- 200Cleared.
Response fields
application/json · object
linkobject | nullrequired4 fields
hoststringrequiredThe lab's IPv4 address, inside the tunnel's remote subnets.
portintegerrequiredThe lab's engine access API port.
setAtstring (date-time)requiredWhen it was last set.
setBystring | nullrequiredWho set it (user id).
- 401No credential, or the token is invalid or expired.
application/json · ApiError
- 403The caller's role, license or network address does not allow this. A signed-in person who is not a member of the requested workspace gets code `WORKSPACE_FORBIDDEN`; a viewer asking for message content gets `PHI_FORBIDDEN` (or `PHI_SEARCH_FORBIDDEN` for a search on message content).
application/json · ApiError
- 404Not found in the caller's workspace.
application/json · ApiError
- 429Rate limit exceeded (see the `Retry-After` header), or on the AI routes the daily AI budget is used up.
application/json · ApiError
- 500Unexpected server error.
application/json · ApiError
Example request
curl -X DELETE "$ENGINE_URL/api/vpn-tunnels/<id>/lab" \
-H "Authorization: Bearer $TOKEN"Read from the tunnel's lab
get/api/vpn-tunnels/{id}/lab/{op}
Calls the lab's engine access API through the tunnel and passes its answer on: status (the lab's view of the tunnel, its MLLP listener, the last burst, drills), samples, received (what this engine sent the lab) or round-trips. Only the configured lab address, while it is inside the tunnel's remote subnets (409 LAB_ADDRESS_OUTSIDE_TUNNEL); no redirects, short timeouts, a size cap. A lab that can't be reached or refuses the key is 502 with LAB_TIMEOUT, LAB_UNREACHABLE, LAB_KEY_REFUSED, LAB_ADDRESS_REFUSED, LAB_REDIRECT, LAB_TOO_LARGE or LAB_BAD_RESPONSE; 409 NO_LAB_LINK without a link.
Minimum role: admin.
Auth: Bearer token (how to get one) · Operation: readVpnTunnelLab
Parameters
| Name | In | Type | Description |
|---|---|---|---|
idrequired | path | string | Tunnel id. |
oprequired | path | string | GET: status, samples, received, round-trips. POST: send, burst, burst-stop, drill. |
Responses
- 200The lab's answer.
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
- 404Not found in the caller's workspace.
application/json · ApiError
- 405Error.
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
- 502Error.
application/json · ApiError
Example request
curl "$ENGINE_URL/api/vpn-tunnels/<id>/lab/status" \
-H "Authorization: Bearer $TOKEN"Act on the tunnel's lab
post/api/vpn-tunnels/{id}/lab/{op}
send ({ sample | message }: one message with a new control ID; the ACK verdict), burst ({ sample | message, count 1-500, rate 1-50 }, 202; the lab runs one at a time), burst-stop, or drill ({ minutes 1-30 }, 202: the lab takes the tunnel down and brings it back by itself when the time is up; until then this engine can't reach the lab). The lab's own refusals keep their status (400, 409, 429). Audited as vpn_tunnel.lab_sent, lab_burst_started, lab_burst_stopped or lab_drill_started, with counts and minutes, never message content.
Minimum role: admin.
Auth: Bearer token (how to get one) · Operation: actOnVpnTunnelLab
Parameters
| Name | In | Type | Description |
|---|---|---|---|
idrequired | path | string | Tunnel id. |
oprequired | path | string | GET: status, samples, received, round-trips. POST: send, burst, burst-stop, drill. |
Request body
application/json · object
samplestringA bundled sample's name, e.g. ADT^A01.
messagestringHL7 v2 text.
countintegerrateintegerMessages a second.
minutesinteger
Responses
- 200The lab's answer (202 for burst and drill).
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
- 404Not found in the caller's workspace.
application/json · ApiError
- 405Error.
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
- 502Error.
application/json · ApiError
Example request
curl -X POST "$ENGINE_URL/api/vpn-tunnels/<id>/lab/status" \
-H "Authorization: Bearer $TOKEN" \
-H "Content-Type: application/json" \
-d '{
"sample": "string",
"message": "string",
"count": 1,
"rate": 1,
"minutes": 1
}'Schemas
Named objects the operations above link to.
ApiError
The error body. error is always present. code is present on most errors and is the field to branch on; a few routes and the sign-in and role checks return only error (and sometimes detail).
errorstringrequiredHuman-readable error message.
codestringMachine-readable error code.
One of: "BAD_REQUEST", "INVALID_REQUEST", "UNAUTHORIZED", "UNAUTHENTICATED", "FORBIDDEN", "NOT_FOUND", "CONFLICT", "UNPROCESSABLE_ENTITY", "RATE_LIMITED", "INTERNAL_ERROR", "SERVICE_UNAVAILABLE", "NOT_CONFIGURED", "SIGNATURE_REQUIRED", "INVALID_SIGNATURE", "TIMESTAMP_REQUIRED", "TIMESTAMP_INVALID", "TIMESTAMP_OUT_OF_TOLERANCE", "INVALID_CREDENTIALS", "INVALID_TOKEN", "PAYLOAD_TOO_LARGE", "INVALID_NDJSON", "PHI_NOT_AUTHORIZED", "PHI_IN_SANDBOX", "IN_PROGRESS", "RETRY_SCHEDULED", "WORKFLOW_DISABLED", "CONFLICTING_SCOPE", "ALREADY_DELIVERED", "CHAIN_TOO_DEEP", "NO_FAILED_DESTINATION", "STALE_SCOPE", "UNKNOWN_DESTINATION", "NO_DESTINATIONS", "NOT_A_MESSAGE", "AI_FEATURES_DISABLED"
detailsanyOptional structured context about the error.
VpnPeerConfig
What the healthcare organization's network engineer enters on their firewall. sharedSecret appears only when it was just generated or reveal=1 was passed.
medhookGatewayIpstringmedhookSubnetsarray of stringyourSubnetsarray of stringThe ranges their side presents. With NAT, the translated ranges.
natobjectPer-tunnel NAT only: the real → translated pairs their firewall maps 1:1 before the tunnel, and a note saying so.
2 fields
mappingsarray of object2 fields
realstringtranslatedstring
notestring
ikeVersionintegerOne of: 1, 2
phase1objectphase2objectsharedSecretstring
VpnTunnel
idstringnamestringgcpNamestringpeerIpstringremoteSubnetsarray of stringThe ranges GCP routes into the tunnel. For a NAT tunnel these are the translated ranges (see
natMappings).natMappingsarray of object | nullPer-tunnel NAT: each real range of the organization and the unique translated range MedHook routes for it. Destinations use translated addresses. Null without NAT.
2 fields
realstringtranslatedstring
localSubnetsarray of stringThe MedHook side's protected networks this tunnel carries: its own override, else the node subnet plus Terraform's
vpn_extra_local_ranges.localSubnetsOverridebooleanlocalSubnetswas set for this tunnel.carriesOtherTrafficbooleanThe local ranges go beyond MedHook's node subnet: the tunnel carries other applications' traffic, which MedHook does not audit.
ikeVersionintegerOne of: 1, 2
statestringOne of: "provisioning", "ready", "failed", "deleting", "updating"
errorstring | nullhealthstring | nullLive GCP status; null unless state is
ready.degraded: an HA tunnel with one of its two interfaces (tunnel and BGP session) up.One of: "established", "degraded", "connecting", "down", "unknown"
gcpStatusstring | nulldetailedStatusstring | nullwatchobject | nullThe tunnel watcher's state; null until it has read the tunnel.
7 fields
phasestringlastActionstring | nulllastActionAtstring (date-time) | nullsuppressedUntilstring (date-time) | nulllastErrorstring | nulllastEstablishedAtstring (date-time) | nullThe last read that found the tunnel up (the Tunnels page's "Last handshake").
downSincestring (date-time) | nullWhen the current outage started; null while up.
createdBystring | nullcreatedAtstring (date-time)updatedAtstring (date-time)pskRollbackVersioninteger | nullR48b: the previous PSK version POST /psk-rollback would put back (kept 24 h after a rotation); null when none is kept.
pskRollbackUntilstring (date-time) | nullR48b: when the running PSK rollback ends and the newer key is applied again; null when none runs.
pskHeldVersioninteger | nullR48b: while a PSK rollback is set, the newer version held ready (links hand it out; POST /psk-rotation applies it again); null otherwise.
pskStagedobject | nullG-tunnels-5: a staged rotation (never its key): the waiting version, when its one-time link was last sent, and when MedHook applies it (the live key keeps working until then). Null when none is staged.
3 fields
versionintegerlinkSentAtstring (date-time) | nulloverlapUntilstring (date-time)
pskLinkSentbooleanG-tunnels-5: GCP is applying a staged key whose one-time link already went out (Apply now or the scheduled apply), so no new link is needed.
VpnTunnelWithConfig
peerConfigVpnPeerConfigWhat the healthcare organization's network engineer enters on their firewall.
sharedSecretappears only when it was just generated orreveal=1was passed.