Returns unified live connection state for a single agent instance.
The response shape is identical for hosted (HTTP callback) and
connected (WebSocket) deployments; switch on the transport and
connection_status fields to render.
Data is sourced from the gateway’s agent_instances row, which
the mesh keeps up to date via the internal
/internal/agents/record_* write path on every dispatch and WS
lifecycle event. That row is the single source of truth — there
is no need to cross-reference the mesh /metrics endpoint except
for aggregate fleet telemetry.
Non-super callers can only query instances in their own tenant;
super-admins may pass tenant_id in the body to narrow the
lookup, or omit it for a global search by instance_id.
Super-admin-only override. Ignored for non-super callers, whose tenant is always read from the auth context. When a super-admin omits this, the lookup is global by instance_id.
Unified connection-state envelope for a single agent instance. Shape is identical regardless of deployment_mode: hosted agents report transport=callback, connected agents report transport=ws. The dashboard renders the same card for either, switching only on the transport and connection_status fields.
Maintained by the mesh write path (/internal/agents/record_*) against the agent_instances row. The gateway row is the single source of truth — clients should not cross-reference the mesh /metrics endpoint except for aggregate fleet-wide telemetry.
{"docsConfig":{"theme":"luma","$schema":"https://mintlify.com/docs.json","name":"Svantic","description":"AI agent platform — discovery, orchestration, governance, and knowledge for agent fleets.","colors":{"primary":"#7C3AED","light":"#A78BFA","dark":"#5B21B6"},"logo":{"light":"https://mintcdn.com/svantic/DQEVJ_RnVW5_l6gu/images/logo_large.png?fit=max\u0026auto=format\u0026n=DQEVJ_RnVW5_l6gu\u0026q=85\u0026s=c23d1b1fd831f2dc24e9b758c0e4f930","dark":"https://mintcdn.com/svantic/DQEVJ_RnVW5_l6gu/images/logo_large.png?fit=max\u0026auto=format\u0026n=DQEVJ_RnVW5_l6gu\u0026q=85\u0026s=c23d1b1fd831f2dc24e9b758c0e4f930"},"favicon":"https://mintcdn.com/svantic/DQEVJ_RnVW5_l6gu/images/logo_large.png?fit=max\u0026auto=format\u0026n=DQEVJ_RnVW5_l6gu\u0026q=85\u0026s=c23d1b1fd831f2dc24e9b758c0e4f930","api":{"openapi":"api-reference/openapi-bundled.yaml","playground":{"display":"interactive"},"examples":{"languages":["curl","javascript","python","go"]}},"appearance":{"default":"light","strict":true},"navbar":{"links":[{"href":"https://svantic.com","label":"Website"},{"href":"https://app.svantic.com","label":"Dashboard"}]},"footer":{"socials":{"github":"https://github.com/svantic","website":"https://svantic.com"},"links":[{"header":"Documentation","items":[{"label":"Home","href":"/"},{"label":"Getting Started","href":"/getting-started"},{"label":"Core Concepts","href":"/core-concepts"}]},{"header":"Reference","items":[{"label":"SDK","href":"/sdk"},{"label":"API Reference","href":"/api-reference"},{"label":"CLI Reference","href":"/cli-reference"}]},{"header":"Resources","items":[{"label":"Website","href":"https://svantic.com"},{"label":"GitHub","href":"https://github.com/svantic"},{"label":"Dashboard","href":"https://app.svantic.com"}]},{"header":"Legal","items":[{"label":"Terms of Service","href":"https://svantic.com/legal/terms"},{"label":"Privacy Policy","href":"https://svantic.com/legal/privacy"}]}]},"fonts":{"heading":{"family":"Inter"},"body":{"family":"Inter"}},"icons":{"library":"lucide"},"styling":{"eyebrows":"breadcrumbs","latex":false},"navigation":{"pages":[]}},"deployment":{"deploymentMetadataValue":{"subdomain":"svantic","hasAudioNarration":false,"actualSubdomain":"svantic","customDomains":["docs.svantic.com"],"gitSource":{"type":"github","owner":"svantic","repo":"docs","deployBranch":"main","contentDirectory":"","isPrivate":true,"mountPath":"","label":""},"chroma":{"liveDeploymentHistoryId":"6a21dcceab250d2c48819885","collectionId":"6c93ef79-0ccb-422b-a348-0750b4a5fbcf","schemaVersion":"v2"},"entitlements":{"AI_CHAT":{"status":"DISABLED"}},"buildId":"6a21dcceab250d2c48819885:success","clientVersion":"0.0.4006","searchFilterCounts":[{"language":"default","tag":"API Reference","count":50},{"language":"default","tag":"REST API","count":49},{"language":"default","tag":"Documentation","count":43},{"language":"default","tag":"SDK","count":27},{"language":"default","tag":"Reference","count":14},{"language":"default","tag":"Guides","count":12},{"language":"default","tag":"Knowledge Base","count":12},{"language":"default","tag":"Agents","count":10},{"language":"default","tag":"Policies","count":10},{"language":"default","tag":"Deep Dive","count":9}]},"assistantConfig":{"enableAskAiButton":false,"enableStarterQuestions":false,"enableContextualStarterQuestions":false,"enableAskAiSearchBar":true},"basePath":"","hasChatPermissions":false,"hasWebMcpPermissions":false,"toggles":[{"name":"kill-isr","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"agent-mintlify-slack","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"editor-v7-file-tree","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"agent-integrations-settings","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"automations-pr-grouping","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"custom-prefix","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"analytics-v7","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"user-flows-analytics","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"no-publish-flow","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"workos-onboarding","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"llms-txt-v2","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"pause-universal-search-reconcile","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"snapshot-serving-live","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"stripTemperatureMiddleware","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"per-site-search-delta","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"support-platform-pylon-zendesk","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"snapshot-serving","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"instant-rollback","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"granular-notifications-server","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"granular-notifications","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"editor-private-page-search","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"automations-fable","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"fixed-ai-action-pricing","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"automation-resolve-merge-conflict","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"scoped-publishing","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"mintql","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"page-level-analytics","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"editor-version-history-v2","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"editor-nav-generations","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"billing-page-v2","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"workspace-projects","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"assistant-v5","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"byok-sep-25","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"fork-pr-previews","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"revalidation-jwt","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"vite-origin","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"editor-agent-model-picker","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"billing-updated-9-15","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"workos-sso-scim","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"hobby-abuse-scan","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"dashboard-inbox","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"workos-signup","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"workos-enabled","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false}],"googleFontsInlined":false},"customCss":[{"filePath":"global.css","content":"#sidebar,nav#sidebar{width:300px!important;min-width:300px!important}html:not([data-current-path^=\"/api-reference\"]) #content,html:not([data-current-path^=\"/api-reference\"]) #content-area{max-width:1260px;margin-left:auto;margin-right:auto}#page-title,h1{color:#7c3aed;font-weight:900;letter-spacing:-.025em}html:not([data-current-path^=\"/api-reference\"]) h2{color:#7c3aed;font-weight:700;letter-spacing:-.025em;padding-bottom:8px;border-bottom:2px solid rgba(124,58,237,.12);margin-top:1.75rem;margin-bottom:.4rem}html:not([data-current-path^=\"/api-reference\"]) h3{color:#5b21b6;font-weight:600;letter-spacing:-.025em;margin-top:1.25rem;margin-bottom:.3rem}html:not([data-current-path^=\"/api-reference\"]) h4{color:#7c3aed;font-weight:600;letter-spacing:-.025em;margin-top:1rem;margin-bottom:.25rem}html.dark #page-title,html.dark h1{color:#a78bfa}html.dark:not([data-current-path^=\"/api-reference\"]) h2{color:#a78bfa;border-bottom-color:rgba(167,139,250,.2)}html.dark:not([data-current-path^=\"/api-reference\"]) h3,html.dark:not([data-current-path^=\"/api-reference\"]) mdx-content a:not([class]):hover{color:#c4b5fd}html.dark:not([data-current-path^=\"/api-reference\"]) h4{color:#facc15}html:not([data-current-path^=\"/api-reference\"]) p{line-height:1.65;margin-bottom:.75em}html:not([data-current-path^=\"/api-reference\"]) li{line-height:1.6;margin-bottom:2px}html:not([data-current-path^=\"/api-reference\"]) h1{margin-bottom:.5rem}:not(pre)>code{padding:2px 7px;border-radius:5px;font-weight:500;background-color:#f1f5f9;border:1px solid rgba(124,58,237,.12);color:#5b21b6}html.dark :not(pre)>code{background-color:#1e293b;border-color:rgba(103,232,249,.2);color:#67e8f9}pre{border-radius:10px!important;box-shadow:0 2px 8px rgba(0,0,0,.06)}html.dark pre{box-shadow:0 2px 8px rgba(0,0,0,.3)}html:not([data-current-path^=\"/api-reference\"]) blockquote{margin:1.5rem 0 2rem;padding:1rem 1.25rem;background:linear-gradient(135deg,rgba(124,58,237,.05) 0,rgba(124,58,237,.02) 100%);border-left:3px solid #7c3aed;border-radius:0 8px 8px 0;font-style:normal}html.dark:not([data-current-path^=\"/api-reference\"]) blockquote{background:linear-gradient(135deg,rgba(167,139,250,.08) 0,rgba(167,139,250,.02) 100%)}html:not([data-current-path^=\"/api-reference\"]) hr{height:1px;margin:2.5rem 0;background:linear-gradient(to right,transparent,rgba(124,58,237,.18),transparent);border:0}html.dark:not([data-current-path^=\"/api-reference\"]) hr{background:linear-gradient(to right,transparent,rgba(167,139,250,.2),transparent)}html:not([data-current-path^=\"/api-reference\"]) table{border-radius:10px;overflow:hidden;border:1px solid #e2e8f0}html:not([data-current-path^=\"/api-reference\"]) thead{background:linear-gradient(135deg,#f8fafc 0,#f1f5f9 100%)}html.dark:not([data-current-path^=\"/api-reference\"]) thead{background:linear-gradient(135deg,#1e293b 0,#334155 100%)}html:not([data-current-path^=\"/api-reference\"]) th{font-weight:600;text-transform:uppercase;letter-spacing:.05em}html:not([data-current-path^=\"/api-reference\"]) tr:hover td{background:rgba(124,58,237,.04)}html.dark:not([data-current-path^=\"/api-reference\"]) tr:hover td{background:rgba(167,139,250,.06)}html:not([data-current-path^=\"/api-reference\"]) mdx-content img{border-radius:10px;box-shadow:0 2px 12px rgba(0,0,0,.08)}html.dark:not([data-current-path^=\"/api-reference\"]) mdx-content img{box-shadow:0 2px 12px rgba(0,0,0,.3)}::selection{background:rgba(124,58,237,.18)}html.dark ::selection{background:rgba(167,139,250,.25)}html:not([data-current-path^=\"/api-reference\"]) mdx-content a:not([class]){color:#7c3aed}html:not([data-current-path^=\"/api-reference\"]) mdx-content a:not([class]):hover{color:#6d28d9}html.dark:not([data-current-path^=\"/api-reference\"]) mdx-content a:not([class]){color:#a78bfa}html[data-current-path^=\"/api-reference\"] #content-area,html[data-current-path^=\"/api-reference\"] #content-area *{font-family:\"Inter\",-apple-system,BlinkMacSystemFont,\"Segoe UI\",system-ui,sans-serif!important;line-height:1.55}html[data-current-path^=\"/api-reference\"] #content-area dd,html[data-current-path^=\"/api-reference\"] #content-area div,html[data-current-path^=\"/api-reference\"] #content-area dt,html[data-current-path^=\"/api-reference\"] #content-area label,html[data-current-path^=\"/api-reference\"] #content-area li,html[data-current-path^=\"/api-reference\"] #content-area p,html[data-current-path^=\"/api-reference\"] #content-area span,html[data-current-path^=\"/api-reference\"] #content-area td,html[data-current-path^=\"/api-reference\"] #content-area th{font-size:14px;line-height:1.55}html[data-current-path^=\"/api-reference\"] #content-area h1{font-size:24px;line-height:1.3}html[data-current-path^=\"/api-reference\"] #content-area h2{font-size:18px;line-height:1.3}html[data-current-path^=\"/api-reference\"] #content-area h3{font-size:15px;line-height:1.4}mdx-content svg text[fill]{color:unset}mdx-content svg{border-radius:12px;box-shadow:0 1px 6px rgba(0,0,0,.06);border:1px solid #e2e8f0}html{scroll-behavior:smooth}"}],"page":{"pagePath":"api-reference/agents/get-agent-connection-state","slug":"/api-reference/agents/get-agent-connection-state","pageMetadata":{"title":"Get agent connection state","description":"Returns unified live connection state for a single agent instance.\nThe response shape is identical for hosted (HTTP callback) and\nconnected (WebSocket) deployments; switch on the `transport` and\n`connection_status` fields to render.\n\nData is sourced from the gateway's `agent_instances` row, which\nthe mesh keeps up to date via the internal\n`/internal/agents/record_*` write path on every dispatch and WS\nlifecycle event. That row is the single source of truth — there\nis no need to cross-reference the mesh `/metrics` endpoint except\nfor aggregate fleet telemetry.\n\nNon-super callers can only query instances in their own tenant;\nsuper-admins may pass `tenant_id` in the body to narrow the\nlookup, or omit it for a global search by `instance_id`.\n","deprecated":null,"version":null,"openapi":"/api-reference/openapi-bundled.yaml post /agents/get_connection","href":"/api-reference/agents/get-agent-connection-state","autogeneratedByOpenApi":true},"description":{"compiledSource":"\"use strict\";\nconst {Fragment: _Fragment, jsx: _jsx, jsxs: _jsxs} = arguments[0];\nconst {useMDXComponents: _provideComponents} = arguments[0];\nfunction _createMdxContent(props) {\n const _components = {\n code: \"code\",\n p: \"p\",\n ..._provideComponents(),\n ...props.components\n };\n return _jsxs(_Fragment, {\n children: [_jsxs(_components.p, {\n children: [\"Returns unified live connection state for a single agent instance.\\nThe response shape is identical for hosted (HTTP callback) and\\nconnected (WebSocket) deployments; switch on the \", _jsx(_components.code, {\n children: \"transport\"\n }), \" and\\n\", _jsx(_components.code, {\n children: \"connection_status\"\n }), \" fields to render.\"]\n }), \"\\n\", _jsxs(_components.p, {\n children: [\"Data is sourced from the gateway’s \", _jsx(_components.code, {\n children: \"agent_instances\"\n }), \" row, which\\nthe mesh keeps up to date via the internal\\n\", _jsx(_components.code, {\n children: \"/internal/agents/record_*\"\n }), \" write path on every dispatch and WS\\nlifecycle event. That row is the single source of truth — there\\nis no need to cross-reference the mesh \", _jsx(_components.code, {\n children: \"/metrics\"\n }), \" endpoint except\\nfor aggregate fleet telemetry.\"]\n }), \"\\n\", _jsxs(_components.p, {\n children: [\"Non-super callers can only query instances in their own tenant;\\nsuper-admins may pass \", _jsx(_components.code, {\n children: \"tenant_id\"\n }), \" in the body to narrow the\\nlookup, or omit it for a global search by \", _jsx(_components.code, {\n children: \"instance_id\"\n }), \".\"]\n })]\n });\n}\nfunction MDXContent(props = {}) {\n const {wrapper: MDXLayout} = {\n ..._provideComponents(),\n ...props.components\n };\n return MDXLayout ? _jsx(MDXLayout, {\n ...props,\n children: _jsx(_createMdxContent, {\n ...props\n })\n }) : _createMdxContent(props);\n}\nreturn {\n default: MDXContent\n};\n","frontmatter":{},"scope":{}},"pageType":"default","mdx":{"mdxSource":{"compiledSource":"\"use strict\";const{Fragment:_Fragment,jsx:_jsx}=arguments[0];const{useMDXComponents:_provideComponents}=arguments[0];function _createMdxContent(props){return _jsx(_Fragment,{})}function MDXContent(props={}){const{wrapper:MDXLayout}={..._provideComponents(),...props.components};return MDXLayout?_jsx(MDXLayout,{...props,children:_jsx(_createMdxContent,{...props})}):_createMdxContent(props)}return{default:MDXContent}","frontmatter":{},"scope":{"config":{},"pageMetadata":{"title":"Get agent connection state","description":"Returns unified live connection state for a single agent instance.\nThe response shape is identical for hosted (HTTP callback) and\nconnected (WebSocket) deployments; switch on the `transport` and\n`connection_status` fields to render.\n\nData is sourced from the gateway's `agent_instances` row, which\nthe mesh keeps up to date via the internal\n`/internal/agents/record_*` write path on every dispatch and WS\nlifecycle event. That row is the single source of truth — there\nis no need to cross-reference the mesh `/metrics` endpoint except\nfor aggregate fleet telemetry.\n\nNon-super callers can only query instances in their own tenant;\nsuper-admins may pass `tenant_id` in the body to narrow the\nlookup, or omit it for a global search by `instance_id`.\n","deprecated":null,"version":null,"openapi":"/api-reference/openapi-bundled.yaml post /agents/get_connection","href":"/api-reference/agents/get-agent-connection-state","autogeneratedByOpenApi":true}}},"mdxSourceWithNoJs":null},"mdxExtracts":{"tableOfContents":[],"codeExamples":{}},"jsLinks":[],"openApiReferenceData":{"operation":{"operationId":"agents_get_connection","summary":"Get agent connection state","description":"Returns unified live connection state for a single agent instance.\nThe response shape is identical for hosted (HTTP callback) and\nconnected (WebSocket) deployments; switch on the `transport` and\n`connection_status` fields to render.\n\nData is sourced from the gateway's `agent_instances` row, which\nthe mesh keeps up to date via the internal\n`/internal/agents/record_*` write path on every dispatch and WS\nlifecycle event. That row is the single source of truth — there\nis no need to cross-reference the mesh `/metrics` endpoint except\nfor aggregate fleet telemetry.\n\nNon-super callers can only query instances in their own tenant;\nsuper-admins may pass `tenant_id` in the body to narrow the\nlookup, or omit it for a global search by `instance_id`.\n","tags":["Agents"],"requestBody":"007ab305-c57a-4562-b401-abafe7f8b4b6","responses":{"200":"8dcc96b4-c049-4107-9763-19ab88df3005","400":"a8f6f5f8-d40f-42c2-bd6c-edf98525841c","401":"0a19cf43-43e9-499d-a46f-89dcdb7b3c79","403":"72c1ab9e-402d-4574-91ae-72eb79661750","404":"52d1928a-3cbe-4d5c-ba9e-e419fa62c7b1","500":"be312686-6214-433c-965c-ed6699548683","502":"513902b5-ed19-4583-9c67-3babaed5272f","503":"a50f0996-37be-42de-b669-33990f33e49b"},"method":"post","type":"path","servers":["23c8e2ad-07ab-4135-be8c-1e87165fd5ec","50d8a590-0451-4c5b-9ac8-40df9dd6b53e"],"security":["cecde30b-8822-4598-9468-5ad0203a2961"],"path":"/agents/get_connection","baseUrlOptions":["https://api.svantic.com","https://mesh.svantic.com"],"title":"Get agent connection state","codeSamples":[],"requestExampleLanguages":["bash","javascript","python","go"],"requiredOnlyExamples":false,"requestExampleType":"generated","responseExampleType":"generated"},"dependencies":{"parameters":{},"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","required":["instance_id"],"properties":{"instance_id":{"type":"string","description":"Agent instance identifier.","isRequired":true,"uniqueKey":"instance_id","typeLabel":"string"},"tenant_id":{"type":"string","description":"Super-admin-only override. Ignored for non-super callers, whose tenant is always read from the auth context. When a super-admin omits this, the lookup is global by `instance_id`.\n","uniqueKey":"tenant_id","typeLabel":"string"}},"uniqueKey":"","typeLabel":"object"},"examples":{"sample":{"title":"sample","value":{"instance_id":"inst-orchestrator-7f3d"}}},"exampleType":"examples"}},"exampleType":"examples"},"responses":{"8dcc96b4-c049-4107-9763-19ab88df3005":{"description":"Connection state for the instance.","content":{"application/json":{"schema":{"type":"object","required":["ok","connection"],"properties":{"ok":{"type":"boolean","isRequired":true,"uniqueKey":"ok","typeLabel":"boolean"},"connection":{"type":"object","description":"Unified connection-state envelope for a single agent instance. Shape is identical regardless of `deployment_mode`: hosted agents report `transport=callback`, connected agents report `transport=ws`. The dashboard renders the same card for either, switching only on the `transport` and `connection_status` fields.\nMaintained by the mesh write path (`/internal/agents/record_*`) against the `agent_instances` row. The gateway row is the single source of truth — clients should not cross-reference the mesh `/metrics` endpoint except for aggregate fleet-wide telemetry.\n","required":["instance_id","agent_type","tenant_id","deployment_mode","connection_status","dispatches_succeeded","dispatches_failed"],"properties":{"instance_id":{"type":"string","isRequired":true,"uniqueKey":"connection.instance_id","typeLabel":"string"},"agent_type":{"type":"string","isRequired":true,"uniqueKey":"connection.agent_type","typeLabel":"string"},"tenant_id":{"type":"string","isRequired":true,"uniqueKey":"connection.tenant_id","typeLabel":"string"},"deployment_mode":{"type":"string","enum":["hosted","connected"],"description":"Declared at registration; immutable for the instance lifetime.","isRequired":true,"uniqueKey":"connection.deployment_mode","typeLabel":"enum\u003cstring>"},"connection_status":{"type":"string","enum":["online","healthy","degraded","offline","unknown"],"description":"Current liveness, folded from the last reported event:\n\n - `online` — connected-mode agent with an open WS.\n - `healthy` — hosted-mode agent with a recent successful dispatch.\n - `degraded` — recent dispatch failures; agent may still respond.\n - `offline` — WS closed / hosted agent unreachable.\n - `unknown` — never reported a dispatch or handshake yet.\n","isRequired":true,"uniqueKey":"connection.connection_status","typeLabel":"enum\u003cstring>"},"dispatches_succeeded":{"type":"integer","format":"int64","description":"Lifetime counter of successful dispatches recorded by the mesh.","isRequired":true,"uniqueKey":"connection.dispatches_succeeded","typeLabel":"integer\u003cint64>"},"dispatches_failed":{"type":"integer","format":"int64","description":"Lifetime counter of failed dispatches recorded by the mesh.","isRequired":true,"uniqueKey":"connection.dispatches_failed","typeLabel":"integer\u003cint64>"},"transport":{"oneOf":[{"type":"string","enum":["ws","callback",null],"description":"The transport the mesh is currently using. `null` until the first dispatch attempt or WS handshake is recorded.\n","uniqueKey":"connection.transport.oneOf.0","typeLabel":"enum\u003cstring>"},{"type":"null","enum":["ws","callback",null],"description":"The transport the mesh is currently using. `null` until the first dispatch attempt or WS handshake is recorded.\n","uniqueKey":"connection.transport.oneOf.1","typeLabel":"null"}],"uniqueKey":"connection.transport","typeLabel":"enum\u003cstring> | null"},"owner_pod":{"oneOf":[{"type":"string","description":"Mesh pod that currently owns this agent's channel. Populated for connected-mode agents only; `null` for hosted agents (no ownership) and offline connected agents.\n","uniqueKey":"connection.owner_pod.oneOf.0","typeLabel":"string"},{"type":"null","description":"Mesh pod that currently owns this agent's channel. Populated for connected-mode agents only; `null` for hosted agents (no ownership) and offline connected agents.\n","uniqueKey":"connection.owner_pod.oneOf.1","typeLabel":"null"}],"uniqueKey":"connection.owner_pod","typeLabel":"string | null"},"connected_since":{"oneOf":[{"type":"string","format":"date-time","description":"Handshake timestamp for the current WS session (connected mode only).","uniqueKey":"connection.connected_since.oneOf.0","typeLabel":"string\u003cdate-time>"},{"type":"null","format":"date-time","description":"Handshake timestamp for the current WS session (connected mode only).","uniqueKey":"connection.connected_since.oneOf.1","typeLabel":"null"}],"uniqueKey":"connection.connected_since","typeLabel":"string\u003cdate-time> | null"},"last_dispatch_at":{"oneOf":[{"type":"string","format":"date-time","description":"Timestamp of the most recent dispatch attempt (success or failure).","uniqueKey":"connection.last_dispatch_at.oneOf.0","typeLabel":"string\u003cdate-time>"},{"type":"null","format":"date-time","description":"Timestamp of the most recent dispatch attempt (success or failure).","uniqueKey":"connection.last_dispatch_at.oneOf.1","typeLabel":"null"}],"uniqueKey":"connection.last_dispatch_at","typeLabel":"string\u003cdate-time> | null"},"last_dispatch_error":{"oneOf":[{"type":"object","description":"Last failure observed by the mesh when dispatching to this instance.\nPopulated from the `AgentChannel` snapshot regardless of transport: both `CallbackChannel` (hosted) and `WsChannel` (connected) record into the same shape, so dashboards can render a single view. `null` when the instance has never failed a dispatch since registration.\n","properties":{"code":{"type":"integer","description":"Stable numeric status code from the channel's `ChannelError` taxonomy. Maps 1:1 to the HTTP status the hosted transport would return (e.g. 408 timeout, 429 rate-limited, 500 internal, 502 agent unhealthy, 503 disconnected).\n","uniqueKey":"connection.last_dispatch_error.oneOf.0.code","typeLabel":"integer"},"body":{"type":"string","description":"Human-readable error message as reported by the agent or channel.","uniqueKey":"connection.last_dispatch_error.oneOf.0.body","typeLabel":"string"},"dispatch_id":{"oneOf":[{"type":"string","description":"Correlation id of the failing dispatch, if one was assigned.","uniqueKey":"connection.last_dispatch_error.oneOf.0.dispatch_id.oneOf.0","typeLabel":"string"},{"type":"null","description":"Correlation id of the failing dispatch, if one was assigned.","uniqueKey":"connection.last_dispatch_error.oneOf.0.dispatch_id.oneOf.1","typeLabel":"null"}],"uniqueKey":"connection.last_dispatch_error.oneOf.0.dispatch_id","typeLabel":"string | null"},"at":{"type":"string","format":"date-time","description":"Timestamp the error was recorded by the mesh.","uniqueKey":"connection.last_dispatch_error.oneOf.0.at","typeLabel":"string\u003cdate-time>"}},"uniqueKey":"connection.last_dispatch_error.oneOf.0","typeLabel":"object"},{"type":"null","description":"Last failure observed by the mesh when dispatching to this instance.\nPopulated from the `AgentChannel` snapshot regardless of transport: both `CallbackChannel` (hosted) and `WsChannel` (connected) record into the same shape, so dashboards can render a single view. `null` when the instance has never failed a dispatch since registration.\n","properties":{"code":{"type":"integer","description":"Stable numeric status code from the channel's `ChannelError` taxonomy. Maps 1:1 to the HTTP status the hosted transport would return (e.g. 408 timeout, 429 rate-limited, 500 internal, 502 agent unhealthy, 503 disconnected).\n"},"body":{"type":"string","description":"Human-readable error message as reported by the agent or channel."},"dispatch_id":{"oneOf":[{"type":"string","description":"Correlation id of the failing dispatch, if one was assigned."},{"type":"null","description":"Correlation id of the failing dispatch, if one was assigned."}]},"at":{"type":"string","format":"date-time","description":"Timestamp the error was recorded by the mesh."}},"uniqueKey":"connection.last_dispatch_error.oneOf.1","typeLabel":"null"}],"uniqueKey":"connection.last_dispatch_error","typeLabel":"object | null"},"status":{"type":"string","enum":["available","busy","draining","offline","unhealthy","unknown"],"description":"Back-compat field from the pre-4.3 heartbeat model. Prefer `connection_status` for new clients; this is retained so legacy dashboards keep rendering.\n","uniqueKey":"connection.status","typeLabel":"enum\u003cstring>"},"last_seen":{"oneOf":[{"type":"string","format":"date-time","description":"Back-compat heartbeat timestamp. Prefer `last_dispatch_at`.","uniqueKey":"connection.last_seen.oneOf.0","typeLabel":"string\u003cdate-time>"},{"type":"null","format":"date-time","description":"Back-compat heartbeat timestamp. Prefer `last_dispatch_at`.","uniqueKey":"connection.last_seen.oneOf.1","typeLabel":"null"}],"uniqueKey":"connection.last_seen","typeLabel":"string\u003cdate-time> | null"},"ws_mesh_pod_id":{"oneOf":[{"type":"string","description":"Back-compat alias for `owner_pod` (connected mode only).","uniqueKey":"connection.ws_mesh_pod_id.oneOf.0","typeLabel":"string"},{"type":"null","description":"Back-compat alias for `owner_pod` (connected mode only).","uniqueKey":"connection.ws_mesh_pod_id.oneOf.1","typeLabel":"null"}],"uniqueKey":"connection.ws_mesh_pod_id","typeLabel":"string | null"},"ws_last_seen":{"oneOf":[{"type":"string","format":"date-time","description":"Back-compat alias for most recent WS activity.","uniqueKey":"connection.ws_last_seen.oneOf.0","typeLabel":"string\u003cdate-time>"},{"type":"null","format":"date-time","description":"Back-compat alias for most recent WS activity.","uniqueKey":"connection.ws_last_seen.oneOf.1","typeLabel":"null"}],"uniqueKey":"connection.ws_last_seen","typeLabel":"string\u003cdate-time> | null"}},"isRequired":true,"uniqueKey":"connection","typeLabel":"object"}},"uniqueKey":"","typeLabel":"object"},"examples":{"hosted":{"title":"hosted","value":{"ok":true,"connection":{"instance_id":"inst-orchestrator-7f3d","agent_type":"orchestrator","tenant_id":"tenant-acme","deployment_mode":"hosted","transport":"callback","connection_status":"healthy","owner_pod":null,"connected_since":null,"last_dispatch_at":"2026-04-17T12:00:05.000Z","dispatches_succeeded":142,"dispatches_failed":3,"last_dispatch_error":null,"status":"available","last_seen":"2026-04-17T12:00:05.000Z","ws_mesh_pod_id":null,"ws_last_seen":null}}},"connected":{"title":"connected","value":{"ok":true,"connection":{"instance_id":"inst-worker-9a2b","agent_type":"worker","tenant_id":"tenant-acme","deployment_mode":"connected","transport":"ws","connection_status":"online","owner_pod":"mesh-pod-a","connected_since":"2026-04-17T11:58:30.000Z","last_dispatch_at":"2026-04-17T12:00:10.000Z","dispatches_succeeded":27,"dispatches_failed":0,"last_dispatch_error":null,"status":"available","last_seen":"2026-04-17T12:00:10.000Z","ws_mesh_pod_id":"mesh-pod-a","ws_last_seen":"2026-04-17T12:00:10.000Z"}}}},"exampleType":"examples"}},"exampleType":"examples"},"a8f6f5f8-d40f-42c2-bd6c-edf98525841c":{"description":"Malformed JSON, failed request validation, or missing required fields in the body (gateway returns before the handler runs in some cases).\n","content":{"application/json":{"schema":{"type":"object","required":["error"],"properties":{"error":{"type":"string","description":"Human-readable error message.","isRequired":true,"uniqueKey":"error","typeLabel":"string"},"code":{"type":"string","description":"Machine-readable error code, when available.","uniqueKey":"code","typeLabel":"string"},"request_id":{"type":"string","description":"Correlation id for support — present on some gateway catch-all responses (e.g. unmatched route, unhandled error).\n","uniqueKey":"request_id","typeLabel":"string"},"timestamp":{"type":"string","format":"date-time","description":"ISO 8601 time when the error was produced, when returned by the gateway.","uniqueKey":"timestamp","typeLabel":"string\u003cdate-time>"}},"uniqueKey":"","typeLabel":"object"},"examples":{"sample":{"title":"sample","value":{"error":"Invalid request body","code":"BAD_REQUEST"}}},"exampleType":"examples"}},"exampleType":"examples"},"0a19cf43-43e9-499d-a46f-89dcdb7b3c79":{"description":"Authentication failed — missing or invalid credentials.","content":{"application/json":{"schema":{"type":"object","required":["error"],"properties":{"error":{"type":"string","description":"Human-readable error message.","isRequired":true,"uniqueKey":"error","typeLabel":"string"},"code":{"type":"string","description":"Machine-readable error code, when available.","uniqueKey":"code","typeLabel":"string"},"request_id":{"type":"string","description":"Correlation id for support — present on some gateway catch-all responses (e.g. unmatched route, unhandled error).\n","uniqueKey":"request_id","typeLabel":"string"},"timestamp":{"type":"string","format":"date-time","description":"ISO 8601 time when the error was produced, when returned by the gateway.","uniqueKey":"timestamp","typeLabel":"string\u003cdate-time>"}},"uniqueKey":"","typeLabel":"object"},"examples":{"sample":{"title":"sample","value":{"error":"Invalid or expired token","code":"unauthorized"}}},"exampleType":"examples"}},"exampleType":"examples"},"72c1ab9e-402d-4574-91ae-72eb79661750":{"description":"Insufficient scope — JWT does not carry the required scope for this operation.","content":{"application/json":{"schema":{"type":"object","required":["error"],"properties":{"error":{"type":"string","description":"Human-readable error message.","isRequired":true,"uniqueKey":"error","typeLabel":"string"},"code":{"type":"string","description":"Machine-readable error code, when available.","uniqueKey":"code","typeLabel":"string"},"request_id":{"type":"string","description":"Correlation id for support — present on some gateway catch-all responses (e.g. unmatched route, unhandled error).\n","uniqueKey":"request_id","typeLabel":"string"},"timestamp":{"type":"string","format":"date-time","description":"ISO 8601 time when the error was produced, when returned by the gateway.","uniqueKey":"timestamp","typeLabel":"string\u003cdate-time>"}},"uniqueKey":"","typeLabel":"object"},"examples":{"sample":{"title":"sample","value":{"error":"JWT does not include the required scope for this operation","code":"forbidden"}}},"exampleType":"examples"}},"exampleType":"examples"},"52d1928a-3cbe-4d5c-ba9e-e419fa62c7b1":{"description":"Agent instance not found.","content":{"application/json":{"schema":{"type":"object","required":["error"],"properties":{"error":{"type":"string","description":"Human-readable error message.","isRequired":true,"uniqueKey":"error","typeLabel":"string"},"code":{"type":"string","description":"Machine-readable error code, when available.","uniqueKey":"code","typeLabel":"string"},"request_id":{"type":"string","description":"Correlation id for support — present on some gateway catch-all responses (e.g. unmatched route, unhandled error).\n","uniqueKey":"request_id","typeLabel":"string"},"timestamp":{"type":"string","format":"date-time","description":"ISO 8601 time when the error was produced, when returned by the gateway.","uniqueKey":"timestamp","typeLabel":"string\u003cdate-time>"}},"uniqueKey":"","typeLabel":"object"},"examples":{"Example":{"title":"Example","value":{"error":"\u003cstring>","code":"\u003cstring>","request_id":"\u003cstring>","timestamp":"2023-11-07T05:31:56Z"}}},"exampleType":"generated"}},"exampleType":"generated"},"be312686-6214-433c-965c-ed6699548683":{"description":"Unhandled exception in the gateway — `INTERNAL_ERROR` with optional `request_id` and `timestamp` for correlation.\n","content":{"application/json":{"schema":{"type":"object","required":["error"],"properties":{"error":{"type":"string","description":"Human-readable error message.","isRequired":true,"uniqueKey":"error","typeLabel":"string"},"code":{"type":"string","description":"Machine-readable error code, when available.","uniqueKey":"code","typeLabel":"string"},"request_id":{"type":"string","description":"Correlation id for support — present on some gateway catch-all responses (e.g. unmatched route, unhandled error).\n","uniqueKey":"request_id","typeLabel":"string"},"timestamp":{"type":"string","format":"date-time","description":"ISO 8601 time when the error was produced, when returned by the gateway.","uniqueKey":"timestamp","typeLabel":"string\u003cdate-time>"}},"uniqueKey":"","typeLabel":"object"},"examples":{"sample":{"title":"sample","value":{"error":"Internal server error","code":"INTERNAL_ERROR","request_id":"req_01EXAMPLE","timestamp":"2026-03-31T12:00:00.000Z"}}},"exampleType":"examples"}},"exampleType":"examples"},"513902b5-ed19-4583-9c67-3babaed5272f":{"description":"Gateway received an invalid or failed response from an upstream dependency (MCP Servers, Mesh, Gateway, etc.), or could not complete a proxied request.\n","content":{"application/json":{"schema":{"type":"object","required":["error"],"properties":{"error":{"type":"string","description":"Human-readable error message.","isRequired":true,"uniqueKey":"error","typeLabel":"string"},"code":{"type":"string","description":"Machine-readable error code, when available.","uniqueKey":"code","typeLabel":"string"},"request_id":{"type":"string","description":"Correlation id for support — present on some gateway catch-all responses (e.g. unmatched route, unhandled error).\n","uniqueKey":"request_id","typeLabel":"string"},"timestamp":{"type":"string","format":"date-time","description":"ISO 8601 time when the error was produced, when returned by the gateway.","uniqueKey":"timestamp","typeLabel":"string\u003cdate-time>"}},"uniqueKey":"","typeLabel":"object"},"examples":{"sample":{"title":"sample","value":{"error":"Bad gateway","code":"BAD_GATEWAY"}}},"exampleType":"examples"}},"exampleType":"examples"},"a50f0996-37be-42de-b669-33990f33e49b":{"description":"Temporary failure — e.g. JWT signing not configured (`MESH_SECRET` missing on token route), mesh or upstream unreachable, or dependency unavailable.\n","content":{"application/json":{"schema":{"type":"object","required":["error"],"properties":{"error":{"type":"string","description":"Human-readable error message.","isRequired":true,"uniqueKey":"error","typeLabel":"string"},"code":{"type":"string","description":"Machine-readable error code, when available.","uniqueKey":"code","typeLabel":"string"},"request_id":{"type":"string","description":"Correlation id for support — present on some gateway catch-all responses (e.g. unmatched route, unhandled error).\n","uniqueKey":"request_id","typeLabel":"string"},"timestamp":{"type":"string","format":"date-time","description":"ISO 8601 time when the error was produced, when returned by the gateway.","uniqueKey":"timestamp","typeLabel":"string\u003cdate-time>"}},"uniqueKey":"","typeLabel":"object"},"examples":{"sample":{"title":"sample","value":{"error":"Service temporarily unavailable","code":"SERVICE_UNAVAILABLE"}}},"exampleType":"examples"}},"exampleType":"examples"}},"security":{"cecde30b-8822-4598-9468-5ad0203a2961":{"bearerAuth":{"$ref":"d88ee237-81d8-4cdd-a44b-4a75927b9d73","scopes":[]}}},"servers":{"23c8e2ad-07ab-4135-be8c-1e87165fd5ec":{"url":"https://api.svantic.com","description":"Production"},"50d8a590-0451-4c5b-9ac8-40df9dd6b53e":{"url":"https://mesh.svantic.com","description":"Mesh runtime"}}},"originalFileLocation":"api-reference/openapi-bundled.yaml"},"subdomain":"svantic","siteName":"Svantic","title":"Get agent connection state - Svantic","navMaps":{"firstHrefInVersion":{},"firstHrefInLanguage":{}},"lastModified":"2026-04-27T14:39:56.725Z","originalFileLocation":"api-reference/agents/get-agent-connection-state.mdx"},"headHtml":"\u003cscript data-mint-head>(function(){var d=document.documentElement,p=\"light\";if(!p){try{p=localStorage.getItem(\"isDarkMode\")}catch(e){}if(p==='true')p='dark';else if(p==='false')p='light';if(p!=='light'\u0026\u0026p!=='dark'\u0026\u0026p!=='system')p=\"light\"}var r=p==='system'?(matchMedia(\"(prefers-color-scheme: dark)\").matches?'dark':'light'):p;d.classList.remove(r==='dark'?'light':'dark');d.classList.add(r);d.setAttribute(\"data-theme-preference\",p)})();\u003c/script>\u003cmeta data-mint-head name=\"description\" content=\"Returns unified live connection state for a single agent instance. The response shape is identical for hosted (HTTP callback) and connected (WebSocket) deployments; switch on the transport and connection_status fields to render. Data is sourced from the gateway\u0026#x27;s agent_instances row, which the mesh keeps up to date via the internal /internal/agents/record_* write path on every dispatch and WS lifecycle event. That row is the single source of truth — there is no need to cross-reference the mesh /metrics endpoint except for aggregate fleet telemetry. Non-super callers can only query instances in their own tenant; super-admins may pass tenant_id in the body to narrow the lookup, or omit it for a global search by instance_id.\">\u003cmeta data-mint-head name=\"application-name\" content=\"Svantic\">\u003cmeta data-mint-head name=\"generator\" content=\"Mintlify\">\u003clink data-mint-head rel=\"icon\" type=\"image/png\" sizes=\"192x192\" href=\"/mintlify-assets/_mintlify/favicons/svantic/RPjRh-i-AWgBqfl_/_generated/favicon/android-chrome-192x192.png\" media=\"(prefers-color-scheme: light)\">\u003clink data-mint-head rel=\"apple-touch-icon\" type=\"image/png\" sizes=\"180x180\" href=\"/mintlify-assets/_mintlify/favicons/svantic/RPjRh-i-AWgBqfl_/_generated/favicon/apple-touch-icon.png\">\u003clink data-mint-head rel=\"icon\" type=\"image/png\" sizes=\"16x16\" href=\"/mintlify-assets/_mintlify/favicons/svantic/RPjRh-i-AWgBqfl_/_generated/favicon/favicon-16x16.png\" media=\"(prefers-color-scheme: light)\">\u003clink data-mint-head rel=\"icon\" type=\"image/png\" sizes=\"32x32\" href=\"/mintlify-assets/_mintlify/favicons/svantic/RPjRh-i-AWgBqfl_/_generated/favicon/favicon-32x32.png\" media=\"(prefers-color-scheme: light)\">\u003clink data-mint-head rel=\"shortcut icon\" type=\"image/x-icon\" href=\"/mintlify-assets/_mintlify/favicons/svantic/RPjRh-i-AWgBqfl_/_generated/favicon/favicon.ico\" media=\"(prefers-color-scheme: light)\">\u003clink data-mint-head rel=\"icon\" type=\"image/png\" sizes=\"192x192\" href=\"/mintlify-assets/_mintlify/favicons/svantic/RPjRh-i-AWgBqfl_/_generated/favicon-dark/android-chrome-192x192.png\" media=\"(prefers-color-scheme: dark)\">\u003clink data-mint-head rel=\"icon\" type=\"image/png\" sizes=\"16x16\" href=\"/mintlify-assets/_mintlify/favicons/svantic/RPjRh-i-AWgBqfl_/_generated/favicon-dark/favicon-16x16.png\" media=\"(prefers-color-scheme: dark)\">\u003clink data-mint-head rel=\"icon\" type=\"image/png\" sizes=\"32x32\" href=\"/mintlify-assets/_mintlify/favicons/svantic/RPjRh-i-AWgBqfl_/_generated/favicon-dark/favicon-32x32.png\" media=\"(prefers-color-scheme: dark)\">\u003clink data-mint-head rel=\"shortcut icon\" type=\"image/x-icon\" href=\"/mintlify-assets/_mintlify/favicons/svantic/RPjRh-i-AWgBqfl_/_generated/favicon-dark/favicon.ico\" media=\"(prefers-color-scheme: dark)\">\u003cmeta data-mint-head property=\"og:title\" content=\"Get agent connection state - Svantic\">\u003cmeta data-mint-head property=\"og:description\" content=\"Returns unified live connection state for a single agent instance. The response shape is identical for hosted (HTTP callback) and connected (WebSocket) deployments; switch on the transport and connection_status fields to render. Data is sourced from the gateway\u0026#x27;s agent_instances row, which the mesh keeps up to date via the internal /internal/agents/record_* write path on every dispatch and WS lifecycle event. That row is the single source of truth — there is no need to cross-reference the mesh /metrics endpoint except for aggregate fleet telemetry. Non-super callers can only query instances in their own tenant; super-admins may pass tenant_id in the body to narrow the lookup, or omit it for a global search by instance_id.\">\u003cmeta data-mint-head property=\"og:site_name\" content=\"Svantic\">\u003cmeta data-mint-head property=\"og:url\" content=\"https://docs.svantic.com/api-reference/agents/get-agent-connection-state\">\u003cmeta data-mint-head property=\"og:type\" content=\"website\">\u003cmeta data-mint-head property=\"og:image\" content=\"https://svantic.mintlify.app/_mintlify/api/og/v2?division=Agents\u0026amp;title=Get+agent+connection+state\u0026amp;description=Returns+unified+live+connection+state+for+a+single+agent+instance.%0AThe+response+shape+is+identical+for+hosted+%28HTTP+callback%29+and%0Aconnected+%28WebSocket%29+deployme\u0026amp;theme=2470158210da7f4215f78abb\u0026amp;signature=9dbb979f151e8762ac6e6218491e3d9bb062ae8855bd7adb6c106df1a0f9b5eb\">\u003cmeta data-mint-head property=\"og:image:width\" content=\"1200\">\u003cmeta data-mint-head property=\"og:image:height\" content=\"630\">\u003cmeta data-mint-head name=\"twitter:card\" content=\"summary_large_image\">\u003cmeta data-mint-head name=\"twitter:title\" content=\"Get agent connection state - Svantic\">\u003cmeta data-mint-head name=\"twitter:description\" content=\"Returns unified live connection state for a single agent instance. The response shape is identical for hosted (HTTP callback) and connected (WebSocket) deployments; switch on the transport and connection_status fields to render. Data is sourced from the gateway\u0026#x27;s agent_instances row, which the mesh keeps up to date via the internal /internal/agents/record_* write path on every dispatch and WS lifecycle event. That row is the single source of truth — there is no need to cross-reference the mesh /metrics endpoint except for aggregate fleet telemetry. Non-super callers can only query instances in their own tenant; super-admins may pass tenant_id in the body to narrow the lookup, or omit it for a global search by instance_id.\">\u003cmeta data-mint-head name=\"twitter:image\" content=\"https://svantic.mintlify.app/_mintlify/api/og/v2?division=Agents\u0026amp;title=Get+agent+connection+state\u0026amp;description=Returns+unified+live+connection+state+for+a+single+agent+instance.%0AThe+response+shape+is+identical+for+hosted+%28HTTP+callback%29+and%0Aconnected+%28WebSocket%29+deployme\u0026amp;theme=2470158210da7f4215f78abb\u0026amp;signature=9dbb979f151e8762ac6e6218491e3d9bb062ae8855bd7adb6c106df1a0f9b5eb\">\u003cmeta data-mint-head name=\"twitter:image:width\" content=\"1200\">\u003cmeta data-mint-head name=\"twitter:image:height\" content=\"630\">\u003cmeta data-mint-head name=\"msapplication-config\" content=\"/mintlify-assets/_mintlify/favicons/svantic/RPjRh-i-AWgBqfl_/_generated/favicon/browserconfig.xml\">\u003cmeta data-mint-head name=\"apple-mobile-web-app-title\" content=\"Svantic\">\u003cmeta data-mint-head name=\"msapplication-TileColor\" content=\"#7C3AED\">\u003clink data-mint-head rel=\"canonical\" href=\"https://docs.svantic.com/api-reference/agents/get-agent-connection-state\">\u003clink data-mint-head rel=\"alternate\" type=\"application/xml\" href=\"/sitemap.xml\">\u003clink data-mint-head rel=\"alternate\" type=\"text/markdown\" href=\"/api-reference/agents/get-agent-connection-state.md\">\u003cscript data-mint-head type=\"application/ld+json\">{\"@context\":\"https://schema.org\",\"@graph\":[{\"@type\":\"Organization\",\"@id\":\"https://docs.svantic.com/#organization\",\"name\":\"Svantic\",\"url\":\"https://docs.svantic.com\",\"logo\":{\"@type\":\"ImageObject\",\"url\":\"https://mintcdn.com/svantic/DQEVJ_RnVW5_l6gu/images/logo_large.png?fit=max\u0026auto=format\u0026n=DQEVJ_RnVW5_l6gu\u0026q=85\u0026s=c23d1b1fd831f2dc24e9b758c0e4f930\"}},{\"@type\":\"WebSite\",\"@id\":\"https://docs.svantic.com#website\",\"name\":\"Svantic\",\"url\":\"https://docs.svantic.com\",\"publisher\":{\"@id\":\"https://docs.svantic.com/#organization\"}},{\"@type\":\"WebPage\",\"@id\":\"https://docs.svantic.com/api-reference/agents/get-agent-connection-state#webpage\",\"url\":\"https://docs.svantic.com/api-reference/agents/get-agent-connection-state\",\"name\":\"Get agent connection state\",\"description\":\"Returns unified live connection state for a single agent instance. The response shape is identical for hosted (HTTP callback) and connected (WebSocket) deployments; switch on the transport and connection_status fields to render. Data is sourced from the gateway's agent_instances row, which the mesh keeps up to date via the internal /internal/agents/record_* write path on every dispatch and WS lifecycle event. That row is the single source of truth — there is no need to cross-reference the mesh /metrics endpoint except for aggregate fleet telemetry. Non-super callers can only query instances in their own tenant; super-admins may pass tenant_id in the body to narrow the lookup, or omit it for a global search by instance_id.\",\"dateModified\":\"2026-04-27T14:39:56.725Z\",\"isPartOf\":{\"@id\":\"https://docs.svantic.com#website\"},\"breadcrumb\":{\"@id\":\"https://docs.svantic.com/api-reference/agents/get-agent-connection-state#breadcrumb\"}},{\"@type\":\"BreadcrumbList\",\"@id\":\"https://docs.svantic.com/api-reference/agents/get-agent-connection-state#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"REST API\",\"item\":\"https://docs.svantic.com/api-reference/credentials-\u0026-access/get-token\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"Agents\",\"item\":\"https://docs.svantic.com/api-reference/agents/register-agent\"},{\"@type\":\"ListItem\",\"position\":3,\"name\":\"Get agent connection state\",\"item\":\"https://docs.svantic.com/api-reference/agents/get-agent-connection-state\"}]},{\"@type\":[\"TechArticle\",\"APIReference\"],\"@id\":\"https://docs.svantic.com/api-reference/agents/get-agent-connection-state#apireference\",\"headline\":\"Get agent connection state\",\"name\":\"Get agent connection state\",\"description\":\"Returns unified live connection state for a single agent instance. The response shape is identical for hosted (HTTP callback) and connected (WebSocket) deployments; switch on the transport and connection_status fields to render. Data is sourced from the gateway's agent_instances row, which the mesh keeps up to date via the internal /internal/agents/record_* write path on every dispatch and WS lifecycle event. That row is the single source of truth — there is no need to cross-reference the mesh /metrics endpoint except for aggregate fleet telemetry. Non-super callers can only query instances in their own tenant; super-admins may pass tenant_id in the body to narrow the lookup, or omit it for a global search by instance_id.\",\"url\":\"https://docs.svantic.com/api-reference/agents/get-agent-connection-state\",\"mainEntityOfPage\":{\"@id\":\"https://docs.svantic.com/api-reference/agents/get-agent-connection-state#webpage\"},\"dateModified\":\"2026-04-27T14:39:56.725Z\",\"publisher\":{\"@id\":\"https://docs.svantic.com/#organization\"},\"isPartOf\":{\"@id\":\"https://docs.svantic.com#website\"}}]}\u003c/script>\u003cscript data-mint-head type=\"application/ld+json\">{\"@context\":\"https://schema.org\",\"@type\":\"WebSite\",\"name\":\"Svantic\",\"creator\":{\"@type\":\"Organization\",\"name\":\"Mintlify\",\"url\":\"https://mintlify.com\"}}\u003c/script>","siteName":"Svantic","nav":{"global":null,"tabs":[{"tab":"Documentation","pages":[{"title":"Documentation","href":"/what-is-svantic"}]},{"tab":"SDK","pages":[{"title":"SDK","href":"/sdk"}]},{"tab":"CLI","pages":[{"title":"CLI","href":"/cli-reference"}]},{"tab":"API Reference","groups":[{"group":"REST API","pages":[{"group":"Credentials \u0026 Access","pages":[{"title":"Get Token","deprecated":null,"version":null,"openapi":"/api-reference/openapi-bundled.yaml post /auth/get_token","href":"/api-reference/credentials-\u0026-access/get-token"}]},{"group":"Agents","pages":[{"title":"Register Agent","deprecated":null,"version":null,"openapi":"/api-reference/openapi-bundled.yaml post /agents/register","href":"/api-reference/agents/register-agent"},{"title":"Deregister Agent","deprecated":null,"version":null,"openapi":"/api-reference/openapi-bundled.yaml post /agents/deregister","href":"/api-reference/agents/deregister-agent"},{"title":"Agent heartbeat","deprecated":null,"version":null,"openapi":"/api-reference/openapi-bundled.yaml post /agents/heartbeat","href":"/api-reference/agents/agent-heartbeat"},{"title":"List agent instances","deprecated":null,"version":null,"openapi":"/api-reference/openapi-bundled.yaml post /agents/get","href":"/api-reference/agents/list-agent-instances"},{"title":"Get agent instance detail","description":"Returns full detail for a single agent instance identified by instance_id. \n","deprecated":null,"version":null,"openapi":"/api-reference/openapi-bundled.yaml post /agents/get_by_id","href":"/api-reference/agents/get-agent-instance-detail"},{"title":"Get agent connection state","deprecated":null,"version":null,"openapi":"/api-reference/openapi-bundled.yaml post /agents/get_connection","href":"/api-reference/agents/get-agent-connection-state"},{"title":"Aggregate agent connection counters","description":"Returns tenant-scoped aggregates of connection state for the\nAgents dashboard summary cards. The response groups the\n`agent_instances` rows by `deployment_mode`, `connection_status`,\nand `transport`.\n\nThe underlying query hits the\n`(tenant_id, connection_status)` index added in migration 074,\nso response time is independent of fleet size for a single\ntenant.\n\nScope rules:\n - Non-super callers: always scoped to the caller's tenant;\n `body.tenant_id` is silently ignored.\n - Super-admins: pass `tenant_id` to scope to a single tenant,\n or omit it to aggregate globally across all tenants.\n - `agent_type` (optional, both roles) narrows to a single fleet.\n","deprecated":null,"version":null,"openapi":"/api-reference/openapi-bundled.yaml post /agents/get_connection_stats","href":"/api-reference/agents/aggregate-agent-connection-counters"},{"title":"Allow Agent Type","deprecated":null,"version":null,"openapi":"/api-reference/openapi-bundled.yaml post /agents/allow_type","href":"/api-reference/agents/allow-agent-type"},{"title":"Disallow Agent Type","deprecated":null,"version":null,"openapi":"/api-reference/openapi-bundled.yaml post /agents/disallow_type","href":"/api-reference/agents/disallow-agent-type"},{"title":"Agent card discovery","deprecated":null,"version":null,"openapi":"/api-reference/openapi-bundled.yaml get /.well-known/agent-card.json","href":"/api-reference/agents/agent-card-discovery"}]},{"group":"Messages","pages":[{"title":"Send a message (A2A JSON-RPC)","deprecated":null,"version":null,"openapi":"/api-reference/openapi-bundled.yaml post /send","href":"/api-reference/messages/send-a-message-a2a-json-rpc"},{"title":"List pending messages (Approval Queue)","deprecated":null,"version":null,"openapi":"/api-reference/openapi-bundled.yaml post /messages/pending","href":"/api-reference/messages/list-pending-messages-approval-queue"},{"title":"Resolve a pending message","deprecated":null,"version":null,"openapi":"/api-reference/openapi-bundled.yaml post /messages/{message_id}/resolve","href":"/api-reference/messages/resolve-a-pending-message"},{"title":"List messages for a tenant","deprecated":null,"version":null,"openapi":"/api-reference/openapi-bundled.yaml post /messages/get","href":"/api-reference/messages/list-messages-for-a-tenant"},{"title":"Get a single message by ID","deprecated":null,"version":null,"openapi":"/api-reference/openapi-bundled.yaml post /messages/get_by_id","href":"/api-reference/messages/get-a-single-message-by-id"},{"title":"Cancel a running message","deprecated":null,"version":null,"openapi":"/api-reference/openapi-bundled.yaml post /messages/cancel","href":"/api-reference/messages/cancel-a-running-message"}]},{"group":"Sessions","pages":[{"title":"Interrupt in-flight streams","deprecated":null,"version":null,"openapi":"/api-reference/openapi-bundled.yaml post /sessions/interrupt","href":"/api-reference/sessions/interrupt-in-flight-streams"},{"title":"Create a new session","deprecated":null,"version":null,"openapi":"/api-reference/openapi-bundled.yaml post /sessions/init","href":"/api-reference/sessions/create-a-new-session"},{"title":"Close a session","deprecated":null,"version":null,"openapi":"/api-reference/openapi-bundled.yaml post /sessions/close","href":"/api-reference/sessions/close-a-session"},{"title":"List sessions","deprecated":null,"version":null,"openapi":"/api-reference/openapi-bundled.yaml post /sessions/get","href":"/api-reference/sessions/list-sessions"},{"title":"Get session detail","deprecated":null,"version":null,"openapi":"/api-reference/openapi-bundled.yaml post /sessions/get_by_id","href":"/api-reference/sessions/get-session-detail"}]},{"group":"Knowledge Base","pages":[{"title":"List knowledge bases","deprecated":null,"version":null,"openapi":"/api-reference/openapi-bundled.yaml post /knowledge_base/get","href":"/api-reference/knowledge-base/list-knowledge-bases"},{"title":"Get a single knowledge base","deprecated":null,"version":null,"openapi":"/api-reference/openapi-bundled.yaml post /knowledge_base/get_by_id","href":"/api-reference/knowledge-base/get-a-single-knowledge-base"},{"title":"Create a knowledge base","deprecated":null,"version":null,"openapi":"/api-reference/openapi-bundled.yaml post /knowledge_base/new","href":"/api-reference/knowledge-base/create-a-knowledge-base"},{"title":"Update a knowledge base","deprecated":null,"version":null,"openapi":"/api-reference/openapi-bundled.yaml post /knowledge_base/update","href":"/api-reference/knowledge-base/update-a-knowledge-base"},{"title":"Delete a knowledge base","deprecated":null,"version":null,"openapi":"/api-reference/openapi-bundled.yaml post /knowledge_base/delete","href":"/api-reference/knowledge-base/delete-a-knowledge-base"},{"title":"Ingest a document","deprecated":null,"version":null,"openapi":"/api-reference/openapi-bundled.yaml post /knowledge_base/ingest","href":"/api-reference/knowledge-base/ingest-a-document"},{"title":"Semantic search","deprecated":null,"version":null,"openapi":"/api-reference/openapi-bundled.yaml post /knowledge_base/query","href":"/api-reference/knowledge-base/semantic-search"},{"title":"List ingested sources","deprecated":null,"version":null,"openapi":"/api-reference/openapi-bundled.yaml post /knowledge_base/get_sources","href":"/api-reference/knowledge-base/list-ingested-sources"},{"title":"Delete a source","deprecated":null,"version":null,"openapi":"/api-reference/openapi-bundled.yaml post /knowledge_base/delete_source","href":"/api-reference/knowledge-base/delete-a-source"},{"title":"Regenerate embeddings","deprecated":null,"version":null,"openapi":"/api-reference/openapi-bundled.yaml post /knowledge_base/refresh","href":"/api-reference/knowledge-base/regenerate-embeddings"},{"title":"Knowledge base statistics","deprecated":null,"version":null,"openapi":"/api-reference/openapi-bundled.yaml post /knowledge_base/get_stats","href":"/api-reference/knowledge-base/knowledge-base-statistics"},{"title":"Processing job status","deprecated":null,"version":null,"openapi":"/api-reference/openapi-bundled.yaml post /knowledge_base/get_status","href":"/api-reference/knowledge-base/processing-job-status"}]},{"group":"Policies","pages":[{"title":"List policies","deprecated":null,"version":null,"openapi":"/api-reference/openapi-bundled.yaml post /policies/get_policies","href":"/api-reference/policies/list-policies"},{"title":"Get a single policy","deprecated":null,"version":null,"openapi":"/api-reference/openapi-bundled.yaml post /policies/get_policy_by_id","href":"/api-reference/policies/get-a-single-policy"},{"title":"Create a policy","deprecated":null,"version":null,"openapi":"/api-reference/openapi-bundled.yaml post /policies/create_policy","href":"/api-reference/policies/create-a-policy"},{"title":"Update a policy","deprecated":null,"version":null,"openapi":"/api-reference/openapi-bundled.yaml post /policies/update_policy","href":"/api-reference/policies/update-a-policy"},{"title":"Delete a policy","deprecated":null,"version":null,"openapi":"/api-reference/openapi-bundled.yaml post /policies/delete_policy","href":"/api-reference/policies/delete-a-policy"},{"title":"List alert rules","deprecated":null,"version":null,"openapi":"/api-reference/openapi-bundled.yaml post /policies/get_alerts","href":"/api-reference/policies/list-alert-rules"},{"title":"Create alert rule","deprecated":null,"version":null,"openapi":"/api-reference/openapi-bundled.yaml post /policies/new_alert","href":"/api-reference/policies/create-alert-rule"},{"title":"Update alert rule","deprecated":null,"version":null,"openapi":"/api-reference/openapi-bundled.yaml post /policies/update_alert","href":"/api-reference/policies/update-alert-rule"},{"title":"Delete alert rule","deprecated":null,"version":null,"openapi":"/api-reference/openapi-bundled.yaml post /policies/delete_alert","href":"/api-reference/policies/delete-alert-rule"},{"title":"Test alert rule notifications","deprecated":null,"version":null,"openapi":"/api-reference/openapi-bundled.yaml post /policies/test_alert","href":"/api-reference/policies/test-alert-rule-notifications"}]},{"group":"Telemetry","pages":[{"title":"List or get traces","deprecated":null,"version":null,"openapi":"/api-reference/openapi-bundled.yaml post /telemetry/get_traces","href":"/api-reference/telemetry/list-or-get-traces"},{"title":"Usage statistics","deprecated":null,"version":null,"openapi":"/api-reference/openapi-bundled.yaml post /telemetry/get_usage","href":"/api-reference/telemetry/usage-statistics"},{"title":"List events","deprecated":null,"version":null,"openapi":"/api-reference/openapi-bundled.yaml post /telemetry/get_events","href":"/api-reference/telemetry/list-events"},{"title":"Stream events (SSE)","deprecated":null,"version":null,"openapi":"/api-reference/openapi-bundled.yaml get /telemetry/stream_events","href":"/api-reference/telemetry/stream-events-sse"},{"title":"Event statistics","deprecated":null,"version":null,"openapi":"/api-reference/openapi-bundled.yaml post /telemetry/get_event_stats","href":"/api-reference/telemetry/event-statistics"}]}]},{"group":"WebSocket","pages":[{"title":null,"href":"/api-reference/websocket/agents-connect"}]}]}]},"title":"Get agent connection state - Svantic","buildId":"dpl_2xiSHD9XEvLsPGPcfoMtkLTB3dy9","deploymentId":"dpl_2xiSHD9XEvLsPGPcfoMtkLTB3dy9","dynamics":["c2aa737661","b0f84f53ff","a9bb46feb3","2b790eda92"],"chunks":["OpenApiReferenceProvider-DmVyH30O.js","utils-BHQqGGOd.js","cloneDeep-izs3Hzxb.js","_Uint8Array-BVIqJ90l.js","isObjectLike-C8vmzPEN.js","isArray-Dcu1dQ5t.js","utils-CD-E4BIt.js","toString-BX-iyh8G.js","isSymbol-CSH9U2Gm.js","addUniqueKeysToSchema-Bp5Lq9Ds.js","snippetPresets-C4xAVCFP.js","style-to-object-BY3JEAdk.js","v4-DIgz8zy6.js","Page-CBCH2P7b.js","ApiExamples-CgXVLxUC.js","isEqual-BfaiBbcl.js","usePlaygroundInputsStore-BF8I5oUf.js","shallow-Byd0lWnC.js","getApiPlaygroundDisplay-BGOZG1OK.js","CodeSnippet-CpvQL0CY.js","CodeSnippets-B8wkBKXa.js","getPastedJson-Ry3scI3Y.js","icon-D7a9HcdD.js","MethodPill-CJ8pmHhz.js","DuplicateIcon-rh1HJF0t.js","createIcon-DvGznqYs.js","DynamicMarkdown-Cc6AuSHS.js","SectionHeading-B4A0S-ep.js","axios-vUo_bRtp.js","Markdown-Cc16CX65.js","clsx-Cs6nMGht.js","lib-DuNMoZ05.js","lib-B8HbPgcC.js","html-void-elements-mCSPHezU.js","dist-zbf22OZA.js","katex-YMM-FMeD.js","marked.esm-CZWythHk.js","AssistantPageLink-C_fs-y5n.js"]}