Legacy alias of POST /api/impersonation/start. Both routes are registered; this one takes targetUserId (the canonical route takes userId + type) and additionally mints an impersonation access token for bearer sessions. Begin impersonating another user — the caller must already hold all-facilities scope (super admin / internal operator).
There is no /api/impersonate/stop: end an impersonation with POST /api/impersonation/stop.
Pin the request to a dated API version (e.g. 2026-05-10). Applied by app-level middleware to every /api route (server/routes/index.ts → apiVersionMiddleware), which echoes the resolved value back in the NexSpace-Version response header. Omit to get the latest version. Discover the catalog at GET /.well-known/api-versions.
Pattern: ^\d{4}-\d{2}-\d{2}$
Idempotency-Key
string
Replay guard for write requests. Applied by app-level middleware to every /api route (server/routes/index.ts → idempotencyMiddleware), which only acts on POST/PUT/PATCH — GET, DELETE and OPTIONS ignore the header. Re-sending the same key with an identical body within 24 hours replays the original response; the same key with a different body returns 409.
Maximum string length: 255
Body
application/json
targetUserId
integer
required
ID of the record to impersonate — a users.id, facility_users.id, or staff.id depending on userType.
userType
enum<string>
default:user
Which table targetUserId points at. Optional — the handler defaults to user.
Present ONLY for bearer (native/mobile) sessions whose target resolves to a login identity: a short-lived access token that acts as the target and carries the original operator in its impersonation claim. Cookie sessions and staff targets with no linked users row omit this field — those callers rely on the server session instead.
{"docsConfig":{"theme":"mint","$schema":"https://mintlify.com/docs.json","name":"NexSpace Developer Docs","colors":{"primary":"#2563EB","light":"#60A5FA","dark":"#2563EB"},"logo":{"light":"https://mintcdn.com/nexspace365llc/21j0LL11KKqoYm2B/logo/light.png?fit=max\u0026auto=format\u0026n=21j0LL11KKqoYm2B\u0026q=85\u0026s=0d9972d5ef71de66b5eb2f87e39d22db","dark":"https://mintcdn.com/nexspace365llc/21j0LL11KKqoYm2B/logo/dark.png?fit=max\u0026auto=format\u0026n=21j0LL11KKqoYm2B\u0026q=85\u0026s=d28e8c7ab6777003c6c2633f81859237"},"favicon":"https://mintcdn.com/nexspace365llc/21j0LL11KKqoYm2B/favicon.png?fit=max\u0026auto=format\u0026n=21j0LL11KKqoYm2B\u0026q=85\u0026s=870af17e66cf7713bd976289f6b96737","api":{"openapi":["https://api.nexspace365.com/api/openapi.json"],"mdx":{"auth":{"method":"bearer","name":"Authorization"},"server":"https://api.nexspace365.com"}},"navbar":{"links":[{"href":"mailto:admin@nexspace365.com","label":"Contact"}],"primary":{"type":"button","label":"Dashboard","href":"https://app.nexspace365.com"}},"footer":{"socials":{"x":"https://x.com/nexspace365","github":"https://github.com/Nexspace365","linkedin":"https://linkedin.com/company/nexspace365"}},"styling":{"latex":false},"navigation":{"global":{"anchors":[{"anchor":"GitHub","icon":"github","href":"https://github.com/Nexspace365/NexSpace"}]},"pages":[]}},"deployment":{"deploymentMetadataValue":{"subdomain":"nexspace365llc","hasAudioNarration":false,"actualSubdomain":"nexspace365llc","customDomains":["developers.nexspace365.com"],"gitSource":{"type":"github","owner":"nexspace365","repo":"nexspace","deployBranch":"production","contentDirectory":"docs/developers","isPrivate":true,"mountPath":"","label":"","_id":"6b10e8c99ffae5051c41467c"},"entitlements":{"AI_CHAT":{"status":"DISABLED"}},"buildId":"6b07b2d4572bfd1099776647","clientVersion":"0.0.4448","searchFilterCounts":[{"language":"default","tag":"API Reference","count":87},{"language":"default","tag":"Endpoints","count":84},{"language":"default","tag":"Documentation","count":22},{"language":"default","tag":"Agents","count":17},{"language":"default","tag":"OAuth","count":13},{"language":"default","tag":"Core Concepts","count":12},{"language":"default","tag":"CLI","count":8},{"language":"default","tag":"Analytics","count":7},{"language":"default","tag":"Shifts","count":7},{"language":"default","tag":"Integrations","count":6}]},"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":"agent-integrations-settings","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"rbac-expansion","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":"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":"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":"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":"billing-page-v2","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"full-page-search","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":"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":"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":"turbopuffer-dual-write","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"approve-review-flow","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"editor-metadata","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"turbopuffer-serve","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"live-agents","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"starter-pricing","enabled":true,"variant":{"name":"treatment","enabled":true,"payload":{"type":"string","value":"treatment"},"feature_enabled":true},"impressionData":false},{"name":"llms-txt-v2","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"auth-vite-origin","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false}],"starterQuestions":[],"googleFontsInlined":false},"customCss":[]}
{"page":{"pagePath":"api-reference/authentication/start-user-impersonation","slug":"/api-reference/authentication/start-user-impersonation","pageMetadata":{"title":"Start user impersonation","description":"Legacy alias of `POST /api/impersonation/start`. Both routes are registered; this one takes `targetUserId` (the canonical route takes `userId` + `type`) and additionally mints an impersonation access token for bearer sessions. Begin impersonating another user — the caller must already hold all-facilities scope (super admin / internal operator).\nThere is no `/api/impersonate/stop`: end an impersonation with `POST /api/impersonation/stop`.","deprecated":null,"version":null,"openapi":"https://api.nexspace365.com/api/openapi.json post /api/impersonate/start","href":"/api-reference/authentication/start-user-impersonation","autogeneratedByOpenApi":true},"description":{"compiledSource":"\"use strict\";\nconst {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(_components.p, {\n children: [\"Legacy alias of \", _jsx(_components.code, {\n children: \"POST /api/impersonation/start\"\n }), \". Both routes are registered; this one takes \", _jsx(_components.code, {\n children: \"targetUserId\"\n }), \" (the canonical route takes \", _jsx(_components.code, {\n children: \"userId\"\n }), \" + \", _jsx(_components.code, {\n children: \"type\"\n }), \") and additionally mints an impersonation access token for bearer sessions. Begin impersonating another user — the caller must already hold all-facilities scope (super admin / internal operator).\\nThere is no \", _jsx(_components.code, {\n children: \"/api/impersonate/stop\"\n }), \": end an impersonation with \", _jsx(_components.code, {\n children: \"POST /api/impersonation/stop\"\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":"Start user impersonation","description":"Legacy alias of `POST /api/impersonation/start`. Both routes are registered; this one takes `targetUserId` (the canonical route takes `userId` + `type`) and additionally mints an impersonation access token for bearer sessions. Begin impersonating another user — the caller must already hold all-facilities scope (super admin / internal operator).\nThere is no `/api/impersonate/stop`: end an impersonation with `POST /api/impersonation/stop`.","deprecated":null,"version":null,"openapi":"https://api.nexspace365.com/api/openapi.json post /api/impersonate/start","href":"/api-reference/authentication/start-user-impersonation","autogeneratedByOpenApi":true}}},"mdxSourceWithNoJs":null},"mdxExtracts":{"tableOfContents":[],"codeExamples":{}},"jsLinks":[],"openApiReferenceData":{"operation":{"operationId":"startImpersonation","tags":["Authentication"],"summary":"Start user impersonation","description":"Legacy alias of `POST /api/impersonation/start`. Both routes are registered; this one takes `targetUserId` (the canonical route takes `userId` + `type`) and additionally mints an impersonation access token for bearer sessions. Begin impersonating another user — the caller must already hold all-facilities scope (super admin / internal operator).\nThere is no `/api/impersonate/stop`: end an impersonation with `POST /api/impersonation/stop`.","security":["da864ec9-4806-4947-80c9-4229dbdb49e6"],"parameters":["417ca154-4929-4424-9a9b-e50d3761973d","579b7711-413c-4ddc-8bca-e9bc28b74d4e"],"requestBody":"f572df11-9d23-4f78-b380-ad879ee57bdc","responses":{"200":"0a051014-f73c-4e34-83b6-d3cdb65b623b","401":"fdca2000-8a64-4015-9994-4c1789930df6","403":"5d3dcc17-f0e4-4966-bd07-037fea1c935b","404":"271bae54-17e5-4022-b537-f169b94a0389"},"method":"post","type":"path","servers":["23f228a2-9ed2-4aee-8b02-70e1bb3089c7"],"path":"/api/impersonate/start","baseUrlOptions":["https://api.nexspace365.com"],"title":"Start user impersonation","codeSamples":[],"requiredOnlyExamples":false,"requestExampleType":"generated","responseExampleType":"generated"},"dependencies":{"parameters":{"417ca154-4929-4424-9a9b-e50d3761973d":{"name":"NexSpace-Version","in":"header","required":false,"schema":{"type":"string","pattern":"^\\d{4}-\\d{2}-\\d{2}$","isRequired":false,"description":"Pin the request to a dated API version (e.g. `2026-05-10`). Applied by app-level middleware to every `/api` route (`server/routes/index.ts` → `apiVersionMiddleware`), which echoes the resolved value back in the `NexSpace-Version` response header. Omit to get the latest version. Discover the catalog at `GET /.well-known/api-versions`.\n","uniqueKey":"","typeLabel":"string"},"description":"Pin the request to a dated API version (e.g. `2026-05-10`). Applied by app-level middleware to every `/api` route (`server/routes/index.ts` → `apiVersionMiddleware`), which echoes the resolved value back in the `NexSpace-Version` response header. Omit to get the latest version. Discover the catalog at `GET /.well-known/api-versions`.\n"},"579b7711-413c-4ddc-8bca-e9bc28b74d4e":{"name":"Idempotency-Key","in":"header","required":false,"schema":{"type":"string","maxLength":255,"isRequired":false,"description":"Replay guard for write requests. Applied by app-level middleware to every `/api` route (`server/routes/index.ts` → `idempotencyMiddleware`), which only acts on POST/PUT/PATCH — GET, DELETE and OPTIONS ignore the header. Re-sending the same key with an identical body within 24 hours replays the original response; the same key with a different body returns `409`.\n","uniqueKey":"","typeLabel":"string"},"description":"Replay guard for write requests. Applied by app-level middleware to every `/api` route (`server/routes/index.ts` → `idempotencyMiddleware`), which only acts on POST/PUT/PATCH — GET, DELETE and OPTIONS ignore the header. Re-sending the same key with an identical body within 24 hours replays the original response; the same key with a different body returns `409`.\n"}},"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"targetUserId":{"type":"integer","description":"ID of the record to impersonate — a `users.id`, `facility_users.id`, or `staff.id` depending on `userType`.","isRequired":true,"uniqueKey":"targetUserId","typeLabel":"integer"},"userType":{"type":"string","enum":["user","facility_user","staff"],"default":"user","description":"Which table `targetUserId` points at. Optional — the handler defaults to `user`.","uniqueKey":"userType","typeLabel":"enum\u003cstring>"}},"required":["targetUserId"],"uniqueKey":"","typeLabel":"object"},"examples":{"Example":{"title":"Example","value":{"targetUserId":123,"userType":"user"}}},"exampleType":"generated"}},"exampleType":"generated"},"responses":{"0a051014-f73c-4e34-83b6-d3cdb65b623b":{"description":"Impersonation started successfully","content":{"application/json":{"schema":{"type":"object","properties":{"success":{"type":"boolean","uniqueKey":"success","typeLabel":"boolean"},"message":{"type":"string","uniqueKey":"message","typeLabel":"string"},"user":{"type":"object","properties":{"id":{"type":"integer","description":"Unique user identifier","uniqueKey":"user.id","typeLabel":"integer"},"username":{"type":"string","description":"Username for login","uniqueKey":"user.username","typeLabel":"string"},"email":{"type":"string","format":"email","description":"User email address","uniqueKey":"user.email","typeLabel":"string\u003cemail>"},"firstName":{"type":"string","description":"First name","uniqueKey":"user.firstName","typeLabel":"string"},"lastName":{"type":"string","description":"Last name","uniqueKey":"user.lastName","typeLabel":"string"},"role":{"type":"string","enum":["super_admin","facility_manager","staff","internal_employee","contractor_1099"],"description":"User role determining permissions","uniqueKey":"user.role","typeLabel":"enum\u003cstring>"},"avatar":{"oneOf":[{"type":"string","description":"URL to user's avatar image","uniqueKey":"user.avatar.oneOf.0","typeLabel":"string"},{"type":"null","description":"URL to user's avatar image","uniqueKey":"user.avatar.oneOf.1","typeLabel":"null"}],"uniqueKey":"user.avatar","typeLabel":"string | null"},"isActive":{"type":"boolean","description":"Whether the user account is active","uniqueKey":"user.isActive","typeLabel":"boolean"},"facilityId":{"oneOf":[{"type":"integer","description":"Primary facility ID for the user","uniqueKey":"user.facilityId.oneOf.0","typeLabel":"integer"},{"type":"null","description":"Primary facility ID for the user","uniqueKey":"user.facilityId.oneOf.1","typeLabel":"null"}],"uniqueKey":"user.facilityId","typeLabel":"integer | null"},"permissions":{"type":"array","items":{"type":"string","uniqueKey":"user.permissions.items.[INDEX]","typeLabel":"string"},"description":"List of user permissions","uniqueKey":"user.permissions","typeLabel":"string[]"},"onboardingCompleted":{"type":"boolean","description":"Whether user has completed onboarding","uniqueKey":"user.onboardingCompleted","typeLabel":"boolean"}},"example":{"id":1,"username":"acme-ops","email":"ops@acme.example.com","firstName":"Ada","lastName":"Lovelace","role":"facility_manager","avatar":null,"isActive":true,"facilityId":1,"permissions":["shifts.view","staff.view","facilities.view"],"onboardingCompleted":true},"uniqueKey":"user","typeLabel":"object"},"impersonationAccessToken":{"type":"string","description":"Present ONLY for bearer (native/mobile) sessions whose target resolves to a login identity: a short-lived access token that acts as the target and carries the original operator in its `impersonation` claim. Cookie sessions and staff targets with no linked `users` row omit this field — those callers rely on the server session instead.","uniqueKey":"impersonationAccessToken","typeLabel":"string"}},"uniqueKey":"","typeLabel":"object"},"examples":{"Example":{"title":"Example","value":{"success":true,"message":"\u003cstring>","user":{"id":1,"username":"acme-ops","email":"ops@acme.example.com","firstName":"Ada","lastName":"Lovelace","role":"facility_manager","avatar":null,"isActive":true,"facilityId":1,"permissions":["shifts.view","staff.view","facilities.view"],"onboardingCompleted":true},"impersonationAccessToken":"\u003cstring>"}}},"exampleType":"generated"}},"exampleType":"generated"},"fdca2000-8a64-4015-9994-4c1789930df6":{"description":"Not authenticated.","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"object","properties":{"message":{"type":"string","description":"Human-readable error message","isRequired":true,"uniqueKey":"error.message","typeLabel":"string"},"code":{"type":"string","description":"Machine-readable error code (e.g. VALIDATION_FAILED, NOT_FOUND)","uniqueKey":"error.code","typeLabel":"string"},"details":{"type":"object","description":"Structured details (e.g. Zod validation issues)","uniqueKey":"error.details","typeLabel":"object"},"suggestion":{"type":"string","description":"Hint for agents on how to recover","uniqueKey":"error.suggestion","typeLabel":"string"},"retryable":{"type":"boolean","description":"Whether the same request might succeed on retry","uniqueKey":"error.retryable","typeLabel":"boolean"}},"required":["message"],"isRequired":true,"uniqueKey":"error","typeLabel":"object"},"requestId":{"type":"string","description":"Correlation ID for logs and Sentry","uniqueKey":"requestId","typeLabel":"string"}},"required":["error"],"uniqueKey":"","typeLabel":"object"},"examples":{"Example":{"title":"Example","value":{"error":{"message":"\u003cstring>","code":"\u003cstring>","details":{},"suggestion":"\u003cstring>","retryable":true},"requestId":"\u003cstring>"}}},"exampleType":"generated"}},"exampleType":"generated"},"5d3dcc17-f0e4-4966-bd07-037fea1c935b":{"description":"Rejected before any lookup, in this order:\n- **API key or OAuth token** — `DELEGATED_CREDENTIAL_NOT_ALLOWED`,\n \"Impersonation is not available to API keys or OAuth tokens\".\n Impersonation is a per-human capability, so a leaked `nex_…` key\n or OAuth token can never become someone else.\n- **Already impersonating** — \"Already impersonating — stop the\n current impersonation first\". No chaining; call\n `POST /api/impersonation/stop` first.\n- **Not a superuser** — \"Superuser access required\".\n","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"object","properties":{"message":{"type":"string","description":"Human-readable error message","isRequired":true,"uniqueKey":"error.message","typeLabel":"string"},"code":{"type":"string","description":"Machine-readable error code (e.g. VALIDATION_FAILED, NOT_FOUND)","uniqueKey":"error.code","typeLabel":"string"},"details":{"type":"object","description":"Structured details (e.g. Zod validation issues)","uniqueKey":"error.details","typeLabel":"object"},"suggestion":{"type":"string","description":"Hint for agents on how to recover","uniqueKey":"error.suggestion","typeLabel":"string"},"retryable":{"type":"boolean","description":"Whether the same request might succeed on retry","uniqueKey":"error.retryable","typeLabel":"boolean"}},"required":["message"],"isRequired":true,"uniqueKey":"error","typeLabel":"object"},"requestId":{"type":"string","description":"Correlation ID for logs and Sentry","uniqueKey":"requestId","typeLabel":"string"}},"required":["error"],"uniqueKey":"","typeLabel":"object"},"examples":{"Example":{"title":"Example","value":{"error":{"message":"\u003cstring>","code":"\u003cstring>","details":{},"suggestion":"\u003cstring>","retryable":true},"requestId":"\u003cstring>"}}},"exampleType":"generated"}},"exampleType":"generated"},"271bae54-17e5-4022-b537-f169b94a0389":{"description":"No record for `targetUserId` in the table selected by `userType` (\"Staff member not found\" / \"Facility user not found\" / \"User not found\").","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"object","properties":{"message":{"type":"string","description":"Human-readable error message","isRequired":true,"uniqueKey":"error.message","typeLabel":"string"},"code":{"type":"string","description":"Machine-readable error code (e.g. VALIDATION_FAILED, NOT_FOUND)","uniqueKey":"error.code","typeLabel":"string"},"details":{"type":"object","description":"Structured details (e.g. Zod validation issues)","uniqueKey":"error.details","typeLabel":"object"},"suggestion":{"type":"string","description":"Hint for agents on how to recover","uniqueKey":"error.suggestion","typeLabel":"string"},"retryable":{"type":"boolean","description":"Whether the same request might succeed on retry","uniqueKey":"error.retryable","typeLabel":"boolean"}},"required":["message"],"isRequired":true,"uniqueKey":"error","typeLabel":"object"},"requestId":{"type":"string","description":"Correlation ID for logs and Sentry","uniqueKey":"requestId","typeLabel":"string"}},"required":["error"],"uniqueKey":"","typeLabel":"object"},"examples":{"Example":{"title":"Example","value":{"error":{"message":"\u003cstring>","code":"\u003cstring>","details":{},"suggestion":"\u003cstring>","retryable":true},"requestId":"\u003cstring>"}}},"exampleType":"generated"}},"exampleType":"generated"}},"security":{"da864ec9-4806-4947-80c9-4229dbdb49e6":{"bearerAuth":{"type":"http","scheme":"bearer","bearerFormat":"JWT","description":"JWT token authentication","scopes":[],"schemeName":"bearerAuth"}}},"servers":{"23f228a2-9ed2-4aee-8b02-70e1bb3089c7":{"url":"https://api.nexspace365.com","description":"Production server"}},"processedSecurityOptions":[{"schemes":[{"scheme":{"type":"http","scheme":"bearer","bearerFormat":"JWT","description":"JWT token authentication","scopes":[],"schemeName":"bearerAuth"},"schema":{"title":"Bearer Auth","type":"string","isRequired":true,"description":"JWT token authentication","format":"bearer","typeLabel":"string\u003cbearer>","deprecated":false},"schemeName":"bearerAuth","name":"Authorization"}],"title":"bearerAuth"}]},"originalFileLocation":"https://api.nexspace365.com/api/openapi.json"},"subdomain":"nexspace365llc","siteName":"NexSpace Developer Docs","title":"Start user impersonation - NexSpace Developer Docs","contextualStarterQuestions":[],"navMaps":{"firstHrefInVersion":{},"firstHrefInLanguage":{}},"lastModified":"2026-11-25T05:11:08.590Z","originalFileLocation":"api-reference/authentication/start-user-impersonation.mdx"},"headHtml":"\u003cscript data-mint-head>(function(){var d=document.documentElement,p=null;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=\"system\"}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=\"Legacy alias of POST /api/impersonation/start. Both routes are registered; this one takes targetUserId (the canonical route takes userId + type) and additionally mints an impersonation access token for bearer sessions. Begin impersonating another user — the caller must already hold all-facilities scope (super admin / internal operator). There is no /api/impersonate/stop: end an impersonation with POST /api/impersonation/stop.\">\u003cmeta data-mint-head name=\"application-name\" content=\"NexSpace Developer Docs\">\u003cmeta data-mint-head name=\"generator\" content=\"Mintlify\">\u003clink data-mint-head rel=\"icon\" type=\"image/png\" sizes=\"192x192\" href=\"/mintlify-assets/_mintlify/favicons/nexspace365llc/i9uOvj_RbWrMRRIL/_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/nexspace365llc/i9uOvj_RbWrMRRIL/_generated/favicon/apple-touch-icon.png\">\u003clink data-mint-head rel=\"icon\" type=\"image/png\" sizes=\"16x16\" href=\"/mintlify-assets/_mintlify/favicons/nexspace365llc/i9uOvj_RbWrMRRIL/_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/nexspace365llc/i9uOvj_RbWrMRRIL/_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/nexspace365llc/i9uOvj_RbWrMRRIL/_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/nexspace365llc/i9uOvj_RbWrMRRIL/_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/nexspace365llc/i9uOvj_RbWrMRRIL/_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/nexspace365llc/i9uOvj_RbWrMRRIL/_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/nexspace365llc/i9uOvj_RbWrMRRIL/_generated/favicon-dark/favicon.ico\" media=\"(prefers-color-scheme: dark)\">\u003cmeta data-mint-head property=\"og:title\" content=\"Start user impersonation - NexSpace Developer Docs\">\u003cmeta data-mint-head property=\"og:description\" content=\"Legacy alias of POST /api/impersonation/start. Both routes are registered; this one takes targetUserId (the canonical route takes userId + type) and additionally mints an impersonation access token for bearer sessions. Begin impersonating another user — the caller must already hold all-facilities scope (super admin / internal operator). There is no /api/impersonate/stop: end an impersonation with POST /api/impersonation/stop.\">\u003cmeta data-mint-head property=\"og:site_name\" content=\"NexSpace Developer Docs\">\u003cmeta data-mint-head property=\"og:url\" content=\"https://developers.nexspace365.com/api-reference/authentication/start-user-impersonation\">\u003cmeta data-mint-head property=\"og:type\" content=\"website\">\u003cmeta data-mint-head property=\"og:image\" content=\"https://nexspace365llc.mintlify.site/_mintlify/api/og/v2?division=Authentication\u0026amp;title=Start+user+impersonation\u0026amp;description=Legacy+alias+of+%60POST+%2Fapi%2Fimpersonation%2Fstart%60.+Both+routes+are+registered%3B+this+one+takes+%60targetUserId%60+%28the+canonical+route+takes+%60userId%60+%2B+%60type%60%29+and+add\u0026amp;theme=b6b488d5142a420cec1aa907\u0026amp;signature=ab4890fb0eccd1e996ee22d8c957a786fa7c36f545bb0d193cc39d7f36da1f11\">\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=\"Start user impersonation - NexSpace Developer Docs\">\u003cmeta data-mint-head name=\"twitter:description\" content=\"Legacy alias of POST /api/impersonation/start. Both routes are registered; this one takes targetUserId (the canonical route takes userId + type) and additionally mints an impersonation access token for bearer sessions. Begin impersonating another user — the caller must already hold all-facilities scope (super admin / internal operator). There is no /api/impersonate/stop: end an impersonation with POST /api/impersonation/stop.\">\u003cmeta data-mint-head name=\"twitter:image\" content=\"https://nexspace365llc.mintlify.site/_mintlify/api/og/v2?division=Authentication\u0026amp;title=Start+user+impersonation\u0026amp;description=Legacy+alias+of+%60POST+%2Fapi%2Fimpersonation%2Fstart%60.+Both+routes+are+registered%3B+this+one+takes+%60targetUserId%60+%28the+canonical+route+takes+%60userId%60+%2B+%60type%60%29+and+add\u0026amp;theme=b6b488d5142a420cec1aa907\u0026amp;signature=ab4890fb0eccd1e996ee22d8c957a786fa7c36f545bb0d193cc39d7f36da1f11\">\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/nexspace365llc/i9uOvj_RbWrMRRIL/_generated/favicon/browserconfig.xml\">\u003cmeta data-mint-head name=\"apple-mobile-web-app-title\" content=\"NexSpace Developer Docs\">\u003cmeta data-mint-head name=\"msapplication-TileColor\" content=\"#2563EB\">\u003clink data-mint-head rel=\"canonical\" href=\"https://developers.nexspace365.com/api-reference/authentication/start-user-impersonation\">\u003clink data-mint-head rel=\"alternate\" type=\"application/xml\" href=\"/sitemap.xml\">\u003clink data-mint-head rel=\"alternate\" type=\"text/markdown\" href=\"/api-reference/authentication/start-user-impersonation.md\">\u003cscript data-mint-head type=\"application/ld+json\">{\"@context\":\"https://schema.org\",\"@graph\":[{\"@type\":\"Organization\",\"@id\":\"https://developers.nexspace365.com/#organization\",\"name\":\"NexSpace Developer Docs\",\"url\":\"https://developers.nexspace365.com\",\"logo\":{\"@type\":\"ImageObject\",\"url\":\"https://mintcdn.com/nexspace365llc/21j0LL11KKqoYm2B/logo/light.png?fit=max\u0026auto=format\u0026n=21j0LL11KKqoYm2B\u0026q=85\u0026s=0d9972d5ef71de66b5eb2f87e39d22db\"}},{\"@type\":\"WebSite\",\"@id\":\"https://developers.nexspace365.com#website\",\"name\":\"NexSpace Developer Docs\",\"url\":\"https://developers.nexspace365.com\",\"publisher\":{\"@id\":\"https://developers.nexspace365.com/#organization\"}},{\"@type\":\"WebPage\",\"@id\":\"https://developers.nexspace365.com/api-reference/authentication/start-user-impersonation#webpage\",\"url\":\"https://developers.nexspace365.com/api-reference/authentication/start-user-impersonation\",\"name\":\"Start user impersonation\",\"description\":\"Legacy alias of POST /api/impersonation/start. Both routes are registered; this one takes targetUserId (the canonical route takes userId + type) and additionally mints an impersonation access token for bearer sessions. Begin impersonating another user — the caller must already hold all-facilities scope (super admin / internal operator). There is no /api/impersonate/stop: end an impersonation with POST /api/impersonation/stop.\",\"dateModified\":\"2026-11-25T05:11:08.590Z\",\"isPartOf\":{\"@id\":\"https://developers.nexspace365.com#website\"},\"breadcrumb\":{\"@id\":\"https://developers.nexspace365.com/api-reference/authentication/start-user-impersonation#breadcrumb\"}},{\"@type\":\"BreadcrumbList\",\"@id\":\"https://developers.nexspace365.com/api-reference/authentication/start-user-impersonation#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"Endpoints\",\"item\":\"https://developers.nexspace365.com/api-reference/authentication/get-the-authenticated-identity\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"Authentication\",\"item\":\"https://developers.nexspace365.com/api-reference/authentication/get-the-authenticated-identity\"},{\"@type\":\"ListItem\",\"position\":3,\"name\":\"Start user impersonation\",\"item\":\"https://developers.nexspace365.com/api-reference/authentication/start-user-impersonation\"}]},{\"@type\":[\"TechArticle\",\"APIReference\"],\"@id\":\"https://developers.nexspace365.com/api-reference/authentication/start-user-impersonation#apireference\",\"headline\":\"Start user impersonation\",\"name\":\"Start user impersonation\",\"description\":\"Legacy alias of POST /api/impersonation/start. Both routes are registered; this one takes targetUserId (the canonical route takes userId + type) and additionally mints an impersonation access token for bearer sessions. Begin impersonating another user — the caller must already hold all-facilities scope (super admin / internal operator). There is no /api/impersonate/stop: end an impersonation with POST /api/impersonation/stop.\",\"url\":\"https://developers.nexspace365.com/api-reference/authentication/start-user-impersonation\",\"mainEntityOfPage\":{\"@id\":\"https://developers.nexspace365.com/api-reference/authentication/start-user-impersonation#webpage\"},\"dateModified\":\"2026-11-25T05:11:08.590Z\",\"publisher\":{\"@id\":\"https://developers.nexspace365.com/#organization\"},\"isPartOf\":{\"@id\":\"https://developers.nexspace365.com#website\"}}]}\u003c/script>\u003cscript data-mint-head type=\"application/ld+json\">{\"@context\":\"https://schema.org\",\"@type\":\"WebSite\",\"name\":\"NexSpace Developer Docs\",\"publisher\":{\"@type\":\"Organization\",\"name\":\"NexSpace Developer Docs\"},\"provider\":{\"@type\":\"Organization\",\"name\":\"Mintlify\",\"url\":\"https://mintlify.com\"}}\u003c/script>","agentPointerHref":"/api-reference/authentication/start-user-impersonation.md","siteName":"NexSpace Developer Docs","nav":{"global":{"anchors":[{"anchor":"GitHub","icon":"github","href":"https://github.com/Nexspace365/NexSpace"}]},"tabs":[{"tab":"Documentation","pages":[{"title":"Documentation","href":"/introduction"}]},{"tab":"API Reference","groups":[{"group":"Overview","pages":[{"title":"API Reference","href":"/api-reference/overview"},{"title":"Usage Analytics","openapi":"get /api/api-usage/summary","href":"/api-reference/usage-analytics"},{"title":"Tool Catalog","href":"/api-reference/tool-catalog"}]},{"group":"Endpoints","pages":[{"group":"Authentication","pages":[{"title":"Get the authenticated identity","description":"Returns the user the presented credential authenticates as. Accepts any supported credential — API key (nex_live_/nex_test_), personal access token (nex_pat_), OAuth 2.1 access token, or first-party session. This is the identity probe used by the CLI (`nexspace whoami`), SDKs, and MCP clients.","deprecated":null,"version":null,"openapi":"https://api.nexspace365.com/api/openapi.json get /api/auth/me","href":"/api-reference/authentication/get-the-authenticated-identity"},{"title":"Start user impersonation","deprecated":null,"version":null,"openapi":"https://api.nexspace365.com/api/openapi.json post /api/impersonate/start","href":"/api-reference/authentication/start-user-impersonation"},{"title":"Stop user impersonation","description":"End the current impersonation. Two paths, both handled here: a bearer session presents its impersonation access token and the server just records the audit entry (the client discards the token); a cookie session has its impersonation keys cleared from the server session.","deprecated":null,"version":null,"openapi":"https://api.nexspace365.com/api/openapi.json post /api/impersonation/stop","href":"/api-reference/authentication/stop-user-impersonation"},{"title":"Get impersonation status","deprecated":null,"version":null,"openapi":"https://api.nexspace365.com/api/openapi.json get /api/impersonation/status","href":"/api-reference/authentication/get-impersonation-status"}]},{"group":"Facilities","pages":[{"title":"Get all facilities","deprecated":null,"version":null,"openapi":"https://api.nexspace365.com/api/openapi.json get /api/facilities","href":"/api-reference/facilities/get-all-facilities"},{"title":"Create new facility","deprecated":null,"version":null,"openapi":"https://api.nexspace365.com/api/openapi.json post /api/facilities","href":"/api-reference/facilities/create-new-facility"},{"title":"Get facility by ID","deprecated":null,"version":null,"openapi":"https://api.nexspace365.com/api/openapi.json get /api/facilities/{id}","href":"/api-reference/facilities/get-facility-by-id"},{"title":"Deactivate facility","deprecated":null,"version":null,"openapi":"https://api.nexspace365.com/api/openapi.json delete /api/facilities/{id}","href":"/api-reference/facilities/deactivate-facility"},{"title":"Update facility","deprecated":null,"version":null,"openapi":"https://api.nexspace365.com/api/openapi.json patch /api/facilities/{id}","href":"/api-reference/facilities/update-facility"}]},{"group":"Staff","pages":[{"title":"Get all staff members","deprecated":null,"version":null,"openapi":"https://api.nexspace365.com/api/openapi.json get /api/staff","href":"/api-reference/staff/get-all-staff-members"},{"title":"Create new staff member","deprecated":null,"version":null,"openapi":"https://api.nexspace365.com/api/openapi.json post /api/staff","href":"/api-reference/staff/create-new-staff-member"},{"title":"Get staff member by ID","deprecated":null,"version":null,"openapi":"https://api.nexspace365.com/api/openapi.json get /api/staff/{id}","href":"/api-reference/staff/get-staff-member-by-id"},{"title":"Update staff member","deprecated":null,"version":null,"openapi":"https://api.nexspace365.com/api/openapi.json patch /api/staff/{id}","href":"/api-reference/staff/update-staff-member"}]},{"group":"Credentials","pages":[{"title":"List a staff member's credentials","deprecated":null,"version":null,"openapi":"https://api.nexspace365.com/api/openapi.json get /api/staff/{id}/credentials","href":"/api-reference/credentials/list-a-staff-members-credentials"},{"title":"Add a credential","deprecated":null,"version":null,"openapi":"https://api.nexspace365.com/api/openapi.json post /api/staff/{id}/credentials","href":"/api-reference/credentials/add-a-credential"},{"title":"Delete a credential","deprecated":null,"version":null,"openapi":"https://api.nexspace365.com/api/openapi.json delete /api/credentials/{id}","href":"/api-reference/credentials/delete-a-credential"},{"title":"Update a credential","deprecated":null,"version":null,"openapi":"https://api.nexspace365.com/api/openapi.json patch /api/credentials/{id}","href":"/api-reference/credentials/update-a-credential"}]},{"group":"Shifts","pages":[{"title":"Get all shifts","deprecated":null,"version":null,"openapi":"https://api.nexspace365.com/api/openapi.json get /api/shifts","href":"/api-reference/shifts/get-all-shifts"},{"title":"Create new shift","deprecated":null,"version":null,"openapi":"https://api.nexspace365.com/api/openapi.json post /api/shifts","href":"/api-reference/shifts/create-new-shift"},{"title":"Get shift by ID","deprecated":null,"version":null,"openapi":"https://api.nexspace365.com/api/openapi.json get /api/shifts/{id}","href":"/api-reference/shifts/get-shift-by-id"},{"title":"Delete shift","deprecated":null,"version":null,"openapi":"https://api.nexspace365.com/api/openapi.json delete /api/shifts/{id}","href":"/api-reference/shifts/delete-shift"},{"title":"Update shift","deprecated":null,"version":null,"openapi":"https://api.nexspace365.com/api/openapi.json patch /api/shifts/{id}","href":"/api-reference/shifts/update-shift"},{"title":"Assign staff to shift","deprecated":null,"version":null,"openapi":"https://api.nexspace365.com/api/openapi.json post /api/shifts/{id}/assign","href":"/api-reference/shifts/assign-staff-to-shift"},{"title":"Unassign staff from shift","deprecated":null,"version":null,"openapi":"https://api.nexspace365.com/api/openapi.json post /api/shifts/{id}/unassign","href":"/api-reference/shifts/unassign-staff-from-shift"}]},{"group":"Dashboard","pages":[{"title":"Get dashboard statistics","deprecated":null,"version":null,"openapi":"https://api.nexspace365.com/api/openapi.json get /api/dashboard/stats","href":"/api-reference/dashboard/get-dashboard-statistics"},{"title":"Get dashboard widgets","deprecated":null,"version":null,"openapi":"https://api.nexspace365.com/api/openapi.json get /api/dashboard/widgets","href":"/api-reference/dashboard/get-dashboard-widgets"},{"title":"Save dashboard widget layout","deprecated":null,"version":null,"openapi":"https://api.nexspace365.com/api/openapi.json post /api/dashboard/widgets","href":"/api-reference/dashboard/save-dashboard-widget-layout"},{"title":"Get the organization activity feed","deprecated":null,"version":null,"openapi":"https://api.nexspace365.com/api/openapi.json get /api/activity","href":"/api-reference/dashboard/get-the-organization-activity-feed"},{"title":"Get recent activity (legacy)","deprecated":null,"version":null,"openapi":"https://api.nexspace365.com/api/openapi.json get /api/dashboard/recent-activity","href":"/api-reference/dashboard/get-recent-activity-legacy"}]},{"group":"API Keys","pages":[{"title":"List API keys","deprecated":null,"version":null,"openapi":"https://api.nexspace365.com/api/openapi.json get /api/api-keys","href":"/api-reference/api-keys/list-api-keys"},{"title":"Create API key","deprecated":null,"version":null,"openapi":"https://api.nexspace365.com/api/openapi.json post /api/api-keys","href":"/api-reference/api-keys/create-api-key"},{"title":"Revoke API key","deprecated":null,"version":null,"openapi":"https://api.nexspace365.com/api/openapi.json post /api/api-keys/{id}/revoke","href":"/api-reference/api-keys/revoke-api-key"},{"title":"Rotate API key","deprecated":null,"version":null,"openapi":"https://api.nexspace365.com/api/openapi.json post /api/api-keys/{id}/rotate","href":"/api-reference/api-keys/rotate-api-key"}]},{"group":"MCP","pages":[{"title":"MCP JSON-RPC endpoint","deprecated":null,"version":null,"openapi":"https://api.nexspace365.com/api/openapi.json post /mcp","href":"/api-reference/mcp/mcp-json-rpc-endpoint"},{"title":"Resume a dropped MCP tool-call stream","deprecated":null,"version":null,"openapi":"https://api.nexspace365.com/api/openapi.json get /mcp/stream/{streamId}","href":"/api-reference/mcp/resume-a-dropped-mcp-tool-call-stream"},{"title":"MCP server discovery","deprecated":null,"version":null,"openapi":"https://api.nexspace365.com/api/openapi.json get /.well-known/mcp","href":"/api-reference/mcp/mcp-server-discovery"},{"title":"MCP liveness probe","deprecated":null,"version":null,"openapi":"https://api.nexspace365.com/api/openapi.json get /mcp/health","href":"/api-reference/mcp/mcp-liveness-probe"},{"title":"Protected-resource metadata (RFC 9728)","deprecated":null,"version":null,"openapi":"https://api.nexspace365.com/api/openapi.json get /.well-known/oauth-protected-resource","href":"/api-reference/mcp/protected-resource-metadata-rfc-9728"},{"title":"Protected-resource metadata for /mcp (RFC 9728 §3.1)","deprecated":null,"version":null,"openapi":"https://api.nexspace365.com/api/openapi.json get /.well-known/oauth-protected-resource/mcp","href":"/api-reference/mcp/protected-resource-metadata-for-mcp-rfc-9728-§31"}]},{"group":"Agents","pages":[{"title":"List headless agent runs","deprecated":null,"version":null,"openapi":"https://api.nexspace365.com/api/openapi.json get /api/agents/{id}/runs","href":"/api-reference/agents/list-headless-agent-runs"},{"title":"Start a headless agent run","deprecated":null,"version":null,"openapi":"https://api.nexspace365.com/api/openapi.json post /api/agents/{id}/runs","href":"/api-reference/agents/start-a-headless-agent-run"},{"title":"Get headless agent run state","deprecated":null,"version":null,"openapi":"https://api.nexspace365.com/api/openapi.json get /api/agents/{id}/runs/{runId}","href":"/api-reference/agents/get-headless-agent-run-state"},{"title":"Cancel a headless agent run","deprecated":null,"version":null,"openapi":"https://api.nexspace365.com/api/openapi.json delete /api/agents/{id}/runs/{runId}","href":"/api-reference/agents/cancel-a-headless-agent-run"},{"title":"Stream a headless agent run (SSE)","deprecated":null,"version":null,"openapi":"https://api.nexspace365.com/api/openapi.json get /api/agents/{id}/runs/{runId}/stream","href":"/api-reference/agents/stream-a-headless-agent-run-sse"},{"title":"List the approvals a headless run raised","deprecated":null,"version":null,"openapi":"https://api.nexspace365.com/api/openapi.json get /api/agents/{id}/runs/{runId}/approvals","href":"/api-reference/agents/list-the-approvals-a-headless-run-raised"},{"title":"List an agent's automation triggers","deprecated":null,"version":null,"openapi":"https://api.nexspace365.com/api/openapi.json get /api/agent-builder/{id}/triggers","href":"/api-reference/agents/list-an-agents-automation-triggers"},{"title":"Create an automation trigger","deprecated":null,"version":null,"openapi":"https://api.nexspace365.com/api/openapi.json post /api/agent-builder/{id}/triggers","href":"/api-reference/agents/create-an-automation-trigger"},{"title":"Delete an automation trigger","deprecated":null,"version":null,"openapi":"https://api.nexspace365.com/api/openapi.json delete /api/agent-builder/{id}/triggers/{triggerId}","href":"/api-reference/agents/delete-an-automation-trigger"},{"title":"Update an automation trigger","deprecated":null,"version":null,"openapi":"https://api.nexspace365.com/api/openapi.json patch /api/agent-builder/{id}/triggers/{triggerId}","href":"/api-reference/agents/update-an-automation-trigger"},{"title":"Enable or disable an automation trigger","deprecated":null,"version":null,"openapi":"https://api.nexspace365.com/api/openapi.json post /api/agent-builder/{id}/triggers/{triggerId}/toggle","href":"/api-reference/agents/enable-or-disable-an-automation-trigger"},{"title":"Dispatch a trigger's agent immediately","deprecated":null,"version":null,"openapi":"https://api.nexspace365.com/api/openapi.json post /api/agent-builder/{id}/triggers/{triggerId}/run-now","href":"/api-reference/agents/dispatch-a-triggers-agent-immediately"},{"title":"Approve a pending agent action (and resume its run)","deprecated":null,"version":null,"openapi":"https://api.nexspace365.com/api/openapi.json post /api/approvals/{approvalId}/approve","href":"/api-reference/agents/approve-a-pending-agent-action-and-resume-its-run"},{"title":"Reject a pending agent action (and terminate its run)","deprecated":null,"version":null,"openapi":"https://api.nexspace365.com/api/openapi.json post /api/approvals/{approvalId}/reject","href":"/api-reference/agents/reject-a-pending-agent-action-and-terminate-its-run"},{"title":"Get an approval's status (in-app card)","deprecated":null,"version":null,"openapi":"https://api.nexspace365.com/api/openapi.json get /api/ai/actions/{id}","href":"/api-reference/agents/get-an-approvals-status-in-app-card"},{"title":"Approve an action (in-app card)","deprecated":null,"version":null,"openapi":"https://api.nexspace365.com/api/openapi.json post /api/ai/actions/{id}/approve","href":"/api-reference/agents/approve-an-action-in-app-card"},{"title":"Reject an action (in-app card)","deprecated":null,"version":null,"openapi":"https://api.nexspace365.com/api/openapi.json post /api/ai/actions/{id}/reject","href":"/api-reference/agents/reject-an-action-in-app-card"}]},{"group":"OAuth","pages":[{"title":"Dynamic Client Registration (RFC 7591)","deprecated":null,"version":null,"openapi":"https://api.nexspace365.com/api/openapi.json post /oauth/register","href":"/api-reference/oauth/dynamic-client-registration-rfc-7591"},{"title":"Authorization endpoint","deprecated":null,"version":null,"openapi":"https://api.nexspace365.com/api/openapi.json get /oauth/authorize","href":"/api-reference/oauth/authorization-endpoint"},{"title":"Consent submission","deprecated":null,"version":null,"openapi":"https://api.nexspace365.com/api/openapi.json post /oauth/authorize","href":"/api-reference/oauth/consent-submission"},{"title":"Token exchange","deprecated":null,"version":null,"openapi":"https://api.nexspace365.com/api/openapi.json post /oauth/token","href":"/api-reference/oauth/token-exchange"},{"title":"Token introspection (RFC 7662)","deprecated":null,"version":null,"openapi":"https://api.nexspace365.com/api/openapi.json post /oauth/introspect","href":"/api-reference/oauth/token-introspection-rfc-7662"},{"title":"Token revocation (RFC 7009)","deprecated":null,"version":null,"openapi":"https://api.nexspace365.com/api/openapi.json post /oauth/revoke","href":"/api-reference/oauth/token-revocation-rfc-7009"},{"title":"OAuth server metadata (RFC 8414)","deprecated":null,"version":null,"openapi":"https://api.nexspace365.com/api/openapi.json get /.well-known/oauth-authorization-server","href":"/api-reference/oauth/oauth-server-metadata-rfc-8414"},{"title":"Start device authorization (RFC 8628)","deprecated":null,"version":null,"openapi":"https://api.nexspace365.com/api/openapi.json post /oauth/device/code","href":"/api-reference/oauth/start-device-authorization-rfc-8628"},{"title":"Device approval page (browser)","deprecated":null,"version":null,"openapi":"https://api.nexspace365.com/api/openapi.json get /oauth/device","href":"/api-reference/oauth/device-approval-page-browser"},{"title":"Submit device approval","deprecated":null,"version":null,"openapi":"https://api.nexspace365.com/api/openapi.json post /oauth/device","href":"/api-reference/oauth/submit-device-approval"},{"title":"List registered OAuth clients","deprecated":null,"version":null,"openapi":"https://api.nexspace365.com/api/openapi.json get /api/oauth-clients","href":"/api-reference/oauth/list-registered-oauth-clients"},{"title":"Register an OAuth client from the dashboard","deprecated":null,"version":null,"openapi":"https://api.nexspace365.com/api/openapi.json post /api/oauth-clients","href":"/api-reference/oauth/register-an-oauth-client-from-the-dashboard"},{"title":"Revoke an OAuth client","deprecated":null,"version":null,"openapi":"https://api.nexspace365.com/api/openapi.json delete /api/oauth-clients/{id}","href":"/api-reference/oauth/revoke-an-oauth-client"}]},{"group":"Webhooks","pages":[{"title":"List webhook subscriptions","deprecated":null,"version":null,"openapi":"https://api.nexspace365.com/api/openapi.json get /api/webhooks","href":"/api-reference/webhooks/list-webhook-subscriptions"},{"title":"Create webhook subscription","deprecated":null,"version":null,"openapi":"https://api.nexspace365.com/api/openapi.json post /api/webhooks","href":"/api-reference/webhooks/create-webhook-subscription"},{"title":"Get webhook subscription with recent deliveries","deprecated":null,"version":null,"openapi":"https://api.nexspace365.com/api/openapi.json get /api/webhooks/{id}","href":"/api-reference/webhooks/get-webhook-subscription-with-recent-deliveries"},{"title":"Delete webhook subscription","deprecated":null,"version":null,"openapi":"https://api.nexspace365.com/api/openapi.json delete /api/webhooks/{id}","href":"/api-reference/webhooks/delete-webhook-subscription"},{"title":"Update webhook subscription","deprecated":null,"version":null,"openapi":"https://api.nexspace365.com/api/openapi.json patch /api/webhooks/{id}","href":"/api-reference/webhooks/update-webhook-subscription"},{"title":"Send a test event to a webhook","deprecated":null,"version":null,"openapi":"https://api.nexspace365.com/api/openapi.json post /api/webhooks/{id}/test","href":"/api-reference/webhooks/send-a-test-event-to-a-webhook"}]},{"group":"Analytics","pages":[{"title":"Usage summary statistics","deprecated":null,"version":null,"openapi":"https://api.nexspace365.com/api/openapi.json get /api/api-usage/summary","href":"/api-reference/analytics/usage-summary-statistics"},{"title":"Usage timeseries","deprecated":null,"version":null,"openapi":"https://api.nexspace365.com/api/openapi.json get /api/api-usage/timeseries","href":"/api-reference/analytics/usage-timeseries"},{"title":"Usage by agent client","deprecated":null,"version":null,"openapi":"https://api.nexspace365.com/api/openapi.json get /api/api-usage/by-agent","href":"/api-reference/analytics/usage-by-agent-client"},{"title":"Usage by MCP tool","deprecated":null,"version":null,"openapi":"https://api.nexspace365.com/api/openapi.json get /api/api-usage/by-tool","href":"/api-reference/analytics/usage-by-mcp-tool"},{"title":"Usage by API key","deprecated":null,"version":null,"openapi":"https://api.nexspace365.com/api/openapi.json get /api/api-usage/by-key","href":"/api-reference/analytics/usage-by-api-key"},{"title":"Billable outcome counts","deprecated":null,"version":null,"openapi":"https://api.nexspace365.com/api/openapi.json get /api/api-usage/outcomes","href":"/api-reference/analytics/billable-outcome-counts"},{"title":"Export API usage (CSV)","deprecated":null,"version":null,"openapi":"https://api.nexspace365.com/api/openapi.json get /api/api-usage/export","href":"/api-reference/analytics/export-api-usage-csv"}]},{"group":"Sandbox","pages":[{"title":"Clear and re-seed a facility's sandbox data","deprecated":null,"version":null,"openapi":"https://api.nexspace365.com/api/openapi.json post /api/sandbox/reset","href":"/api-reference/sandbox/clear-and-re-seed-a-facilitys-sandbox-data"}]},{"group":"Platform","pages":[{"title":"List available API versions","deprecated":null,"version":null,"openapi":"https://api.nexspace365.com/api/openapi.json get /.well-known/api-versions","href":"/api-reference/platform/list-available-api-versions"}]}]}]},{"tab":"SDKs","pages":[{"title":"SDKs","href":"/sdks/overview"}]},{"tab":"CLI","pages":[{"title":"CLI","href":"/cli/overview"}]}]},"basePath":"","title":"Start user impersonation - NexSpace Developer Docs","deploymentId":"dpl_XLevHnGPjzxq9mbREha5Faad63Sp","buildId":"dpl_XLevHnGPjzxq9mbREha5Faad63Sp","dynamics":["c2aa737661","2b790eda92","b0f84f53ff","a9bb46feb3"],"chunks":["OpenApiReferenceProvider-BD9G1WMi.js","snippetPresets-Bcqr8I2u.js","utils-BrYn4XiY.js","style-to-object-BY3JEAdk.js","utils-CYrCnchl.js","v4-DIgz8zy6.js","addTypeLabelsToSchema-CNFO66BS.js","conditional-requirements-CFM0id0Q.js","cloneDeep-BneVo7uA.js","_Uint8Array-n4RvRzp3.js","isObject-FP1Yky1u.js","ApiExamples-C1YMsTjy.js","usePlaygroundInputsStore-DayW4kZ9.js","shallow-DDCzdKmR.js","isEqual-CBVoazy8.js","CodeSnippets-CWandYY5.js","CodeSnippet-grFP6YU_.js","use-playground-group-access-BBqHUxQK.js","Page-DBPN_x5x.js","api-description-markdown-1J-AA_Kv.js","DynamicMarkdown-Dgh_e4rL.js","SectionHeading-BP6Np9Uh.js","MethodPill-4k_Ty_Xv.js","getPastedJson-CWUNKLcr.js","Check2Icon-Cs4FQb2J.js","axios-CsQoIw0U.js","Markdown-CR8c2fXT.js","AssistantPageLink-BBR7elHb.js","dist-DjFwSv8l.js","lib-DMeTj1gb.js","lib-B8HbPgcC.js","katex-Dbtb6Wk7.js","html-void-elements-mCSPHezU.js","marked.esm-CZWythHk.js"]}