@clear-street/clearstreet 0.100.0 → 0.102.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 (81) hide show
  1. package/CHANGELOG.md +20 -0
  2. package/package.json +1 -1
  3. package/resources/v1/calendar.d.mts +153 -1
  4. package/resources/v1/calendar.d.mts.map +1 -1
  5. package/resources/v1/calendar.d.ts +153 -1
  6. package/resources/v1/calendar.d.ts.map +1 -1
  7. package/resources/v1/calendar.js +17 -0
  8. package/resources/v1/calendar.js.map +1 -1
  9. package/resources/v1/calendar.mjs +17 -0
  10. package/resources/v1/calendar.mjs.map +1 -1
  11. package/resources/v1/index.d.mts +2 -2
  12. package/resources/v1/index.d.mts.map +1 -1
  13. package/resources/v1/index.d.ts +2 -2
  14. package/resources/v1/index.d.ts.map +1 -1
  15. package/resources/v1/index.js.map +1 -1
  16. package/resources/v1/index.mjs.map +1 -1
  17. package/resources/v1/omni-ai/index.d.mts +1 -1
  18. package/resources/v1/omni-ai/index.d.mts.map +1 -1
  19. package/resources/v1/omni-ai/index.d.ts +1 -1
  20. package/resources/v1/omni-ai/index.d.ts.map +1 -1
  21. package/resources/v1/omni-ai/index.js.map +1 -1
  22. package/resources/v1/omni-ai/index.mjs.map +1 -1
  23. package/resources/v1/omni-ai/messages.d.mts +17 -17
  24. package/resources/v1/omni-ai/messages.d.mts.map +1 -1
  25. package/resources/v1/omni-ai/messages.d.ts +17 -17
  26. package/resources/v1/omni-ai/messages.d.ts.map +1 -1
  27. package/resources/v1/omni-ai/messages.js +9 -11
  28. package/resources/v1/omni-ai/messages.js.map +1 -1
  29. package/resources/v1/omni-ai/messages.mjs +9 -11
  30. package/resources/v1/omni-ai/messages.mjs.map +1 -1
  31. package/resources/v1/omni-ai/omni-ai.d.mts +8 -2
  32. package/resources/v1/omni-ai/omni-ai.d.mts.map +1 -1
  33. package/resources/v1/omni-ai/omni-ai.d.ts +8 -2
  34. package/resources/v1/omni-ai/omni-ai.d.ts.map +1 -1
  35. package/resources/v1/omni-ai/omni-ai.js.map +1 -1
  36. package/resources/v1/omni-ai/omni-ai.mjs.map +1 -1
  37. package/resources/v1/omni-ai/responses.d.mts +21 -21
  38. package/resources/v1/omni-ai/responses.d.mts.map +1 -1
  39. package/resources/v1/omni-ai/responses.d.ts +21 -21
  40. package/resources/v1/omni-ai/responses.d.ts.map +1 -1
  41. package/resources/v1/omni-ai/responses.js +14 -18
  42. package/resources/v1/omni-ai/responses.js.map +1 -1
  43. package/resources/v1/omni-ai/responses.mjs +14 -18
  44. package/resources/v1/omni-ai/responses.mjs.map +1 -1
  45. package/resources/v1/omni-ai/threads.d.mts +124 -64
  46. package/resources/v1/omni-ai/threads.d.mts.map +1 -1
  47. package/resources/v1/omni-ai/threads.d.ts +124 -64
  48. package/resources/v1/omni-ai/threads.d.ts.map +1 -1
  49. package/resources/v1/omni-ai/threads.js +41 -51
  50. package/resources/v1/omni-ai/threads.js.map +1 -1
  51. package/resources/v1/omni-ai/threads.mjs +41 -51
  52. package/resources/v1/omni-ai/threads.mjs.map +1 -1
  53. package/resources/v1/orders.d.mts +126 -22
  54. package/resources/v1/orders.d.mts.map +1 -1
  55. package/resources/v1/orders.d.ts +126 -22
  56. package/resources/v1/orders.d.ts.map +1 -1
  57. package/resources/v1/positions.d.mts +13 -11
  58. package/resources/v1/positions.d.mts.map +1 -1
  59. package/resources/v1/positions.d.ts +13 -11
  60. package/resources/v1/positions.d.ts.map +1 -1
  61. package/resources/v1/v1.d.mts +4 -4
  62. package/resources/v1/v1.d.mts.map +1 -1
  63. package/resources/v1/v1.d.ts +4 -4
  64. package/resources/v1/v1.d.ts.map +1 -1
  65. package/resources/v1/v1.js.map +1 -1
  66. package/resources/v1/v1.mjs.map +1 -1
  67. package/src/resources/v1/calendar.ts +188 -0
  68. package/src/resources/v1/index.ts +7 -0
  69. package/src/resources/v1/omni-ai/index.ts +2 -0
  70. package/src/resources/v1/omni-ai/messages.ts +17 -17
  71. package/src/resources/v1/omni-ai/omni-ai.ts +11 -0
  72. package/src/resources/v1/omni-ai/responses.ts +22 -22
  73. package/src/resources/v1/omni-ai/threads.ts +136 -65
  74. package/src/resources/v1/orders.ts +140 -21
  75. package/src/resources/v1/positions.ts +14 -11
  76. package/src/resources/v1/v1.ts +14 -0
  77. package/src/version.ts +1 -1
  78. package/version.d.mts +1 -1
  79. package/version.d.ts +1 -1
  80. package/version.js +1 -1
  81. package/version.mjs +1 -1
@@ -13,22 +13,23 @@ import { path } from '../../../internal/utils/path';
13
13
  */
14
14
  export class Threads extends APIResource {
15
15
  /**
16
- * Continue an existing conversation thread.
17
- *
18
- * Appends a new user message to the thread and starts an assistant response. Only
19
- * one response may be active per thread at a time — if the previous turn is still
20
- * in progress, this endpoint returns **409 Conflict**. Wait for the active
21
- * response to reach a terminal status before submitting the next turn.
22
- *
16
+ * Append a user message to an existing thread and start an assistant response.
23
17
  * Poll the returned `response_id` via `GET /omni-ai/responses/{response_id}` for
24
18
  * assistant output.
25
19
  *
20
+ * Only one response may be active per thread. Wait for it to reach a terminal
21
+ * status before submitting another turn; otherwise this endpoint returns 409.
22
+ *
23
+ * The first accepted selected-account message links an unlinked thread. A linked
24
+ * thread keeps its account regardless of omission or another selection. A changed
25
+ * scope also returns 409 without accepting a turn.
26
+ *
26
27
  * @example
27
28
  * ```ts
28
29
  * const response =
29
30
  * await client.v1.omniAI.threads.createMessage(
30
31
  * '182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e',
31
- * { account_id: 19816, text: 'Compare that to AMD.' },
32
+ * { text: 'Compare that to AMD.' },
32
33
  * );
33
34
  * ```
34
35
  */
@@ -41,23 +42,21 @@ export class Threads extends APIResource {
41
42
  }
42
43
 
43
44
  /**
44
- * Create a new conversation thread.
45
+ * Atomically create a conversation and submit its first user turn. Use `instant`
46
+ * with `text` for a prompt, or `deep_insights` with a ticker `target` and optional
47
+ * `thesis` for long-form research.
45
48
  *
46
- * Atomically creates a new thread and submits the first user turn. The response
47
- * contains a `response_id` that should be polled via
48
- * `GET /omni-ai/responses/{response_id}` for assistant output.
49
- *
50
- * Two creation modes are supported:
49
+ * Poll the returned `response_id` via `GET /omni-ai/responses/{response_id}` for
50
+ * assistant output.
51
51
  *
52
- * - **instant** — provide `text` with a natural-language prompt.
53
- * - **deep_insights** — provide a `target` ticker and optional `thesis` for
54
- * long-form research.
52
+ * Omit `account_id` to start without an account. The first accepted turn with a
53
+ * selected account links that account permanently. Reuse `Idempotency-Key` only
54
+ * for an identical request.
55
55
  *
56
56
  * @example
57
57
  * ```ts
58
58
  * const response =
59
59
  * await client.v1.omniAI.threads.createThread({
60
- * account_id: 19816,
61
60
  * type: 'instant',
62
61
  * });
63
62
  * ```
@@ -70,102 +69,122 @@ export class Threads extends APIResource {
70
69
  }
71
70
 
72
71
  /**
73
- * List finalized messages in a thread.
72
+ * List finalized messages, including messages created before the account link.
73
+ * Return the latest page by default, in chronological order within each page. Use
74
+ * the returned page token to navigate history.
74
75
  *
75
- * Returns the latest page of **finalized** messages by default, with messages
76
- * within each page ordered chronologically. Messages from in-progress assistant
77
- * turns are excluded — use `GET /omni-ai/threads/{thread_id}/response` or
78
- * `GET /omni-ai/responses/{response_id}` for live output.
79
- *
80
- * If the last finalized message has role `USER`, an active response likely exists
81
- * and should be polled separately.
76
+ * In-progress assistant output is not included. Poll
77
+ * `GET /omni-ai/responses/{response_id}` until the response reaches a terminal
78
+ * status, then read its finalized message here.
82
79
  *
83
80
  * @example
84
81
  * ```ts
85
82
  * const response = await client.v1.omniAI.threads.getMessages(
86
83
  * '182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e',
87
- * { account_id: 0 },
88
84
  * );
89
85
  * ```
90
86
  */
91
87
  getMessages(
92
88
  threadID: string,
93
- query: ThreadGetMessagesParams,
89
+ query: ThreadGetMessagesParams | null | undefined = {},
94
90
  options?: RequestOptions,
95
91
  ): APIPromise<ThreadGetMessagesResponse> {
96
92
  return this._client.get(path`/v1/omni-ai/threads/${threadID}/messages`, { query, ...options });
97
93
  }
98
94
 
99
95
  /**
100
- * Get a specific thread.
96
+ * Read an owned thread's metadata. Use `GET /omni-ai/threads/{thread_id}/messages`
97
+ * for conversation history.
101
98
  *
102
- * Returns metadata (title, timestamps) for a single thread. Does not include
103
- * messages — use `GET /omni-ai/threads/{thread_id}/messages` for conversation
104
- * history.
99
+ * Omission or another account selection does not change authorization.
105
100
  *
106
101
  * @example
107
102
  * ```ts
108
103
  * const response =
109
104
  * await client.v1.omniAI.threads.getThreadByID(
110
105
  * '182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e',
111
- * { account_id: 0 },
112
106
  * );
113
107
  * ```
114
108
  */
115
109
  getThreadByID(
116
110
  threadID: string,
117
- query: ThreadGetThreadByIDParams,
111
+ query: ThreadGetThreadByIDParams | null | undefined = {},
118
112
  options?: RequestOptions,
119
113
  ): APIPromise<ThreadGetThreadByIDResponse> {
120
114
  return this._client.get(path`/v1/omni-ai/threads/${threadID}`, { query, ...options });
121
115
  }
122
116
 
123
117
  /**
124
- * Get the active response for a thread.
125
- *
126
- * Convenience endpoint to look up the currently active response for a thread
127
- * without knowing the `response_id`. Useful when reloading a thread whose last
128
- * finalized message is a `USER` message — this indicates an assistant turn is
129
- * likely in progress.
118
+ * Look up the currently active response without knowing its `response_id`. Use
119
+ * this endpoint when reopening a thread whose assistant turn may still be in
120
+ * progress.
130
121
  *
131
- * Returns **404** if no active response exists (the thread is idle).
122
+ * An idle owned thread returns HTTP 200 with `data: null`.
132
123
  *
133
124
  * @example
134
125
  * ```ts
135
126
  * const response =
136
127
  * await client.v1.omniAI.threads.getThreadResponse(
137
128
  * '182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e',
138
- * { account_id: 0 },
139
129
  * );
140
130
  * ```
141
131
  */
142
132
  getThreadResponse(
143
133
  threadID: string,
144
- query: ThreadGetThreadResponseParams,
134
+ query: ThreadGetThreadResponseParams | null | undefined = {},
145
135
  options?: RequestOptions,
146
136
  ): APIPromise<ThreadGetThreadResponseResponse> {
147
137
  return this._client.get(path`/v1/omni-ai/threads/${threadID}/response`, { query, ...options });
148
138
  }
149
139
 
150
140
  /**
151
- * List conversation threads.
141
+ * List authorized conversation metadata, newest first. Use `page_size` and
142
+ * `page_token` for pagination, and the messages endpoint for conversation history.
152
143
  *
153
- * Returns thread metadata ordered by most recently created first. Use `page_size`
154
- * and `page_token` for pagination. Thread objects contain only metadata (title,
155
- * timestamps) — use the messages endpoint for conversation history.
144
+ * With `account_id`, list only conversations linked to that account and require
145
+ * current account access. Without it, list only conversations with no linked
146
+ * account.
156
147
  *
157
148
  * @example
158
149
  * ```ts
159
- * const response = await client.v1.omniAI.threads.getThreads({
160
- * account_id: 0,
161
- * });
150
+ * const response =
151
+ * await client.v1.omniAI.threads.getThreads();
162
152
  * ```
163
153
  */
164
- getThreads(query: ThreadGetThreadsParams, options?: RequestOptions): APIPromise<ThreadGetThreadsResponse> {
154
+ getThreads(
155
+ query: ThreadGetThreadsParams | null | undefined = {},
156
+ options?: RequestOptions,
157
+ ): APIPromise<ThreadGetThreadsResponse> {
165
158
  return this._client.get('/v1/omni-ai/threads', { query, ...options });
166
159
  }
167
160
  }
168
161
 
162
+ /**
163
+ * A snapshot of the widget the user asks about.
164
+ */
165
+ export interface ContextItem {
166
+ /**
167
+ * Relevant widget data, selections, and units. Use strings for exact decimals and
168
+ * large IDs.
169
+ */
170
+ data: { [key: string]: unknown };
171
+
172
+ /**
173
+ * Nonblank descriptive kind. New kinds do not require a backend release.
174
+ */
175
+ kind: string;
176
+
177
+ /**
178
+ * Nonblank attachment label for conversation rendering.
179
+ */
180
+ label: string;
181
+
182
+ /**
183
+ * Client-reported snapshot time. Omit when unknown.
184
+ */
185
+ captured_at?: string | null;
186
+ }
187
+
169
188
  /**
170
189
  * Response payload for continuing a thread with a new message.
171
190
  */
@@ -215,6 +234,13 @@ export interface Message {
215
234
 
216
235
  thread_id: string;
217
236
 
237
+ /**
238
+ * Immutable snapshots attached to this user message. Omitted when none were
239
+ * supplied. When a null/undefined value is observed, it indicates that there is no
240
+ * available data.
241
+ */
242
+ context?: TurnContext | null;
243
+
218
244
  /**
219
245
  * When a null/undefined value is observed, it indicates it does not apply.
220
246
  */
@@ -288,7 +314,7 @@ export type MessageOutcome = 'completed' | 'errored' | 'canceled';
288
314
  export type MessageRole = 'USER' | 'ASSISTANT';
289
315
 
290
316
  /**
291
- * Thread metadata returned by list/get thread endpoints.
317
+ * Thread metadata.
292
318
  */
293
319
  export interface Thread {
294
320
  id: string;
@@ -302,6 +328,20 @@ export interface Thread {
302
328
 
303
329
  export type ThreadList = Array<Thread>;
304
330
 
331
+ /**
332
+ * Client snapshots attached to one instant-chat user message.
333
+ *
334
+ * Context is separate from visible message text and does not grant account access.
335
+ * The compact JSON representation must not exceed 64 KiB.
336
+ */
337
+ export interface TurnContext {
338
+ /**
339
+ * One to four snapshots. Each snapshot's data may contain at most 32 levels of
340
+ * nesting.
341
+ */
342
+ items: Array<ContextItem>;
343
+ }
344
+
305
345
  export interface ThreadCreateMessageResponse extends Shared.BaseResponse {
306
346
  /**
307
347
  * Response payload for continuing a thread with a new message.
@@ -322,7 +362,7 @@ export interface ThreadGetMessagesResponse extends Shared.BaseResponse {
322
362
 
323
363
  export interface ThreadGetThreadByIDResponse extends Shared.BaseResponse {
324
364
  /**
325
- * Thread metadata returned by list/get thread endpoints.
365
+ * Thread metadata.
326
366
  */
327
367
  data: Thread;
328
368
  }
@@ -339,23 +379,44 @@ export interface ThreadGetThreadsResponse extends Shared.BaseResponse {
339
379
  }
340
380
 
341
381
  export interface ThreadCreateMessageParams {
342
- account_id: number;
343
-
344
382
  text: string;
345
383
 
384
+ /**
385
+ * Selected account for creation or the first account-linked turn. Omit for an
386
+ * unlinked conversation. An existing account link remains authoritative even when
387
+ * another account is selected.
388
+ */
389
+ account_id?: number | null;
390
+
346
391
  capabilities?: Array<'PREFILL_ORDER' | 'OPEN_CHART' | 'OPEN_SCREENER' | 'OPEN_ENTITLEMENT_CONSENT'>;
392
+
393
+ /**
394
+ * Snapshots for this instant-chat message. Omission does not remove earlier
395
+ * attachments.
396
+ */
397
+ context?: TurnContext | null;
347
398
  }
348
399
 
349
400
  export interface ThreadCreateThreadParams {
350
- account_id: number;
351
-
352
401
  /**
353
402
  * Thread creation mode.
354
403
  */
355
404
  type: 'instant' | 'deep_insights';
356
405
 
406
+ /**
407
+ * Selected account for creation or the first account-linked turn. Omit for an
408
+ * unlinked conversation. An existing account link remains authoritative even when
409
+ * another account is selected.
410
+ */
411
+ account_id?: number | null;
412
+
357
413
  capabilities?: Array<'PREFILL_ORDER' | 'OPEN_CHART' | 'OPEN_SCREENER' | 'OPEN_ENTITLEMENT_CONSENT'>;
358
414
 
415
+ /**
416
+ * Snapshots for the first instant-chat message. Omit to attach no new context.
417
+ */
418
+ context?: TurnContext | null;
419
+
359
420
  /**
360
421
  * Deep-insights target payload.
361
422
  */
@@ -382,9 +443,11 @@ export namespace ThreadCreateThreadParams {
382
443
 
383
444
  export interface ThreadGetMessagesParams {
384
445
  /**
385
- * Account ID for the request
446
+ * Lists only conversations for this account, or unlinked conversations when
447
+ * omitted. Other reads authorize the resource's linked account. Omit when no
448
+ * account is selected; empty values and the string null are invalid.
386
449
  */
387
- account_id: number;
450
+ account_id?: number;
388
451
 
389
452
  /**
390
453
  * The number of items to return per page. Only used when page_token is not
@@ -401,23 +464,29 @@ export interface ThreadGetMessagesParams {
401
464
 
402
465
  export interface ThreadGetThreadByIDParams {
403
466
  /**
404
- * Account ID for the request
467
+ * Lists only conversations for this account, or unlinked conversations when
468
+ * omitted. Other reads authorize the resource's linked account. Omit when no
469
+ * account is selected; empty values and the string null are invalid.
405
470
  */
406
- account_id: number;
471
+ account_id?: number;
407
472
  }
408
473
 
409
474
  export interface ThreadGetThreadResponseParams {
410
475
  /**
411
- * Account ID for the request
476
+ * Lists only conversations for this account, or unlinked conversations when
477
+ * omitted. Other reads authorize the resource's linked account. Omit when no
478
+ * account is selected; empty values and the string null are invalid.
412
479
  */
413
- account_id: number;
480
+ account_id?: number;
414
481
  }
415
482
 
416
483
  export interface ThreadGetThreadsParams {
417
484
  /**
418
- * Account ID for the request
485
+ * Lists only conversations for this account, or unlinked conversations when
486
+ * omitted. Other reads authorize the resource's linked account. Omit when no
487
+ * account is selected; empty values and the string null are invalid.
419
488
  */
420
- account_id: number;
489
+ account_id?: number;
421
490
 
422
491
  /**
423
492
  * The number of items to return per page. Only used when page_token is not
@@ -434,6 +503,7 @@ export interface ThreadGetThreadsParams {
434
503
 
435
504
  export declare namespace Threads {
436
505
  export {
506
+ type ContextItem as ContextItem,
437
507
  type CreateMessageResponse as CreateMessageResponse,
438
508
  type CreateThreadResponse as CreateThreadResponse,
439
509
  type Message as Message,
@@ -444,6 +514,7 @@ export declare namespace Threads {
444
514
  type MessageRole as MessageRole,
445
515
  type Thread as Thread,
446
516
  type ThreadList as ThreadList,
517
+ type TurnContext as TurnContext,
447
518
  type ThreadCreateMessageResponse as ThreadCreateMessageResponse,
448
519
  type ThreadCreateThreadResponse as ThreadCreateThreadResponse,
449
520
  type ThreadGetMessagesResponse as ThreadGetMessagesResponse,
@@ -172,7 +172,8 @@ export interface Execution {
172
172
  order_id: string;
173
173
 
174
174
  /**
175
- * Filled quantity.
175
+ * Filled quantity. For a strategy-level multileg fill this is the net strategy
176
+ * quantity, not a per-leg quantity.
176
177
  */
177
178
  quantity: string;
178
179
 
@@ -187,9 +188,9 @@ export interface Execution {
187
188
  transaction_time: string;
188
189
 
189
190
  /**
190
- * Unique instrument identifier. `null` when this fill has no single resolvable
191
- * instrument. When a null/undefined value is observed, it indicates it does not
192
- * apply.
191
+ * Unique instrument identifier. `null` when this is a strategy-level multileg fill
192
+ * whose legs are reported individually in `legs[]`. When a null/undefined value is
193
+ * observed, it indicates it does not apply.
193
194
  */
194
195
  instrument_id?: string | null;
195
196
 
@@ -200,8 +201,9 @@ export interface Execution {
200
201
  price?: string | null;
201
202
 
202
203
  /**
203
- * Trading symbol. `null` when this fill has no single resolvable instrument. When
204
- * a null/undefined value is observed, it indicates it does not apply.
204
+ * Trading symbol. `null` when this is a strategy-level multileg fill whose legs
205
+ * are reported individually in `legs[]`. When a null/undefined value is observed,
206
+ * it indicates it does not apply.
205
207
  */
206
208
  symbol?: string | null;
207
209
 
@@ -306,6 +308,13 @@ export interface NewOrderRequest {
306
308
  */
307
309
  stop_price?: string | null;
308
310
 
311
+ /**
312
+ * Optional execution strategy. One of `SOR`, `VWAP`, or `TWAP`. Defaults to `SOR`.
313
+ * `VWAP` and `TWAP` are supported only on `MARKET` and `LIMIT` orders with `DAY`
314
+ * time-in-force, and are not supported on OTC common-stock orders.
315
+ */
316
+ strategy?: OrderStrategy | null;
317
+
309
318
  /**
310
319
  * Trading symbol. For equities, use the ticker symbol (e.g., "TSLA"). For options,
311
320
  * use the OSI symbol (e.g., "TSLA 250117C00190000"). Either `symbol` or
@@ -424,15 +433,16 @@ export interface Order {
424
433
  extended_hours?: boolean | null;
425
434
 
426
435
  /**
427
- * Instrument identifier for the traded instrument. `null` when the order has no
428
- * single resolvable instrument. When a null/undefined value is observed, it
429
- * indicates it does not apply.
436
+ * Instrument identifier for the traded instrument. `null` when the order is a
437
+ * multileg strategy whose legs are reported individually in `legs[]`. When a
438
+ * null/undefined value is observed, it indicates it does not apply.
430
439
  */
431
440
  instrument_id?: string | null;
432
441
 
433
442
  /**
434
- * Type of security. `null` when the order has no single resolvable instrument.
435
- * When a null/undefined value is observed, it indicates it does not apply.
443
+ * Type of security. `null` when the order is a multileg strategy whose legs are
444
+ * reported individually in `legs[]`. When a null/undefined value is observed, it
445
+ * indicates it does not apply.
436
446
  */
437
447
  instrument_type?: V1API.SecurityType | null;
438
448
 
@@ -468,8 +478,14 @@ export interface Order {
468
478
  stop_price?: string | null;
469
479
 
470
480
  /**
471
- * Trading symbol. `null` when the order has no single resolvable instrument. When
472
- * a null/undefined value is observed, it indicates it does not apply.
481
+ * The execution strategy the order was submitted with, if any.
482
+ */
483
+ strategy?: Order.Strategy;
484
+
485
+ /**
486
+ * Trading symbol. `null` when the order is a multileg strategy whose legs are
487
+ * reported individually in `legs[]`. When a null/undefined value is observed, it
488
+ * indicates it does not apply.
473
489
  */
474
490
  symbol?: string | null;
475
491
 
@@ -529,6 +545,30 @@ export interface Order {
529
545
  underlying_instrument_type?: V1API.SecurityType | null;
530
546
  }
531
547
 
548
+ export namespace Order {
549
+ /**
550
+ * The execution strategy the order was submitted with, if any.
551
+ */
552
+ export interface Strategy {
553
+ /**
554
+ * Execution strategy type.
555
+ */
556
+ type: string;
557
+
558
+ /**
559
+ * UTC timestamp (RFC 3339) at which execution ends.
560
+ */
561
+ end_at?: string;
562
+
563
+ /**
564
+ * UTC timestamp (RFC 3339) at which execution begins.
565
+ */
566
+ start_at?: string;
567
+
568
+ [k: string]: unknown;
569
+ }
570
+ }
571
+
532
572
  export type OrderList = Array<Order>;
533
573
 
534
574
  /**
@@ -553,6 +593,70 @@ export type OrderStatus =
553
593
  | 'CALCULATED'
554
594
  | 'OTHER';
555
595
 
596
+ /**
597
+ * Optional execution strategy controlling how the order is worked in the market.
598
+ * Omit to use standard routing. One of `SOR`, `VWAP`, or `TWAP`.
599
+ */
600
+ export type OrderStrategy = OrderStrategy.Type | OrderStrategy.UnionMember1 | OrderStrategy.UnionMember2;
601
+
602
+ export namespace OrderStrategy {
603
+ /**
604
+ * Smart Order Router. Routes the order to the best available venue(s).
605
+ */
606
+ export interface Type {
607
+ /**
608
+ * Execution strategy type.
609
+ */
610
+ type: 'SOR';
611
+ }
612
+
613
+ /**
614
+ * Volume-Weighted Average Price. Works the order to track the volume-weighted
615
+ * average price over the execution window.
616
+ */
617
+ export interface UnionMember1 {
618
+ /**
619
+ * Execution strategy type.
620
+ */
621
+ type: 'VWAP';
622
+
623
+ /**
624
+ * UTC timestamp (RFC 3339) by which to finish working the order. Defaults to
625
+ * market close.
626
+ */
627
+ end_at?: string;
628
+
629
+ /**
630
+ * UTC timestamp (RFC 3339) at which to begin working the order. Defaults to the
631
+ * time the order is received.
632
+ */
633
+ start_at?: string;
634
+ }
635
+
636
+ /**
637
+ * Time-Weighted Average Price. Spreads execution evenly across the execution
638
+ * window.
639
+ */
640
+ export interface UnionMember2 {
641
+ /**
642
+ * Execution strategy type.
643
+ */
644
+ type: 'TWAP';
645
+
646
+ /**
647
+ * UTC timestamp (RFC 3339) by which to finish working the order. Defaults to
648
+ * market close.
649
+ */
650
+ end_at?: string;
651
+
652
+ /**
653
+ * UTC timestamp (RFC 3339) at which to begin working the order. Defaults to the
654
+ * time the order is received.
655
+ */
656
+ start_at?: string;
657
+ }
658
+ }
659
+
556
660
  /**
557
661
  * Order type
558
662
  */
@@ -870,26 +974,40 @@ export interface OrderGetOrdersParams {
870
974
  export namespace OrderGetOrdersParams {
871
975
  export interface UpdatedAt {
872
976
  /**
873
- * > **Alpha** — this parameter is experimental and may change or be removed at any
874
- * > time.
977
+ * Return only rows where `updated_at` is strictly after the given value. A bare
978
+ * `YYYY-MM-DD` date expands to the end of that day (UTC), so this matches from the
979
+ * start of the following day. See
980
+ * [Range filters](https://docs.clearstreet.com/guides/api-fundamentals#range-filters)
981
+ * for accepted formats, bare-date expansion, and combining bounds. Returns 400 if
982
+ * the resulting range is inverted.
875
983
  */
876
984
  gt?: string;
877
985
 
878
986
  /**
879
- * > **Alpha** — this parameter is experimental and may change or be removed at any
880
- * > time.
987
+ * Return only rows where `updated_at` is on or after the given value. A bare
988
+ * `YYYY-MM-DD` date expands to the start of that day (UTC). See
989
+ * [Range filters](https://docs.clearstreet.com/guides/api-fundamentals#range-filters)
990
+ * for accepted formats, bare-date expansion, and combining bounds. Returns 400 if
991
+ * the resulting range is inverted.
881
992
  */
882
993
  gte?: string;
883
994
 
884
995
  /**
885
- * > **Alpha** — this parameter is experimental and may change or be removed at any
886
- * > time.
996
+ * Return only rows where `updated_at` is strictly before the given value. A bare
997
+ * `YYYY-MM-DD` date expands to the start of that day (UTC). See
998
+ * [Range filters](https://docs.clearstreet.com/guides/api-fundamentals#range-filters)
999
+ * for accepted formats, bare-date expansion, and combining bounds. Returns 400 if
1000
+ * the resulting range is inverted.
887
1001
  */
888
1002
  lt?: string;
889
1003
 
890
1004
  /**
891
- * > **Alpha** — this parameter is experimental and may change or be removed at any
892
- * > time.
1005
+ * Return only rows where `updated_at` is on or before the given value. A bare
1006
+ * `YYYY-MM-DD` date expands to the end of that day (UTC), so this matches through
1007
+ * the end of that day. See
1008
+ * [Range filters](https://docs.clearstreet.com/guides/api-fundamentals#range-filters)
1009
+ * for accepted formats, bare-date expansion, and combining bounds. Returns 400 if
1010
+ * the resulting range is inverted.
893
1011
  */
894
1012
  lte?: string;
895
1013
  }
@@ -945,6 +1063,7 @@ export declare namespace Orders {
945
1063
  type Order as Order,
946
1064
  type OrderList as OrderList,
947
1065
  type OrderStatus as OrderStatus,
1066
+ type OrderStrategy as OrderStrategy,
948
1067
  type OrderType as OrderType,
949
1068
  type QueueState as QueueState,
950
1069
  type ReplaceOrderRequest as ReplaceOrderRequest,
@@ -350,12 +350,11 @@ export interface PositionInstruction {
350
350
  created_at?: string | null;
351
351
 
352
352
  /**
353
- * Machine-readable counterpart to `rejection_reason`: a stable reason code plus
354
- * params, present on every rejected row that has a `rejection_reason` — on submit,
355
- * cancel, get, and list alike. Branch on `rejection.reason` instead of parsing
356
- * `rejection_reason`. Forward-only: instructions rejected before this field
357
- * shipped may carry only `rejection_reason`. When a null/undefined value is
358
- * observed, it indicates it does not apply.
353
+ * Machine-readable counterpart to `rejection_reason`: a stable reason code,
354
+ * human-readable `description`, and params, present on every rejected row — on
355
+ * submit, cancel, get, and list alike. Branch on `rejection.reason` and read
356
+ * `rejection.description` instead of the top-level `rejection_reason`. When a
357
+ * null/undefined value is observed, it indicates it does not apply.
359
358
  */
360
359
  rejection?: PositionInstructionRejection | null;
361
360
 
@@ -385,13 +384,17 @@ export type PositionInstructionList = Array<PositionInstruction>;
385
384
  /**
386
385
  * Machine-readable detail for a rejected position instruction.
387
386
  *
388
- * Present on every rejected row that carries a `rejection_reason`, across the full
389
- * lifecycle — submit, cancel, get, and list. Branch on `reason` for programmatic
390
- * handling and template your own copy from `metadata`; `rejection_reason` remains
391
- * the human-readable fallback. Forward-only: instructions rejected before this
392
- * field shipped may carry only `rejection_reason`.
387
+ * Present on every rejected row, across the full lifecycle — submit, cancel, get,
388
+ * and list. Branch on `reason` for programmatic handling and template your own
389
+ * copy from `metadata`, or show `description` directly.
393
390
  */
394
391
  export interface PositionInstructionRejection {
392
+ /**
393
+ * Human-readable explanation of the rejection. Duplicates the top-level
394
+ * `rejection_reason`; prefer this field.
395
+ */
396
+ description: string;
397
+
395
398
  /**
396
399
  * Namespacing domain of the `reason` code — `com.clearstreet.oems.exercise` for
397
400
  * reasons OEMS validates, `com.clearstreet.oems.clearing` for clearing-owned