@elevasis/sdk 1.20.2 → 1.22.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (164) hide show
  1. package/dist/cli.cjs +4220 -1583
  2. package/dist/index.d.ts +1035 -481
  3. package/dist/index.js +7381 -4187
  4. package/dist/node/index.d.ts +1 -3
  5. package/dist/node/index.js +40 -49
  6. package/dist/test-utils/index.d.ts +699 -123
  7. package/dist/test-utils/index.js +3826 -630
  8. package/dist/worker/index.js +3616 -442
  9. package/package.json +3 -3
  10. package/reference/_navigation.md +9 -7
  11. package/reference/_reference-manifest.json +1 -1
  12. package/reference/claude-config/hooks/post-edit-validate.mjs +98 -98
  13. package/reference/claude-config/hooks/scaffold-registry-reminder.mjs +188 -188
  14. package/reference/claude-config/hooks/tool-failure-recovery.mjs +73 -73
  15. package/reference/claude-config/registries/graph-skills.json +4 -4
  16. package/reference/claude-config/registries/knowledge-flags.json +0 -2
  17. package/reference/claude-config/rules/active-change-index.md +80 -80
  18. package/reference/claude-config/rules/agent-start-here.md +277 -273
  19. package/reference/claude-config/rules/deployment.md +57 -57
  20. package/reference/claude-config/rules/error-handling.md +56 -56
  21. package/reference/claude-config/rules/execution.md +40 -40
  22. package/reference/claude-config/rules/frontend.md +4 -4
  23. package/reference/claude-config/rules/observability.md +31 -31
  24. package/reference/claude-config/rules/operations.md +29 -17
  25. package/reference/claude-config/rules/organization-model.md +108 -40
  26. package/reference/claude-config/rules/organization-os.md +115 -113
  27. package/reference/claude-config/rules/package-taxonomy.md +33 -33
  28. package/reference/claude-config/rules/platform.md +42 -42
  29. package/reference/claude-config/rules/shared-types.md +49 -46
  30. package/reference/claude-config/rules/task-tracking.md +47 -47
  31. package/reference/claude-config/rules/ui.md +200 -200
  32. package/reference/claude-config/rules/vibe.md +235 -231
  33. package/reference/claude-config/scripts/statusline-command.js +18 -18
  34. package/reference/claude-config/settings.json +34 -34
  35. package/reference/claude-config/skills/deploy/{SKILL.md → skill.md} +156 -156
  36. package/reference/claude-config/skills/dsp/SKILL.md +66 -66
  37. package/reference/claude-config/skills/elevasis/SKILL.md +235 -235
  38. package/reference/claude-config/skills/explore/SKILL.md +6 -6
  39. package/reference/claude-config/skills/git-sync/SKILL.md +126 -126
  40. package/reference/claude-config/skills/knowledge/SKILL.md +330 -271
  41. package/reference/claude-config/skills/knowledge/operations/codify-level-a.md +100 -100
  42. package/reference/claude-config/skills/knowledge/operations/codify-level-b.md +159 -158
  43. package/reference/claude-config/skills/knowledge/operations/customers.md +109 -109
  44. package/reference/claude-config/skills/knowledge/operations/features.md +76 -113
  45. package/reference/claude-config/skills/knowledge/operations/goals.md +118 -118
  46. package/reference/claude-config/skills/knowledge/operations/identity.md +93 -93
  47. package/reference/claude-config/skills/knowledge/operations/labels.md +94 -89
  48. package/reference/claude-config/skills/knowledge/operations/offerings.md +109 -109
  49. package/reference/claude-config/skills/knowledge/operations/roles.md +99 -99
  50. package/reference/claude-config/skills/knowledge/operations/techStack.md +30 -30
  51. package/reference/claude-config/skills/project/SKILL.md +1088 -1088
  52. package/reference/claude-config/skills/run-ui/SKILL.md +73 -73
  53. package/reference/claude-config/skills/save/SKILL.md +3 -3
  54. package/reference/claude-config/skills/setup/SKILL.md +275 -275
  55. package/reference/claude-config/skills/status/SKILL.md +59 -59
  56. package/reference/claude-config/skills/submit-request/SKILL.md +180 -180
  57. package/reference/claude-config/skills/sync/SKILL.md +47 -47
  58. package/reference/claude-config/skills/tutorial/SKILL.md +259 -259
  59. package/reference/claude-config/skills/tutorial/progress-template.md +74 -74
  60. package/reference/claude-config/skills/tutorial/technical.md +1303 -1306
  61. package/reference/claude-config/skills/tutorial/vibe-coder.md +890 -890
  62. package/reference/claude-config/sync-notes/2026-04-22-git-sync-and-sync-notes.md +27 -27
  63. package/reference/claude-config/sync-notes/2026-04-22-lead-gen-deliverability-removal.md +30 -30
  64. package/reference/claude-config/sync-notes/2026-04-24-test-utils-and-template-tests.md +73 -73
  65. package/reference/claude-config/sync-notes/2026-04-24-ui-consolidation-and-sdk-cli-train.md +86 -86
  66. package/reference/claude-config/sync-notes/2026-04-25-auth-role-system-and-settings-roles.md +55 -55
  67. package/reference/claude-config/sync-notes/2026-04-27-crm-hitl-action-layer-cutover.md +97 -97
  68. package/reference/claude-config/sync-notes/2026-04-27-lead-gen-substrate-train.md +112 -112
  69. package/reference/claude-config/sync-notes/2026-04-29-crm-state-and-lead-gen-processing-status.md +93 -93
  70. package/reference/claude-config/sync-notes/2026-05-02-crm-ownership-next-action.md +58 -58
  71. package/reference/claude-config/sync-notes/2026-05-02-template-hardcode-workos-config.md +56 -56
  72. package/reference/claude-config/sync-notes/2026-05-04-elevasis-workspace.md +71 -71
  73. package/reference/claude-config/sync-notes/2026-05-04-knowledge-bundle.md +83 -83
  74. package/reference/claude-config/sync-notes/2026-05-04-template-skills-run-ui-and-tutorial.md +59 -59
  75. package/reference/claude-config/sync-notes/2026-05-05-list-builder.md +42 -42
  76. package/reference/claude-config/sync-notes/2026-05-06-crm-spine.md +60 -60
  77. package/reference/claude-config/sync-notes/2026-05-06-sdk-changes-release-train.md +37 -37
  78. package/reference/claude-config/sync-notes/2026-05-07-sdk-changes-release-train.md +34 -34
  79. package/reference/claude-config/sync-notes/2026-05-08-resource-governance-scaffold-guidance.md +38 -38
  80. package/reference/claude-config/sync-notes/2026-05-09-clients-domain.md +32 -32
  81. package/reference/claude-config/sync-notes/2026-05-09-command-system.md +33 -33
  82. package/reference/claude-config/sync-notes/2026-05-09-resource-governance-and-misc.md +69 -69
  83. package/reference/claude-config/sync-notes/2026-05-12-sdk-ready-release-train.md +30 -0
  84. package/reference/claude-config/sync-notes/2026-05-14-organization-model-ontology-refactor.md +42 -0
  85. package/reference/claude-config/sync-notes/README.md +43 -43
  86. package/reference/cli.mdx +808 -668
  87. package/reference/concepts.mdx +146 -146
  88. package/reference/deployment/api.mdx +297 -297
  89. package/reference/deployment/command-center.mdx +209 -209
  90. package/reference/deployment/index.mdx +195 -195
  91. package/reference/deployment/provided-features.mdx +107 -93
  92. package/reference/deployment/ui-execution.mdx +250 -250
  93. package/reference/examples/organization-model.ts +147 -84
  94. package/reference/framework/agent.mdx +156 -156
  95. package/reference/framework/index.mdx +195 -195
  96. package/reference/framework/interaction-guidance.mdx +182 -182
  97. package/reference/framework/memory.mdx +326 -326
  98. package/reference/framework/project-structure.mdx +282 -282
  99. package/reference/framework/tutorial-system.mdx +135 -135
  100. package/reference/getting-started.mdx +142 -142
  101. package/reference/index.mdx +106 -106
  102. package/reference/packages/core/src/README.md +14 -14
  103. package/reference/packages/core/src/business/README.md +2 -2
  104. package/reference/packages/core/src/knowledge/README.md +33 -32
  105. package/reference/packages/core/src/organization-model/README.md +149 -109
  106. package/reference/packages/core/src/test-utils/README.md +37 -37
  107. package/reference/packages/ui/src/api/README.md +18 -18
  108. package/reference/packages/ui/src/app/README.md +24 -24
  109. package/reference/packages/ui/src/auth/README.md +18 -18
  110. package/reference/packages/ui/src/components/README.md +24 -24
  111. package/reference/packages/ui/src/execution/README.md +16 -16
  112. package/reference/packages/ui/src/features/README.md +28 -28
  113. package/reference/packages/ui/src/graph/README.md +16 -16
  114. package/reference/packages/ui/src/hooks/README.md +23 -23
  115. package/reference/packages/ui/src/initialization/README.md +19 -19
  116. package/reference/packages/ui/src/knowledge/README.md +31 -31
  117. package/reference/packages/ui/src/organization/README.md +18 -18
  118. package/reference/packages/ui/src/profile/README.md +19 -19
  119. package/reference/packages/ui/src/provider/README.md +32 -32
  120. package/reference/packages/ui/src/router/README.md +18 -18
  121. package/reference/packages/ui/src/sse/README.md +13 -13
  122. package/reference/packages/ui/src/test-utils/README.md +7 -7
  123. package/reference/packages/ui/src/theme/README.md +23 -23
  124. package/reference/packages/ui/src/theme/presets/README.md +19 -19
  125. package/reference/packages/ui/src/types/README.md +16 -16
  126. package/reference/packages/ui/src/utils/README.md +18 -18
  127. package/reference/packages/ui/src/zustand/README.md +18 -18
  128. package/reference/platform-tools/adapters-integration.mdx +301 -301
  129. package/reference/platform-tools/adapters-platform.mdx +553 -553
  130. package/reference/platform-tools/index.mdx +217 -217
  131. package/reference/platform-tools/type-safety.mdx +82 -82
  132. package/reference/resources/index.mdx +349 -349
  133. package/reference/resources/patterns.mdx +449 -449
  134. package/reference/resources/types.mdx +116 -116
  135. package/reference/roadmap.mdx +165 -165
  136. package/reference/runtime.mdx +173 -173
  137. package/reference/scaffold/core/organization-graph.mdx +110 -89
  138. package/reference/scaffold/core/organization-model.mdx +226 -171
  139. package/reference/scaffold/index.mdx +67 -67
  140. package/reference/scaffold/operations/propagation-pipeline.md +77 -77
  141. package/reference/scaffold/operations/scaffold-maintenance.md +10 -10
  142. package/reference/scaffold/operations/workflow-recipes.md +138 -138
  143. package/reference/scaffold/recipes/add-a-feature.md +310 -88
  144. package/reference/scaffold/recipes/add-a-resource.md +137 -117
  145. package/reference/scaffold/recipes/customize-crm-actions.md +439 -439
  146. package/reference/scaffold/recipes/customize-knowledge-browser.md +384 -0
  147. package/reference/scaffold/recipes/customize-organization-model.md +281 -118
  148. package/reference/scaffold/recipes/extend-a-base-entity.md +8 -8
  149. package/reference/scaffold/recipes/extend-crm.md +40 -39
  150. package/reference/scaffold/recipes/extend-lead-gen.md +400 -401
  151. package/reference/scaffold/recipes/gate-by-feature-or-admin.md +118 -114
  152. package/reference/scaffold/recipes/index.md +47 -46
  153. package/reference/scaffold/recipes/query-the-knowledge-graph.md +227 -0
  154. package/reference/scaffold/reference/contracts.md +2389 -2121
  155. package/reference/scaffold/reference/feature-registry.md +9 -20
  156. package/reference/scaffold/reference/glossary.md +76 -76
  157. package/reference/scaffold/ui/composition-extensibility.mdx +233 -233
  158. package/reference/scaffold/ui/customization.md +243 -243
  159. package/reference/scaffold/ui/feature-flags-and-gating.md +46 -46
  160. package/reference/scaffold/ui/feature-shell.mdx +72 -72
  161. package/reference/scaffold/ui/recipes.md +221 -213
  162. package/reference/spine/spine-primer.md +96 -96
  163. package/reference/templates/index.mdx +47 -47
  164. package/reference/troubleshooting.mdx +223 -223
@@ -1,297 +1,297 @@
1
- ---
2
- title: Execution API
3
- description: REST endpoints for executing resources, querying execution history, and managing deployments via the Elevasis external API
4
- loadWhen: "Calling the API directly or debugging API responses"
5
- ---
6
-
7
- The Elevasis external API exposes REST endpoints under `/api/external/` for executing your deployed resources and inspecting results. All endpoints require your `ELEVASIS_PLATFORM_KEY` sent as a Bearer token. Organization is resolved server-side from the API key -- you never pass an org identifier in requests.
8
-
9
- **Authentication header:**
10
-
11
- ```
12
- Authorization: Bearer sk_...
13
- ```
14
-
15
- ---
16
-
17
- ## API Base URL
18
-
19
- | Environment | Base URL |
20
- | ----------- | --------------------------- |
21
- | Production | `https://api.elevasis.io` |
22
- | Development | `http://localhost:<port>` |
23
-
24
- Override the base URL by setting `ELEVASIS_API_URL` in your environment or passing `--api-url` to any CLI command.
25
-
26
- ---
27
-
28
- ## Endpoints
29
-
30
- | Method | Path | Purpose |
31
- | ------ | ---------------------------------------------------------- | ---------------------------------------- |
32
- | `GET` | `/api/external/resources` | List all resources for your organization |
33
- | `GET` | `/api/external/resources/:resourceId/definition` | Get resource metadata and schemas |
34
- | `POST` | `/api/external/execute` | Execute a resource synchronously |
35
- | `POST` | `/api/external/execute-async` | Execute a resource asynchronously |
36
- | `POST` | `/api/external/executions/:resourceId/:executionId/cancel` | Cancel a running execution |
37
- | `GET` | `/api/external/executions/:resourceId` | List execution history for a resource |
38
- | `GET` | `/api/external/executions/:resourceId/:executionId` | Get full execution detail |
39
- | `POST` | `/api/external/deploy` | Upload bundle and deploy resources |
40
- | `GET` | `/api/external/deployments` | List all deployments |
41
- | `GET` | `/api/external/deployments/:id` | Get a deployment by ID |
42
-
43
- ---
44
-
45
- ## Execution Endpoints
46
-
47
- ### POST /api/external/execute
48
-
49
- Execute a resource synchronously. The request waits for the resource to complete and returns the full result.
50
-
51
- **Request body:**
52
-
53
- ```json
54
- {
55
- "resourceId": "onboard-client",
56
- "input": {
57
- "clientName": "Jane",
58
- "email": "jane@example.com"
59
- }
60
- }
61
- ```
62
-
63
- **Response:**
64
-
65
- ```json
66
- {
67
- "executionId": "550e8400-e29b-41d4-a716-446655440000",
68
- "success": true,
69
- "data": {
70
- "success": true,
71
- "clientId": "client_1708521600000",
72
- "welcomeEmailSent": true
73
- }
74
- }
75
- ```
76
-
77
- ### POST /api/external/execute-async
78
-
79
- Execute a resource asynchronously. Returns immediately with an `executionId`. Poll `GET /executions/:resourceId/:executionId` to check status and retrieve output.
80
-
81
- **Request body:**
82
-
83
- ```json
84
- {
85
- "resourceId": "onboard-client",
86
- "input": { "clientName": "Jane" }
87
- }
88
- ```
89
-
90
- **Response:**
91
-
92
- ```json
93
- {
94
- "executionId": "550e8400-e29b-41d4-a716-446655440000",
95
- "status": "running"
96
- }
97
- ```
98
-
99
- ### POST /api/external/executions/:resourceId/:executionId/cancel
100
-
101
- Cancel a running execution. If the execution is found in memory, sends a cancellation signal immediately. Falls back to a database status update if no in-memory signal is found.
102
-
103
- **Response:**
104
-
105
- ```json
106
- {
107
- "success": true
108
- }
109
- ```
110
-
111
- ---
112
-
113
- ## Resource Endpoints
114
-
115
- ### GET /api/external/resources
116
-
117
- List all resources registered to your organization. In production, only `status: 'prod'` resources are returned.
118
-
119
- **Response:**
120
-
121
- ```json
122
- [
123
- {
124
- "resourceId": "onboard-client",
125
- "resourceType": "workflow",
126
- "name": "Onboard Client",
127
- "status": "prod"
128
- },
129
- {
130
- "resourceId": "email-assistant",
131
- "resourceType": "agent",
132
- "name": "Email Assistant",
133
- "status": "prod"
134
- }
135
- ]
136
- ```
137
-
138
- ### GET /api/external/resources/:resourceId/definition
139
-
140
- Get the full definition for a single resource: metadata, input schema, and output schema.
141
-
142
- **Response:**
143
-
144
- ```json
145
- {
146
- "resourceId": "onboard-client",
147
- "resourceType": "workflow",
148
- "name": "Onboard Client",
149
- "description": "Creates a client record and sends a welcome email",
150
- "status": "prod",
151
- "inputSchema": {
152
- "type": "object",
153
- "properties": {
154
- "clientName": { "type": "string" },
155
- "email": { "type": "string", "format": "email" }
156
- },
157
- "required": ["clientName", "email"]
158
- },
159
- "outputSchema": {
160
- "type": "object",
161
- "properties": {
162
- "success": { "type": "boolean" },
163
- "clientId": { "type": "string" }
164
- }
165
- }
166
- }
167
- ```
168
-
169
- Returns `404` if the resource is not found.
170
-
171
- ---
172
-
173
- ## Execution History Endpoints
174
-
175
- ### GET /api/external/executions/:resourceId
176
-
177
- List execution history for a resource.
178
-
179
- **Query parameters:**
180
-
181
- | Parameter | Description |
182
- | --------- | --------------------------------------------------------------- |
183
- | `limit` | Maximum number of results (default: 20) |
184
- | `status` | Filter by status: `running`, `completed`, `failed`, `cancelled` |
185
-
186
- **Response:**
187
-
188
- ```json
189
- [
190
- {
191
- "executionId": "550e8400-e29b-41d4-a716-446655440000",
192
- "resourceId": "onboard-client",
193
- "status": "completed",
194
- "createdAt": "2026-02-25T14:32:01Z",
195
- "durationMs": 1234
196
- }
197
- ]
198
- ```
199
-
200
- ### GET /api/external/executions/:resourceId/:executionId
201
-
202
- Get the full detail for a single execution including input, output, logs, and error.
203
-
204
- **Response:**
205
-
206
- ```json
207
- {
208
- "executionId": "550e8400-e29b-41d4-a716-446655440000",
209
- "resourceId": "onboard-client",
210
- "status": "completed",
211
- "createdAt": "2026-02-25T14:32:01Z",
212
- "durationMs": 1234,
213
- "input": {
214
- "clientName": "Jane",
215
- "email": "jane@example.com"
216
- },
217
- "output": {
218
- "success": true,
219
- "clientId": "client_1708521600000",
220
- "welcomeEmailSent": true
221
- },
222
- "logs": [
223
- { "timestamp": "2026-02-25T14:32:01.123Z", "message": "Starting onboard-client workflow" },
224
- { "timestamp": "2026-02-25T14:32:01.456Z", "message": "Created client record" }
225
- ],
226
- "error": null
227
- }
228
- ```
229
-
230
- ---
231
-
232
- ## Deployment Endpoints
233
-
234
- ### POST /api/external/deploy
235
-
236
- Upload a resource bundle and deploy it. Accepts a multipart request with the compiled bundle and resource metadata.
237
-
238
- **Response:**
239
-
240
- ```json
241
- {
242
- "deployId": "deploy_abc123",
243
- "status": "active",
244
- "resources": 4
245
- }
246
- ```
247
-
248
- Use `elevasis-sdk deploy` from the CLI rather than calling this endpoint directly -- the CLI handles bundling, metadata generation, and status streaming automatically.
249
-
250
- ### GET /api/external/deployments
251
-
252
- List all deployments for your organization.
253
-
254
- **Response:**
255
-
256
- ```json
257
- [
258
- {
259
- "id": "deploy_abc123",
260
- "status": "active",
261
- "createdAt": "2026-02-25T14:00:00Z",
262
- "resources": 4
263
- },
264
- {
265
- "id": "deploy_abc122",
266
- "status": "stopped",
267
- "createdAt": "2026-02-24T09:30:00Z",
268
- "resources": 3
269
- }
270
- ]
271
- ```
272
-
273
- ### GET /api/external/deployments/:id
274
-
275
- Get a single deployment by ID.
276
-
277
- **Response shape:** Same as a single item from `GET /deployments`.
278
-
279
- ---
280
-
281
- ## CLI Execution Commands
282
-
283
- The SDK CLI wraps all execution endpoints. Use these commands instead of calling the API directly during development:
284
-
285
- | Command | API call | Purpose |
286
- | ------------------------------------------------------ | -------------------------------------------- | ------------------------ |
287
- | `elevasis-sdk resources` | `GET /api/external/resources` | List all resources |
288
- | `elevasis-sdk describe <resource>` | `GET /api/external/resources/:id/definition` | Show resource definition |
289
- | `elevasis-sdk exec <resource> --input '...'` | `POST /api/external/execute` | Execute synchronously |
290
- | `elevasis-sdk exec <resource> --input '...' --async` | `POST /api/external/execute-async` | Execute asynchronously |
291
- | `elevasis-sdk executions <resource>` | `GET /api/external/executions/:id` | List execution history |
292
- | `elevasis-sdk execution <resource> <id>` | `GET /api/external/executions/:id/:execId` | Get execution detail |
293
- | `elevasis-sdk deployments` | `GET /api/external/deployments` | List deployments |
294
-
295
- ---
296
-
297
- **Last Updated:** 2026-02-25
1
+ ---
2
+ title: Execution API
3
+ description: REST endpoints for executing resources, querying execution history, and managing deployments via the Elevasis external API
4
+ loadWhen: "Calling the API directly or debugging API responses"
5
+ ---
6
+
7
+ The Elevasis external API exposes REST endpoints under `/api/external/` for executing your deployed resources and inspecting results. All endpoints require your `ELEVASIS_PLATFORM_KEY` sent as a Bearer token. Organization is resolved server-side from the API key -- you never pass an org identifier in requests.
8
+
9
+ **Authentication header:**
10
+
11
+ ```
12
+ Authorization: Bearer sk_...
13
+ ```
14
+
15
+ ---
16
+
17
+ ## API Base URL
18
+
19
+ | Environment | Base URL |
20
+ | ----------- | --------------------------- |
21
+ | Production | `https://api.elevasis.io` |
22
+ | Development | `http://localhost:<port>` |
23
+
24
+ Override the base URL by setting `ELEVASIS_API_URL` in your environment or passing `--api-url` to any CLI command.
25
+
26
+ ---
27
+
28
+ ## Endpoints
29
+
30
+ | Method | Path | Purpose |
31
+ | ------ | ---------------------------------------------------------- | ---------------------------------------- |
32
+ | `GET` | `/api/external/resources` | List all resources for your organization |
33
+ | `GET` | `/api/external/resources/:resourceId/definition` | Get resource metadata and schemas |
34
+ | `POST` | `/api/external/execute` | Execute a resource synchronously |
35
+ | `POST` | `/api/external/execute-async` | Execute a resource asynchronously |
36
+ | `POST` | `/api/external/executions/:resourceId/:executionId/cancel` | Cancel a running execution |
37
+ | `GET` | `/api/external/executions/:resourceId` | List execution history for a resource |
38
+ | `GET` | `/api/external/executions/:resourceId/:executionId` | Get full execution detail |
39
+ | `POST` | `/api/external/deploy` | Upload bundle and deploy resources |
40
+ | `GET` | `/api/external/deployments` | List all deployments |
41
+ | `GET` | `/api/external/deployments/:id` | Get a deployment by ID |
42
+
43
+ ---
44
+
45
+ ## Execution Endpoints
46
+
47
+ ### POST /api/external/execute
48
+
49
+ Execute a resource synchronously. The request waits for the resource to complete and returns the full result.
50
+
51
+ **Request body:**
52
+
53
+ ```json
54
+ {
55
+ "resourceId": "onboard-client",
56
+ "input": {
57
+ "clientName": "Jane",
58
+ "email": "jane@example.com"
59
+ }
60
+ }
61
+ ```
62
+
63
+ **Response:**
64
+
65
+ ```json
66
+ {
67
+ "executionId": "550e8400-e29b-41d4-a716-446655440000",
68
+ "success": true,
69
+ "data": {
70
+ "success": true,
71
+ "clientId": "client_1708521600000",
72
+ "welcomeEmailSent": true
73
+ }
74
+ }
75
+ ```
76
+
77
+ ### POST /api/external/execute-async
78
+
79
+ Execute a resource asynchronously. Returns immediately with an `executionId`. Poll `GET /executions/:resourceId/:executionId` to check status and retrieve output.
80
+
81
+ **Request body:**
82
+
83
+ ```json
84
+ {
85
+ "resourceId": "onboard-client",
86
+ "input": { "clientName": "Jane" }
87
+ }
88
+ ```
89
+
90
+ **Response:**
91
+
92
+ ```json
93
+ {
94
+ "executionId": "550e8400-e29b-41d4-a716-446655440000",
95
+ "status": "running"
96
+ }
97
+ ```
98
+
99
+ ### POST /api/external/executions/:resourceId/:executionId/cancel
100
+
101
+ Cancel a running execution. If the execution is found in memory, sends a cancellation signal immediately. Falls back to a database status update if no in-memory signal is found.
102
+
103
+ **Response:**
104
+
105
+ ```json
106
+ {
107
+ "success": true
108
+ }
109
+ ```
110
+
111
+ ---
112
+
113
+ ## Resource Endpoints
114
+
115
+ ### GET /api/external/resources
116
+
117
+ List all resources registered to your organization. In production, only `status: 'prod'` resources are returned.
118
+
119
+ **Response:**
120
+
121
+ ```json
122
+ [
123
+ {
124
+ "resourceId": "onboard-client",
125
+ "resourceType": "workflow",
126
+ "name": "Onboard Client",
127
+ "status": "prod"
128
+ },
129
+ {
130
+ "resourceId": "email-assistant",
131
+ "resourceType": "agent",
132
+ "name": "Email Assistant",
133
+ "status": "prod"
134
+ }
135
+ ]
136
+ ```
137
+
138
+ ### GET /api/external/resources/:resourceId/definition
139
+
140
+ Get the full definition for a single resource: metadata, input schema, and output schema.
141
+
142
+ **Response:**
143
+
144
+ ```json
145
+ {
146
+ "resourceId": "onboard-client",
147
+ "resourceType": "workflow",
148
+ "name": "Onboard Client",
149
+ "description": "Creates a client record and sends a welcome email",
150
+ "status": "prod",
151
+ "inputSchema": {
152
+ "type": "object",
153
+ "properties": {
154
+ "clientName": { "type": "string" },
155
+ "email": { "type": "string", "format": "email" }
156
+ },
157
+ "required": ["clientName", "email"]
158
+ },
159
+ "outputSchema": {
160
+ "type": "object",
161
+ "properties": {
162
+ "success": { "type": "boolean" },
163
+ "clientId": { "type": "string" }
164
+ }
165
+ }
166
+ }
167
+ ```
168
+
169
+ Returns `404` if the resource is not found.
170
+
171
+ ---
172
+
173
+ ## Execution History Endpoints
174
+
175
+ ### GET /api/external/executions/:resourceId
176
+
177
+ List execution history for a resource.
178
+
179
+ **Query parameters:**
180
+
181
+ | Parameter | Description |
182
+ | --------- | --------------------------------------------------------------- |
183
+ | `limit` | Maximum number of results (default: 20) |
184
+ | `status` | Filter by status: `running`, `completed`, `failed`, `cancelled` |
185
+
186
+ **Response:**
187
+
188
+ ```json
189
+ [
190
+ {
191
+ "executionId": "550e8400-e29b-41d4-a716-446655440000",
192
+ "resourceId": "onboard-client",
193
+ "status": "completed",
194
+ "createdAt": "2026-02-25T14:32:01Z",
195
+ "durationMs": 1234
196
+ }
197
+ ]
198
+ ```
199
+
200
+ ### GET /api/external/executions/:resourceId/:executionId
201
+
202
+ Get the full detail for a single execution including input, output, logs, and error.
203
+
204
+ **Response:**
205
+
206
+ ```json
207
+ {
208
+ "executionId": "550e8400-e29b-41d4-a716-446655440000",
209
+ "resourceId": "onboard-client",
210
+ "status": "completed",
211
+ "createdAt": "2026-02-25T14:32:01Z",
212
+ "durationMs": 1234,
213
+ "input": {
214
+ "clientName": "Jane",
215
+ "email": "jane@example.com"
216
+ },
217
+ "output": {
218
+ "success": true,
219
+ "clientId": "client_1708521600000",
220
+ "welcomeEmailSent": true
221
+ },
222
+ "logs": [
223
+ { "timestamp": "2026-02-25T14:32:01.123Z", "message": "Starting onboard-client workflow" },
224
+ { "timestamp": "2026-02-25T14:32:01.456Z", "message": "Created client record" }
225
+ ],
226
+ "error": null
227
+ }
228
+ ```
229
+
230
+ ---
231
+
232
+ ## Deployment Endpoints
233
+
234
+ ### POST /api/external/deploy
235
+
236
+ Upload a resource bundle and deploy it. Accepts a multipart request with the compiled bundle and resource metadata.
237
+
238
+ **Response:**
239
+
240
+ ```json
241
+ {
242
+ "deployId": "deploy_abc123",
243
+ "status": "active",
244
+ "resources": 4
245
+ }
246
+ ```
247
+
248
+ Use `elevasis-sdk deploy` from the CLI rather than calling this endpoint directly -- the CLI handles bundling, metadata generation, and status streaming automatically.
249
+
250
+ ### GET /api/external/deployments
251
+
252
+ List all deployments for your organization.
253
+
254
+ **Response:**
255
+
256
+ ```json
257
+ [
258
+ {
259
+ "id": "deploy_abc123",
260
+ "status": "active",
261
+ "createdAt": "2026-02-25T14:00:00Z",
262
+ "resources": 4
263
+ },
264
+ {
265
+ "id": "deploy_abc122",
266
+ "status": "stopped",
267
+ "createdAt": "2026-02-24T09:30:00Z",
268
+ "resources": 3
269
+ }
270
+ ]
271
+ ```
272
+
273
+ ### GET /api/external/deployments/:id
274
+
275
+ Get a single deployment by ID.
276
+
277
+ **Response shape:** Same as a single item from `GET /deployments`.
278
+
279
+ ---
280
+
281
+ ## CLI Execution Commands
282
+
283
+ The SDK CLI wraps all execution endpoints. Use these commands instead of calling the API directly during development:
284
+
285
+ | Command | API call | Purpose |
286
+ | ------------------------------------------------------ | -------------------------------------------- | ------------------------ |
287
+ | `elevasis-sdk resources` | `GET /api/external/resources` | List all resources |
288
+ | `elevasis-sdk describe <resource>` | `GET /api/external/resources/:id/definition` | Show resource definition |
289
+ | `elevasis-sdk exec <resource> --input '...'` | `POST /api/external/execute` | Execute synchronously |
290
+ | `elevasis-sdk exec <resource> --input '...' --async` | `POST /api/external/execute-async` | Execute asynchronously |
291
+ | `elevasis-sdk executions <resource>` | `GET /api/external/executions/:id` | List execution history |
292
+ | `elevasis-sdk execution <resource> <id>` | `GET /api/external/executions/:id/:execId` | Get execution detail |
293
+ | `elevasis-sdk deployments` | `GET /api/external/deployments` | List deployments |
294
+
295
+ ---
296
+
297
+ **Last Updated:** 2026-02-25