@roarkanalytics/sdk-mcp 2.29.0 → 2.31.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 (84) hide show
  1. package/code-tool-worker.d.mts.map +1 -1
  2. package/code-tool-worker.d.ts.map +1 -1
  3. package/code-tool-worker.js +45 -3
  4. package/code-tool-worker.js.map +1 -1
  5. package/code-tool-worker.mjs +12 -3
  6. package/code-tool-worker.mjs.map +1 -1
  7. package/code-tool.js +4 -4
  8. package/code-tool.js.map +1 -1
  9. package/code-tool.mjs +4 -4
  10. package/code-tool.mjs.map +1 -1
  11. package/docs-search-tool.d.mts +2 -0
  12. package/docs-search-tool.d.mts.map +1 -1
  13. package/docs-search-tool.d.ts +2 -0
  14. package/docs-search-tool.d.ts.map +1 -1
  15. package/docs-search-tool.js +32 -2
  16. package/docs-search-tool.js.map +1 -1
  17. package/docs-search-tool.mjs +31 -2
  18. package/docs-search-tool.mjs.map +1 -1
  19. package/http.d.mts.map +1 -1
  20. package/http.d.ts.map +1 -1
  21. package/http.js +24 -1
  22. package/http.js.map +1 -1
  23. package/http.mjs +24 -1
  24. package/http.mjs.map +1 -1
  25. package/instructions.d.mts +4 -1
  26. package/instructions.d.mts.map +1 -1
  27. package/instructions.d.ts +4 -1
  28. package/instructions.d.ts.map +1 -1
  29. package/instructions.js +24 -5
  30. package/instructions.js.map +1 -1
  31. package/instructions.mjs +21 -5
  32. package/instructions.mjs.map +1 -1
  33. package/local-docs-search.d.mts +28 -0
  34. package/local-docs-search.d.mts.map +1 -0
  35. package/local-docs-search.d.ts +28 -0
  36. package/local-docs-search.d.ts.map +1 -0
  37. package/local-docs-search.js +1814 -0
  38. package/local-docs-search.js.map +1 -0
  39. package/local-docs-search.mjs +1774 -0
  40. package/local-docs-search.mjs.map +1 -0
  41. package/options.d.mts +3 -0
  42. package/options.d.mts.map +1 -1
  43. package/options.d.ts +3 -0
  44. package/options.d.ts.map +1 -1
  45. package/options.js +19 -0
  46. package/options.js.map +1 -1
  47. package/options.mjs +19 -0
  48. package/options.mjs.map +1 -1
  49. package/package.json +13 -2
  50. package/server.d.mts +9 -1
  51. package/server.d.mts.map +1 -1
  52. package/server.d.ts +9 -1
  53. package/server.d.ts.map +1 -1
  54. package/server.js +12 -3
  55. package/server.js.map +1 -1
  56. package/server.mjs +12 -3
  57. package/server.mjs.map +1 -1
  58. package/src/code-tool-worker.ts +12 -3
  59. package/src/code-tool.ts +7 -9
  60. package/src/docs-search-tool.ts +46 -8
  61. package/src/http.ts +27 -1
  62. package/src/instructions.ts +28 -5
  63. package/src/local-docs-search.ts +2114 -0
  64. package/src/options.ts +24 -0
  65. package/src/server.ts +21 -3
  66. package/src/stdio.ts +4 -1
  67. package/src/types.ts +2 -0
  68. package/src/util.ts +2 -2
  69. package/stdio.d.mts.map +1 -1
  70. package/stdio.d.ts.map +1 -1
  71. package/stdio.js +4 -1
  72. package/stdio.js.map +1 -1
  73. package/stdio.mjs +4 -1
  74. package/stdio.mjs.map +1 -1
  75. package/types.d.mts +5 -0
  76. package/types.d.mts.map +1 -1
  77. package/types.d.ts +5 -0
  78. package/types.d.ts.map +1 -1
  79. package/types.js.map +1 -1
  80. package/types.mjs.map +1 -1
  81. package/util.js +2 -2
  82. package/util.js.map +1 -1
  83. package/util.mjs +2 -2
  84. package/util.mjs.map +1 -1
@@ -0,0 +1,1814 @@
1
+ "use strict";
2
+ // File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
3
+ var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
4
+ if (k2 === undefined) k2 = k;
5
+ var desc = Object.getOwnPropertyDescriptor(m, k);
6
+ if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
7
+ desc = { enumerable: true, get: function() { return m[k]; } };
8
+ }
9
+ Object.defineProperty(o, k2, desc);
10
+ }) : (function(o, m, k, k2) {
11
+ if (k2 === undefined) k2 = k;
12
+ o[k2] = m[k];
13
+ }));
14
+ var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
15
+ Object.defineProperty(o, "default", { enumerable: true, value: v });
16
+ }) : function(o, v) {
17
+ o["default"] = v;
18
+ });
19
+ var __importStar = (this && this.__importStar) || (function () {
20
+ var ownKeys = function(o) {
21
+ ownKeys = Object.getOwnPropertyNames || function (o) {
22
+ var ar = [];
23
+ for (var k in o) if (Object.prototype.hasOwnProperty.call(o, k)) ar[ar.length] = k;
24
+ return ar;
25
+ };
26
+ return ownKeys(o);
27
+ };
28
+ return function (mod) {
29
+ if (mod && mod.__esModule) return mod;
30
+ var result = {};
31
+ if (mod != null) for (var k = ownKeys(mod), i = 0; i < k.length; i++) if (k[i] !== "default") __createBinding(result, mod, k[i]);
32
+ __setModuleDefault(result, mod);
33
+ return result;
34
+ };
35
+ })();
36
+ var __importDefault = (this && this.__importDefault) || function (mod) {
37
+ return (mod && mod.__esModule) ? mod : { "default": mod };
38
+ };
39
+ Object.defineProperty(exports, "__esModule", { value: true });
40
+ exports.LocalDocsSearch = void 0;
41
+ const minisearch_1 = __importDefault(require("minisearch"));
42
+ const fs = __importStar(require("node:fs/promises"));
43
+ const path = __importStar(require("node:path"));
44
+ const logger_1 = require("./logger.js");
45
+ const EMBEDDED_METHODS = [
46
+ {
47
+ name: 'get',
48
+ endpoint: '/health',
49
+ httpMethod: 'get',
50
+ summary: 'Get API health status',
51
+ description: 'Returns the health status of the API and its dependencies',
52
+ stainlessPath: '(resource) health > (method) get',
53
+ qualified: 'client.health.get',
54
+ response: "{ data: { status: 'healthy' | 'degraded' | 'unhealthy'; timestamp: string; version: string; }; }",
55
+ markdown: "## get\n\n`client.health.get(): { data: object; }`\n\n**get** `/health`\n\nReturns the health status of the API and its dependencies\n\n### Returns\n\n- `{ data: { status: 'healthy' | 'degraded' | 'unhealthy'; timestamp: string; version: string; }; }`\n\n - `data: { status: 'healthy' | 'degraded' | 'unhealthy'; timestamp: string; version: string; }`\n\n### Example\n\n```typescript\nimport Roark from '@roarkanalytics/sdk';\n\nconst client = new Roark();\n\nconst health = await client.health.get();\n\nconsole.log(health);\n```",
56
+ perLanguage: {
57
+ http: {
58
+ example: 'curl https://api.roark.ai/health \\\n -H "Authorization: Bearer $ROARK_API_BEARER_TOKEN"',
59
+ },
60
+ python: {
61
+ method: 'health.get',
62
+ example: 'import os\nfrom roark_analytics import Roark\n\nclient = Roark(\n bearer_token=os.environ.get("ROARK_API_BEARER_TOKEN"), # This is the default and can be omitted\n)\nhealth = client.health.get()\nprint(health.data)',
63
+ },
64
+ typescript: {
65
+ method: 'client.health.get',
66
+ example: "import Roark from '@roarkanalytics/sdk';\n\nconst client = new Roark({\n bearerToken: process.env['ROARK_API_BEARER_TOKEN'], // This is the default and can be omitted\n});\n\nconst health = await client.health.get();\n\nconsole.log(health.data);",
67
+ },
68
+ },
69
+ },
70
+ {
71
+ name: 'list',
72
+ endpoint: '/v1/call',
73
+ httpMethod: 'get',
74
+ summary: 'List calls',
75
+ description: 'Returns a paginated list of calls for the authenticated project.',
76
+ stainlessPath: '(resource) call > (method) list',
77
+ qualified: 'client.call.list',
78
+ params: [
79
+ 'after?: string;',
80
+ 'limit?: number;',
81
+ 'searchText?: string;',
82
+ 'simulationRunPlanJobId?: string;',
83
+ "sortBy?: 'createdAt' | 'startedAt' | 'endedAt' | 'duration' | 'title' | 'status';",
84
+ "sortDirection?: 'asc' | 'desc';",
85
+ "status?: 'RINGING' | 'IN_PROGRESS' | 'ENDED';",
86
+ ],
87
+ response: "{ data: { id: string; callDirection: 'INBOUND' | 'OUTBOUND'; projectId: string; startedAt: string; agents?: { id: string; endpoint?: object; }[]; createdAt?: string; customers?: { label?: string; phoneNumberE164?: string; }[]; durationMs?: number; endedAt?: string; endedStatus?: string; policyIds?: string[]; properties?: object; recordingUrl?: string; simulationJobId?: string; status?: 'RINGING' | 'IN_PROGRESS' | 'ENDED'; summary?: string; supersededByCallId?: string; title?: string; updatedAt?: string; }[]; pagination: { hasMore: boolean; nextCursor: string; total: number; }; }",
88
+ markdown: "## list\n\n`client.call.list(after?: string, limit?: number, searchText?: string, simulationRunPlanJobId?: string, sortBy?: 'createdAt' | 'startedAt' | 'endedAt' | 'duration' | 'title' | 'status', sortDirection?: 'asc' | 'desc', status?: 'RINGING' | 'IN_PROGRESS' | 'ENDED'): { data: object[]; pagination: object; }`\n\n**get** `/v1/call`\n\nReturns a paginated list of calls for the authenticated project.\n\n### Parameters\n\n- `after?: string`\n Cursor for pagination - use the nextCursor value from a previous response\n\n- `limit?: number`\n Maximum number of calls to return (default: 20, max: 100)\n\n- `searchText?: string`\n Search text to filter calls by title, summary, or transcript\n\n- `simulationRunPlanJobId?: string`\n Filter by simulation run plan job ID to get all calls from a specific simulation batch\n\n- `sortBy?: 'createdAt' | 'startedAt' | 'endedAt' | 'duration' | 'title' | 'status'`\n Field to sort by (default: createdAt)\n\n- `sortDirection?: 'asc' | 'desc'`\n Sort direction (default: desc)\n\n- `status?: 'RINGING' | 'IN_PROGRESS' | 'ENDED'`\n Filter by call status\n\n### Returns\n\n- `{ data: { id: string; callDirection: 'INBOUND' | 'OUTBOUND'; projectId: string; startedAt: string; agents?: { id: string; endpoint?: object; }[]; createdAt?: string; customers?: { label?: string; phoneNumberE164?: string; }[]; durationMs?: number; endedAt?: string; endedStatus?: string; policyIds?: string[]; properties?: object; recordingUrl?: string; simulationJobId?: string; status?: 'RINGING' | 'IN_PROGRESS' | 'ENDED'; summary?: string; supersededByCallId?: string; title?: string; updatedAt?: string; }[]; pagination: { hasMore: boolean; nextCursor: string; total: number; }; }`\n\n - `data: { id: string; callDirection: 'INBOUND' | 'OUTBOUND'; projectId: string; startedAt: string; agents?: { id: string; endpoint?: { id: string; environment: string; phoneNumberE164?: string; }; }[]; createdAt?: string; customers?: { label?: string; phoneNumberE164?: string; }[]; durationMs?: number; endedAt?: string; endedStatus?: string; policyIds?: string[]; properties?: object; recordingUrl?: string; simulationJobId?: string; status?: 'RINGING' | 'IN_PROGRESS' | 'ENDED'; summary?: string; supersededByCallId?: string; title?: string; updatedAt?: string; }[]`\n - `pagination: { hasMore: boolean; nextCursor: string; total: number; }`\n\n### Example\n\n```typescript\nimport Roark from '@roarkanalytics/sdk';\n\nconst client = new Roark();\n\nconst calls = await client.call.list();\n\nconsole.log(calls);\n```",
89
+ perLanguage: {
90
+ http: {
91
+ example: 'curl https://api.roark.ai/v1/call \\\n -H "Authorization: Bearer $ROARK_API_BEARER_TOKEN"',
92
+ },
93
+ python: {
94
+ method: 'call.list',
95
+ example: 'import os\nfrom roark_analytics import Roark\n\nclient = Roark(\n bearer_token=os.environ.get("ROARK_API_BEARER_TOKEN"), # This is the default and can be omitted\n)\ncalls = client.call.list()\nprint(calls.data)',
96
+ },
97
+ typescript: {
98
+ method: 'client.call.list',
99
+ example: "import Roark from '@roarkanalytics/sdk';\n\nconst client = new Roark({\n bearerToken: process.env['ROARK_API_BEARER_TOKEN'], // This is the default and can be omitted\n});\n\nconst calls = await client.call.list();\n\nconsole.log(calls.data);",
100
+ },
101
+ },
102
+ },
103
+ {
104
+ name: 'create',
105
+ endpoint: '/v1/call',
106
+ httpMethod: 'post',
107
+ summary: 'Create a call',
108
+ description: 'Create a new call with recording, transcript, agents, and customers',
109
+ stainlessPath: '(resource) call > (method) create',
110
+ qualified: 'client.call.create',
111
+ params: [
112
+ "callDirection: 'INBOUND' | 'OUTBOUND';",
113
+ "interfaceType: 'PHONE' | 'WEB';",
114
+ 'recordingUrl: string;',
115
+ 'startedAt: string;',
116
+ 'agent?: { roarkId: string; endpoint?: { id: string; } | { type: string; value: string; direction?: string; }; prompt?: { resolvedPrompt: string; }; } | { name: string; customId?: string; description?: string; endpoint?: { id: string; } | { type: string; value: string; direction?: string; }; prompt?: { resolvedPrompt: string; }; } | { customId: string; endpoint?: { id: string; } | { type: string; value: string; direction?: string; }; prompt?: { resolvedPrompt: string; }; };',
117
+ 'agents?: { roarkId: string; endpoint?: { id: string; } | { type: string; value: string; direction?: string; }; prompt?: { resolvedPrompt: string; }; } | { name: string; customId?: string; description?: string; endpoint?: { id: string; } | { type: string; value: string; direction?: string; }; prompt?: { resolvedPrompt: string; }; } | { customId: string; endpoint?: { id: string; } | { type: string; value: string; direction?: string; }; prompt?: { resolvedPrompt: string; }; }[];',
118
+ 'customer?: { phoneNumberE164: string; label?: string; };',
119
+ 'customers?: { phoneNumberE164: string; label?: string; }[];',
120
+ 'endedStatus?: string;',
121
+ 'properties?: object;',
122
+ 'stereoRecordingUrl?: string;',
123
+ 'toolInvocations?: { name: string; parameters: object; result: string | object; startOffsetMs: number; agent?: { customId?: string; roarkId?: string; }; description?: string; endOffsetMs?: number; }[];',
124
+ "transcript?: { endOffsetMs: number; role: 'AGENT'; startOffsetMs: number; text: string; agent?: { customId?: string; roarkId?: string; }; languageCode?: string; } | { endOffsetMs: number; role: 'CUSTOMER'; startOffsetMs: number; text: string; customer?: { label?: string; phoneNumberE164?: string; }; languageCode?: string; }[];",
125
+ ],
126
+ response: "{ data: { id: string; agents: { id: string; endpoint?: object; }[]; callDirection: 'INBOUND' | 'OUTBOUND'; createdAt: string; customers: { label?: string; phoneNumberE164?: string; }[]; projectId: string; startedAt: string; status: 'RINGING' | 'IN_PROGRESS' | 'ENDED'; }; }",
127
+ markdown: "## create\n\n`client.call.create(callDirection: 'INBOUND' | 'OUTBOUND', interfaceType: 'PHONE' | 'WEB', recordingUrl: string, startedAt: string, agent?: { roarkId: string; endpoint?: { id: string; } | { type: string; value: string; direction?: string; }; prompt?: { resolvedPrompt: string; }; } | { name: string; customId?: string; description?: string; endpoint?: { id: string; } | { type: string; value: string; direction?: string; }; prompt?: { resolvedPrompt: string; }; } | { customId: string; endpoint?: { id: string; } | { type: string; value: string; direction?: string; }; prompt?: { resolvedPrompt: string; }; }, agents?: { roarkId: string; endpoint?: { id: string; } | { type: string; value: string; direction?: string; }; prompt?: { resolvedPrompt: string; }; } | { name: string; customId?: string; description?: string; endpoint?: { id: string; } | { type: string; value: string; direction?: string; }; prompt?: { resolvedPrompt: string; }; } | { customId: string; endpoint?: { id: string; } | { type: string; value: string; direction?: string; }; prompt?: { resolvedPrompt: string; }; }[], customer?: { phoneNumberE164: string; label?: string; }, customers?: { phoneNumberE164: string; label?: string; }[], endedStatus?: string, properties?: object, stereoRecordingUrl?: string, toolInvocations?: { name: string; parameters: object; result: string | object; startOffsetMs: number; agent?: { customId?: string; roarkId?: string; }; description?: string; endOffsetMs?: number; }[], transcript?: { endOffsetMs: number; role: 'AGENT'; startOffsetMs: number; text: string; agent?: { customId?: string; roarkId?: string; }; languageCode?: string; } | { endOffsetMs: number; role: 'CUSTOMER'; startOffsetMs: number; text: string; customer?: { label?: string; phoneNumberE164?: string; }; languageCode?: string; }[]): { data: object; }`\n\n**post** `/v1/call`\n\nCreate a new call with recording, transcript, agents, and customers\n\n### Parameters\n\n- `callDirection: 'INBOUND' | 'OUTBOUND'`\n Direction of the call (INBOUND or OUTBOUND)\n\n- `interfaceType: 'PHONE' | 'WEB'`\n Interface type of the call (PHONE or WEB)\n\n- `recordingUrl: string`\n URL of source recording (must be an accessible WAV, MP3, MP4, or OGG file). Can be a signed URL.\n\n- `startedAt: string`\n When the call started (ISO 8601 format)\n\n- `agent?: { roarkId: string; endpoint?: { id: string; } | { type: string; value: string; direction?: string; }; prompt?: { resolvedPrompt: string; }; } | { name: string; customId?: string; description?: string; endpoint?: { id: string; } | { type: string; value: string; direction?: string; }; prompt?: { resolvedPrompt: string; }; } | { customId: string; endpoint?: { id: string; } | { type: string; value: string; direction?: string; }; prompt?: { resolvedPrompt: string; }; }`\n Single agent participating in the call. Use this for simpler API when you have only one agent.\n\n- `agents?: { roarkId: string; endpoint?: { id: string; } | { type: string; value: string; direction?: string; }; prompt?: { resolvedPrompt: string; }; } | { name: string; customId?: string; description?: string; endpoint?: { id: string; } | { type: string; value: string; direction?: string; }; prompt?: { resolvedPrompt: string; }; } | { customId: string; endpoint?: { id: string; } | { type: string; value: string; direction?: string; }; prompt?: { resolvedPrompt: string; }; }[]`\n Agents participating in the call. Each agent requires identification and prompt information.\n\n- `customer?: { phoneNumberE164: string; label?: string; }`\n Single customer participating in the call. Use this for simpler API when you have only one customer.\n - `phoneNumberE164: string`\n Customer phone number in E.164 format (e.g., +14155551234)\n - `label?: string`\n Label to identify this customer in the transcript (e.g., \"speaker-01\", \"speaker-02\")\n\n- `customers?: { phoneNumberE164: string; label?: string; }[]`\n Customers participating in the call.\n\n- `endedStatus?: string`\n High-level call end status, indicating how the call terminated\n\n- `properties?: object`\n Custom properties to include with the call. These can be used for filtering and will show in the call details page\n\n- `stereoRecordingUrl?: string`\n URL of source stereo recording. Must be accessible. Can be a signed URL. Supported formats: WAV, MP3, MP4, OGG.\n\n- `toolInvocations?: { name: string; parameters: object; result: string | object; startOffsetMs: number; agent?: { customId?: string; roarkId?: string; }; description?: string; endOffsetMs?: number; }[]`\n List of tool invocations made during the call\n\n- `transcript?: { endOffsetMs: number; role: 'AGENT'; startOffsetMs: number; text: string; agent?: { customId?: string; roarkId?: string; }; languageCode?: string; } | { endOffsetMs: number; role: 'CUSTOMER'; startOffsetMs: number; text: string; customer?: { label?: string; phoneNumberE164?: string; }; languageCode?: string; }[]`\n List of transcript entries made during the call\n\n### Returns\n\n- `{ data: { id: string; agents: { id: string; endpoint?: object; }[]; callDirection: 'INBOUND' | 'OUTBOUND'; createdAt: string; customers: { label?: string; phoneNumberE164?: string; }[]; projectId: string; startedAt: string; status: 'RINGING' | 'IN_PROGRESS' | 'ENDED'; }; }`\n\n - `data: { id: string; agents: { id: string; endpoint?: { id: string; environment: string; phoneNumberE164?: string; }; }[]; callDirection: 'INBOUND' | 'OUTBOUND'; createdAt: string; customers: { label?: string; phoneNumberE164?: string; }[]; projectId: string; startedAt: string; status: 'RINGING' | 'IN_PROGRESS' | 'ENDED'; }`\n\n### Example\n\n```typescript\nimport Roark from '@roarkanalytics/sdk';\n\nconst client = new Roark();\n\nconst call = await client.call.create({\n callDirection: 'INBOUND',\n interfaceType: 'PHONE',\n recordingUrl: 'https://example.com',\n startedAt: 'startedAt',\n});\n\nconsole.log(call);\n```",
128
+ perLanguage: {
129
+ http: {
130
+ example: 'curl https://api.roark.ai/v1/call \\\n -H \'Content-Type: application/json\' \\\n -H "Authorization: Bearer $ROARK_API_BEARER_TOKEN" \\\n -d \'{\n "callDirection": "INBOUND",\n "interfaceType": "PHONE",\n "recordingUrl": "https://example.com",\n "startedAt": "startedAt"\n }\'',
131
+ },
132
+ python: {
133
+ method: 'call.create',
134
+ example: 'import os\nfrom roark_analytics import Roark\n\nclient = Roark(\n bearer_token=os.environ.get("ROARK_API_BEARER_TOKEN"), # This is the default and can be omitted\n)\ncall = client.call.create(\n call_direction="INBOUND",\n interface_type="PHONE",\n recording_url="https://example.com",\n started_at="startedAt",\n)\nprint(call.data)',
135
+ },
136
+ typescript: {
137
+ method: 'client.call.create',
138
+ example: "import Roark from '@roarkanalytics/sdk';\n\nconst client = new Roark({\n bearerToken: process.env['ROARK_API_BEARER_TOKEN'], // This is the default and can be omitted\n});\n\nconst call = await client.call.create({\n callDirection: 'INBOUND',\n interfaceType: 'PHONE',\n recordingUrl: 'https://example.com',\n startedAt: 'startedAt',\n});\n\nconsole.log(call.data);",
139
+ },
140
+ },
141
+ },
142
+ {
143
+ name: 'getById',
144
+ endpoint: '/v1/call/{callId}',
145
+ httpMethod: 'get',
146
+ summary: 'Get a call by ID',
147
+ description: 'Retrieve an existing call by its unique identifier',
148
+ stainlessPath: '(resource) call > (method) getById',
149
+ qualified: 'client.call.getByID',
150
+ params: ['callId: string;'],
151
+ response: "{ data: { id: string; callDirection: 'INBOUND' | 'OUTBOUND'; projectId: string; startedAt: string; agents?: { id: string; endpoint?: object; }[]; createdAt?: string; customers?: { label?: string; phoneNumberE164?: string; }[]; durationMs?: number; endedAt?: string; endedStatus?: string; policyIds?: string[]; properties?: object; recordingUrl?: string; simulationJobId?: string; status?: 'RINGING' | 'IN_PROGRESS' | 'ENDED'; summary?: string; supersededByCallId?: string; title?: string; updatedAt?: string; }; }",
152
+ markdown: "## getById\n\n`client.call.getByID(callId: string): { data: object; }`\n\n**get** `/v1/call/{callId}`\n\nRetrieve an existing call by its unique identifier\n\n### Parameters\n\n- `callId: string`\n\n### Returns\n\n- `{ data: { id: string; callDirection: 'INBOUND' | 'OUTBOUND'; projectId: string; startedAt: string; agents?: { id: string; endpoint?: object; }[]; createdAt?: string; customers?: { label?: string; phoneNumberE164?: string; }[]; durationMs?: number; endedAt?: string; endedStatus?: string; policyIds?: string[]; properties?: object; recordingUrl?: string; simulationJobId?: string; status?: 'RINGING' | 'IN_PROGRESS' | 'ENDED'; summary?: string; supersededByCallId?: string; title?: string; updatedAt?: string; }; }`\n\n - `data: { id: string; callDirection: 'INBOUND' | 'OUTBOUND'; projectId: string; startedAt: string; agents?: { id: string; endpoint?: { id: string; environment: string; phoneNumberE164?: string; }; }[]; createdAt?: string; customers?: { label?: string; phoneNumberE164?: string; }[]; durationMs?: number; endedAt?: string; endedStatus?: string; policyIds?: string[]; properties?: object; recordingUrl?: string; simulationJobId?: string; status?: 'RINGING' | 'IN_PROGRESS' | 'ENDED'; summary?: string; supersededByCallId?: string; title?: string; updatedAt?: string; }`\n\n### Example\n\n```typescript\nimport Roark from '@roarkanalytics/sdk';\n\nconst client = new Roark();\n\nconst response = await client.call.getByID('182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e');\n\nconsole.log(response);\n```",
153
+ perLanguage: {
154
+ http: {
155
+ example: 'curl https://api.roark.ai/v1/call/$CALL_ID \\\n -H "Authorization: Bearer $ROARK_API_BEARER_TOKEN"',
156
+ },
157
+ python: {
158
+ method: 'call.get_by_id',
159
+ example: 'import os\nfrom roark_analytics import Roark\n\nclient = Roark(\n bearer_token=os.environ.get("ROARK_API_BEARER_TOKEN"), # This is the default and can be omitted\n)\nresponse = client.call.get_by_id(\n "182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e",\n)\nprint(response.data)',
160
+ },
161
+ typescript: {
162
+ method: 'client.call.getByID',
163
+ example: "import Roark from '@roarkanalytics/sdk';\n\nconst client = new Roark({\n bearerToken: process.env['ROARK_API_BEARER_TOKEN'], // This is the default and can be omitted\n});\n\nconst response = await client.call.getByID('182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e');\n\nconsole.log(response.data);",
164
+ },
165
+ },
166
+ },
167
+ {
168
+ name: 'listSentimentRuns',
169
+ endpoint: '/v1/call/{callId}/sentiment-run',
170
+ httpMethod: 'get',
171
+ summary: 'List call sentiment runs',
172
+ description: 'Fetch detailed sentiment analysis results for a specific call, including emotional tone, key phrases, and sentiment scores.',
173
+ stainlessPath: '(resource) call > (method) listSentimentRuns',
174
+ qualified: 'client.call.listSentimentRuns',
175
+ params: ['callId: string;'],
176
+ response: '{ data: { status: string; averageCategoricalSentiment?: string; averageSentiment?: number; commonEmotion?: string; }; }',
177
+ markdown: "## listSentimentRuns\n\n`client.call.listSentimentRuns(callId: string): { data: object; }`\n\n**get** `/v1/call/{callId}/sentiment-run`\n\nFetch detailed sentiment analysis results for a specific call, including emotional tone, key phrases, and sentiment scores.\n\n### Parameters\n\n- `callId: string`\n ID of the call to fetch sentiment run for\n\n### Returns\n\n- `{ data: { status: string; averageCategoricalSentiment?: string; averageSentiment?: number; commonEmotion?: string; }; }`\n\n - `data: { status: string; averageCategoricalSentiment?: string; averageSentiment?: number; commonEmotion?: string; }`\n\n### Example\n\n```typescript\nimport Roark from '@roarkanalytics/sdk';\n\nconst client = new Roark();\n\nconst response = await client.call.listSentimentRuns('182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e');\n\nconsole.log(response);\n```",
178
+ perLanguage: {
179
+ http: {
180
+ example: 'curl https://api.roark.ai/v1/call/$CALL_ID/sentiment-run \\\n -H "Authorization: Bearer $ROARK_API_BEARER_TOKEN"',
181
+ },
182
+ python: {
183
+ method: 'call.list_sentiment_runs',
184
+ example: 'import os\nfrom roark_analytics import Roark\n\nclient = Roark(\n bearer_token=os.environ.get("ROARK_API_BEARER_TOKEN"), # This is the default and can be omitted\n)\nresponse = client.call.list_sentiment_runs(\n "182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e",\n)\nprint(response.data)',
185
+ },
186
+ typescript: {
187
+ method: 'client.call.listSentimentRuns',
188
+ example: "import Roark from '@roarkanalytics/sdk';\n\nconst client = new Roark({\n bearerToken: process.env['ROARK_API_BEARER_TOKEN'], // This is the default and can be omitted\n});\n\nconst response = await client.call.listSentimentRuns('182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e');\n\nconsole.log(response.data);",
189
+ },
190
+ },
191
+ },
192
+ {
193
+ name: 'listEvaluationRuns',
194
+ endpoint: '/v1/call/{callId}/evaluation-run',
195
+ httpMethod: 'get',
196
+ summary: 'List call evaluation runs',
197
+ description: 'Fetch all evaluation run results for a specific call.',
198
+ stainlessPath: '(resource) call > (method) listEvaluationRuns',
199
+ qualified: 'client.call.listEvaluationRuns',
200
+ params: ['callId: string;'],
201
+ response: "{ data: { blockRuns: { blockDefinitionId: string; blockName: string; blockRunId: string; createdAt: string; reason: string; result: 'PASSED' | 'FAILED' | 'SKIPPED'; score: number; status: 'PENDING' | 'RUNNING' | 'COMPLETED' | 'FAILED'; }[]; evaluator: { id: string; name: string; weight?: number; }; evidence: { commentText: string; createdAt: string; isPositive: boolean; snippetText: string; }[]; metrics: { booleanValue: boolean; confidence: number; createdAt: string; name: string; numericValue: number; reasoning: string; role: string; textValue: string; valueType: string; }[]; status: 'PENDING' | 'IN_PROGRESS' | 'COMPLETED' | 'FAILED'; id?: string; completedAt?: string; result?: 'SUCCESS' | 'FAILURE' | 'SKIPPED'; score?: number; startedAt?: string; summary?: string; }[]; }",
202
+ markdown: "## listEvaluationRuns\n\n`client.call.listEvaluationRuns(callId: string): { data: object[]; }`\n\n**get** `/v1/call/{callId}/evaluation-run`\n\nFetch all evaluation run results for a specific call.\n\n### Parameters\n\n- `callId: string`\n ID of the call to fetch evaluation run for\n\n### Returns\n\n- `{ data: { blockRuns: { blockDefinitionId: string; blockName: string; blockRunId: string; createdAt: string; reason: string; result: 'PASSED' | 'FAILED' | 'SKIPPED'; score: number; status: 'PENDING' | 'RUNNING' | 'COMPLETED' | 'FAILED'; }[]; evaluator: { id: string; name: string; weight?: number; }; evidence: { commentText: string; createdAt: string; isPositive: boolean; snippetText: string; }[]; metrics: { booleanValue: boolean; confidence: number; createdAt: string; name: string; numericValue: number; reasoning: string; role: string; textValue: string; valueType: string; }[]; status: 'PENDING' | 'IN_PROGRESS' | 'COMPLETED' | 'FAILED'; id?: string; completedAt?: string; result?: 'SUCCESS' | 'FAILURE' | 'SKIPPED'; score?: number; startedAt?: string; summary?: string; }[]; }`\n\n - `data: { blockRuns: { blockDefinitionId: string; blockName: string; blockRunId: string; createdAt: string; reason: string; result: 'PASSED' | 'FAILED' | 'SKIPPED'; score: number; status: 'PENDING' | 'RUNNING' | 'COMPLETED' | 'FAILED'; }[]; evaluator: { id: string; name: string; weight?: number; }; evidence: { commentText: string; createdAt: string; isPositive: boolean; snippetText: string; }[]; metrics: { booleanValue: boolean; confidence: number; createdAt: string; name: string; numericValue: number; reasoning: string; role: string; textValue: string; valueType: string; }[]; status: 'PENDING' | 'IN_PROGRESS' | 'COMPLETED' | 'FAILED'; id?: string; completedAt?: string; result?: 'SUCCESS' | 'FAILURE' | 'SKIPPED'; score?: number; startedAt?: string; summary?: string; }[]`\n\n### Example\n\n```typescript\nimport Roark from '@roarkanalytics/sdk';\n\nconst client = new Roark();\n\nconst response = await client.call.listEvaluationRuns('182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e');\n\nconsole.log(response);\n```",
203
+ perLanguage: {
204
+ http: {
205
+ example: 'curl https://api.roark.ai/v1/call/$CALL_ID/evaluation-run \\\n -H "Authorization: Bearer $ROARK_API_BEARER_TOKEN"',
206
+ },
207
+ python: {
208
+ method: 'call.list_evaluation_runs',
209
+ example: 'import os\nfrom roark_analytics import Roark\n\nclient = Roark(\n bearer_token=os.environ.get("ROARK_API_BEARER_TOKEN"), # This is the default and can be omitted\n)\nresponse = client.call.list_evaluation_runs(\n "182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e",\n)\nprint(response.data)',
210
+ },
211
+ typescript: {
212
+ method: 'client.call.listEvaluationRuns',
213
+ example: "import Roark from '@roarkanalytics/sdk';\n\nconst client = new Roark({\n bearerToken: process.env['ROARK_API_BEARER_TOKEN'], // This is the default and can be omitted\n});\n\nconst response = await client.call.listEvaluationRuns('182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e');\n\nconsole.log(response.data);",
214
+ },
215
+ },
216
+ },
217
+ {
218
+ name: 'listMetrics',
219
+ endpoint: '/v1/call/{callId}/metrics',
220
+ httpMethod: 'get',
221
+ summary: 'List call metrics',
222
+ description: 'Fetch all call-level metrics for a specific call, including both system-generated and custom metrics. Only returns successfully computed metrics.',
223
+ stainlessPath: '(resource) call > (method) listMetrics',
224
+ qualified: 'client.call.listMetrics',
225
+ params: ['callId: string;', 'flatten?: string;'],
226
+ response: "{ data: { description: string; metricDefinitionId: string; metricId: string; name: string; scope: 'GLOBAL' | 'PER_PARTICIPANT'; type: 'COUNT' | 'NUMERIC' | 'BOOLEAN' | 'SCALE' | 'TEXT' | 'CLASSIFICATION' | 'OFFSET'; values: { computedAt: string; confidence: number; context: 'CALL' | 'SEGMENT' | 'SEGMENT_RANGE'; value: number | boolean | string; fromSegment?: object; participantRole?: 'agent' | 'customer'; policyIds?: string[]; segment?: object; toSegment?: object; valueReasoning?: string; }[]; unit?: { name: string; symbol: string; }; }[]; }",
227
+ markdown: "## listMetrics\n\n`client.call.listMetrics(callId: string, flatten?: string): { data: object[]; }`\n\n**get** `/v1/call/{callId}/metrics`\n\nFetch all call-level metrics for a specific call, including both system-generated and custom metrics. Only returns successfully computed metrics.\n\n### Parameters\n\n- `callId: string`\n\n- `flatten?: string`\n Whether to return a flat list instead of grouped by metric definition (default: false)\n\n### Returns\n\n- `{ data: { description: string; metricDefinitionId: string; metricId: string; name: string; scope: 'GLOBAL' | 'PER_PARTICIPANT'; type: 'COUNT' | 'NUMERIC' | 'BOOLEAN' | 'SCALE' | 'TEXT' | 'CLASSIFICATION' | 'OFFSET'; values: { computedAt: string; confidence: number; context: 'CALL' | 'SEGMENT' | 'SEGMENT_RANGE'; value: number | boolean | string; fromSegment?: object; participantRole?: 'agent' | 'customer'; policyIds?: string[]; segment?: object; toSegment?: object; valueReasoning?: string; }[]; unit?: { name: string; symbol: string; }; }[]; }`\n\n - `data: { description: string; metricDefinitionId: string; metricId: string; name: string; scope: 'GLOBAL' | 'PER_PARTICIPANT'; type: 'COUNT' | 'NUMERIC' | 'BOOLEAN' | 'SCALE' | 'TEXT' | 'CLASSIFICATION' | 'OFFSET'; values: { computedAt: string; confidence: number; context: 'CALL' | 'SEGMENT' | 'SEGMENT_RANGE'; value: number | boolean | string; fromSegment?: { id: string; endOffsetMs: number; startOffsetMs: number; text: string; }; participantRole?: 'agent' | 'customer'; policyIds?: string[]; segment?: { id: string; endOffsetMs: number; startOffsetMs: number; text: string; }; toSegment?: { id: string; endOffsetMs: number; startOffsetMs: number; text: string; }; valueReasoning?: string; }[]; unit?: { name: string; symbol: string; }; }[]`\n\n### Example\n\n```typescript\nimport Roark from '@roarkanalytics/sdk';\n\nconst client = new Roark();\n\nconst response = await client.call.listMetrics('callId');\n\nconsole.log(response);\n```",
228
+ perLanguage: {
229
+ http: {
230
+ example: 'curl https://api.roark.ai/v1/call/$CALL_ID/metrics \\\n -H "Authorization: Bearer $ROARK_API_BEARER_TOKEN"',
231
+ },
232
+ python: {
233
+ method: 'call.list_metrics',
234
+ example: 'import os\nfrom roark_analytics import Roark\n\nclient = Roark(\n bearer_token=os.environ.get("ROARK_API_BEARER_TOKEN"), # This is the default and can be omitted\n)\nresponse = client.call.list_metrics(\n call_id="callId",\n)\nprint(response.data)',
235
+ },
236
+ typescript: {
237
+ method: 'client.call.listMetrics',
238
+ example: "import Roark from '@roarkanalytics/sdk';\n\nconst client = new Roark({\n bearerToken: process.env['ROARK_API_BEARER_TOKEN'], // This is the default and can be omitted\n});\n\nconst response = await client.call.listMetrics('callId');\n\nconsole.log(response.data);",
239
+ },
240
+ },
241
+ },
242
+ {
243
+ name: 'getTranscript',
244
+ endpoint: '/v1/call/{callId}/transcript',
245
+ httpMethod: 'get',
246
+ summary: 'Get call transcript',
247
+ description: 'Fetch the full transcript for a specific call. Optionally specify a transcription source; otherwise the best available source is used automatically.',
248
+ stainlessPath: '(resource) call > (method) getTranscript',
249
+ qualified: 'client.call.getTranscript',
250
+ params: [
251
+ 'callId: string;',
252
+ "source?: 'ROARK_POST_CALL' | 'SIMULATION_AGENT_REALTIME' | 'CUSTOMER_AGENT_REALTIME';",
253
+ ],
254
+ response: "{ data: { entries: { endOffsetMs: number; participantId: string; role: 'AGENT' | 'CUSTOMER'; startOffsetMs: number; text: string; }[]; participants: { id: string; agentId: string; type: 'AGENT'; } | { id: string; customerId: string; type: 'CUSTOMER'; } | { id: string; customerId: string; type: 'SIMULATED_CUSTOMER'; } | { id: string; type: 'BACKGROUND_SPEAKER'; }[]; transcriptionSource: 'ROARK_POST_CALL' | 'SIMULATION_AGENT_REALTIME' | 'CUSTOMER_AGENT_REALTIME'; }; }",
255
+ markdown: "## getTranscript\n\n`client.call.getTranscript(callId: string, source?: 'ROARK_POST_CALL' | 'SIMULATION_AGENT_REALTIME' | 'CUSTOMER_AGENT_REALTIME'): { data: object; }`\n\n**get** `/v1/call/{callId}/transcript`\n\nFetch the full transcript for a specific call. Optionally specify a transcription source; otherwise the best available source is used automatically.\n\n### Parameters\n\n- `callId: string`\n\n- `source?: 'ROARK_POST_CALL' | 'SIMULATION_AGENT_REALTIME' | 'CUSTOMER_AGENT_REALTIME'`\n Transcription source to fetch. When omitted, uses the preferred source based on availability: CUSTOMER_AGENT_REALTIME > SIMULATION_AGENT_REALTIME > ROARK_POST_CALL\n\n### Returns\n\n- `{ data: { entries: { endOffsetMs: number; participantId: string; role: 'AGENT' | 'CUSTOMER'; startOffsetMs: number; text: string; }[]; participants: { id: string; agentId: string; type: 'AGENT'; } | { id: string; customerId: string; type: 'CUSTOMER'; } | { id: string; customerId: string; type: 'SIMULATED_CUSTOMER'; } | { id: string; type: 'BACKGROUND_SPEAKER'; }[]; transcriptionSource: 'ROARK_POST_CALL' | 'SIMULATION_AGENT_REALTIME' | 'CUSTOMER_AGENT_REALTIME'; }; }`\n\n - `data: { entries: { endOffsetMs: number; participantId: string; role: 'AGENT' | 'CUSTOMER'; startOffsetMs: number; text: string; }[]; participants: { id: string; agentId: string; type: 'AGENT'; } | { id: string; customerId: string; type: 'CUSTOMER'; } | { id: string; customerId: string; type: 'SIMULATED_CUSTOMER'; } | { id: string; type: 'BACKGROUND_SPEAKER'; }[]; transcriptionSource: 'ROARK_POST_CALL' | 'SIMULATION_AGENT_REALTIME' | 'CUSTOMER_AGENT_REALTIME'; }`\n\n### Example\n\n```typescript\nimport Roark from '@roarkanalytics/sdk';\n\nconst client = new Roark();\n\nconst response = await client.call.getTranscript('callId');\n\nconsole.log(response);\n```",
256
+ perLanguage: {
257
+ http: {
258
+ example: 'curl https://api.roark.ai/v1/call/$CALL_ID/transcript \\\n -H "Authorization: Bearer $ROARK_API_BEARER_TOKEN"',
259
+ },
260
+ python: {
261
+ method: 'call.get_transcript',
262
+ example: 'import os\nfrom roark_analytics import Roark\n\nclient = Roark(\n bearer_token=os.environ.get("ROARK_API_BEARER_TOKEN"), # This is the default and can be omitted\n)\nresponse = client.call.get_transcript(\n call_id="callId",\n)\nprint(response.data)',
263
+ },
264
+ typescript: {
265
+ method: 'client.call.getTranscript',
266
+ example: "import Roark from '@roarkanalytics/sdk';\n\nconst client = new Roark({\n bearerToken: process.env['ROARK_API_BEARER_TOKEN'], // This is the default and can be omitted\n});\n\nconst response = await client.call.getTranscript('callId');\n\nconsole.log(response.data);",
267
+ },
268
+ },
269
+ },
270
+ {
271
+ name: 'listDefinitions',
272
+ endpoint: '/v1/metric/definitions',
273
+ httpMethod: 'get',
274
+ summary: 'List metric definitions',
275
+ description: 'Fetch all metric definitions available in the project, including both system-generated and custom metrics.',
276
+ stainlessPath: '(resource) metric > (method) listDefinitions',
277
+ qualified: 'client.metric.listDefinitions',
278
+ response: "{ data: { id: string; description: string; metricId: string; name: string; scope: 'GLOBAL' | 'PER_PARTICIPANT'; supportedContexts: 'CALL' | 'SEGMENT' | 'TURN'[]; type: 'COUNT' | 'NUMERIC' | 'BOOLEAN' | 'SCALE' | 'TEXT' | 'CLASSIFICATION' | 'OFFSET'; unit?: { name: string; symbol: string; }; }[]; }",
279
+ markdown: "## listDefinitions\n\n`client.metric.listDefinitions(): { data: object[]; }`\n\n**get** `/v1/metric/definitions`\n\nFetch all metric definitions available in the project, including both system-generated and custom metrics.\n\n### Returns\n\n- `{ data: { id: string; description: string; metricId: string; name: string; scope: 'GLOBAL' | 'PER_PARTICIPANT'; supportedContexts: 'CALL' | 'SEGMENT' | 'TURN'[]; type: 'COUNT' | 'NUMERIC' | 'BOOLEAN' | 'SCALE' | 'TEXT' | 'CLASSIFICATION' | 'OFFSET'; unit?: { name: string; symbol: string; }; }[]; }`\n\n - `data: { id: string; description: string; metricId: string; name: string; scope: 'GLOBAL' | 'PER_PARTICIPANT'; supportedContexts: 'CALL' | 'SEGMENT' | 'TURN'[]; type: 'COUNT' | 'NUMERIC' | 'BOOLEAN' | 'SCALE' | 'TEXT' | 'CLASSIFICATION' | 'OFFSET'; unit?: { name: string; symbol: string; }; }[]`\n\n### Example\n\n```typescript\nimport Roark from '@roarkanalytics/sdk';\n\nconst client = new Roark();\n\nconst response = await client.metric.listDefinitions();\n\nconsole.log(response);\n```",
280
+ perLanguage: {
281
+ http: {
282
+ example: 'curl https://api.roark.ai/v1/metric/definitions \\\n -H "Authorization: Bearer $ROARK_API_BEARER_TOKEN"',
283
+ },
284
+ python: {
285
+ method: 'metric.list_definitions',
286
+ example: 'import os\nfrom roark_analytics import Roark\n\nclient = Roark(\n bearer_token=os.environ.get("ROARK_API_BEARER_TOKEN"), # This is the default and can be omitted\n)\nresponse = client.metric.list_definitions()\nprint(response.data)',
287
+ },
288
+ typescript: {
289
+ method: 'client.metric.listDefinitions',
290
+ example: "import Roark from '@roarkanalytics/sdk';\n\nconst client = new Roark({\n bearerToken: process.env['ROARK_API_BEARER_TOKEN'], // This is the default and can be omitted\n});\n\nconst response = await client.metric.listDefinitions();\n\nconsole.log(response.data);",
291
+ },
292
+ },
293
+ },
294
+ {
295
+ name: 'createDefinition',
296
+ endpoint: '/v1/metric/definitions',
297
+ httpMethod: 'post',
298
+ summary: 'Create a metric definition',
299
+ description: 'Create a new custom metric definition. The metric will be added to the specified analysis package and can be used for evaluating calls.',
300
+ stainlessPath: '(resource) metric > (method) createDefinition',
301
+ qualified: 'client.metric.createDefinition',
302
+ params: [
303
+ 'analysisPackageId: string;',
304
+ 'name: string;',
305
+ "outputType: 'COUNT' | 'NUMERIC' | 'BOOLEAN' | 'SCALE' | 'TEXT' | 'CLASSIFICATION' | 'OFFSET';",
306
+ 'booleanFalseLabel?: string;',
307
+ 'booleanTrueLabel?: string;',
308
+ 'classificationOptions?: { description: string; displayOrder: number; label: string; }[];',
309
+ 'llmPrompt?: string;',
310
+ 'maxClassifications?: number;',
311
+ 'metricId?: string;',
312
+ "participantRole?: 'AGENT' | 'CUSTOMER' | 'SIMULATED_CUSTOMER' | 'BACKGROUND_SPEAKER';",
313
+ 'scaleLabels?: { displayOrder: number; label: string; rangeMax: number; rangeMin: number; colorHex?: string; description?: string; }[];',
314
+ 'scaleMax?: number;',
315
+ 'scaleMin?: number;',
316
+ "scope?: 'GLOBAL' | 'PER_PARTICIPANT';",
317
+ "supportedContexts?: 'CALL' | 'SEGMENT' | 'TURN'[];",
318
+ ],
319
+ response: "{ data: { id: string; description: string; metricId: string; name: string; scope: 'GLOBAL' | 'PER_PARTICIPANT'; supportedContexts: 'CALL' | 'SEGMENT' | 'TURN'[]; type: 'COUNT' | 'NUMERIC' | 'BOOLEAN' | 'SCALE' | 'TEXT' | 'CLASSIFICATION' | 'OFFSET'; unit?: { name: string; symbol: string; }; }; }",
320
+ markdown: "## createDefinition\n\n`client.metric.createDefinition(analysisPackageId: string, name: string, outputType: 'COUNT' | 'NUMERIC' | 'BOOLEAN' | 'SCALE' | 'TEXT' | 'CLASSIFICATION' | 'OFFSET', booleanFalseLabel?: string, booleanTrueLabel?: string, classificationOptions?: { description: string; displayOrder: number; label: string; }[], llmPrompt?: string, maxClassifications?: number, metricId?: string, participantRole?: 'AGENT' | 'CUSTOMER' | 'SIMULATED_CUSTOMER' | 'BACKGROUND_SPEAKER', scaleLabels?: { displayOrder: number; label: string; rangeMax: number; rangeMin: number; colorHex?: string; description?: string; }[], scaleMax?: number, scaleMin?: number, scope?: 'GLOBAL' | 'PER_PARTICIPANT', supportedContexts?: 'CALL' | 'SEGMENT' | 'TURN'[]): { data: object; }`\n\n**post** `/v1/metric/definitions`\n\nCreate a new custom metric definition. The metric will be added to the specified analysis package and can be used for evaluating calls.\n\n### Parameters\n\n- `analysisPackageId: string`\n ID of the analysis package to add this metric to\n\n- `name: string`\n Name of the metric\n\n- `outputType: 'COUNT' | 'NUMERIC' | 'BOOLEAN' | 'SCALE' | 'TEXT' | 'CLASSIFICATION' | 'OFFSET'`\n Type of value this metric produces\n\n- `booleanFalseLabel?: string`\n Label for the false/negative case (only for BOOLEAN type)\n\n- `booleanTrueLabel?: string`\n Label for the true/positive case (only for BOOLEAN type)\n\n- `classificationOptions?: { description: string; displayOrder: number; label: string; }[]`\n Options for classification. Required for CLASSIFICATION type.\n\n- `llmPrompt?: string`\n LLM prompt/criteria for evaluating this metric. Used to instruct the model on how to score. Required for BOOLEAN, NUMERIC, TEXT, and SCALE types.\n\n- `maxClassifications?: number`\n Maximum number of classifications that can be selected (only for CLASSIFICATION type)\n\n- `metricId?: string`\n Unique identifier for the metric (e.g. \"customer_satisfaction\"). Auto-generated from name if not provided.\n\n- `participantRole?: 'AGENT' | 'CUSTOMER' | 'SIMULATED_CUSTOMER' | 'BACKGROUND_SPEAKER'`\n Participant role to evaluate. Required when scope is PER_PARTICIPANT.\n\n- `scaleLabels?: { displayOrder: number; label: string; rangeMax: number; rangeMin: number; colorHex?: string; description?: string; }[]`\n Labels for scale ranges (only for SCALE type)\n\n- `scaleMax?: number`\n Maximum value for scale. Required for SCALE type.\n\n- `scaleMin?: number`\n Minimum value for scale. Required for SCALE type.\n\n- `scope?: 'GLOBAL' | 'PER_PARTICIPANT'`\n Whether metric is global or per-participant (default: GLOBAL)\n\n- `supportedContexts?: 'CALL' | 'SEGMENT' | 'TURN'[]`\n Which levels this metric can produce values at (default: [\"CALL\"])\n\n### Returns\n\n- `{ data: { id: string; description: string; metricId: string; name: string; scope: 'GLOBAL' | 'PER_PARTICIPANT'; supportedContexts: 'CALL' | 'SEGMENT' | 'TURN'[]; type: 'COUNT' | 'NUMERIC' | 'BOOLEAN' | 'SCALE' | 'TEXT' | 'CLASSIFICATION' | 'OFFSET'; unit?: { name: string; symbol: string; }; }; }`\n\n - `data: { id: string; description: string; metricId: string; name: string; scope: 'GLOBAL' | 'PER_PARTICIPANT'; supportedContexts: 'CALL' | 'SEGMENT' | 'TURN'[]; type: 'COUNT' | 'NUMERIC' | 'BOOLEAN' | 'SCALE' | 'TEXT' | 'CLASSIFICATION' | 'OFFSET'; unit?: { name: string; symbol: string; }; }`\n\n### Example\n\n```typescript\nimport Roark from '@roarkanalytics/sdk';\n\nconst client = new Roark();\n\nconst response = await client.metric.createDefinition({\n analysisPackageId: '182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e',\n name: 'Customer Satisfaction',\n outputType: 'BOOLEAN',\n});\n\nconsole.log(response);\n```",
321
+ perLanguage: {
322
+ http: {
323
+ example: 'curl https://api.roark.ai/v1/metric/definitions \\\n -H \'Content-Type: application/json\' \\\n -H "Authorization: Bearer $ROARK_API_BEARER_TOKEN" \\\n -d \'{\n "analysisPackageId": "182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e",\n "name": "Customer Satisfaction",\n "outputType": "BOOLEAN",\n "booleanFalseLabel": "Not Satisfied",\n "booleanTrueLabel": "Satisfied",\n "llmPrompt": "Evaluate whether the customer expressed satisfaction with the service provided.",\n "metricId": "customer_satisfaction",\n "scaleMax": 5,\n "scaleMin": 1,\n "scope": "GLOBAL",\n "supportedContexts": [\n "CALL"\n ]\n }\'',
324
+ },
325
+ python: {
326
+ method: 'metric.create_definition',
327
+ example: 'import os\nfrom roark_analytics import Roark\n\nclient = Roark(\n bearer_token=os.environ.get("ROARK_API_BEARER_TOKEN"), # This is the default and can be omitted\n)\nresponse = client.metric.create_definition(\n analysis_package_id="182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e",\n name="Customer Satisfaction",\n output_type="BOOLEAN",\n)\nprint(response.data)',
328
+ },
329
+ typescript: {
330
+ method: 'client.metric.createDefinition',
331
+ example: "import Roark from '@roarkanalytics/sdk';\n\nconst client = new Roark({\n bearerToken: process.env['ROARK_API_BEARER_TOKEN'], // This is the default and can be omitted\n});\n\nconst response = await client.metric.createDefinition({\n analysisPackageId: '182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e',\n name: 'Customer Satisfaction',\n outputType: 'BOOLEAN',\n});\n\nconsole.log(response.data);",
332
+ },
333
+ },
334
+ },
335
+ {
336
+ name: 'list',
337
+ endpoint: '/v1/metric/policies',
338
+ httpMethod: 'get',
339
+ summary: 'List metric policies',
340
+ description: 'Returns a paginated list of metric policies for the project, including system policies.',
341
+ stainlessPath: '(resource) metricPolicy > (method) list',
342
+ qualified: 'client.metricPolicy.list',
343
+ params: ['after?: string;', 'limit?: number;', "status?: 'ACTIVE' | 'INACTIVE';"],
344
+ response: "{ data: { id: string; conditions: { conditions: object[]; }[]; createdAt: string; metrics: { id: string; }[]; name: string; status: 'ACTIVE' | 'INACTIVE'; type: 'SYSTEM' | 'USER'; updatedAt: string; }[]; pagination: { hasMore: boolean; nextCursor: string; total: number; }; }",
345
+ markdown: "## list\n\n`client.metricPolicy.list(after?: string, limit?: number, status?: 'ACTIVE' | 'INACTIVE'): { data: object[]; pagination: object; }`\n\n**get** `/v1/metric/policies`\n\nReturns a paginated list of metric policies for the project, including system policies.\n\n### Parameters\n\n- `after?: string`\n Cursor for pagination - use the nextCursor value from a previous response\n\n- `limit?: number`\n Maximum number of policies to return (default: 20, max: 50)\n\n- `status?: 'ACTIVE' | 'INACTIVE'`\n Filter by policy status\n\n### Returns\n\n- `{ data: { id: string; conditions: { conditions: object[]; }[]; createdAt: string; metrics: { id: string; }[]; name: string; status: 'ACTIVE' | 'INACTIVE'; type: 'SYSTEM' | 'USER'; updatedAt: string; }[]; pagination: { hasMore: boolean; nextCursor: string; total: number; }; }`\n Paginated list of metric policies\n\n - `data: { id: string; conditions: { conditions: { conditionKey: string; conditionOperator: string; conditionType: 'AGENT' | 'CALL_SOURCE' | 'CALL_PROPERTY' | 'INTEGRATION'; conditionValue: string; }[]; }[]; createdAt: string; metrics: { id: string; }[]; name: string; status: 'ACTIVE' | 'INACTIVE'; type: 'SYSTEM' | 'USER'; updatedAt: string; }[]`\n - `pagination: { hasMore: boolean; nextCursor: string; total: number; }`\n\n### Example\n\n```typescript\nimport Roark from '@roarkanalytics/sdk';\n\nconst client = new Roark();\n\nconst metricPolicies = await client.metricPolicy.list();\n\nconsole.log(metricPolicies);\n```",
346
+ perLanguage: {
347
+ http: {
348
+ example: 'curl https://api.roark.ai/v1/metric/policies \\\n -H "Authorization: Bearer $ROARK_API_BEARER_TOKEN"',
349
+ },
350
+ python: {
351
+ method: 'metric_policy.list',
352
+ example: 'import os\nfrom roark_analytics import Roark\n\nclient = Roark(\n bearer_token=os.environ.get("ROARK_API_BEARER_TOKEN"), # This is the default and can be omitted\n)\nmetric_policies = client.metric_policy.list()\nprint(metric_policies.data)',
353
+ },
354
+ typescript: {
355
+ method: 'client.metricPolicy.list',
356
+ example: "import Roark from '@roarkanalytics/sdk';\n\nconst client = new Roark({\n bearerToken: process.env['ROARK_API_BEARER_TOKEN'], // This is the default and can be omitted\n});\n\nconst metricPolicies = await client.metricPolicy.list();\n\nconsole.log(metricPolicies.data);",
357
+ },
358
+ },
359
+ },
360
+ {
361
+ name: 'getById',
362
+ endpoint: '/v1/metric/policies/{policyId}',
363
+ httpMethod: 'get',
364
+ summary: 'Get metric policy by ID',
365
+ description: 'Returns a specific metric policy with its conditions and metrics.',
366
+ stainlessPath: '(resource) metricPolicy > (method) getById',
367
+ qualified: 'client.metricPolicy.getByID',
368
+ params: ['policyId: string;'],
369
+ response: "{ data: { id: string; conditions: { conditions: object[]; }[]; createdAt: string; metrics: { id: string; }[]; name: string; status: 'ACTIVE' | 'INACTIVE'; type: 'SYSTEM' | 'USER'; updatedAt: string; }; }",
370
+ markdown: "## getById\n\n`client.metricPolicy.getByID(policyId: string): { data: object; }`\n\n**get** `/v1/metric/policies/{policyId}`\n\nReturns a specific metric policy with its conditions and metrics.\n\n### Parameters\n\n- `policyId: string`\n\n### Returns\n\n- `{ data: { id: string; conditions: { conditions: object[]; }[]; createdAt: string; metrics: { id: string; }[]; name: string; status: 'ACTIVE' | 'INACTIVE'; type: 'SYSTEM' | 'USER'; updatedAt: string; }; }`\n\n - `data: { id: string; conditions: { conditions: { conditionKey: string; conditionOperator: string; conditionType: 'AGENT' | 'CALL_SOURCE' | 'CALL_PROPERTY' | 'INTEGRATION'; conditionValue: string; }[]; }[]; createdAt: string; metrics: { id: string; }[]; name: string; status: 'ACTIVE' | 'INACTIVE'; type: 'SYSTEM' | 'USER'; updatedAt: string; }`\n\n### Example\n\n```typescript\nimport Roark from '@roarkanalytics/sdk';\n\nconst client = new Roark();\n\nconst response = await client.metricPolicy.getByID('182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e');\n\nconsole.log(response);\n```",
371
+ perLanguage: {
372
+ http: {
373
+ example: 'curl https://api.roark.ai/v1/metric/policies/$POLICY_ID \\\n -H "Authorization: Bearer $ROARK_API_BEARER_TOKEN"',
374
+ },
375
+ python: {
376
+ method: 'metric_policy.get_by_id',
377
+ example: 'import os\nfrom roark_analytics import Roark\n\nclient = Roark(\n bearer_token=os.environ.get("ROARK_API_BEARER_TOKEN"), # This is the default and can be omitted\n)\nresponse = client.metric_policy.get_by_id(\n "182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e",\n)\nprint(response.data)',
378
+ },
379
+ typescript: {
380
+ method: 'client.metricPolicy.getByID',
381
+ example: "import Roark from '@roarkanalytics/sdk';\n\nconst client = new Roark({\n bearerToken: process.env['ROARK_API_BEARER_TOKEN'], // This is the default and can be omitted\n});\n\nconst response = await client.metricPolicy.getByID('182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e');\n\nconsole.log(response.data);",
382
+ },
383
+ },
384
+ },
385
+ {
386
+ name: 'create',
387
+ endpoint: '/v1/metric/policies',
388
+ httpMethod: 'post',
389
+ summary: 'Create a metric policy',
390
+ description: 'Creates a new metric policy. Policies define which metrics to collect and under what conditions.',
391
+ stainlessPath: '(resource) metricPolicy > (method) create',
392
+ qualified: 'client.metricPolicy.create',
393
+ params: [
394
+ 'metrics: { id: string; }[];',
395
+ "modality: 'call' | 'chat';",
396
+ 'name: string;',
397
+ "conditions?: { conditions: { conditionKey: string; conditionType: 'AGENT' | 'CALL_SOURCE' | 'CALL_PROPERTY' | 'INTEGRATION'; conditionOperator?: string; conditionValue?: string; }[]; }[];",
398
+ "status?: 'ACTIVE' | 'INACTIVE';",
399
+ ],
400
+ response: "{ data: { id: string; conditions: { conditions: object[]; }[]; createdAt: string; metrics: { id: string; }[]; name: string; status: 'ACTIVE' | 'INACTIVE'; type: 'SYSTEM' | 'USER'; updatedAt: string; }; }",
401
+ markdown: "## create\n\n`client.metricPolicy.create(metrics: { id: string; }[], modality: 'call' | 'chat', name: string, conditions?: { conditions: { conditionKey: string; conditionType: 'AGENT' | 'CALL_SOURCE' | 'CALL_PROPERTY' | 'INTEGRATION'; conditionOperator?: string; conditionValue?: string; }[]; }[], status?: 'ACTIVE' | 'INACTIVE'): { data: object; }`\n\n**post** `/v1/metric/policies`\n\nCreates a new metric policy. Policies define which metrics to collect and under what conditions.\n\n### Parameters\n\n- `metrics: { id: string; }[]`\n Metric definitions to collect when this policy matches\n\n- `modality: 'call' | 'chat'`\n Modality this policy targets. A policy fires for exactly one modality and can only reference metrics that support that modality.\n\n- `name: string`\n Name of the metric policy\n\n- `conditions?: { conditions: { conditionKey: string; conditionType: 'AGENT' | 'CALL_SOURCE' | 'CALL_PROPERTY' | 'INTEGRATION'; conditionOperator?: string; conditionValue?: string; }[]; }[]`\n Condition groups. Omit to match all calls.\n\n- `status?: 'ACTIVE' | 'INACTIVE'`\n Status of the policy (default: ACTIVE)\n\n### Returns\n\n- `{ data: { id: string; conditions: { conditions: object[]; }[]; createdAt: string; metrics: { id: string; }[]; name: string; status: 'ACTIVE' | 'INACTIVE'; type: 'SYSTEM' | 'USER'; updatedAt: string; }; }`\n\n - `data: { id: string; conditions: { conditions: { conditionKey: string; conditionOperator: string; conditionType: 'AGENT' | 'CALL_SOURCE' | 'CALL_PROPERTY' | 'INTEGRATION'; conditionValue: string; }[]; }[]; createdAt: string; metrics: { id: string; }[]; name: string; status: 'ACTIVE' | 'INACTIVE'; type: 'SYSTEM' | 'USER'; updatedAt: string; }`\n\n### Example\n\n```typescript\nimport Roark from '@roarkanalytics/sdk';\n\nconst client = new Roark();\n\nconst metricPolicy = await client.metricPolicy.create({\n metrics: [{ id: '182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e' }],\n modality: 'call',\n name: 'Evaluate all inbound calls',\n});\n\nconsole.log(metricPolicy);\n```",
402
+ perLanguage: {
403
+ http: {
404
+ example: 'curl https://api.roark.ai/v1/metric/policies \\\n -H \'Content-Type: application/json\' \\\n -H "Authorization: Bearer $ROARK_API_BEARER_TOKEN" \\\n -d \'{\n "metrics": [\n {\n "id": "182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e"\n }\n ],\n "modality": "call",\n "name": "Evaluate all inbound calls",\n "status": "ACTIVE"\n }\'',
405
+ },
406
+ python: {
407
+ method: 'metric_policy.create',
408
+ example: 'import os\nfrom roark_analytics import Roark\n\nclient = Roark(\n bearer_token=os.environ.get("ROARK_API_BEARER_TOKEN"), # This is the default and can be omitted\n)\nmetric_policy = client.metric_policy.create(\n metrics=[{\n "id": "182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e"\n }],\n modality="call",\n name="Evaluate all inbound calls",\n)\nprint(metric_policy.data)',
409
+ },
410
+ typescript: {
411
+ method: 'client.metricPolicy.create',
412
+ example: "import Roark from '@roarkanalytics/sdk';\n\nconst client = new Roark({\n bearerToken: process.env['ROARK_API_BEARER_TOKEN'], // This is the default and can be omitted\n});\n\nconst metricPolicy = await client.metricPolicy.create({\n metrics: [{ id: '182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e' }],\n modality: 'call',\n name: 'Evaluate all inbound calls',\n});\n\nconsole.log(metricPolicy.data);",
413
+ },
414
+ },
415
+ },
416
+ {
417
+ name: 'update',
418
+ endpoint: '/v1/metric/policies/{policyId}',
419
+ httpMethod: 'put',
420
+ summary: 'Update a metric policy',
421
+ description: 'Updates an existing metric policy. System policies cannot be modified.',
422
+ stainlessPath: '(resource) metricPolicy > (method) update',
423
+ qualified: 'client.metricPolicy.update',
424
+ params: [
425
+ 'policyId: string;',
426
+ "conditions?: { conditions: { conditionKey: string; conditionType: 'AGENT' | 'CALL_SOURCE' | 'CALL_PROPERTY' | 'INTEGRATION'; conditionOperator?: string; conditionValue?: string; }[]; }[];",
427
+ 'metrics?: { id: string; }[];',
428
+ 'name?: string;',
429
+ "status?: 'ACTIVE' | 'INACTIVE';",
430
+ ],
431
+ response: "{ data: { id: string; conditions: { conditions: object[]; }[]; createdAt: string; metrics: { id: string; }[]; name: string; status: 'ACTIVE' | 'INACTIVE'; type: 'SYSTEM' | 'USER'; updatedAt: string; }; }",
432
+ markdown: "## update\n\n`client.metricPolicy.update(policyId: string, conditions?: { conditions: { conditionKey: string; conditionType: 'AGENT' | 'CALL_SOURCE' | 'CALL_PROPERTY' | 'INTEGRATION'; conditionOperator?: string; conditionValue?: string; }[]; }[], metrics?: { id: string; }[], name?: string, status?: 'ACTIVE' | 'INACTIVE'): { data: object; }`\n\n**put** `/v1/metric/policies/{policyId}`\n\nUpdates an existing metric policy. System policies cannot be modified.\n\n### Parameters\n\n- `policyId: string`\n\n- `conditions?: { conditions: { conditionKey: string; conditionType: 'AGENT' | 'CALL_SOURCE' | 'CALL_PROPERTY' | 'INTEGRATION'; conditionOperator?: string; conditionValue?: string; }[]; }[]`\n Condition groups. Omit to keep existing, provide empty array to remove all conditions.\n\n- `metrics?: { id: string; }[]`\n Metric definitions to collect when this policy matches\n\n- `name?: string`\n Name of the metric policy\n\n- `status?: 'ACTIVE' | 'INACTIVE'`\n Status of the policy\n\n### Returns\n\n- `{ data: { id: string; conditions: { conditions: object[]; }[]; createdAt: string; metrics: { id: string; }[]; name: string; status: 'ACTIVE' | 'INACTIVE'; type: 'SYSTEM' | 'USER'; updatedAt: string; }; }`\n\n - `data: { id: string; conditions: { conditions: { conditionKey: string; conditionOperator: string; conditionType: 'AGENT' | 'CALL_SOURCE' | 'CALL_PROPERTY' | 'INTEGRATION'; conditionValue: string; }[]; }[]; createdAt: string; metrics: { id: string; }[]; name: string; status: 'ACTIVE' | 'INACTIVE'; type: 'SYSTEM' | 'USER'; updatedAt: string; }`\n\n### Example\n\n```typescript\nimport Roark from '@roarkanalytics/sdk';\n\nconst client = new Roark();\n\nconst metricPolicy = await client.metricPolicy.update('182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e');\n\nconsole.log(metricPolicy);\n```",
433
+ perLanguage: {
434
+ http: {
435
+ example: 'curl https://api.roark.ai/v1/metric/policies/$POLICY_ID \\\n -X PUT \\\n -H "Authorization: Bearer $ROARK_API_BEARER_TOKEN"',
436
+ },
437
+ python: {
438
+ method: 'metric_policy.update',
439
+ example: 'import os\nfrom roark_analytics import Roark\n\nclient = Roark(\n bearer_token=os.environ.get("ROARK_API_BEARER_TOKEN"), # This is the default and can be omitted\n)\nmetric_policy = client.metric_policy.update(\n policy_id="182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e",\n)\nprint(metric_policy.data)',
440
+ },
441
+ typescript: {
442
+ method: 'client.metricPolicy.update',
443
+ example: "import Roark from '@roarkanalytics/sdk';\n\nconst client = new Roark({\n bearerToken: process.env['ROARK_API_BEARER_TOKEN'], // This is the default and can be omitted\n});\n\nconst metricPolicy = await client.metricPolicy.update('182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e');\n\nconsole.log(metricPolicy.data);",
444
+ },
445
+ },
446
+ },
447
+ {
448
+ name: 'delete',
449
+ endpoint: '/v1/metric/policies/{policyId}',
450
+ httpMethod: 'delete',
451
+ summary: 'Delete a metric policy',
452
+ description: 'Soft-deletes a metric policy. System policies cannot be deleted.',
453
+ stainlessPath: '(resource) metricPolicy > (method) delete',
454
+ qualified: 'client.metricPolicy.delete',
455
+ params: ['policyId: string;'],
456
+ response: '{ data: { deleted: boolean; }; }',
457
+ markdown: "## delete\n\n`client.metricPolicy.delete(policyId: string): { data: object; }`\n\n**delete** `/v1/metric/policies/{policyId}`\n\nSoft-deletes a metric policy. System policies cannot be deleted.\n\n### Parameters\n\n- `policyId: string`\n\n### Returns\n\n- `{ data: { deleted: boolean; }; }`\n\n - `data: { deleted: boolean; }`\n\n### Example\n\n```typescript\nimport Roark from '@roarkanalytics/sdk';\n\nconst client = new Roark();\n\nconst metricPolicy = await client.metricPolicy.delete('182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e');\n\nconsole.log(metricPolicy);\n```",
458
+ perLanguage: {
459
+ http: {
460
+ example: 'curl https://api.roark.ai/v1/metric/policies/$POLICY_ID \\\n -X DELETE \\\n -H "Authorization: Bearer $ROARK_API_BEARER_TOKEN"',
461
+ },
462
+ python: {
463
+ method: 'metric_policy.delete',
464
+ example: 'import os\nfrom roark_analytics import Roark\n\nclient = Roark(\n bearer_token=os.environ.get("ROARK_API_BEARER_TOKEN"), # This is the default and can be omitted\n)\nmetric_policy = client.metric_policy.delete(\n "182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e",\n)\nprint(metric_policy.data)',
465
+ },
466
+ typescript: {
467
+ method: 'client.metricPolicy.delete',
468
+ example: "import Roark from '@roarkanalytics/sdk';\n\nconst client = new Roark({\n bearerToken: process.env['ROARK_API_BEARER_TOKEN'], // This is the default and can be omitted\n});\n\nconst metricPolicy = await client.metricPolicy.delete('182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e');\n\nconsole.log(metricPolicy.data);",
469
+ },
470
+ },
471
+ },
472
+ {
473
+ name: 'list',
474
+ endpoint: '/v1/metric/collection-jobs',
475
+ httpMethod: 'get',
476
+ summary: 'List metric collection jobs',
477
+ description: 'Returns a paginated list of metric collection jobs for the project.',
478
+ stainlessPath: '(resource) metricCollectionJob > (method) list',
479
+ qualified: 'client.metricCollectionJob.list',
480
+ params: [
481
+ 'after?: string;',
482
+ 'limit?: number;',
483
+ "status?: 'PENDING' | 'PROCESSING' | 'COMPLETED' | 'FAILED' | 'CANCELED';",
484
+ ],
485
+ response: "{ data: { id: string; completedAt: string; completedItems: number; createdAt: string; errorMessage: string; failedItems: number; policyIds: string[]; startedAt: string; status: 'PENDING' | 'PROCESSING' | 'COMPLETED' | 'FAILED' | 'CANCELED'; totalItems: number; triggeredBy: 'USER_MANUAL' | 'USER_API' | 'METRIC_POLICY' | 'SIMULATION'; updatedAt: string; }[]; pagination: { hasMore: boolean; nextCursor: string; total: number; }; }",
486
+ markdown: "## list\n\n`client.metricCollectionJob.list(after?: string, limit?: number, status?: 'PENDING' | 'PROCESSING' | 'COMPLETED' | 'FAILED' | 'CANCELED'): { data: object[]; pagination: object; }`\n\n**get** `/v1/metric/collection-jobs`\n\nReturns a paginated list of metric collection jobs for the project.\n\n### Parameters\n\n- `after?: string`\n Cursor for pagination - use the nextCursor value from a previous response\n\n- `limit?: number`\n Maximum number of jobs to return (default: 20, max: 50)\n\n- `status?: 'PENDING' | 'PROCESSING' | 'COMPLETED' | 'FAILED' | 'CANCELED'`\n Filter by job status\n\n### Returns\n\n- `{ data: { id: string; completedAt: string; completedItems: number; createdAt: string; errorMessage: string; failedItems: number; policyIds: string[]; startedAt: string; status: 'PENDING' | 'PROCESSING' | 'COMPLETED' | 'FAILED' | 'CANCELED'; totalItems: number; triggeredBy: 'USER_MANUAL' | 'USER_API' | 'METRIC_POLICY' | 'SIMULATION'; updatedAt: string; }[]; pagination: { hasMore: boolean; nextCursor: string; total: number; }; }`\n Paginated list of metric collection jobs\n\n - `data: { id: string; completedAt: string; completedItems: number; createdAt: string; errorMessage: string; failedItems: number; policyIds: string[]; startedAt: string; status: 'PENDING' | 'PROCESSING' | 'COMPLETED' | 'FAILED' | 'CANCELED'; totalItems: number; triggeredBy: 'USER_MANUAL' | 'USER_API' | 'METRIC_POLICY' | 'SIMULATION'; updatedAt: string; }[]`\n - `pagination: { hasMore: boolean; nextCursor: string; total: number; }`\n\n### Example\n\n```typescript\nimport Roark from '@roarkanalytics/sdk';\n\nconst client = new Roark();\n\nconst metricCollectionJobs = await client.metricCollectionJob.list();\n\nconsole.log(metricCollectionJobs);\n```",
487
+ perLanguage: {
488
+ http: {
489
+ example: 'curl https://api.roark.ai/v1/metric/collection-jobs \\\n -H "Authorization: Bearer $ROARK_API_BEARER_TOKEN"',
490
+ },
491
+ python: {
492
+ method: 'metric_collection_job.list',
493
+ example: 'import os\nfrom roark_analytics import Roark\n\nclient = Roark(\n bearer_token=os.environ.get("ROARK_API_BEARER_TOKEN"), # This is the default and can be omitted\n)\nmetric_collection_jobs = client.metric_collection_job.list()\nprint(metric_collection_jobs.data)',
494
+ },
495
+ typescript: {
496
+ method: 'client.metricCollectionJob.list',
497
+ example: "import Roark from '@roarkanalytics/sdk';\n\nconst client = new Roark({\n bearerToken: process.env['ROARK_API_BEARER_TOKEN'], // This is the default and can be omitted\n});\n\nconst metricCollectionJobs = await client.metricCollectionJob.list();\n\nconsole.log(metricCollectionJobs.data);",
498
+ },
499
+ },
500
+ },
501
+ {
502
+ name: 'getById',
503
+ endpoint: '/v1/metric/collection-jobs/{jobId}',
504
+ httpMethod: 'get',
505
+ summary: 'Get metric collection job by ID',
506
+ description: 'Returns a specific metric collection job with progress information.',
507
+ stainlessPath: '(resource) metricCollectionJob > (method) getById',
508
+ qualified: 'client.metricCollectionJob.getByID',
509
+ params: ['jobId: string;'],
510
+ response: "{ data: { id: string; completedAt: string; completedItems: number; createdAt: string; errorMessage: string; failedItems: number; policyIds: string[]; startedAt: string; status: 'PENDING' | 'PROCESSING' | 'COMPLETED' | 'FAILED' | 'CANCELED'; totalItems: number; triggeredBy: 'USER_MANUAL' | 'USER_API' | 'METRIC_POLICY' | 'SIMULATION'; updatedAt: string; }; }",
511
+ markdown: "## getById\n\n`client.metricCollectionJob.getByID(jobId: string): { data: object; }`\n\n**get** `/v1/metric/collection-jobs/{jobId}`\n\nReturns a specific metric collection job with progress information.\n\n### Parameters\n\n- `jobId: string`\n\n### Returns\n\n- `{ data: { id: string; completedAt: string; completedItems: number; createdAt: string; errorMessage: string; failedItems: number; policyIds: string[]; startedAt: string; status: 'PENDING' | 'PROCESSING' | 'COMPLETED' | 'FAILED' | 'CANCELED'; totalItems: number; triggeredBy: 'USER_MANUAL' | 'USER_API' | 'METRIC_POLICY' | 'SIMULATION'; updatedAt: string; }; }`\n\n - `data: { id: string; completedAt: string; completedItems: number; createdAt: string; errorMessage: string; failedItems: number; policyIds: string[]; startedAt: string; status: 'PENDING' | 'PROCESSING' | 'COMPLETED' | 'FAILED' | 'CANCELED'; totalItems: number; triggeredBy: 'USER_MANUAL' | 'USER_API' | 'METRIC_POLICY' | 'SIMULATION'; updatedAt: string; }`\n\n### Example\n\n```typescript\nimport Roark from '@roarkanalytics/sdk';\n\nconst client = new Roark();\n\nconst response = await client.metricCollectionJob.getByID('182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e');\n\nconsole.log(response);\n```",
512
+ perLanguage: {
513
+ http: {
514
+ example: 'curl https://api.roark.ai/v1/metric/collection-jobs/$JOB_ID \\\n -H "Authorization: Bearer $ROARK_API_BEARER_TOKEN"',
515
+ },
516
+ python: {
517
+ method: 'metric_collection_job.get_by_id',
518
+ example: 'import os\nfrom roark_analytics import Roark\n\nclient = Roark(\n bearer_token=os.environ.get("ROARK_API_BEARER_TOKEN"), # This is the default and can be omitted\n)\nresponse = client.metric_collection_job.get_by_id(\n "182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e",\n)\nprint(response.data)',
519
+ },
520
+ typescript: {
521
+ method: 'client.metricCollectionJob.getByID',
522
+ example: "import Roark from '@roarkanalytics/sdk';\n\nconst client = new Roark({\n bearerToken: process.env['ROARK_API_BEARER_TOKEN'], // This is the default and can be omitted\n});\n\nconst response = await client.metricCollectionJob.getByID('182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e');\n\nconsole.log(response.data);",
523
+ },
524
+ },
525
+ },
526
+ {
527
+ name: 'create',
528
+ endpoint: '/v1/metric/collection-jobs',
529
+ httpMethod: 'post',
530
+ summary: 'Create and run a metric collection job',
531
+ description: 'Creates a metric collection job for the specified calls or chats and metrics, then triggers processing. Provide exactly one of callIds or chatIds.',
532
+ stainlessPath: '(resource) metricCollectionJob > (method) create',
533
+ qualified: 'client.metricCollectionJob.create',
534
+ params: ['metrics: { id: string; }[];', 'callIds?: string[];', 'chatIds?: string[];'],
535
+ response: "{ data: { id: string; completedAt: string; completedItems: number; createdAt: string; errorMessage: string; failedItems: number; policyIds: string[]; startedAt: string; status: 'PENDING' | 'PROCESSING' | 'COMPLETED' | 'FAILED' | 'CANCELED'; totalItems: number; triggeredBy: 'USER_MANUAL' | 'USER_API' | 'METRIC_POLICY' | 'SIMULATION'; updatedAt: string; }; }",
536
+ markdown: "## create\n\n`client.metricCollectionJob.create(metrics: { id: string; }[], callIds?: string[], chatIds?: string[]): { data: object; }`\n\n**post** `/v1/metric/collection-jobs`\n\nCreates a metric collection job for the specified calls or chats and metrics, then triggers processing. Provide exactly one of callIds or chatIds.\n\n### Parameters\n\n- `metrics: { id: string; }[]`\n Metric definitions to collect\n\n- `callIds?: string[]`\n Call IDs to collect metrics for. Mutually exclusive with chatIds.\n\n- `chatIds?: string[]`\n Chat IDs to collect metrics for. Mutually exclusive with callIds.\n\n### Returns\n\n- `{ data: { id: string; completedAt: string; completedItems: number; createdAt: string; errorMessage: string; failedItems: number; policyIds: string[]; startedAt: string; status: 'PENDING' | 'PROCESSING' | 'COMPLETED' | 'FAILED' | 'CANCELED'; totalItems: number; triggeredBy: 'USER_MANUAL' | 'USER_API' | 'METRIC_POLICY' | 'SIMULATION'; updatedAt: string; }; }`\n\n - `data: { id: string; completedAt: string; completedItems: number; createdAt: string; errorMessage: string; failedItems: number; policyIds: string[]; startedAt: string; status: 'PENDING' | 'PROCESSING' | 'COMPLETED' | 'FAILED' | 'CANCELED'; totalItems: number; triggeredBy: 'USER_MANUAL' | 'USER_API' | 'METRIC_POLICY' | 'SIMULATION'; updatedAt: string; }`\n\n### Example\n\n```typescript\nimport Roark from '@roarkanalytics/sdk';\n\nconst client = new Roark();\n\nconst metricCollectionJob = await client.metricCollectionJob.create({ metrics: [{ id: '182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e' }] });\n\nconsole.log(metricCollectionJob);\n```",
537
+ perLanguage: {
538
+ http: {
539
+ example: 'curl https://api.roark.ai/v1/metric/collection-jobs \\\n -H \'Content-Type: application/json\' \\\n -H "Authorization: Bearer $ROARK_API_BEARER_TOKEN" \\\n -d \'{\n "metrics": [\n {\n "id": "182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e"\n }\n ]\n }\'',
540
+ },
541
+ python: {
542
+ method: 'metric_collection_job.create',
543
+ example: 'import os\nfrom roark_analytics import Roark\n\nclient = Roark(\n bearer_token=os.environ.get("ROARK_API_BEARER_TOKEN"), # This is the default and can be omitted\n)\nmetric_collection_job = client.metric_collection_job.create(\n metrics=[{\n "id": "182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e"\n }],\n)\nprint(metric_collection_job.data)',
544
+ },
545
+ typescript: {
546
+ method: 'client.metricCollectionJob.create',
547
+ example: "import Roark from '@roarkanalytics/sdk';\n\nconst client = new Roark({\n bearerToken: process.env['ROARK_API_BEARER_TOKEN'], // This is the default and can be omitted\n});\n\nconst metricCollectionJob = await client.metricCollectionJob.create({\n metrics: [{ id: '182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e' }],\n});\n\nconsole.log(metricCollectionJob.data);",
548
+ },
549
+ },
550
+ },
551
+ {
552
+ name: 'lookup',
553
+ endpoint: '/v1/simulation/job/lookup',
554
+ httpMethod: 'get',
555
+ summary: 'Lookup by phone number',
556
+ description: 'Find the matching simulation using the number used by the Roark simulation agent.',
557
+ stainlessPath: '(resource) simulationJob > (method) lookup',
558
+ qualified: 'client.simulationJob.lookup',
559
+ params: ['roarkPhoneNumber: object;', 'callReceivedAt?: object;'],
560
+ response: '{ data: { agentEndpoint: object; createdAt: string; persona: object; processingStatus: string; scenario: object; simulationJobId: string; status: string; callId?: string; completedAt?: string; roarkPhoneNumber?: string; startedAt?: string; }; }',
561
+ markdown: "## lookup\n\n`client.simulationJob.lookup(roarkPhoneNumber: object, callReceivedAt?: object): { data: object; }`\n\n**get** `/v1/simulation/job/lookup`\n\nFind the matching simulation using the number used by the Roark simulation agent.\n\n### Parameters\n\n- `roarkPhoneNumber: object`\n Phone number provisioned by Roark for the simulation job in E.164 format. In the case of an inbound simulation, this is the number that calls your agent; in the case of an outbound simulation, this is the number you call from your agent.\n\n- `callReceivedAt?: object`\n ISO 8601 timestamp of when the call was received. Alternatively, any time between the start and end of the call is valid. Defaults to the current time, which fetches any jobs that are currently ongoing.\n\n### Returns\n\n- `{ data: { agentEndpoint: { id: string; name: string; phoneNumber: string; type: 'PHONE' | 'WEBSOCKET' | 'LIVEKIT' | 'SMALL_WEBRTC' | 'ELEVENLABS_WS' | 'KORE' | 'GOOGLE_CES'; }; createdAt: string; persona: { id: string; accent: string; backgroundNoise: string; baseEmotion: 'NEUTRAL' | 'CHEERFUL' | 'CONFUSED' | 'FRUSTRATED' | 'SKEPTICAL' | 'RUSHED' | 'DISTRACTED'; confirmationStyle: 'EXPLICIT' | 'VAGUE'; createdAt: string; gender: 'MALE' | 'FEMALE'; hasDisfluencies: boolean; idleMessageMaxSpokenCount: number; idleMessageResetCountOnUserSpeechEnabled: boolean; idleMessages: string[]; idleTimeoutSeconds: number; intentClarity: 'CLEAR' | 'INDIRECT' | 'VAGUE'; language: string; memoryReliability: 'HIGH' | 'LOW'; name: string; properties: object; responseTiming: 'RELAXED' | 'NORMAL' | 'QUICK'; speechClarity: 'CLEAR' | 'VAGUE' | 'RAMBLING'; speechPace: 'SUPER_SLOW' | 'SLOW' | 'NORMAL' | 'FAST' | 'SUPER_FAST'; updatedAt: string; backstoryPrompt?: string; description?: string; secondaryLanguage?: 'EN'; }; processingStatus: string; scenario: { id: string; description?: string; }; simulationJobId: string; status: string; callId?: string; completedAt?: string; roarkPhoneNumber?: string; startedAt?: string; }; }`\n\n - `data: { agentEndpoint: { id: string; name: string; phoneNumber: string; type: 'PHONE' | 'WEBSOCKET' | 'LIVEKIT' | 'SMALL_WEBRTC' | 'ELEVENLABS_WS' | 'KORE' | 'GOOGLE_CES'; }; createdAt: string; persona: { id: string; accent: string; backgroundNoise: string; baseEmotion: 'NEUTRAL' | 'CHEERFUL' | 'CONFUSED' | 'FRUSTRATED' | 'SKEPTICAL' | 'RUSHED' | 'DISTRACTED'; confirmationStyle: 'EXPLICIT' | 'VAGUE'; createdAt: string; gender: 'MALE' | 'FEMALE'; hasDisfluencies: boolean; idleMessageMaxSpokenCount: number; idleMessageResetCountOnUserSpeechEnabled: boolean; idleMessages: string[]; idleTimeoutSeconds: number; intentClarity: 'CLEAR' | 'INDIRECT' | 'VAGUE'; language: string; memoryReliability: 'HIGH' | 'LOW'; name: string; properties: object; responseTiming: 'RELAXED' | 'NORMAL' | 'QUICK'; speechClarity: 'CLEAR' | 'VAGUE' | 'RAMBLING'; speechPace: 'SUPER_SLOW' | 'SLOW' | 'NORMAL' | 'FAST' | 'SUPER_FAST'; updatedAt: string; backstoryPrompt?: string; description?: string; secondaryLanguage?: 'EN'; }; processingStatus: string; scenario: { id: string; description?: string; }; simulationJobId: string; status: string; callId?: string; completedAt?: string; roarkPhoneNumber?: string; startedAt?: string; }`\n\n### Example\n\n```typescript\nimport Roark from '@roarkanalytics/sdk';\n\nconst client = new Roark();\n\nconst response = await client.simulationJob.lookup({ roarkPhoneNumber: {} });\n\nconsole.log(response);\n```",
562
+ perLanguage: {
563
+ http: {
564
+ example: 'curl https://api.roark.ai/v1/simulation/job/lookup \\\n -H "Authorization: Bearer $ROARK_API_BEARER_TOKEN"',
565
+ },
566
+ python: {
567
+ method: 'simulation_job.lookup',
568
+ example: 'import os\nfrom roark_analytics import Roark\n\nclient = Roark(\n bearer_token=os.environ.get("ROARK_API_BEARER_TOKEN"), # This is the default and can be omitted\n)\nresponse = client.simulation_job.lookup(\n roark_phone_number={},\n)\nprint(response.data)',
569
+ },
570
+ typescript: {
571
+ method: 'client.simulationJob.lookup',
572
+ example: "import Roark from '@roarkanalytics/sdk';\n\nconst client = new Roark({\n bearerToken: process.env['ROARK_API_BEARER_TOKEN'], // This is the default and can be omitted\n});\n\nconst response = await client.simulationJob.lookup({ roarkPhoneNumber: {} });\n\nconsole.log(response.data);",
573
+ },
574
+ },
575
+ },
576
+ {
577
+ name: 'getById',
578
+ endpoint: '/v1/simulation/job/{jobId}',
579
+ httpMethod: 'get',
580
+ summary: 'Get simulation by ID',
581
+ description: 'Get a individual simulation run directly by its ID. This is generally part of a larger simulation run plan job.',
582
+ stainlessPath: '(resource) simulationJob > (method) getById',
583
+ qualified: 'client.simulationJob.getByID',
584
+ params: ['jobId: object;'],
585
+ response: '{ data: { agentEndpoint: object; createdAt: string; persona: object; processingStatus: string; scenario: object; simulationJobId: string; status: string; callId?: string; completedAt?: string; roarkPhoneNumber?: string; startedAt?: string; }; }',
586
+ markdown: "## getById\n\n`client.simulationJob.getByID(jobId: object): { data: object; }`\n\n**get** `/v1/simulation/job/{jobId}`\n\nGet a individual simulation run directly by its ID. This is generally part of a larger simulation run plan job.\n\n### Parameters\n\n- `jobId: object`\n\n### Returns\n\n- `{ data: { agentEndpoint: { id: string; name: string; phoneNumber: string; type: 'PHONE' | 'WEBSOCKET' | 'LIVEKIT' | 'SMALL_WEBRTC' | 'ELEVENLABS_WS' | 'KORE' | 'GOOGLE_CES'; }; createdAt: string; persona: { id: string; accent: string; backgroundNoise: string; baseEmotion: 'NEUTRAL' | 'CHEERFUL' | 'CONFUSED' | 'FRUSTRATED' | 'SKEPTICAL' | 'RUSHED' | 'DISTRACTED'; confirmationStyle: 'EXPLICIT' | 'VAGUE'; createdAt: string; gender: 'MALE' | 'FEMALE'; hasDisfluencies: boolean; idleMessageMaxSpokenCount: number; idleMessageResetCountOnUserSpeechEnabled: boolean; idleMessages: string[]; idleTimeoutSeconds: number; intentClarity: 'CLEAR' | 'INDIRECT' | 'VAGUE'; language: string; memoryReliability: 'HIGH' | 'LOW'; name: string; properties: object; responseTiming: 'RELAXED' | 'NORMAL' | 'QUICK'; speechClarity: 'CLEAR' | 'VAGUE' | 'RAMBLING'; speechPace: 'SUPER_SLOW' | 'SLOW' | 'NORMAL' | 'FAST' | 'SUPER_FAST'; updatedAt: string; backstoryPrompt?: string; description?: string; secondaryLanguage?: 'EN'; }; processingStatus: string; scenario: { id: string; description?: string; }; simulationJobId: string; status: string; callId?: string; completedAt?: string; roarkPhoneNumber?: string; startedAt?: string; }; }`\n\n - `data: { agentEndpoint: { id: string; name: string; phoneNumber: string; type: 'PHONE' | 'WEBSOCKET' | 'LIVEKIT' | 'SMALL_WEBRTC' | 'ELEVENLABS_WS' | 'KORE' | 'GOOGLE_CES'; }; createdAt: string; persona: { id: string; accent: string; backgroundNoise: string; baseEmotion: 'NEUTRAL' | 'CHEERFUL' | 'CONFUSED' | 'FRUSTRATED' | 'SKEPTICAL' | 'RUSHED' | 'DISTRACTED'; confirmationStyle: 'EXPLICIT' | 'VAGUE'; createdAt: string; gender: 'MALE' | 'FEMALE'; hasDisfluencies: boolean; idleMessageMaxSpokenCount: number; idleMessageResetCountOnUserSpeechEnabled: boolean; idleMessages: string[]; idleTimeoutSeconds: number; intentClarity: 'CLEAR' | 'INDIRECT' | 'VAGUE'; language: string; memoryReliability: 'HIGH' | 'LOW'; name: string; properties: object; responseTiming: 'RELAXED' | 'NORMAL' | 'QUICK'; speechClarity: 'CLEAR' | 'VAGUE' | 'RAMBLING'; speechPace: 'SUPER_SLOW' | 'SLOW' | 'NORMAL' | 'FAST' | 'SUPER_FAST'; updatedAt: string; backstoryPrompt?: string; description?: string; secondaryLanguage?: 'EN'; }; processingStatus: string; scenario: { id: string; description?: string; }; simulationJobId: string; status: string; callId?: string; completedAt?: string; roarkPhoneNumber?: string; startedAt?: string; }`\n\n### Example\n\n```typescript\nimport Roark from '@roarkanalytics/sdk';\n\nconst client = new Roark();\n\nconst response = await client.simulationJob.getByID('7f3e4d2c-8a91-4b5c-9e6f-1a2b3c4d5e6f');\n\nconsole.log(response);\n```",
587
+ perLanguage: {
588
+ http: {
589
+ example: 'curl https://api.roark.ai/v1/simulation/job/$JOB_ID \\\n -H "Authorization: Bearer $ROARK_API_BEARER_TOKEN"',
590
+ },
591
+ python: {
592
+ method: 'simulation_job.get_by_id',
593
+ example: 'import os\nfrom roark_analytics import Roark\n\nclient = Roark(\n bearer_token=os.environ.get("ROARK_API_BEARER_TOKEN"), # This is the default and can be omitted\n)\nresponse = client.simulation_job.get_by_id(\n "7f3e4d2c-8a91-4b5c-9e6f-1a2b3c4d5e6f",\n)\nprint(response.data)',
594
+ },
595
+ typescript: {
596
+ method: 'client.simulationJob.getByID',
597
+ example: "import Roark from '@roarkanalytics/sdk';\n\nconst client = new Roark({\n bearerToken: process.env['ROARK_API_BEARER_TOKEN'], // This is the default and can be omitted\n});\n\nconst response = await client.simulationJob.getByID('7f3e4d2c-8a91-4b5c-9e6f-1a2b3c4d5e6f');\n\nconsole.log(response.data);",
598
+ },
599
+ },
600
+ },
601
+ {
602
+ name: 'list',
603
+ endpoint: '/v1/simulation/plan',
604
+ httpMethod: 'get',
605
+ summary: 'List run plans',
606
+ description: 'Returns a paginated list of simulation run plans. Optionally filter by search text or agent ID.',
607
+ stainlessPath: '(resource) simulationRunPlan > (method) list',
608
+ qualified: 'client.simulationRunPlan.list',
609
+ params: ['after?: string;', 'agentId?: string;', 'limit?: number;', 'searchText?: string;'],
610
+ response: "{ data: { id: string; agentEndpoints: { id: string; }[]; createdAt: string; direction: 'INBOUND' | 'OUTBOUND'; endCallPhrases: string[]; endCallReasons: string[]; evaluators: { id: string; }[]; executionMode: 'PARALLEL' | 'SEQUENTIAL_SAME_RUN_PLAN' | 'SEQUENTIAL_PROJECT'; iterationCount: number; maxConcurrentJobs: number; maxSimulationDurationSeconds: number; metrics: { id: string; }[]; name: string; personas: { id: string; }[]; scenarios: { id: string; variables?: object; }[]; silenceTimeoutSeconds: number; testCaseCount: number; updatedAt: string; description?: string; }[]; pagination: { hasMore: boolean; nextCursor: string; total: number; }; }",
611
+ markdown: "## list\n\n`client.simulationRunPlan.list(after?: string, agentId?: string, limit?: number, searchText?: string): { data: object[]; pagination: object; }`\n\n**get** `/v1/simulation/plan`\n\nReturns a paginated list of simulation run plans. Optionally filter by search text or agent ID.\n\n### Parameters\n\n- `after?: string`\n Cursor for pagination - use the nextCursor value from a previous response\n\n- `agentId?: string`\n Filter run plans by agent ID\n\n- `limit?: number`\n Maximum number of run plans to return (default: 20, max: 50)\n\n- `searchText?: string`\n Search text to filter run plans by name\n\n### Returns\n\n- `{ data: { id: string; agentEndpoints: { id: string; }[]; createdAt: string; direction: 'INBOUND' | 'OUTBOUND'; endCallPhrases: string[]; endCallReasons: string[]; evaluators: { id: string; }[]; executionMode: 'PARALLEL' | 'SEQUENTIAL_SAME_RUN_PLAN' | 'SEQUENTIAL_PROJECT'; iterationCount: number; maxConcurrentJobs: number; maxSimulationDurationSeconds: number; metrics: { id: string; }[]; name: string; personas: { id: string; }[]; scenarios: { id: string; variables?: object; }[]; silenceTimeoutSeconds: number; testCaseCount: number; updatedAt: string; description?: string; }[]; pagination: { hasMore: boolean; nextCursor: string; total: number; }; }`\n Paginated list of simulation run plans\n\n - `data: { id: string; agentEndpoints: { id: string; }[]; createdAt: string; direction: 'INBOUND' | 'OUTBOUND'; endCallPhrases: string[]; endCallReasons: string[]; evaluators: { id: string; }[]; executionMode: 'PARALLEL' | 'SEQUENTIAL_SAME_RUN_PLAN' | 'SEQUENTIAL_PROJECT'; iterationCount: number; maxConcurrentJobs: number; maxSimulationDurationSeconds: number; metrics: { id: string; }[]; name: string; personas: { id: string; }[]; scenarios: { id: string; variables?: object; }[]; silenceTimeoutSeconds: number; testCaseCount: number; updatedAt: string; description?: string; }[]`\n - `pagination: { hasMore: boolean; nextCursor: string; total: number; }`\n\n### Example\n\n```typescript\nimport Roark from '@roarkanalytics/sdk';\n\nconst client = new Roark();\n\nconst simulationRunPlans = await client.simulationRunPlan.list();\n\nconsole.log(simulationRunPlans);\n```",
612
+ perLanguage: {
613
+ http: {
614
+ example: 'curl https://api.roark.ai/v1/simulation/plan \\\n -H "Authorization: Bearer $ROARK_API_BEARER_TOKEN"',
615
+ },
616
+ python: {
617
+ method: 'simulation_run_plan.list',
618
+ example: 'import os\nfrom roark_analytics import Roark\n\nclient = Roark(\n bearer_token=os.environ.get("ROARK_API_BEARER_TOKEN"), # This is the default and can be omitted\n)\nsimulation_run_plans = client.simulation_run_plan.list()\nprint(simulation_run_plans.data)',
619
+ },
620
+ typescript: {
621
+ method: 'client.simulationRunPlan.list',
622
+ example: "import Roark from '@roarkanalytics/sdk';\n\nconst client = new Roark({\n bearerToken: process.env['ROARK_API_BEARER_TOKEN'], // This is the default and can be omitted\n});\n\nconst simulationRunPlans = await client.simulationRunPlan.list();\n\nconsole.log(simulationRunPlans.data);",
623
+ },
624
+ },
625
+ },
626
+ {
627
+ name: 'getById',
628
+ endpoint: '/v1/simulation/plan/{planId}',
629
+ httpMethod: 'get',
630
+ summary: 'Get run plan by ID',
631
+ description: 'Returns a specific simulation run plan by its ID.',
632
+ stainlessPath: '(resource) simulationRunPlan > (method) getById',
633
+ qualified: 'client.simulationRunPlan.getByID',
634
+ params: ['planId: string;'],
635
+ response: "{ data: { id: string; agentEndpoints: { id: string; }[]; createdAt: string; direction: 'INBOUND' | 'OUTBOUND'; endCallPhrases: string[]; endCallReasons: string[]; evaluators: { id: string; }[]; executionMode: 'PARALLEL' | 'SEQUENTIAL_SAME_RUN_PLAN' | 'SEQUENTIAL_PROJECT'; iterationCount: number; maxConcurrentJobs: number; maxSimulationDurationSeconds: number; metrics: { id: string; }[]; name: string; personas: { id: string; }[]; scenarios: { id: string; variables?: object; }[]; silenceTimeoutSeconds: number; testCaseCount: number; updatedAt: string; description?: string; }; }",
636
+ markdown: "## getById\n\n`client.simulationRunPlan.getByID(planId: string): { data: object; }`\n\n**get** `/v1/simulation/plan/{planId}`\n\nReturns a specific simulation run plan by its ID.\n\n### Parameters\n\n- `planId: string`\n\n### Returns\n\n- `{ data: { id: string; agentEndpoints: { id: string; }[]; createdAt: string; direction: 'INBOUND' | 'OUTBOUND'; endCallPhrases: string[]; endCallReasons: string[]; evaluators: { id: string; }[]; executionMode: 'PARALLEL' | 'SEQUENTIAL_SAME_RUN_PLAN' | 'SEQUENTIAL_PROJECT'; iterationCount: number; maxConcurrentJobs: number; maxSimulationDurationSeconds: number; metrics: { id: string; }[]; name: string; personas: { id: string; }[]; scenarios: { id: string; variables?: object; }[]; silenceTimeoutSeconds: number; testCaseCount: number; updatedAt: string; description?: string; }; }`\n\n - `data: { id: string; agentEndpoints: { id: string; }[]; createdAt: string; direction: 'INBOUND' | 'OUTBOUND'; endCallPhrases: string[]; endCallReasons: string[]; evaluators: { id: string; }[]; executionMode: 'PARALLEL' | 'SEQUENTIAL_SAME_RUN_PLAN' | 'SEQUENTIAL_PROJECT'; iterationCount: number; maxConcurrentJobs: number; maxSimulationDurationSeconds: number; metrics: { id: string; }[]; name: string; personas: { id: string; }[]; scenarios: { id: string; variables?: object; }[]; silenceTimeoutSeconds: number; testCaseCount: number; updatedAt: string; description?: string; }`\n\n### Example\n\n```typescript\nimport Roark from '@roarkanalytics/sdk';\n\nconst client = new Roark();\n\nconst response = await client.simulationRunPlan.getByID('182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e');\n\nconsole.log(response);\n```",
637
+ perLanguage: {
638
+ http: {
639
+ example: 'curl https://api.roark.ai/v1/simulation/plan/$PLAN_ID \\\n -H "Authorization: Bearer $ROARK_API_BEARER_TOKEN"',
640
+ },
641
+ python: {
642
+ method: 'simulation_run_plan.get_by_id',
643
+ example: 'import os\nfrom roark_analytics import Roark\n\nclient = Roark(\n bearer_token=os.environ.get("ROARK_API_BEARER_TOKEN"), # This is the default and can be omitted\n)\nresponse = client.simulation_run_plan.get_by_id(\n "182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e",\n)\nprint(response.data)',
644
+ },
645
+ typescript: {
646
+ method: 'client.simulationRunPlan.getByID',
647
+ example: "import Roark from '@roarkanalytics/sdk';\n\nconst client = new Roark({\n bearerToken: process.env['ROARK_API_BEARER_TOKEN'], // This is the default and can be omitted\n});\n\nconst response = await client.simulationRunPlan.getByID('182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e');\n\nconsole.log(response.data);",
648
+ },
649
+ },
650
+ },
651
+ {
652
+ name: 'create',
653
+ endpoint: '/v1/simulation/plan',
654
+ httpMethod: 'post',
655
+ summary: 'Create a run plan',
656
+ description: 'Creates a new simulation run plan. Optionally triggers a job immediately if autoRun is true.',
657
+ stainlessPath: '(resource) simulationRunPlan > (method) create',
658
+ qualified: 'client.simulationRunPlan.create',
659
+ params: [
660
+ 'agentEndpoints: { id: string; }[];',
661
+ "direction: 'INBOUND' | 'OUTBOUND';",
662
+ 'maxSimulationDurationSeconds: number;',
663
+ 'metrics: { id: string; }[];',
664
+ 'name: string;',
665
+ 'personas: { id: string; }[];',
666
+ 'scenarios: { id: string; variables?: object; }[];',
667
+ 'autoRun?: boolean;',
668
+ 'description?: string;',
669
+ 'endCallPhrases?: string[];',
670
+ 'endCallReasons?: string[];',
671
+ "executionMode?: 'PARALLEL' | 'SEQUENTIAL_SAME_RUN_PLAN' | 'SEQUENTIAL_PROJECT';",
672
+ 'iterationCount?: number;',
673
+ 'maxConcurrentJobs?: number;',
674
+ 'silenceTimeoutSeconds?: number;',
675
+ ],
676
+ response: "{ data: { runPlan: { id: string; agentEndpoints: object[]; createdAt: string; direction: 'INBOUND' | 'OUTBOUND'; endCallPhrases: string[]; endCallReasons: string[]; evaluators: object[]; executionMode: 'PARALLEL' | 'SEQUENTIAL_SAME_RUN_PLAN' | 'SEQUENTIAL_PROJECT'; iterationCount: number; maxConcurrentJobs: number; maxSimulationDurationSeconds: number; metrics: object[]; name: string; personas: object[]; scenarios: object[]; silenceTimeoutSeconds: number; testCaseCount: number; updatedAt: string; description?: string; }; runPlanJob?: { createdAt: string; simulationRunPlanId: string; simulationRunPlanJobId: string; status: string; }; }; }",
677
+ markdown: "## create\n\n`client.simulationRunPlan.create(agentEndpoints: { id: string; }[], direction: 'INBOUND' | 'OUTBOUND', maxSimulationDurationSeconds: number, metrics: { id: string; }[], name: string, personas: { id: string; }[], scenarios: { id: string; variables?: object; }[], autoRun?: boolean, description?: string, endCallPhrases?: string[], endCallReasons?: string[], executionMode?: 'PARALLEL' | 'SEQUENTIAL_SAME_RUN_PLAN' | 'SEQUENTIAL_PROJECT', iterationCount?: number, maxConcurrentJobs?: number, silenceTimeoutSeconds?: number): { data: object; }`\n\n**post** `/v1/simulation/plan`\n\nCreates a new simulation run plan. Optionally triggers a job immediately if autoRun is true.\n\n### Parameters\n\n- `agentEndpoints: { id: string; }[]`\n Agent endpoints to include in this run plan\n\n- `direction: 'INBOUND' | 'OUTBOUND'`\n Direction of the simulation (INBOUND or OUTBOUND)\n\n- `maxSimulationDurationSeconds: number`\n Maximum duration in seconds for each simulation\n\n- `metrics: { id: string; }[]`\n Metric definitions to include in this run plan\n\n- `name: string`\n Name of the run plan\n\n- `personas: { id: string; }[]`\n Personas to include in this run plan\n\n- `scenarios: { id: string; variables?: object; }[]`\n Scenarios to include in this run plan. The same scenario ID can appear multiple times with different variables.\n\n- `autoRun?: boolean`\n Whether to automatically trigger a job after creating the run plan\n\n- `description?: string`\n Description of the run plan\n\n- `endCallPhrases?: string[]`\n Phrases that trigger end of call. Empty array disables the feature.\n\n- `endCallReasons?: string[]`\n Semantic conditions that trigger end of call. The LLM evaluates the conversation against these conditions. Empty array disables the feature.\n\n- `executionMode?: 'PARALLEL' | 'SEQUENTIAL_SAME_RUN_PLAN' | 'SEQUENTIAL_PROJECT'`\n Execution mode (PARALLEL or SEQUENTIAL)\n\n- `iterationCount?: number`\n Number of iterations to run for each test case. Must be 1 for OUTBOUND direction.\n\n- `maxConcurrentJobs?: number`\n Maximum number of concurrent simulation jobs\n\n- `silenceTimeoutSeconds?: number`\n Timeout in seconds for silence detection\n\n### Returns\n\n- `{ data: { runPlan: { id: string; agentEndpoints: object[]; createdAt: string; direction: 'INBOUND' | 'OUTBOUND'; endCallPhrases: string[]; endCallReasons: string[]; evaluators: object[]; executionMode: 'PARALLEL' | 'SEQUENTIAL_SAME_RUN_PLAN' | 'SEQUENTIAL_PROJECT'; iterationCount: number; maxConcurrentJobs: number; maxSimulationDurationSeconds: number; metrics: object[]; name: string; personas: object[]; scenarios: object[]; silenceTimeoutSeconds: number; testCaseCount: number; updatedAt: string; description?: string; }; runPlanJob?: { createdAt: string; simulationRunPlanId: string; simulationRunPlanJobId: string; status: string; }; }; }`\n\n - `data: { runPlan: { id: string; agentEndpoints: { id: string; }[]; createdAt: string; direction: 'INBOUND' | 'OUTBOUND'; endCallPhrases: string[]; endCallReasons: string[]; evaluators: { id: string; }[]; executionMode: 'PARALLEL' | 'SEQUENTIAL_SAME_RUN_PLAN' | 'SEQUENTIAL_PROJECT'; iterationCount: number; maxConcurrentJobs: number; maxSimulationDurationSeconds: number; metrics: { id: string; }[]; name: string; personas: { id: string; }[]; scenarios: { id: string; variables?: object; }[]; silenceTimeoutSeconds: number; testCaseCount: number; updatedAt: string; description?: string; }; runPlanJob?: { createdAt: string; simulationRunPlanId: string; simulationRunPlanJobId: string; status: string; }; }`\n\n### Example\n\n```typescript\nimport Roark from '@roarkanalytics/sdk';\n\nconst client = new Roark();\n\nconst simulationRunPlan = await client.simulationRunPlan.create({\n agentEndpoints: [{ id: '182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e' }],\n direction: 'INBOUND',\n maxSimulationDurationSeconds: 300,\n metrics: [{ id: '182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e' }],\n name: 'My Run Plan',\n personas: [{ id: '182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e' }],\n scenarios: [{ id: '182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e' }],\n});\n\nconsole.log(simulationRunPlan);\n```",
678
+ perLanguage: {
679
+ http: {
680
+ example: 'curl https://api.roark.ai/v1/simulation/plan \\\n -H \'Content-Type: application/json\' \\\n -H "Authorization: Bearer $ROARK_API_BEARER_TOKEN" \\\n -d \'{\n "agentEndpoints": [\n {\n "id": "182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e"\n }\n ],\n "direction": "INBOUND",\n "maxSimulationDurationSeconds": 300,\n "metrics": [\n {\n "id": "182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e"\n }\n ],\n "name": "My Run Plan",\n "personas": [\n {\n "id": "182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e"\n }\n ],\n "scenarios": [\n {\n "id": "182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e"\n }\n ],\n "description": "A run plan for testing inbound calls",\n "endCallPhrases": [\n "goodbye"\n ],\n "endCallReasons": [\n "Order has been confirmed by the agent"\n ],\n "executionMode": "PARALLEL",\n "iterationCount": 1,\n "maxConcurrentJobs": 5,\n "silenceTimeoutSeconds": 30\n }\'',
681
+ },
682
+ python: {
683
+ method: 'simulation_run_plan.create',
684
+ example: 'import os\nfrom roark_analytics import Roark\n\nclient = Roark(\n bearer_token=os.environ.get("ROARK_API_BEARER_TOKEN"), # This is the default and can be omitted\n)\nsimulation_run_plan = client.simulation_run_plan.create(\n agent_endpoints=[{\n "id": "182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e"\n }],\n direction="INBOUND",\n max_simulation_duration_seconds=300,\n metrics=[{\n "id": "182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e"\n }],\n name="My Run Plan",\n personas=[{\n "id": "182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e"\n }],\n scenarios=[{\n "id": "182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e"\n }],\n)\nprint(simulation_run_plan.data)',
685
+ },
686
+ typescript: {
687
+ method: 'client.simulationRunPlan.create',
688
+ example: "import Roark from '@roarkanalytics/sdk';\n\nconst client = new Roark({\n bearerToken: process.env['ROARK_API_BEARER_TOKEN'], // This is the default and can be omitted\n});\n\nconst simulationRunPlan = await client.simulationRunPlan.create({\n agentEndpoints: [{ id: '182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e' }],\n direction: 'INBOUND',\n maxSimulationDurationSeconds: 300,\n metrics: [{ id: '182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e' }],\n name: 'My Run Plan',\n personas: [{ id: '182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e' }],\n scenarios: [{ id: '182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e' }],\n});\n\nconsole.log(simulationRunPlan.data);",
689
+ },
690
+ },
691
+ },
692
+ {
693
+ name: 'update',
694
+ endpoint: '/v1/simulation/plan/{planId}',
695
+ httpMethod: 'put',
696
+ summary: 'Update a run plan',
697
+ description: 'Updates an existing simulation run plan by its ID.',
698
+ stainlessPath: '(resource) simulationRunPlan > (method) update',
699
+ qualified: 'client.simulationRunPlan.update',
700
+ params: [
701
+ 'planId: string;',
702
+ 'agentEndpoints?: { id: string; }[];',
703
+ 'description?: string;',
704
+ "direction?: 'INBOUND' | 'OUTBOUND';",
705
+ 'endCallPhrases?: string[];',
706
+ 'endCallReasons?: string[];',
707
+ "executionMode?: 'PARALLEL' | 'SEQUENTIAL_SAME_RUN_PLAN' | 'SEQUENTIAL_PROJECT';",
708
+ 'iterationCount?: number;',
709
+ 'maxConcurrentJobs?: number;',
710
+ 'maxSimulationDurationSeconds?: number;',
711
+ 'metrics?: { id: string; }[];',
712
+ 'name?: string;',
713
+ 'personas?: { id: string; }[];',
714
+ 'scenarios?: { id: string; variables?: object; }[];',
715
+ 'silenceTimeoutSeconds?: number;',
716
+ ],
717
+ response: "{ data: { id: string; agentEndpoints: { id: string; }[]; createdAt: string; direction: 'INBOUND' | 'OUTBOUND'; endCallPhrases: string[]; endCallReasons: string[]; evaluators: { id: string; }[]; executionMode: 'PARALLEL' | 'SEQUENTIAL_SAME_RUN_PLAN' | 'SEQUENTIAL_PROJECT'; iterationCount: number; maxConcurrentJobs: number; maxSimulationDurationSeconds: number; metrics: { id: string; }[]; name: string; personas: { id: string; }[]; scenarios: { id: string; variables?: object; }[]; silenceTimeoutSeconds: number; testCaseCount: number; updatedAt: string; description?: string; }; }",
718
+ markdown: "## update\n\n`client.simulationRunPlan.update(planId: string, agentEndpoints?: { id: string; }[], description?: string, direction?: 'INBOUND' | 'OUTBOUND', endCallPhrases?: string[], endCallReasons?: string[], executionMode?: 'PARALLEL' | 'SEQUENTIAL_SAME_RUN_PLAN' | 'SEQUENTIAL_PROJECT', iterationCount?: number, maxConcurrentJobs?: number, maxSimulationDurationSeconds?: number, metrics?: { id: string; }[], name?: string, personas?: { id: string; }[], scenarios?: { id: string; variables?: object; }[], silenceTimeoutSeconds?: number): { data: object; }`\n\n**put** `/v1/simulation/plan/{planId}`\n\nUpdates an existing simulation run plan by its ID.\n\n### Parameters\n\n- `planId: string`\n\n- `agentEndpoints?: { id: string; }[]`\n Agent endpoints to include in this run plan\n\n- `description?: string`\n Description of the run plan\n\n- `direction?: 'INBOUND' | 'OUTBOUND'`\n Direction of the simulation (INBOUND or OUTBOUND)\n\n- `endCallPhrases?: string[]`\n Phrases that trigger end of call. Empty array disables the feature.\n\n- `endCallReasons?: string[]`\n Semantic conditions that trigger end of call. The LLM evaluates the conversation against these conditions. Empty array disables the feature.\n\n- `executionMode?: 'PARALLEL' | 'SEQUENTIAL_SAME_RUN_PLAN' | 'SEQUENTIAL_PROJECT'`\n Execution mode (PARALLEL or SEQUENTIAL)\n\n- `iterationCount?: number`\n Number of iterations to run for each test case. Must be 1 for OUTBOUND direction.\n\n- `maxConcurrentJobs?: number`\n Maximum number of concurrent simulation jobs\n\n- `maxSimulationDurationSeconds?: number`\n Maximum duration in seconds for each simulation\n\n- `metrics?: { id: string; }[]`\n Metric definitions to include in this run plan\n\n- `name?: string`\n Name of the run plan\n\n- `personas?: { id: string; }[]`\n Personas to include in this run plan\n\n- `scenarios?: { id: string; variables?: object; }[]`\n Scenarios to include in this run plan. The same scenario ID can appear multiple times with different variables.\n\n- `silenceTimeoutSeconds?: number`\n Timeout in seconds for silence detection\n\n### Returns\n\n- `{ data: { id: string; agentEndpoints: { id: string; }[]; createdAt: string; direction: 'INBOUND' | 'OUTBOUND'; endCallPhrases: string[]; endCallReasons: string[]; evaluators: { id: string; }[]; executionMode: 'PARALLEL' | 'SEQUENTIAL_SAME_RUN_PLAN' | 'SEQUENTIAL_PROJECT'; iterationCount: number; maxConcurrentJobs: number; maxSimulationDurationSeconds: number; metrics: { id: string; }[]; name: string; personas: { id: string; }[]; scenarios: { id: string; variables?: object; }[]; silenceTimeoutSeconds: number; testCaseCount: number; updatedAt: string; description?: string; }; }`\n\n - `data: { id: string; agentEndpoints: { id: string; }[]; createdAt: string; direction: 'INBOUND' | 'OUTBOUND'; endCallPhrases: string[]; endCallReasons: string[]; evaluators: { id: string; }[]; executionMode: 'PARALLEL' | 'SEQUENTIAL_SAME_RUN_PLAN' | 'SEQUENTIAL_PROJECT'; iterationCount: number; maxConcurrentJobs: number; maxSimulationDurationSeconds: number; metrics: { id: string; }[]; name: string; personas: { id: string; }[]; scenarios: { id: string; variables?: object; }[]; silenceTimeoutSeconds: number; testCaseCount: number; updatedAt: string; description?: string; }`\n\n### Example\n\n```typescript\nimport Roark from '@roarkanalytics/sdk';\n\nconst client = new Roark();\n\nconst simulationRunPlan = await client.simulationRunPlan.update('182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e');\n\nconsole.log(simulationRunPlan);\n```",
719
+ perLanguage: {
720
+ http: {
721
+ example: 'curl https://api.roark.ai/v1/simulation/plan/$PLAN_ID \\\n -X PUT \\\n -H "Authorization: Bearer $ROARK_API_BEARER_TOKEN"',
722
+ },
723
+ python: {
724
+ method: 'simulation_run_plan.update',
725
+ example: 'import os\nfrom roark_analytics import Roark\n\nclient = Roark(\n bearer_token=os.environ.get("ROARK_API_BEARER_TOKEN"), # This is the default and can be omitted\n)\nsimulation_run_plan = client.simulation_run_plan.update(\n plan_id="182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e",\n)\nprint(simulation_run_plan.data)',
726
+ },
727
+ typescript: {
728
+ method: 'client.simulationRunPlan.update',
729
+ example: "import Roark from '@roarkanalytics/sdk';\n\nconst client = new Roark({\n bearerToken: process.env['ROARK_API_BEARER_TOKEN'], // This is the default and can be omitted\n});\n\nconst simulationRunPlan = await client.simulationRunPlan.update(\n '182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e',\n);\n\nconsole.log(simulationRunPlan.data);",
730
+ },
731
+ },
732
+ },
733
+ {
734
+ name: 'delete',
735
+ endpoint: '/v1/simulation/plan/{planId}',
736
+ httpMethod: 'delete',
737
+ summary: 'Delete a run plan',
738
+ description: 'Soft-deletes a simulation run plan by its ID.',
739
+ stainlessPath: '(resource) simulationRunPlan > (method) delete',
740
+ qualified: 'client.simulationRunPlan.delete',
741
+ params: ['planId: string;'],
742
+ response: '{ data: { deleted: boolean; }; }',
743
+ markdown: "## delete\n\n`client.simulationRunPlan.delete(planId: string): { data: object; }`\n\n**delete** `/v1/simulation/plan/{planId}`\n\nSoft-deletes a simulation run plan by its ID.\n\n### Parameters\n\n- `planId: string`\n\n### Returns\n\n- `{ data: { deleted: boolean; }; }`\n\n - `data: { deleted: boolean; }`\n\n### Example\n\n```typescript\nimport Roark from '@roarkanalytics/sdk';\n\nconst client = new Roark();\n\nconst simulationRunPlan = await client.simulationRunPlan.delete('182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e');\n\nconsole.log(simulationRunPlan);\n```",
744
+ perLanguage: {
745
+ http: {
746
+ example: 'curl https://api.roark.ai/v1/simulation/plan/$PLAN_ID \\\n -X DELETE \\\n -H "Authorization: Bearer $ROARK_API_BEARER_TOKEN"',
747
+ },
748
+ python: {
749
+ method: 'simulation_run_plan.delete',
750
+ example: 'import os\nfrom roark_analytics import Roark\n\nclient = Roark(\n bearer_token=os.environ.get("ROARK_API_BEARER_TOKEN"), # This is the default and can be omitted\n)\nsimulation_run_plan = client.simulation_run_plan.delete(\n "182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e",\n)\nprint(simulation_run_plan.data)',
751
+ },
752
+ typescript: {
753
+ method: 'client.simulationRunPlan.delete',
754
+ example: "import Roark from '@roarkanalytics/sdk';\n\nconst client = new Roark({\n bearerToken: process.env['ROARK_API_BEARER_TOKEN'], // This is the default and can be omitted\n});\n\nconst simulationRunPlan = await client.simulationRunPlan.delete(\n '182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e',\n);\n\nconsole.log(simulationRunPlan.data);",
755
+ },
756
+ },
757
+ },
758
+ {
759
+ name: 'list',
760
+ endpoint: '/v1/simulation/plan/jobs',
761
+ httpMethod: 'get',
762
+ summary: 'List simulation plan jobs',
763
+ description: 'Returns a paginated list of simulation run plan jobs. Filter by status, plan ID, or label to find specific simulation batches.',
764
+ stainlessPath: '(resource) simulationRunPlanJob > (method) list',
765
+ qualified: 'client.simulationRunPlanJob.list',
766
+ params: [
767
+ 'after?: string;',
768
+ 'labelId?: string;',
769
+ 'labelName?: string;',
770
+ 'limit?: number;',
771
+ 'simulationRunPlanId?: string;',
772
+ 'status?: string;',
773
+ ],
774
+ response: "{ data: { createdAt: string; simulationRunPlanId: string; simulationRunPlanJobId: string; status: string; triggeredBy: 'SCHEDULED' | 'USER_TRIGGERED_FROM_UI' | 'RE_RUN' | 'TRIGGERED_FROM_API'; endedAt?: string; startedAt?: string; }[]; pagination: { hasMore: boolean; total: number; nextCursor?: string; }; }",
775
+ markdown: "## list\n\n`client.simulationRunPlanJob.list(after?: string, labelId?: string, labelName?: string, limit?: number, simulationRunPlanId?: string, status?: string): { data: object[]; pagination: object; }`\n\n**get** `/v1/simulation/plan/jobs`\n\nReturns a paginated list of simulation run plan jobs. Filter by status, plan ID, or label to find specific simulation batches.\n\n### Parameters\n\n- `after?: string`\n Cursor for pagination - use the nextCursor value from a previous response\n\n- `labelId?: string`\n Filter by label ID attached to the plan job. Use this if you know the label ID.\n\n- `labelName?: string`\n Filter by label name attached to the plan job. More user-friendly alternative to labelId. Case-insensitive.\n\n- `limit?: number`\n Maximum number of plan jobs to return (default: 20, max: 50)\n\n- `simulationRunPlanId?: string`\n Filter by simulation run plan ID\n\n- `status?: string`\n Filter by plan job status (PENDING, CREATING_SNAPSHOTS, CREATING_SIMULATIONS, RUNNING_SIMULATIONS, ENDING_SIMULATIONS, COMPLETED, FAILED, TIMED_OUT, CANCELLED, CANCELLING)\n\n### Returns\n\n- `{ data: { createdAt: string; simulationRunPlanId: string; simulationRunPlanJobId: string; status: string; triggeredBy: 'SCHEDULED' | 'USER_TRIGGERED_FROM_UI' | 'RE_RUN' | 'TRIGGERED_FROM_API'; endedAt?: string; startedAt?: string; }[]; pagination: { hasMore: boolean; total: number; nextCursor?: string; }; }`\n Paginated list of simulation run plan jobs\n\n - `data: { createdAt: string; simulationRunPlanId: string; simulationRunPlanJobId: string; status: string; triggeredBy: 'SCHEDULED' | 'USER_TRIGGERED_FROM_UI' | 'RE_RUN' | 'TRIGGERED_FROM_API'; endedAt?: string; startedAt?: string; }[]`\n - `pagination: { hasMore: boolean; total: number; nextCursor?: string; }`\n\n### Example\n\n```typescript\nimport Roark from '@roarkanalytics/sdk';\n\nconst client = new Roark();\n\nconst simulationRunPlanJobs = await client.simulationRunPlanJob.list();\n\nconsole.log(simulationRunPlanJobs);\n```",
776
+ perLanguage: {
777
+ http: {
778
+ example: 'curl https://api.roark.ai/v1/simulation/plan/jobs \\\n -H "Authorization: Bearer $ROARK_API_BEARER_TOKEN"',
779
+ },
780
+ python: {
781
+ method: 'simulation_run_plan_job.list',
782
+ example: 'import os\nfrom roark_analytics import Roark\n\nclient = Roark(\n bearer_token=os.environ.get("ROARK_API_BEARER_TOKEN"), # This is the default and can be omitted\n)\nsimulation_run_plan_jobs = client.simulation_run_plan_job.list()\nprint(simulation_run_plan_jobs.data)',
783
+ },
784
+ typescript: {
785
+ method: 'client.simulationRunPlanJob.list',
786
+ example: "import Roark from '@roarkanalytics/sdk';\n\nconst client = new Roark({\n bearerToken: process.env['ROARK_API_BEARER_TOKEN'], // This is the default and can be omitted\n});\n\nconst simulationRunPlanJobs = await client.simulationRunPlanJob.list();\n\nconsole.log(simulationRunPlanJobs.data);",
787
+ },
788
+ },
789
+ },
790
+ {
791
+ name: 'getById',
792
+ endpoint: '/v1/simulation/plan/job/{jobId}',
793
+ httpMethod: 'get',
794
+ summary: 'Get simulation plan job',
795
+ description: 'Retrieve details of a simulation plan job including all associated simulation jobs (calls)',
796
+ stainlessPath: '(resource) simulationRunPlanJob > (method) getById',
797
+ qualified: 'client.simulationRunPlanJob.getByID',
798
+ params: ['jobId: object;'],
799
+ response: '{ data: { createdAt: string; simulationJobs: { agentEndpoint: object; createdAt: string; persona: object; processingStatus: string; scenario: object; simulationJobId: string; status: string; callId?: string; completedAt?: string; roarkPhoneNumber?: string; startedAt?: string; }[]; simulationRunPlanId: string; simulationRunPlanJobId: string; status: string; endedAt?: string; startedAt?: string; }; }',
800
+ markdown: "## getById\n\n`client.simulationRunPlanJob.getByID(jobId: object): { data: object; }`\n\n**get** `/v1/simulation/plan/job/{jobId}`\n\nRetrieve details of a simulation plan job including all associated simulation jobs (calls)\n\n### Parameters\n\n- `jobId: object`\n\n### Returns\n\n- `{ data: { createdAt: string; simulationJobs: { agentEndpoint: object; createdAt: string; persona: object; processingStatus: string; scenario: object; simulationJobId: string; status: string; callId?: string; completedAt?: string; roarkPhoneNumber?: string; startedAt?: string; }[]; simulationRunPlanId: string; simulationRunPlanJobId: string; status: string; endedAt?: string; startedAt?: string; }; }`\n\n - `data: { createdAt: string; simulationJobs: { agentEndpoint: { id: string; name: string; phoneNumber: string; type: 'PHONE' | 'WEBSOCKET' | 'LIVEKIT' | 'SMALL_WEBRTC' | 'ELEVENLABS_WS' | 'KORE' | 'GOOGLE_CES'; }; createdAt: string; persona: { id: string; accent: string; backgroundNoise: string; baseEmotion: 'NEUTRAL' | 'CHEERFUL' | 'CONFUSED' | 'FRUSTRATED' | 'SKEPTICAL' | 'RUSHED' | 'DISTRACTED'; confirmationStyle: 'EXPLICIT' | 'VAGUE'; createdAt: string; gender: 'MALE' | 'FEMALE'; hasDisfluencies: boolean; idleMessageMaxSpokenCount: number; idleMessageResetCountOnUserSpeechEnabled: boolean; idleMessages: string[]; idleTimeoutSeconds: number; intentClarity: 'CLEAR' | 'INDIRECT' | 'VAGUE'; language: string; memoryReliability: 'HIGH' | 'LOW'; name: string; properties: object; responseTiming: 'RELAXED' | 'NORMAL' | 'QUICK'; speechClarity: 'CLEAR' | 'VAGUE' | 'RAMBLING'; speechPace: 'SUPER_SLOW' | 'SLOW' | 'NORMAL' | 'FAST' | 'SUPER_FAST'; updatedAt: string; backstoryPrompt?: string; description?: string; secondaryLanguage?: 'EN'; }; processingStatus: string; scenario: { id: string; description?: string; }; simulationJobId: string; status: string; callId?: string; completedAt?: string; roarkPhoneNumber?: string; startedAt?: string; }[]; simulationRunPlanId: string; simulationRunPlanJobId: string; status: string; endedAt?: string; startedAt?: string; }`\n\n### Example\n\n```typescript\nimport Roark from '@roarkanalytics/sdk';\n\nconst client = new Roark();\n\nconst response = await client.simulationRunPlanJob.getByID('7f3e4d2c-8a91-4b5c-9e6f-1a2b3c4d5e6f');\n\nconsole.log(response);\n```",
801
+ perLanguage: {
802
+ http: {
803
+ example: 'curl https://api.roark.ai/v1/simulation/plan/job/$JOB_ID \\\n -H "Authorization: Bearer $ROARK_API_BEARER_TOKEN"',
804
+ },
805
+ python: {
806
+ method: 'simulation_run_plan_job.get_by_id',
807
+ example: 'import os\nfrom roark_analytics import Roark\n\nclient = Roark(\n bearer_token=os.environ.get("ROARK_API_BEARER_TOKEN"), # This is the default and can be omitted\n)\nresponse = client.simulation_run_plan_job.get_by_id(\n "7f3e4d2c-8a91-4b5c-9e6f-1a2b3c4d5e6f",\n)\nprint(response.data)',
808
+ },
809
+ typescript: {
810
+ method: 'client.simulationRunPlanJob.getByID',
811
+ example: "import Roark from '@roarkanalytics/sdk';\n\nconst client = new Roark({\n bearerToken: process.env['ROARK_API_BEARER_TOKEN'], // This is the default and can be omitted\n});\n\nconst response = await client.simulationRunPlanJob.getByID('7f3e4d2c-8a91-4b5c-9e6f-1a2b3c4d5e6f');\n\nconsole.log(response.data);",
812
+ },
813
+ },
814
+ },
815
+ {
816
+ name: 'start',
817
+ endpoint: '/v1/simulation/plan/{planId}/job',
818
+ httpMethod: 'post',
819
+ summary: 'Run a simulation plan',
820
+ description: 'Create and execute a job for an existing simulation run plan. Optionally provide runtime variables to override plan-defined variables.',
821
+ stainlessPath: '(resource) simulationRunPlanJob > (method) start',
822
+ qualified: 'client.simulationRunPlanJob.start',
823
+ params: ['planId: object;', 'variables?: object | { scenarioId: string; variables: object; }[];'],
824
+ response: '{ data: { createdAt: string; simulationRunPlanId: string; simulationRunPlanJobId: string; status: string; }; }',
825
+ markdown: '## start\n\n`client.simulationRunPlanJob.start(planId: object, variables?: object | { scenarioId: string; variables: object; }[]): { data: object; }`\n\n**post** `/v1/simulation/plan/{planId}/job`\n\nCreate and execute a job for an existing simulation run plan. Optionally provide runtime variables to override plan-defined variables.\n\n### Parameters\n\n- `planId: object`\n\n- `variables?: object | { scenarioId: string; variables: object; }[]`\n Runtime variables that override plan-defined scenario variables. Accepts one of two formats:\n\nOption 1 — Global (flat key-value object, applies to ALL scenarios):\n { "orderNumber": "12345", "environment": "staging" }\n\nOption 2 — Per-scenario (array of objects with scenarioId + variables):\n [\n { "scenarioId": "550e8400-...", "variables": { "orderNumber": "12345" } },\n { "scenarioId": "7a3d2e1f-...", "variables": { "orderNumber": "67890" } }\n ]\n\n### Returns\n\n- `{ data: { createdAt: string; simulationRunPlanId: string; simulationRunPlanJobId: string; status: string; }; }`\n\n - `data: { createdAt: string; simulationRunPlanId: string; simulationRunPlanJobId: string; status: string; }`\n\n### Example\n\n```typescript\nimport Roark from \'@roarkanalytics/sdk\';\n\nconst client = new Roark();\n\nconst response = await client.simulationRunPlanJob.start(\'7f3e4d2c-8a91-4b5c-9e6f-1a2b3c4d5e6f\');\n\nconsole.log(response);\n```',
826
+ perLanguage: {
827
+ http: {
828
+ example: 'curl https://api.roark.ai/v1/simulation/plan/$PLAN_ID/job \\\n -X POST \\\n -H "Authorization: Bearer $ROARK_API_BEARER_TOKEN"',
829
+ },
830
+ python: {
831
+ method: 'simulation_run_plan_job.start',
832
+ example: 'import os\nfrom roark_analytics import Roark\n\nclient = Roark(\n bearer_token=os.environ.get("ROARK_API_BEARER_TOKEN"), # This is the default and can be omitted\n)\nresponse = client.simulation_run_plan_job.start(\n plan_id="7f3e4d2c-8a91-4b5c-9e6f-1a2b3c4d5e6f",\n)\nprint(response.data)',
833
+ },
834
+ typescript: {
835
+ method: 'client.simulationRunPlanJob.start',
836
+ example: "import Roark from '@roarkanalytics/sdk';\n\nconst client = new Roark({\n bearerToken: process.env['ROARK_API_BEARER_TOKEN'], // This is the default and can be omitted\n});\n\nconst response = await client.simulationRunPlanJob.start('7f3e4d2c-8a91-4b5c-9e6f-1a2b3c4d5e6f');\n\nconsole.log(response.data);",
837
+ },
838
+ },
839
+ },
840
+ {
841
+ name: 'list',
842
+ endpoint: '/v1/simulation/scenario',
843
+ httpMethod: 'get',
844
+ summary: 'List simulation scenarios',
845
+ description: 'Returns a paginated list of simulation scenarios for the authenticated project.',
846
+ stainlessPath: '(resource) simulationScenario > (method) list',
847
+ qualified: 'client.simulationScenario.list',
848
+ params: ['after?: string;', 'limit?: number;'],
849
+ response: '{ data: { id: string; createdAt: string; description: string; name: string; steps: { content: string; nodeId: string; type: string; dtmfDigits?: string; linkedScenarioId?: string; silenceDurationSeconds?: number; }[]; updatedAt: string; }[]; pagination: { hasMore: boolean; nextCursor: string; total: number; }; }',
850
+ markdown: "## list\n\n`client.simulationScenario.list(after?: string, limit?: number): { data: object[]; pagination: object; }`\n\n**get** `/v1/simulation/scenario`\n\nReturns a paginated list of simulation scenarios for the authenticated project.\n\n### Parameters\n\n- `after?: string`\n\n- `limit?: number`\n\n### Returns\n\n- `{ data: { id: string; createdAt: string; description: string; name: string; steps: { content: string; nodeId: string; type: string; dtmfDigits?: string; linkedScenarioId?: string; silenceDurationSeconds?: number; }[]; updatedAt: string; }[]; pagination: { hasMore: boolean; nextCursor: string; total: number; }; }`\n\n - `data: { id: string; createdAt: string; description: string; name: string; steps: { content: string; nodeId: string; type: string; dtmfDigits?: string; linkedScenarioId?: string; silenceDurationSeconds?: number; }[]; updatedAt: string; }[]`\n - `pagination: { hasMore: boolean; nextCursor: string; total: number; }`\n\n### Example\n\n```typescript\nimport Roark from '@roarkanalytics/sdk';\n\nconst client = new Roark();\n\nconst simulationScenarios = await client.simulationScenario.list();\n\nconsole.log(simulationScenarios);\n```",
851
+ perLanguage: {
852
+ http: {
853
+ example: 'curl https://api.roark.ai/v1/simulation/scenario \\\n -H "Authorization: Bearer $ROARK_API_BEARER_TOKEN"',
854
+ },
855
+ python: {
856
+ method: 'simulation_scenario.list',
857
+ example: 'import os\nfrom roark_analytics import Roark\n\nclient = Roark(\n bearer_token=os.environ.get("ROARK_API_BEARER_TOKEN"), # This is the default and can be omitted\n)\nsimulation_scenarios = client.simulation_scenario.list()\nprint(simulation_scenarios.data)',
858
+ },
859
+ typescript: {
860
+ method: 'client.simulationScenario.list',
861
+ example: "import Roark from '@roarkanalytics/sdk';\n\nconst client = new Roark({\n bearerToken: process.env['ROARK_API_BEARER_TOKEN'], // This is the default and can be omitted\n});\n\nconst simulationScenarios = await client.simulationScenario.list();\n\nconsole.log(simulationScenarios.data);",
862
+ },
863
+ },
864
+ },
865
+ {
866
+ name: 'getById',
867
+ endpoint: '/v1/simulation/scenario/{scenarioId}',
868
+ httpMethod: 'get',
869
+ summary: 'Get scenario by ID',
870
+ description: 'Returns a specific simulation scenario by its ID.',
871
+ stainlessPath: '(resource) simulationScenario > (method) getById',
872
+ qualified: 'client.simulationScenario.getByID',
873
+ params: ['scenarioId: string;'],
874
+ response: '{ data: { id: string; createdAt: string; description: string; name: string; steps: { content: string; nodeId: string; type: string; dtmfDigits?: string; linkedScenarioId?: string; silenceDurationSeconds?: number; }[]; updatedAt: string; }; }',
875
+ markdown: "## getById\n\n`client.simulationScenario.getByID(scenarioId: string): { data: object; }`\n\n**get** `/v1/simulation/scenario/{scenarioId}`\n\nReturns a specific simulation scenario by its ID.\n\n### Parameters\n\n- `scenarioId: string`\n\n### Returns\n\n- `{ data: { id: string; createdAt: string; description: string; name: string; steps: { content: string; nodeId: string; type: string; dtmfDigits?: string; linkedScenarioId?: string; silenceDurationSeconds?: number; }[]; updatedAt: string; }; }`\n\n - `data: { id: string; createdAt: string; description: string; name: string; steps: { content: string; nodeId: string; type: string; dtmfDigits?: string; linkedScenarioId?: string; silenceDurationSeconds?: number; }[]; updatedAt: string; }`\n\n### Example\n\n```typescript\nimport Roark from '@roarkanalytics/sdk';\n\nconst client = new Roark();\n\nconst response = await client.simulationScenario.getByID('scenarioId');\n\nconsole.log(response);\n```",
876
+ perLanguage: {
877
+ http: {
878
+ example: 'curl https://api.roark.ai/v1/simulation/scenario/$SCENARIO_ID \\\n -H "Authorization: Bearer $ROARK_API_BEARER_TOKEN"',
879
+ },
880
+ python: {
881
+ method: 'simulation_scenario.get_by_id',
882
+ example: 'import os\nfrom roark_analytics import Roark\n\nclient = Roark(\n bearer_token=os.environ.get("ROARK_API_BEARER_TOKEN"), # This is the default and can be omitted\n)\nresponse = client.simulation_scenario.get_by_id(\n "scenarioId",\n)\nprint(response.data)',
883
+ },
884
+ typescript: {
885
+ method: 'client.simulationScenario.getByID',
886
+ example: "import Roark from '@roarkanalytics/sdk';\n\nconst client = new Roark({\n bearerToken: process.env['ROARK_API_BEARER_TOKEN'], // This is the default and can be omitted\n});\n\nconst response = await client.simulationScenario.getByID('scenarioId');\n\nconsole.log(response.data);",
887
+ },
888
+ },
889
+ },
890
+ {
891
+ name: 'create',
892
+ endpoint: '/v1/simulation/scenario',
893
+ httpMethod: 'post',
894
+ summary: 'Create a scenario',
895
+ description: 'Creates a new simulation scenario for the authenticated project.',
896
+ stainlessPath: '(resource) simulationScenario > (method) create',
897
+ qualified: 'client.simulationScenario.create',
898
+ params: [
899
+ 'name: string;',
900
+ 'steps: { content: string; type: string; dtmfDigits?: string; linkedScenarioId?: string; silenceDurationSeconds?: number; }[];',
901
+ ],
902
+ response: '{ data: { id: string; createdAt: string; description: string; name: string; steps: { content: string; nodeId: string; type: string; dtmfDigits?: string; linkedScenarioId?: string; silenceDurationSeconds?: number; }[]; updatedAt: string; }; }',
903
+ markdown: "## create\n\n`client.simulationScenario.create(name: string, steps: { content: string; type: string; dtmfDigits?: string; linkedScenarioId?: string; silenceDurationSeconds?: number; }[]): { data: object; }`\n\n**post** `/v1/simulation/scenario`\n\nCreates a new simulation scenario for the authenticated project.\n\n### Parameters\n\n- `name: string`\n Name of the scenario (used as the START node content)\n\n- `steps: { content: string; type: string; dtmfDigits?: string; linkedScenarioId?: string; silenceDurationSeconds?: number; }[]`\n Ordered list of steps for the scenario (at least one step is required)\n\n### Returns\n\n- `{ data: { id: string; createdAt: string; description: string; name: string; steps: { content: string; nodeId: string; type: string; dtmfDigits?: string; linkedScenarioId?: string; silenceDurationSeconds?: number; }[]; updatedAt: string; }; }`\n\n - `data: { id: string; createdAt: string; description: string; name: string; steps: { content: string; nodeId: string; type: string; dtmfDigits?: string; linkedScenarioId?: string; silenceDurationSeconds?: number; }[]; updatedAt: string; }`\n\n### Example\n\n```typescript\nimport Roark from '@roarkanalytics/sdk';\n\nconst client = new Roark();\n\nconst simulationScenario = await client.simulationScenario.create({ name: 'x', steps: [{ content: 'content', type: 'AGENT_TURN' }] });\n\nconsole.log(simulationScenario);\n```",
904
+ perLanguage: {
905
+ http: {
906
+ example: 'curl https://api.roark.ai/v1/simulation/scenario \\\n -H \'Content-Type: application/json\' \\\n -H "Authorization: Bearer $ROARK_API_BEARER_TOKEN" \\\n -d \'{\n "name": "x",\n "steps": [\n {\n "content": "content",\n "type": "AGENT_TURN"\n }\n ]\n }\'',
907
+ },
908
+ python: {
909
+ method: 'simulation_scenario.create',
910
+ example: 'import os\nfrom roark_analytics import Roark\n\nclient = Roark(\n bearer_token=os.environ.get("ROARK_API_BEARER_TOKEN"), # This is the default and can be omitted\n)\nsimulation_scenario = client.simulation_scenario.create(\n name="x",\n steps=[{\n "content": "content",\n "type": "AGENT_TURN",\n }],\n)\nprint(simulation_scenario.data)',
911
+ },
912
+ typescript: {
913
+ method: 'client.simulationScenario.create',
914
+ example: "import Roark from '@roarkanalytics/sdk';\n\nconst client = new Roark({\n bearerToken: process.env['ROARK_API_BEARER_TOKEN'], // This is the default and can be omitted\n});\n\nconst simulationScenario = await client.simulationScenario.create({\n name: 'x',\n steps: [{ content: 'content', type: 'AGENT_TURN' }],\n});\n\nconsole.log(simulationScenario.data);",
915
+ },
916
+ },
917
+ },
918
+ {
919
+ name: 'update',
920
+ endpoint: '/v1/simulation/scenario/{scenarioId}',
921
+ httpMethod: 'put',
922
+ summary: 'Update a scenario',
923
+ description: 'Updates an existing simulation scenario by its ID.',
924
+ stainlessPath: '(resource) simulationScenario > (method) update',
925
+ qualified: 'client.simulationScenario.update',
926
+ params: [
927
+ 'scenarioId: string;',
928
+ "stepChanges: { action: 'create'; content: string; type: string; dtmfDigits?: string; linkedScenarioId?: string; silenceDurationSeconds?: number; } | { action: 'update'; nodeId: string; content?: string; dtmfDigits?: string; linkedScenarioId?: string; silenceDurationSeconds?: number; type?: string; } | { action: 'delete'; nodeId: string; }[];",
929
+ 'name?: string;',
930
+ ],
931
+ response: '{ data: { id: string; createdAt: string; description: string; name: string; steps: { content: string; nodeId: string; type: string; dtmfDigits?: string; linkedScenarioId?: string; silenceDurationSeconds?: number; }[]; updatedAt: string; }; }',
932
+ markdown: "## update\n\n`client.simulationScenario.update(scenarioId: string, stepChanges: { action: 'create'; content: string; type: string; dtmfDigits?: string; linkedScenarioId?: string; silenceDurationSeconds?: number; } | { action: 'update'; nodeId: string; content?: string; dtmfDigits?: string; linkedScenarioId?: string; silenceDurationSeconds?: number; type?: string; } | { action: 'delete'; nodeId: string; }[], name?: string): { data: object; }`\n\n**put** `/v1/simulation/scenario/{scenarioId}`\n\nUpdates an existing simulation scenario by its ID.\n\n### Parameters\n\n- `scenarioId: string`\n\n- `stepChanges: { action: 'create'; content: string; type: string; dtmfDigits?: string; linkedScenarioId?: string; silenceDurationSeconds?: number; } | { action: 'update'; nodeId: string; content?: string; dtmfDigits?: string; linkedScenarioId?: string; silenceDurationSeconds?: number; type?: string; } | { action: 'delete'; nodeId: string; }[]`\n List of step changes to apply to the scenario\n\n- `name?: string`\n New name for the scenario (updates the START node content)\n\n### Returns\n\n- `{ data: { id: string; createdAt: string; description: string; name: string; steps: { content: string; nodeId: string; type: string; dtmfDigits?: string; linkedScenarioId?: string; silenceDurationSeconds?: number; }[]; updatedAt: string; }; }`\n\n - `data: { id: string; createdAt: string; description: string; name: string; steps: { content: string; nodeId: string; type: string; dtmfDigits?: string; linkedScenarioId?: string; silenceDurationSeconds?: number; }[]; updatedAt: string; }`\n\n### Example\n\n```typescript\nimport Roark from '@roarkanalytics/sdk';\n\nconst client = new Roark();\n\nconst simulationScenario = await client.simulationScenario.update('scenarioId', { stepChanges: [{\n action: 'create',\n content: 'content',\n type: 'AGENT_TURN',\n}] });\n\nconsole.log(simulationScenario);\n```",
933
+ perLanguage: {
934
+ http: {
935
+ example: 'curl https://api.roark.ai/v1/simulation/scenario/$SCENARIO_ID \\\n -X PUT \\\n -H \'Content-Type: application/json\' \\\n -H "Authorization: Bearer $ROARK_API_BEARER_TOKEN" \\\n -d \'{\n "stepChanges": [\n {\n "action": "create",\n "content": "content",\n "type": "AGENT_TURN"\n }\n ]\n }\'',
936
+ },
937
+ python: {
938
+ method: 'simulation_scenario.update',
939
+ example: 'import os\nfrom roark_analytics import Roark\n\nclient = Roark(\n bearer_token=os.environ.get("ROARK_API_BEARER_TOKEN"), # This is the default and can be omitted\n)\nsimulation_scenario = client.simulation_scenario.update(\n scenario_id="scenarioId",\n step_changes=[{\n "action": "create",\n "content": "content",\n "type": "AGENT_TURN",\n }],\n)\nprint(simulation_scenario.data)',
940
+ },
941
+ typescript: {
942
+ method: 'client.simulationScenario.update',
943
+ example: "import Roark from '@roarkanalytics/sdk';\n\nconst client = new Roark({\n bearerToken: process.env['ROARK_API_BEARER_TOKEN'], // This is the default and can be omitted\n});\n\nconst simulationScenario = await client.simulationScenario.update('scenarioId', {\n stepChanges: [\n {\n action: 'create',\n content: 'content',\n type: 'AGENT_TURN',\n },\n ],\n});\n\nconsole.log(simulationScenario.data);",
944
+ },
945
+ },
946
+ },
947
+ {
948
+ name: 'delete',
949
+ endpoint: '/v1/simulation/scenario/{scenarioId}',
950
+ httpMethod: 'delete',
951
+ summary: 'Delete a scenario',
952
+ description: 'Deletes a simulation scenario by its ID.',
953
+ stainlessPath: '(resource) simulationScenario > (method) delete',
954
+ qualified: 'client.simulationScenario.delete',
955
+ params: ['scenarioId: string;'],
956
+ response: '{ data: { deleted: boolean; }; }',
957
+ markdown: "## delete\n\n`client.simulationScenario.delete(scenarioId: string): { data: object; }`\n\n**delete** `/v1/simulation/scenario/{scenarioId}`\n\nDeletes a simulation scenario by its ID.\n\n### Parameters\n\n- `scenarioId: string`\n\n### Returns\n\n- `{ data: { deleted: boolean; }; }`\n\n - `data: { deleted: boolean; }`\n\n### Example\n\n```typescript\nimport Roark from '@roarkanalytics/sdk';\n\nconst client = new Roark();\n\nconst simulationScenario = await client.simulationScenario.delete('scenarioId');\n\nconsole.log(simulationScenario);\n```",
958
+ perLanguage: {
959
+ http: {
960
+ example: 'curl https://api.roark.ai/v1/simulation/scenario/$SCENARIO_ID \\\n -X DELETE \\\n -H "Authorization: Bearer $ROARK_API_BEARER_TOKEN"',
961
+ },
962
+ python: {
963
+ method: 'simulation_scenario.delete',
964
+ example: 'import os\nfrom roark_analytics import Roark\n\nclient = Roark(\n bearer_token=os.environ.get("ROARK_API_BEARER_TOKEN"), # This is the default and can be omitted\n)\nsimulation_scenario = client.simulation_scenario.delete(\n "scenarioId",\n)\nprint(simulation_scenario.data)',
965
+ },
966
+ typescript: {
967
+ method: 'client.simulationScenario.delete',
968
+ example: "import Roark from '@roarkanalytics/sdk';\n\nconst client = new Roark({\n bearerToken: process.env['ROARK_API_BEARER_TOKEN'], // This is the default and can be omitted\n});\n\nconst simulationScenario = await client.simulationScenario.delete('scenarioId');\n\nconsole.log(simulationScenario.data);",
969
+ },
970
+ },
971
+ },
972
+ {
973
+ name: 'list',
974
+ endpoint: '/v1/persona',
975
+ httpMethod: 'get',
976
+ summary: 'List personas',
977
+ description: 'Returns a paginated list of personas for the authenticated project.',
978
+ stainlessPath: '(resource) simulationPersona > (method) list',
979
+ qualified: 'client.simulationPersona.list',
980
+ params: ['after?: string;', 'limit?: number;', 'searchText?: string;'],
981
+ response: "{ data: { id: string; accent: string; backgroundNoise: string; baseEmotion: 'NEUTRAL' | 'CHEERFUL' | 'CONFUSED' | 'FRUSTRATED' | 'SKEPTICAL' | 'RUSHED' | 'DISTRACTED'; confirmationStyle: 'EXPLICIT' | 'VAGUE'; createdAt: string; gender: 'MALE' | 'FEMALE'; hasDisfluencies: boolean; idleMessageMaxSpokenCount: number; idleMessageResetCountOnUserSpeechEnabled: boolean; idleMessages: string[]; idleTimeoutSeconds: number; intentClarity: 'CLEAR' | 'INDIRECT' | 'VAGUE'; language: string; memoryReliability: 'HIGH' | 'LOW'; name: string; properties: object; responseTiming: 'RELAXED' | 'NORMAL' | 'QUICK'; speechClarity: 'CLEAR' | 'VAGUE' | 'RAMBLING'; speechPace: 'SUPER_SLOW' | 'SLOW' | 'NORMAL' | 'FAST' | 'SUPER_FAST'; updatedAt: string; backstoryPrompt?: string; description?: string; secondaryLanguage?: 'EN'; }[]; pagination: { hasMore: boolean; nextCursor: string; total: number; }; }",
982
+ markdown: "## list\n\n`client.simulationPersona.list(after?: string, limit?: number, searchText?: string): { data: object[]; pagination: object; }`\n\n**get** `/v1/persona`\n\nReturns a paginated list of personas for the authenticated project.\n\n### Parameters\n\n- `after?: string`\n\n- `limit?: number`\n\n- `searchText?: string`\n\n### Returns\n\n- `{ data: { id: string; accent: string; backgroundNoise: string; baseEmotion: 'NEUTRAL' | 'CHEERFUL' | 'CONFUSED' | 'FRUSTRATED' | 'SKEPTICAL' | 'RUSHED' | 'DISTRACTED'; confirmationStyle: 'EXPLICIT' | 'VAGUE'; createdAt: string; gender: 'MALE' | 'FEMALE'; hasDisfluencies: boolean; idleMessageMaxSpokenCount: number; idleMessageResetCountOnUserSpeechEnabled: boolean; idleMessages: string[]; idleTimeoutSeconds: number; intentClarity: 'CLEAR' | 'INDIRECT' | 'VAGUE'; language: string; memoryReliability: 'HIGH' | 'LOW'; name: string; properties: object; responseTiming: 'RELAXED' | 'NORMAL' | 'QUICK'; speechClarity: 'CLEAR' | 'VAGUE' | 'RAMBLING'; speechPace: 'SUPER_SLOW' | 'SLOW' | 'NORMAL' | 'FAST' | 'SUPER_FAST'; updatedAt: string; backstoryPrompt?: string; description?: string; secondaryLanguage?: 'EN'; }[]; pagination: { hasMore: boolean; nextCursor: string; total: number; }; }`\n\n - `data: { id: string; accent: string; backgroundNoise: string; baseEmotion: 'NEUTRAL' | 'CHEERFUL' | 'CONFUSED' | 'FRUSTRATED' | 'SKEPTICAL' | 'RUSHED' | 'DISTRACTED'; confirmationStyle: 'EXPLICIT' | 'VAGUE'; createdAt: string; gender: 'MALE' | 'FEMALE'; hasDisfluencies: boolean; idleMessageMaxSpokenCount: number; idleMessageResetCountOnUserSpeechEnabled: boolean; idleMessages: string[]; idleTimeoutSeconds: number; intentClarity: 'CLEAR' | 'INDIRECT' | 'VAGUE'; language: string; memoryReliability: 'HIGH' | 'LOW'; name: string; properties: object; responseTiming: 'RELAXED' | 'NORMAL' | 'QUICK'; speechClarity: 'CLEAR' | 'VAGUE' | 'RAMBLING'; speechPace: 'SUPER_SLOW' | 'SLOW' | 'NORMAL' | 'FAST' | 'SUPER_FAST'; updatedAt: string; backstoryPrompt?: string; description?: string; secondaryLanguage?: 'EN'; }[]`\n - `pagination: { hasMore: boolean; nextCursor: string; total: number; }`\n\n### Example\n\n```typescript\nimport Roark from '@roarkanalytics/sdk';\n\nconst client = new Roark();\n\nconst simulationPersonas = await client.simulationPersona.list();\n\nconsole.log(simulationPersonas);\n```",
983
+ perLanguage: {
984
+ http: {
985
+ example: 'curl https://api.roark.ai/v1/persona \\\n -H "Authorization: Bearer $ROARK_API_BEARER_TOKEN"',
986
+ },
987
+ python: {
988
+ method: 'simulation_persona.list',
989
+ example: 'import os\nfrom roark_analytics import Roark\n\nclient = Roark(\n bearer_token=os.environ.get("ROARK_API_BEARER_TOKEN"), # This is the default and can be omitted\n)\nsimulation_personas = client.simulation_persona.list()\nprint(simulation_personas.data)',
990
+ },
991
+ typescript: {
992
+ method: 'client.simulationPersona.list',
993
+ example: "import Roark from '@roarkanalytics/sdk';\n\nconst client = new Roark({\n bearerToken: process.env['ROARK_API_BEARER_TOKEN'], // This is the default and can be omitted\n});\n\nconst simulationPersonas = await client.simulationPersona.list();\n\nconsole.log(simulationPersonas.data);",
994
+ },
995
+ },
996
+ },
997
+ {
998
+ name: 'getById',
999
+ endpoint: '/v1/persona/{personaId}',
1000
+ httpMethod: 'get',
1001
+ summary: 'Get persona by ID',
1002
+ description: 'Returns a specific persona by its ID.',
1003
+ stainlessPath: '(resource) simulationPersona > (method) getById',
1004
+ qualified: 'client.simulationPersona.getByID',
1005
+ params: ['personaId: string;'],
1006
+ response: "{ data: { id: string; accent: string; backgroundNoise: string; baseEmotion: 'NEUTRAL' | 'CHEERFUL' | 'CONFUSED' | 'FRUSTRATED' | 'SKEPTICAL' | 'RUSHED' | 'DISTRACTED'; confirmationStyle: 'EXPLICIT' | 'VAGUE'; createdAt: string; gender: 'MALE' | 'FEMALE'; hasDisfluencies: boolean; idleMessageMaxSpokenCount: number; idleMessageResetCountOnUserSpeechEnabled: boolean; idleMessages: string[]; idleTimeoutSeconds: number; intentClarity: 'CLEAR' | 'INDIRECT' | 'VAGUE'; language: string; memoryReliability: 'HIGH' | 'LOW'; name: string; properties: object; responseTiming: 'RELAXED' | 'NORMAL' | 'QUICK'; speechClarity: 'CLEAR' | 'VAGUE' | 'RAMBLING'; speechPace: 'SUPER_SLOW' | 'SLOW' | 'NORMAL' | 'FAST' | 'SUPER_FAST'; updatedAt: string; backstoryPrompt?: string; description?: string; secondaryLanguage?: 'EN'; }; }",
1007
+ markdown: "## getById\n\n`client.simulationPersona.getByID(personaId: string): { data: object; }`\n\n**get** `/v1/persona/{personaId}`\n\nReturns a specific persona by its ID.\n\n### Parameters\n\n- `personaId: string`\n\n### Returns\n\n- `{ data: { id: string; accent: string; backgroundNoise: string; baseEmotion: 'NEUTRAL' | 'CHEERFUL' | 'CONFUSED' | 'FRUSTRATED' | 'SKEPTICAL' | 'RUSHED' | 'DISTRACTED'; confirmationStyle: 'EXPLICIT' | 'VAGUE'; createdAt: string; gender: 'MALE' | 'FEMALE'; hasDisfluencies: boolean; idleMessageMaxSpokenCount: number; idleMessageResetCountOnUserSpeechEnabled: boolean; idleMessages: string[]; idleTimeoutSeconds: number; intentClarity: 'CLEAR' | 'INDIRECT' | 'VAGUE'; language: string; memoryReliability: 'HIGH' | 'LOW'; name: string; properties: object; responseTiming: 'RELAXED' | 'NORMAL' | 'QUICK'; speechClarity: 'CLEAR' | 'VAGUE' | 'RAMBLING'; speechPace: 'SUPER_SLOW' | 'SLOW' | 'NORMAL' | 'FAST' | 'SUPER_FAST'; updatedAt: string; backstoryPrompt?: string; description?: string; secondaryLanguage?: 'EN'; }; }`\n\n - `data: { id: string; accent: string; backgroundNoise: string; baseEmotion: 'NEUTRAL' | 'CHEERFUL' | 'CONFUSED' | 'FRUSTRATED' | 'SKEPTICAL' | 'RUSHED' | 'DISTRACTED'; confirmationStyle: 'EXPLICIT' | 'VAGUE'; createdAt: string; gender: 'MALE' | 'FEMALE'; hasDisfluencies: boolean; idleMessageMaxSpokenCount: number; idleMessageResetCountOnUserSpeechEnabled: boolean; idleMessages: string[]; idleTimeoutSeconds: number; intentClarity: 'CLEAR' | 'INDIRECT' | 'VAGUE'; language: string; memoryReliability: 'HIGH' | 'LOW'; name: string; properties: object; responseTiming: 'RELAXED' | 'NORMAL' | 'QUICK'; speechClarity: 'CLEAR' | 'VAGUE' | 'RAMBLING'; speechPace: 'SUPER_SLOW' | 'SLOW' | 'NORMAL' | 'FAST' | 'SUPER_FAST'; updatedAt: string; backstoryPrompt?: string; description?: string; secondaryLanguage?: 'EN'; }`\n\n### Example\n\n```typescript\nimport Roark from '@roarkanalytics/sdk';\n\nconst client = new Roark();\n\nconst response = await client.simulationPersona.getByID('personaId');\n\nconsole.log(response);\n```",
1008
+ perLanguage: {
1009
+ http: {
1010
+ example: 'curl https://api.roark.ai/v1/persona/$PERSONA_ID \\\n -H "Authorization: Bearer $ROARK_API_BEARER_TOKEN"',
1011
+ },
1012
+ python: {
1013
+ method: 'simulation_persona.get_by_id',
1014
+ example: 'import os\nfrom roark_analytics import Roark\n\nclient = Roark(\n bearer_token=os.environ.get("ROARK_API_BEARER_TOKEN"), # This is the default and can be omitted\n)\nresponse = client.simulation_persona.get_by_id(\n "personaId",\n)\nprint(response.data)',
1015
+ },
1016
+ typescript: {
1017
+ method: 'client.simulationPersona.getByID',
1018
+ example: "import Roark from '@roarkanalytics/sdk';\n\nconst client = new Roark({\n bearerToken: process.env['ROARK_API_BEARER_TOKEN'], // This is the default and can be omitted\n});\n\nconst response = await client.simulationPersona.getByID('personaId');\n\nconsole.log(response.data);",
1019
+ },
1020
+ },
1021
+ },
1022
+ {
1023
+ name: 'create',
1024
+ endpoint: '/v1/persona',
1025
+ httpMethod: 'post',
1026
+ summary: 'Create a new persona',
1027
+ description: 'Creates a new persona for the authenticated project.',
1028
+ stainlessPath: '(resource) simulationPersona > (method) create',
1029
+ qualified: 'client.simulationPersona.create',
1030
+ params: [
1031
+ 'accent: string;',
1032
+ "gender: 'MALE' | 'FEMALE';",
1033
+ 'language: string;',
1034
+ 'name: string;',
1035
+ 'backgroundNoise?: string;',
1036
+ 'backstoryPrompt?: string;',
1037
+ "baseEmotion?: 'NEUTRAL' | 'CHEERFUL' | 'CONFUSED' | 'FRUSTRATED' | 'SKEPTICAL' | 'RUSHED' | 'DISTRACTED';",
1038
+ "confirmationStyle?: 'EXPLICIT' | 'VAGUE';",
1039
+ 'description?: string;',
1040
+ 'hasDisfluencies?: boolean;',
1041
+ 'idleMessageMaxSpokenCount?: number;',
1042
+ 'idleMessageResetCountOnUserSpeechEnabled?: boolean;',
1043
+ 'idleMessages?: string[];',
1044
+ 'idleTimeoutSeconds?: number;',
1045
+ "intentClarity?: 'CLEAR' | 'INDIRECT' | 'VAGUE';",
1046
+ "memoryReliability?: 'HIGH' | 'LOW';",
1047
+ 'properties?: object;',
1048
+ "responseTiming?: 'RELAXED' | 'NORMAL' | 'QUICK';",
1049
+ "secondaryLanguage?: 'EN';",
1050
+ "speechClarity?: 'CLEAR' | 'VAGUE' | 'RAMBLING';",
1051
+ "speechPace?: 'SUPER_SLOW' | 'SLOW' | 'NORMAL' | 'FAST' | 'SUPER_FAST';",
1052
+ ],
1053
+ response: "{ data: { id: string; accent: string; backgroundNoise: string; baseEmotion: 'NEUTRAL' | 'CHEERFUL' | 'CONFUSED' | 'FRUSTRATED' | 'SKEPTICAL' | 'RUSHED' | 'DISTRACTED'; confirmationStyle: 'EXPLICIT' | 'VAGUE'; createdAt: string; gender: 'MALE' | 'FEMALE'; hasDisfluencies: boolean; idleMessageMaxSpokenCount: number; idleMessageResetCountOnUserSpeechEnabled: boolean; idleMessages: string[]; idleTimeoutSeconds: number; intentClarity: 'CLEAR' | 'INDIRECT' | 'VAGUE'; language: string; memoryReliability: 'HIGH' | 'LOW'; name: string; properties: object; responseTiming: 'RELAXED' | 'NORMAL' | 'QUICK'; speechClarity: 'CLEAR' | 'VAGUE' | 'RAMBLING'; speechPace: 'SUPER_SLOW' | 'SLOW' | 'NORMAL' | 'FAST' | 'SUPER_FAST'; updatedAt: string; backstoryPrompt?: string; description?: string; secondaryLanguage?: 'EN'; }; }",
1054
+ markdown: "## create\n\n`client.simulationPersona.create(accent: string, gender: 'MALE' | 'FEMALE', language: string, name: string, backgroundNoise?: string, backstoryPrompt?: string, baseEmotion?: 'NEUTRAL' | 'CHEERFUL' | 'CONFUSED' | 'FRUSTRATED' | 'SKEPTICAL' | 'RUSHED' | 'DISTRACTED', confirmationStyle?: 'EXPLICIT' | 'VAGUE', description?: string, hasDisfluencies?: boolean, idleMessageMaxSpokenCount?: number, idleMessageResetCountOnUserSpeechEnabled?: boolean, idleMessages?: string[], idleTimeoutSeconds?: number, intentClarity?: 'CLEAR' | 'INDIRECT' | 'VAGUE', memoryReliability?: 'HIGH' | 'LOW', properties?: object, responseTiming?: 'RELAXED' | 'NORMAL' | 'QUICK', secondaryLanguage?: 'EN', speechClarity?: 'CLEAR' | 'VAGUE' | 'RAMBLING', speechPace?: 'SUPER_SLOW' | 'SLOW' | 'NORMAL' | 'FAST' | 'SUPER_FAST'): { data: object; }`\n\n**post** `/v1/persona`\n\nCreates a new persona for the authenticated project.\n\n### Parameters\n\n- `accent: string`\n Accent of the persona, defined using ISO 3166-1 alpha-2 country codes with optional variants\n\n- `gender: 'MALE' | 'FEMALE'`\n Gender of the persona\n\n- `language: string`\n Primary language ISO 639-1 code for the persona\n\n- `name: string`\n The name the agent will identify as during conversations\n\n- `backgroundNoise?: string`\n Background noise setting\n\n- `backstoryPrompt?: string`\n Background story and behavioral patterns for the persona\n\n- `baseEmotion?: 'NEUTRAL' | 'CHEERFUL' | 'CONFUSED' | 'FRUSTRATED' | 'SKEPTICAL' | 'RUSHED' | 'DISTRACTED'`\n Base emotional state of the persona\n\n- `confirmationStyle?: 'EXPLICIT' | 'VAGUE'`\n How the persona confirms information\n\n- `description?: string`\n Human-readable description of the persona\n\n- `hasDisfluencies?: boolean`\n Whether the persona uses filler words like \"um\" and \"uh\"\n\n- `idleMessageMaxSpokenCount?: number`\n Maximum number of idle messages the persona will send before giving up\n\n- `idleMessageResetCountOnUserSpeechEnabled?: boolean`\n Whether the idle message counter resets when the agent speaks\n\n- `idleMessages?: string[]`\n Messages the persona will say when the agent goes silent during a call\n\n- `idleTimeoutSeconds?: number`\n Seconds of silence before the persona sends an idle message\n\n- `intentClarity?: 'CLEAR' | 'INDIRECT' | 'VAGUE'`\n How clearly the persona expresses their intentions\n\n- `memoryReliability?: 'HIGH' | 'LOW'`\n How reliable the persona's memory is\n\n- `properties?: object`\n Additional custom properties about the persona\n\n- `responseTiming?: 'RELAXED' | 'NORMAL' | 'QUICK'`\n Controls how quickly the persona responds to pauses in conversation (QUICK, NORMAL, RELAXED)\n\n- `secondaryLanguage?: 'EN'`\n Secondary language ISO 639-1 code for code-switching (e.g., Hinglish, Spanglish)\n\n- `speechClarity?: 'CLEAR' | 'VAGUE' | 'RAMBLING'`\n Speech clarity of the persona\n\n- `speechPace?: 'SUPER_SLOW' | 'SLOW' | 'NORMAL' | 'FAST' | 'SUPER_FAST'`\n Speech pace of the persona\n\n### Returns\n\n- `{ data: { id: string; accent: string; backgroundNoise: string; baseEmotion: 'NEUTRAL' | 'CHEERFUL' | 'CONFUSED' | 'FRUSTRATED' | 'SKEPTICAL' | 'RUSHED' | 'DISTRACTED'; confirmationStyle: 'EXPLICIT' | 'VAGUE'; createdAt: string; gender: 'MALE' | 'FEMALE'; hasDisfluencies: boolean; idleMessageMaxSpokenCount: number; idleMessageResetCountOnUserSpeechEnabled: boolean; idleMessages: string[]; idleTimeoutSeconds: number; intentClarity: 'CLEAR' | 'INDIRECT' | 'VAGUE'; language: string; memoryReliability: 'HIGH' | 'LOW'; name: string; properties: object; responseTiming: 'RELAXED' | 'NORMAL' | 'QUICK'; speechClarity: 'CLEAR' | 'VAGUE' | 'RAMBLING'; speechPace: 'SUPER_SLOW' | 'SLOW' | 'NORMAL' | 'FAST' | 'SUPER_FAST'; updatedAt: string; backstoryPrompt?: string; description?: string; secondaryLanguage?: 'EN'; }; }`\n\n - `data: { id: string; accent: string; backgroundNoise: string; baseEmotion: 'NEUTRAL' | 'CHEERFUL' | 'CONFUSED' | 'FRUSTRATED' | 'SKEPTICAL' | 'RUSHED' | 'DISTRACTED'; confirmationStyle: 'EXPLICIT' | 'VAGUE'; createdAt: string; gender: 'MALE' | 'FEMALE'; hasDisfluencies: boolean; idleMessageMaxSpokenCount: number; idleMessageResetCountOnUserSpeechEnabled: boolean; idleMessages: string[]; idleTimeoutSeconds: number; intentClarity: 'CLEAR' | 'INDIRECT' | 'VAGUE'; language: string; memoryReliability: 'HIGH' | 'LOW'; name: string; properties: object; responseTiming: 'RELAXED' | 'NORMAL' | 'QUICK'; speechClarity: 'CLEAR' | 'VAGUE' | 'RAMBLING'; speechPace: 'SUPER_SLOW' | 'SLOW' | 'NORMAL' | 'FAST' | 'SUPER_FAST'; updatedAt: string; backstoryPrompt?: string; description?: string; secondaryLanguage?: 'EN'; }`\n\n### Example\n\n```typescript\nimport Roark from '@roarkanalytics/sdk';\n\nconst client = new Roark();\n\nconst simulationPersona = await client.simulationPersona.create({\n accent: 'US',\n gender: 'MALE',\n language: 'EN',\n name: 'name',\n});\n\nconsole.log(simulationPersona);\n```",
1055
+ perLanguage: {
1056
+ http: {
1057
+ example: 'curl https://api.roark.ai/v1/persona \\\n -H \'Content-Type: application/json\' \\\n -H "Authorization: Bearer $ROARK_API_BEARER_TOKEN" \\\n -d \'{\n "accent": "US",\n "gender": "MALE",\n "language": "EN",\n "name": "name",\n "backstoryPrompt": "A busy professional calling during lunch break",\n "properties": {\n "age": "bar",\n "zipCode": "bar",\n "occupation": "bar"\n }\n }\'',
1058
+ },
1059
+ python: {
1060
+ method: 'simulation_persona.create',
1061
+ example: 'import os\nfrom roark_analytics import Roark\n\nclient = Roark(\n bearer_token=os.environ.get("ROARK_API_BEARER_TOKEN"), # This is the default and can be omitted\n)\nsimulation_persona = client.simulation_persona.create(\n accent="US",\n gender="MALE",\n language="EN",\n name="name",\n)\nprint(simulation_persona.data)',
1062
+ },
1063
+ typescript: {
1064
+ method: 'client.simulationPersona.create',
1065
+ example: "import Roark from '@roarkanalytics/sdk';\n\nconst client = new Roark({\n bearerToken: process.env['ROARK_API_BEARER_TOKEN'], // This is the default and can be omitted\n});\n\nconst simulationPersona = await client.simulationPersona.create({\n accent: 'US',\n gender: 'MALE',\n language: 'EN',\n name: 'name',\n});\n\nconsole.log(simulationPersona.data);",
1066
+ },
1067
+ },
1068
+ },
1069
+ {
1070
+ name: 'update',
1071
+ endpoint: '/v1/persona/{personaId}',
1072
+ httpMethod: 'put',
1073
+ summary: 'Update a persona',
1074
+ description: 'Updates an existing persona by its ID.',
1075
+ stainlessPath: '(resource) simulationPersona > (method) update',
1076
+ qualified: 'client.simulationPersona.update',
1077
+ params: [
1078
+ 'personaId: string;',
1079
+ 'accent?: string;',
1080
+ 'backgroundNoise?: string;',
1081
+ 'backstoryPrompt?: string;',
1082
+ "baseEmotion?: 'NEUTRAL' | 'CHEERFUL' | 'CONFUSED' | 'FRUSTRATED' | 'SKEPTICAL' | 'RUSHED' | 'DISTRACTED';",
1083
+ "confirmationStyle?: 'EXPLICIT' | 'VAGUE';",
1084
+ 'description?: string;',
1085
+ "gender?: 'MALE' | 'FEMALE';",
1086
+ 'hasDisfluencies?: boolean;',
1087
+ 'idleMessageMaxSpokenCount?: number;',
1088
+ 'idleMessageResetCountOnUserSpeechEnabled?: boolean;',
1089
+ 'idleMessages?: string[];',
1090
+ 'idleTimeoutSeconds?: number;',
1091
+ "intentClarity?: 'CLEAR' | 'INDIRECT' | 'VAGUE';",
1092
+ 'language?: string;',
1093
+ "memoryReliability?: 'HIGH' | 'LOW';",
1094
+ 'name?: string;',
1095
+ 'properties?: object;',
1096
+ "responseTiming?: 'RELAXED' | 'NORMAL' | 'QUICK';",
1097
+ "secondaryLanguage?: 'EN';",
1098
+ "speechClarity?: 'CLEAR' | 'VAGUE' | 'RAMBLING';",
1099
+ "speechPace?: 'SUPER_SLOW' | 'SLOW' | 'NORMAL' | 'FAST' | 'SUPER_FAST';",
1100
+ ],
1101
+ response: "{ data: { id: string; accent: string; backgroundNoise: string; baseEmotion: 'NEUTRAL' | 'CHEERFUL' | 'CONFUSED' | 'FRUSTRATED' | 'SKEPTICAL' | 'RUSHED' | 'DISTRACTED'; confirmationStyle: 'EXPLICIT' | 'VAGUE'; createdAt: string; gender: 'MALE' | 'FEMALE'; hasDisfluencies: boolean; idleMessageMaxSpokenCount: number; idleMessageResetCountOnUserSpeechEnabled: boolean; idleMessages: string[]; idleTimeoutSeconds: number; intentClarity: 'CLEAR' | 'INDIRECT' | 'VAGUE'; language: string; memoryReliability: 'HIGH' | 'LOW'; name: string; properties: object; responseTiming: 'RELAXED' | 'NORMAL' | 'QUICK'; speechClarity: 'CLEAR' | 'VAGUE' | 'RAMBLING'; speechPace: 'SUPER_SLOW' | 'SLOW' | 'NORMAL' | 'FAST' | 'SUPER_FAST'; updatedAt: string; backstoryPrompt?: string; description?: string; secondaryLanguage?: 'EN'; }; }",
1102
+ markdown: "## update\n\n`client.simulationPersona.update(personaId: string, accent?: string, backgroundNoise?: string, backstoryPrompt?: string, baseEmotion?: 'NEUTRAL' | 'CHEERFUL' | 'CONFUSED' | 'FRUSTRATED' | 'SKEPTICAL' | 'RUSHED' | 'DISTRACTED', confirmationStyle?: 'EXPLICIT' | 'VAGUE', description?: string, gender?: 'MALE' | 'FEMALE', hasDisfluencies?: boolean, idleMessageMaxSpokenCount?: number, idleMessageResetCountOnUserSpeechEnabled?: boolean, idleMessages?: string[], idleTimeoutSeconds?: number, intentClarity?: 'CLEAR' | 'INDIRECT' | 'VAGUE', language?: string, memoryReliability?: 'HIGH' | 'LOW', name?: string, properties?: object, responseTiming?: 'RELAXED' | 'NORMAL' | 'QUICK', secondaryLanguage?: 'EN', speechClarity?: 'CLEAR' | 'VAGUE' | 'RAMBLING', speechPace?: 'SUPER_SLOW' | 'SLOW' | 'NORMAL' | 'FAST' | 'SUPER_FAST'): { data: object; }`\n\n**put** `/v1/persona/{personaId}`\n\nUpdates an existing persona by its ID.\n\n### Parameters\n\n- `personaId: string`\n\n- `accent?: string`\n Accent of the persona, defined using ISO 3166-1 alpha-2 country codes with optional variants\n\n- `backgroundNoise?: string`\n Background noise setting\n\n- `backstoryPrompt?: string`\n Background story and behavioral patterns for the persona\n\n- `baseEmotion?: 'NEUTRAL' | 'CHEERFUL' | 'CONFUSED' | 'FRUSTRATED' | 'SKEPTICAL' | 'RUSHED' | 'DISTRACTED'`\n Base emotional state of the persona\n\n- `confirmationStyle?: 'EXPLICIT' | 'VAGUE'`\n How the persona confirms information\n\n- `description?: string`\n Human-readable description of the persona\n\n- `gender?: 'MALE' | 'FEMALE'`\n Gender of the persona\n\n- `hasDisfluencies?: boolean`\n Whether the persona uses filler words like \"um\" and \"uh\"\n\n- `idleMessageMaxSpokenCount?: number`\n Maximum number of idle messages the persona will send before giving up\n\n- `idleMessageResetCountOnUserSpeechEnabled?: boolean`\n Whether the idle message counter resets when the agent speaks\n\n- `idleMessages?: string[]`\n Messages the persona will say when the agent goes silent during a call\n\n- `idleTimeoutSeconds?: number`\n Seconds of silence before the persona sends an idle message\n\n- `intentClarity?: 'CLEAR' | 'INDIRECT' | 'VAGUE'`\n How clearly the persona expresses their intentions\n\n- `language?: string`\n Primary language ISO 639-1 code for the persona\n\n- `memoryReliability?: 'HIGH' | 'LOW'`\n How reliable the persona's memory is\n\n- `name?: string`\n The name the agent will identify as during conversations\n\n- `properties?: object`\n Additional custom properties about the persona\n\n- `responseTiming?: 'RELAXED' | 'NORMAL' | 'QUICK'`\n Controls how quickly the persona responds to pauses in conversation (QUICK, NORMAL, RELAXED)\n\n- `secondaryLanguage?: 'EN'`\n Secondary language ISO 639-1 code for code-switching (e.g., Hinglish, Spanglish)\n\n- `speechClarity?: 'CLEAR' | 'VAGUE' | 'RAMBLING'`\n Speech clarity of the persona\n\n- `speechPace?: 'SUPER_SLOW' | 'SLOW' | 'NORMAL' | 'FAST' | 'SUPER_FAST'`\n Speech pace of the persona\n\n### Returns\n\n- `{ data: { id: string; accent: string; backgroundNoise: string; baseEmotion: 'NEUTRAL' | 'CHEERFUL' | 'CONFUSED' | 'FRUSTRATED' | 'SKEPTICAL' | 'RUSHED' | 'DISTRACTED'; confirmationStyle: 'EXPLICIT' | 'VAGUE'; createdAt: string; gender: 'MALE' | 'FEMALE'; hasDisfluencies: boolean; idleMessageMaxSpokenCount: number; idleMessageResetCountOnUserSpeechEnabled: boolean; idleMessages: string[]; idleTimeoutSeconds: number; intentClarity: 'CLEAR' | 'INDIRECT' | 'VAGUE'; language: string; memoryReliability: 'HIGH' | 'LOW'; name: string; properties: object; responseTiming: 'RELAXED' | 'NORMAL' | 'QUICK'; speechClarity: 'CLEAR' | 'VAGUE' | 'RAMBLING'; speechPace: 'SUPER_SLOW' | 'SLOW' | 'NORMAL' | 'FAST' | 'SUPER_FAST'; updatedAt: string; backstoryPrompt?: string; description?: string; secondaryLanguage?: 'EN'; }; }`\n\n - `data: { id: string; accent: string; backgroundNoise: string; baseEmotion: 'NEUTRAL' | 'CHEERFUL' | 'CONFUSED' | 'FRUSTRATED' | 'SKEPTICAL' | 'RUSHED' | 'DISTRACTED'; confirmationStyle: 'EXPLICIT' | 'VAGUE'; createdAt: string; gender: 'MALE' | 'FEMALE'; hasDisfluencies: boolean; idleMessageMaxSpokenCount: number; idleMessageResetCountOnUserSpeechEnabled: boolean; idleMessages: string[]; idleTimeoutSeconds: number; intentClarity: 'CLEAR' | 'INDIRECT' | 'VAGUE'; language: string; memoryReliability: 'HIGH' | 'LOW'; name: string; properties: object; responseTiming: 'RELAXED' | 'NORMAL' | 'QUICK'; speechClarity: 'CLEAR' | 'VAGUE' | 'RAMBLING'; speechPace: 'SUPER_SLOW' | 'SLOW' | 'NORMAL' | 'FAST' | 'SUPER_FAST'; updatedAt: string; backstoryPrompt?: string; description?: string; secondaryLanguage?: 'EN'; }`\n\n### Example\n\n```typescript\nimport Roark from '@roarkanalytics/sdk';\n\nconst client = new Roark();\n\nconst simulationPersona = await client.simulationPersona.update('personaId');\n\nconsole.log(simulationPersona);\n```",
1103
+ perLanguage: {
1104
+ http: {
1105
+ example: 'curl https://api.roark.ai/v1/persona/$PERSONA_ID \\\n -X PUT \\\n -H "Authorization: Bearer $ROARK_API_BEARER_TOKEN"',
1106
+ },
1107
+ python: {
1108
+ method: 'simulation_persona.update',
1109
+ example: 'import os\nfrom roark_analytics import Roark\n\nclient = Roark(\n bearer_token=os.environ.get("ROARK_API_BEARER_TOKEN"), # This is the default and can be omitted\n)\nsimulation_persona = client.simulation_persona.update(\n persona_id="personaId",\n)\nprint(simulation_persona.data)',
1110
+ },
1111
+ typescript: {
1112
+ method: 'client.simulationPersona.update',
1113
+ example: "import Roark from '@roarkanalytics/sdk';\n\nconst client = new Roark({\n bearerToken: process.env['ROARK_API_BEARER_TOKEN'], // This is the default and can be omitted\n});\n\nconst simulationPersona = await client.simulationPersona.update('personaId');\n\nconsole.log(simulationPersona.data);",
1114
+ },
1115
+ },
1116
+ },
1117
+ {
1118
+ name: 'list',
1119
+ endpoint: '/v1/agent',
1120
+ httpMethod: 'get',
1121
+ summary: 'List agents',
1122
+ description: 'Returns a paginated list of agents for the authenticated project.',
1123
+ stainlessPath: '(resource) agent > (method) list',
1124
+ qualified: 'client.agent.list',
1125
+ params: ['after?: string;', 'limit?: number;', 'searchText?: string;'],
1126
+ response: '{ data: { id: string; createdAt: string; customId: string; description: string; name: string; updatedAt: string; }[]; pagination: { hasMore: boolean; nextCursor: string; total: number; }; }',
1127
+ markdown: "## list\n\n`client.agent.list(after?: string, limit?: number, searchText?: string): { data: object[]; pagination: object; }`\n\n**get** `/v1/agent`\n\nReturns a paginated list of agents for the authenticated project.\n\n### Parameters\n\n- `after?: string`\n\n- `limit?: number`\n\n- `searchText?: string`\n\n### Returns\n\n- `{ data: { id: string; createdAt: string; customId: string; description: string; name: string; updatedAt: string; }[]; pagination: { hasMore: boolean; nextCursor: string; total: number; }; }`\n\n - `data: { id: string; createdAt: string; customId: string; description: string; name: string; updatedAt: string; }[]`\n - `pagination: { hasMore: boolean; nextCursor: string; total: number; }`\n\n### Example\n\n```typescript\nimport Roark from '@roarkanalytics/sdk';\n\nconst client = new Roark();\n\nconst agents = await client.agent.list();\n\nconsole.log(agents);\n```",
1128
+ perLanguage: {
1129
+ http: {
1130
+ example: 'curl https://api.roark.ai/v1/agent \\\n -H "Authorization: Bearer $ROARK_API_BEARER_TOKEN"',
1131
+ },
1132
+ python: {
1133
+ method: 'agent.list',
1134
+ example: 'import os\nfrom roark_analytics import Roark\n\nclient = Roark(\n bearer_token=os.environ.get("ROARK_API_BEARER_TOKEN"), # This is the default and can be omitted\n)\nagents = client.agent.list()\nprint(agents.data)',
1135
+ },
1136
+ typescript: {
1137
+ method: 'client.agent.list',
1138
+ example: "import Roark from '@roarkanalytics/sdk';\n\nconst client = new Roark({\n bearerToken: process.env['ROARK_API_BEARER_TOKEN'], // This is the default and can be omitted\n});\n\nconst agents = await client.agent.list();\n\nconsole.log(agents.data);",
1139
+ },
1140
+ },
1141
+ },
1142
+ {
1143
+ name: 'getById',
1144
+ endpoint: '/v1/agent/{agentId}',
1145
+ httpMethod: 'get',
1146
+ summary: 'Get agent by ID',
1147
+ description: 'Returns a specific agent by its ID.',
1148
+ stainlessPath: '(resource) agent > (method) getById',
1149
+ qualified: 'client.agent.getByID',
1150
+ params: ['agentId: string;'],
1151
+ response: '{ data: { id: string; createdAt: string; customId: string; description: string; name: string; updatedAt: string; }; }',
1152
+ markdown: "## getById\n\n`client.agent.getByID(agentId: string): { data: object; }`\n\n**get** `/v1/agent/{agentId}`\n\nReturns a specific agent by its ID.\n\n### Parameters\n\n- `agentId: string`\n\n### Returns\n\n- `{ data: { id: string; createdAt: string; customId: string; description: string; name: string; updatedAt: string; }; }`\n\n - `data: { id: string; createdAt: string; customId: string; description: string; name: string; updatedAt: string; }`\n\n### Example\n\n```typescript\nimport Roark from '@roarkanalytics/sdk';\n\nconst client = new Roark();\n\nconst response = await client.agent.getByID('agentId');\n\nconsole.log(response);\n```",
1153
+ perLanguage: {
1154
+ http: {
1155
+ example: 'curl https://api.roark.ai/v1/agent/$AGENT_ID \\\n -H "Authorization: Bearer $ROARK_API_BEARER_TOKEN"',
1156
+ },
1157
+ python: {
1158
+ method: 'agent.get_by_id',
1159
+ example: 'import os\nfrom roark_analytics import Roark\n\nclient = Roark(\n bearer_token=os.environ.get("ROARK_API_BEARER_TOKEN"), # This is the default and can be omitted\n)\nresponse = client.agent.get_by_id(\n "agentId",\n)\nprint(response.data)',
1160
+ },
1161
+ typescript: {
1162
+ method: 'client.agent.getByID',
1163
+ example: "import Roark from '@roarkanalytics/sdk';\n\nconst client = new Roark({\n bearerToken: process.env['ROARK_API_BEARER_TOKEN'], // This is the default and can be omitted\n});\n\nconst response = await client.agent.getByID('agentId');\n\nconsole.log(response.data);",
1164
+ },
1165
+ },
1166
+ },
1167
+ {
1168
+ name: 'create',
1169
+ endpoint: '/v1/agent',
1170
+ httpMethod: 'post',
1171
+ summary: 'Create a new agent',
1172
+ description: 'Creates a new agent for the authenticated project.',
1173
+ stainlessPath: '(resource) agent > (method) create',
1174
+ qualified: 'client.agent.create',
1175
+ params: ['name: string;', 'customId?: string;', 'description?: string;'],
1176
+ response: '{ data: { id: string; createdAt: string; customId: string; description: string; name: string; updatedAt: string; }; }',
1177
+ markdown: "## create\n\n`client.agent.create(name: string, customId?: string, description?: string): { data: object; }`\n\n**post** `/v1/agent`\n\nCreates a new agent for the authenticated project.\n\n### Parameters\n\n- `name: string`\n Name of the agent\n\n- `customId?: string`\n Custom identifier for the agent\n\n- `description?: string`\n Description of the agent\n\n### Returns\n\n- `{ data: { id: string; createdAt: string; customId: string; description: string; name: string; updatedAt: string; }; }`\n\n - `data: { id: string; createdAt: string; customId: string; description: string; name: string; updatedAt: string; }`\n\n### Example\n\n```typescript\nimport Roark from '@roarkanalytics/sdk';\n\nconst client = new Roark();\n\nconst agent = await client.agent.create({ name: 'x' });\n\nconsole.log(agent);\n```",
1178
+ perLanguage: {
1179
+ http: {
1180
+ example: 'curl https://api.roark.ai/v1/agent \\\n -H \'Content-Type: application/json\' \\\n -H "Authorization: Bearer $ROARK_API_BEARER_TOKEN" \\\n -d \'{\n "name": "x"\n }\'',
1181
+ },
1182
+ python: {
1183
+ method: 'agent.create',
1184
+ example: 'import os\nfrom roark_analytics import Roark\n\nclient = Roark(\n bearer_token=os.environ.get("ROARK_API_BEARER_TOKEN"), # This is the default and can be omitted\n)\nagent = client.agent.create(\n name="x",\n)\nprint(agent.data)',
1185
+ },
1186
+ typescript: {
1187
+ method: 'client.agent.create',
1188
+ example: "import Roark from '@roarkanalytics/sdk';\n\nconst client = new Roark({\n bearerToken: process.env['ROARK_API_BEARER_TOKEN'], // This is the default and can be omitted\n});\n\nconst agent = await client.agent.create({ name: 'x' });\n\nconsole.log(agent.data);",
1189
+ },
1190
+ },
1191
+ },
1192
+ {
1193
+ name: 'update',
1194
+ endpoint: '/v1/agent/{agentId}',
1195
+ httpMethod: 'put',
1196
+ summary: 'Update an agent',
1197
+ description: 'Updates an existing agent by its ID.',
1198
+ stainlessPath: '(resource) agent > (method) update',
1199
+ qualified: 'client.agent.update',
1200
+ params: ['agentId: string;', 'description?: string;', 'name?: string;'],
1201
+ response: '{ data: { id: string; createdAt: string; customId: string; description: string; name: string; updatedAt: string; }; }',
1202
+ markdown: "## update\n\n`client.agent.update(agentId: string, description?: string, name?: string): { data: object; }`\n\n**put** `/v1/agent/{agentId}`\n\nUpdates an existing agent by its ID.\n\n### Parameters\n\n- `agentId: string`\n\n- `description?: string`\n Description of the agent\n\n- `name?: string`\n Name of the agent\n\n### Returns\n\n- `{ data: { id: string; createdAt: string; customId: string; description: string; name: string; updatedAt: string; }; }`\n\n - `data: { id: string; createdAt: string; customId: string; description: string; name: string; updatedAt: string; }`\n\n### Example\n\n```typescript\nimport Roark from '@roarkanalytics/sdk';\n\nconst client = new Roark();\n\nconst agent = await client.agent.update('agentId');\n\nconsole.log(agent);\n```",
1203
+ perLanguage: {
1204
+ http: {
1205
+ example: 'curl https://api.roark.ai/v1/agent/$AGENT_ID \\\n -X PUT \\\n -H "Authorization: Bearer $ROARK_API_BEARER_TOKEN"',
1206
+ },
1207
+ python: {
1208
+ method: 'agent.update',
1209
+ example: 'import os\nfrom roark_analytics import Roark\n\nclient = Roark(\n bearer_token=os.environ.get("ROARK_API_BEARER_TOKEN"), # This is the default and can be omitted\n)\nagent = client.agent.update(\n agent_id="agentId",\n)\nprint(agent.data)',
1210
+ },
1211
+ typescript: {
1212
+ method: 'client.agent.update',
1213
+ example: "import Roark from '@roarkanalytics/sdk';\n\nconst client = new Roark({\n bearerToken: process.env['ROARK_API_BEARER_TOKEN'], // This is the default and can be omitted\n});\n\nconst agent = await client.agent.update('agentId');\n\nconsole.log(agent.data);",
1214
+ },
1215
+ },
1216
+ },
1217
+ {
1218
+ name: 'list',
1219
+ endpoint: '/v1/agent/endpoint',
1220
+ httpMethod: 'get',
1221
+ summary: 'List agent endpoints',
1222
+ description: 'Returns a paginated list of agent endpoints for the authenticated project.',
1223
+ stainlessPath: '(resource) agentEndpoint > (method) list',
1224
+ qualified: 'client.agentEndpoint.list',
1225
+ params: ['after?: string;', 'agentId?: string;', 'limit?: number;', 'searchText?: string;'],
1226
+ response: "{ data: { id: string; agentId: string; createdAt: string; direction: 'INCOMING' | 'OUTGOING' | 'INCOMING_AND_OUTGOING'; environment: string; outboundDialHttpRequestDefinitionId: string; outboundDialType: 'NONE' | 'HTTP_REQUEST'; type: 'PHONE' | 'WEBSOCKET' | 'LIVEKIT' | 'SMALL_WEBRTC' | 'ELEVENLABS_WS' | 'KORE' | 'GOOGLE_CES'; updatedAt: string; value: string; }[]; pagination: { hasMore: boolean; nextCursor: string; total: number; }; }",
1227
+ markdown: "## list\n\n`client.agentEndpoint.list(after?: string, agentId?: string, limit?: number, searchText?: string): { data: object[]; pagination: object; }`\n\n**get** `/v1/agent/endpoint`\n\nReturns a paginated list of agent endpoints for the authenticated project.\n\n### Parameters\n\n- `after?: string`\n Cursor for pagination - endpoint ID to start after\n\n- `agentId?: string`\n Filter by agent ID\n\n- `limit?: number`\n Maximum number of endpoints to return (default: 20, max: 50)\n\n- `searchText?: string`\n Search text to filter endpoints\n\n### Returns\n\n- `{ data: { id: string; agentId: string; createdAt: string; direction: 'INCOMING' | 'OUTGOING' | 'INCOMING_AND_OUTGOING'; environment: string; outboundDialHttpRequestDefinitionId: string; outboundDialType: 'NONE' | 'HTTP_REQUEST'; type: 'PHONE' | 'WEBSOCKET' | 'LIVEKIT' | 'SMALL_WEBRTC' | 'ELEVENLABS_WS' | 'KORE' | 'GOOGLE_CES'; updatedAt: string; value: string; }[]; pagination: { hasMore: boolean; nextCursor: string; total: number; }; }`\n\n - `data: { id: string; agentId: string; createdAt: string; direction: 'INCOMING' | 'OUTGOING' | 'INCOMING_AND_OUTGOING'; environment: string; outboundDialHttpRequestDefinitionId: string; outboundDialType: 'NONE' | 'HTTP_REQUEST'; type: 'PHONE' | 'WEBSOCKET' | 'LIVEKIT' | 'SMALL_WEBRTC' | 'ELEVENLABS_WS' | 'KORE' | 'GOOGLE_CES'; updatedAt: string; value: string; }[]`\n - `pagination: { hasMore: boolean; nextCursor: string; total: number; }`\n\n### Example\n\n```typescript\nimport Roark from '@roarkanalytics/sdk';\n\nconst client = new Roark();\n\nconst agentEndpoints = await client.agentEndpoint.list();\n\nconsole.log(agentEndpoints);\n```",
1228
+ perLanguage: {
1229
+ http: {
1230
+ example: 'curl https://api.roark.ai/v1/agent/endpoint \\\n -H "Authorization: Bearer $ROARK_API_BEARER_TOKEN"',
1231
+ },
1232
+ python: {
1233
+ method: 'agent_endpoint.list',
1234
+ example: 'import os\nfrom roark_analytics import Roark\n\nclient = Roark(\n bearer_token=os.environ.get("ROARK_API_BEARER_TOKEN"), # This is the default and can be omitted\n)\nagent_endpoints = client.agent_endpoint.list()\nprint(agent_endpoints.data)',
1235
+ },
1236
+ typescript: {
1237
+ method: 'client.agentEndpoint.list',
1238
+ example: "import Roark from '@roarkanalytics/sdk';\n\nconst client = new Roark({\n bearerToken: process.env['ROARK_API_BEARER_TOKEN'], // This is the default and can be omitted\n});\n\nconst agentEndpoints = await client.agentEndpoint.list();\n\nconsole.log(agentEndpoints.data);",
1239
+ },
1240
+ },
1241
+ },
1242
+ {
1243
+ name: 'getById',
1244
+ endpoint: '/v1/agent/endpoint/{endpointId}',
1245
+ httpMethod: 'get',
1246
+ summary: 'Get agent endpoint by ID',
1247
+ description: 'Returns a specific agent endpoint by its ID.',
1248
+ stainlessPath: '(resource) agentEndpoint > (method) getById',
1249
+ qualified: 'client.agentEndpoint.getByID',
1250
+ params: ['endpointId: string;'],
1251
+ response: "{ data: { id: string; agentId: string; createdAt: string; direction: 'INCOMING' | 'OUTGOING' | 'INCOMING_AND_OUTGOING'; environment: string; outboundDialHttpRequestDefinitionId: string; outboundDialType: 'NONE' | 'HTTP_REQUEST'; type: 'PHONE' | 'WEBSOCKET' | 'LIVEKIT' | 'SMALL_WEBRTC' | 'ELEVENLABS_WS' | 'KORE' | 'GOOGLE_CES'; updatedAt: string; value: string; }; }",
1252
+ markdown: "## getById\n\n`client.agentEndpoint.getByID(endpointId: string): { data: object; }`\n\n**get** `/v1/agent/endpoint/{endpointId}`\n\nReturns a specific agent endpoint by its ID.\n\n### Parameters\n\n- `endpointId: string`\n\n### Returns\n\n- `{ data: { id: string; agentId: string; createdAt: string; direction: 'INCOMING' | 'OUTGOING' | 'INCOMING_AND_OUTGOING'; environment: string; outboundDialHttpRequestDefinitionId: string; outboundDialType: 'NONE' | 'HTTP_REQUEST'; type: 'PHONE' | 'WEBSOCKET' | 'LIVEKIT' | 'SMALL_WEBRTC' | 'ELEVENLABS_WS' | 'KORE' | 'GOOGLE_CES'; updatedAt: string; value: string; }; }`\n\n - `data: { id: string; agentId: string; createdAt: string; direction: 'INCOMING' | 'OUTGOING' | 'INCOMING_AND_OUTGOING'; environment: string; outboundDialHttpRequestDefinitionId: string; outboundDialType: 'NONE' | 'HTTP_REQUEST'; type: 'PHONE' | 'WEBSOCKET' | 'LIVEKIT' | 'SMALL_WEBRTC' | 'ELEVENLABS_WS' | 'KORE' | 'GOOGLE_CES'; updatedAt: string; value: string; }`\n\n### Example\n\n```typescript\nimport Roark from '@roarkanalytics/sdk';\n\nconst client = new Roark();\n\nconst response = await client.agentEndpoint.getByID('endpointId');\n\nconsole.log(response);\n```",
1253
+ perLanguage: {
1254
+ http: {
1255
+ example: 'curl https://api.roark.ai/v1/agent/endpoint/$ENDPOINT_ID \\\n -H "Authorization: Bearer $ROARK_API_BEARER_TOKEN"',
1256
+ },
1257
+ python: {
1258
+ method: 'agent_endpoint.get_by_id',
1259
+ example: 'import os\nfrom roark_analytics import Roark\n\nclient = Roark(\n bearer_token=os.environ.get("ROARK_API_BEARER_TOKEN"), # This is the default and can be omitted\n)\nresponse = client.agent_endpoint.get_by_id(\n "endpointId",\n)\nprint(response.data)',
1260
+ },
1261
+ typescript: {
1262
+ method: 'client.agentEndpoint.getByID',
1263
+ example: "import Roark from '@roarkanalytics/sdk';\n\nconst client = new Roark({\n bearerToken: process.env['ROARK_API_BEARER_TOKEN'], // This is the default and can be omitted\n});\n\nconst response = await client.agentEndpoint.getByID('endpointId');\n\nconsole.log(response.data);",
1264
+ },
1265
+ },
1266
+ },
1267
+ {
1268
+ name: 'create',
1269
+ endpoint: '/v1/agent/endpoint',
1270
+ httpMethod: 'post',
1271
+ summary: 'Create a new agent endpoint',
1272
+ description: 'Creates a new agent endpoint for the authenticated project.',
1273
+ stainlessPath: '(resource) agentEndpoint > (method) create',
1274
+ qualified: 'client.agentEndpoint.create',
1275
+ params: [
1276
+ 'agentId: string;',
1277
+ "direction: 'INCOMING' | 'OUTGOING' | 'INCOMING_AND_OUTGOING';",
1278
+ 'value: string;',
1279
+ 'environment?: string;',
1280
+ 'outboundDialHttpRequestDefinitionId?: string;',
1281
+ "outboundDialType?: 'NONE' | 'HTTP_REQUEST';",
1282
+ ],
1283
+ response: "{ data: { id: string; agentId: string; createdAt: string; direction: 'INCOMING' | 'OUTGOING' | 'INCOMING_AND_OUTGOING'; environment: string; outboundDialHttpRequestDefinitionId: string; outboundDialType: 'NONE' | 'HTTP_REQUEST'; type: 'PHONE' | 'WEBSOCKET' | 'LIVEKIT' | 'SMALL_WEBRTC' | 'ELEVENLABS_WS' | 'KORE' | 'GOOGLE_CES'; updatedAt: string; value: string; }; }",
1284
+ markdown: "## create\n\n`client.agentEndpoint.create(agentId: string, direction: 'INCOMING' | 'OUTGOING' | 'INCOMING_AND_OUTGOING', value: string, environment?: string, outboundDialHttpRequestDefinitionId?: string, outboundDialType?: 'NONE' | 'HTTP_REQUEST'): { data: object; }`\n\n**post** `/v1/agent/endpoint`\n\nCreates a new agent endpoint for the authenticated project.\n\n### Parameters\n\n- `agentId: string`\n Agent ID to associate this endpoint with\n\n- `direction: 'INCOMING' | 'OUTGOING' | 'INCOMING_AND_OUTGOING'`\n Call direction: INCOMING, OUTGOING, or INCOMING_AND_OUTGOING\n\n- `value: string`\n Phone number in E.164 format (e.g., +12345678900)\n\n- `environment?: string`\n Environment name (default: production)\n\n- `outboundDialHttpRequestDefinitionId?: string`\n ID of the HTTP request definition for outbound dialing (required when outboundDialType is HTTP_REQUEST)\n\n- `outboundDialType?: 'NONE' | 'HTTP_REQUEST'`\n Outbound dial type: NONE or HTTP_REQUEST (default: NONE)\n\n### Returns\n\n- `{ data: { id: string; agentId: string; createdAt: string; direction: 'INCOMING' | 'OUTGOING' | 'INCOMING_AND_OUTGOING'; environment: string; outboundDialHttpRequestDefinitionId: string; outboundDialType: 'NONE' | 'HTTP_REQUEST'; type: 'PHONE' | 'WEBSOCKET' | 'LIVEKIT' | 'SMALL_WEBRTC' | 'ELEVENLABS_WS' | 'KORE' | 'GOOGLE_CES'; updatedAt: string; value: string; }; }`\n\n - `data: { id: string; agentId: string; createdAt: string; direction: 'INCOMING' | 'OUTGOING' | 'INCOMING_AND_OUTGOING'; environment: string; outboundDialHttpRequestDefinitionId: string; outboundDialType: 'NONE' | 'HTTP_REQUEST'; type: 'PHONE' | 'WEBSOCKET' | 'LIVEKIT' | 'SMALL_WEBRTC' | 'ELEVENLABS_WS' | 'KORE' | 'GOOGLE_CES'; updatedAt: string; value: string; }`\n\n### Example\n\n```typescript\nimport Roark from '@roarkanalytics/sdk';\n\nconst client = new Roark();\n\nconst agentEndpoint = await client.agentEndpoint.create({\n agentId: '182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e',\n direction: 'INCOMING',\n value: 'value',\n});\n\nconsole.log(agentEndpoint);\n```",
1285
+ perLanguage: {
1286
+ http: {
1287
+ example: 'curl https://api.roark.ai/v1/agent/endpoint \\\n -H \'Content-Type: application/json\' \\\n -H "Authorization: Bearer $ROARK_API_BEARER_TOKEN" \\\n -d \'{\n "agentId": "182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e",\n "direction": "INCOMING",\n "value": "value"\n }\'',
1288
+ },
1289
+ python: {
1290
+ method: 'agent_endpoint.create',
1291
+ example: 'import os\nfrom roark_analytics import Roark\n\nclient = Roark(\n bearer_token=os.environ.get("ROARK_API_BEARER_TOKEN"), # This is the default and can be omitted\n)\nagent_endpoint = client.agent_endpoint.create(\n agent_id="182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e",\n direction="INCOMING",\n value="value",\n)\nprint(agent_endpoint.data)',
1292
+ },
1293
+ typescript: {
1294
+ method: 'client.agentEndpoint.create',
1295
+ example: "import Roark from '@roarkanalytics/sdk';\n\nconst client = new Roark({\n bearerToken: process.env['ROARK_API_BEARER_TOKEN'], // This is the default and can be omitted\n});\n\nconst agentEndpoint = await client.agentEndpoint.create({\n agentId: '182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e',\n direction: 'INCOMING',\n value: 'value',\n});\n\nconsole.log(agentEndpoint.data);",
1296
+ },
1297
+ },
1298
+ },
1299
+ {
1300
+ name: 'update',
1301
+ endpoint: '/v1/agent/endpoint/{endpointId}',
1302
+ httpMethod: 'put',
1303
+ summary: 'Update an agent endpoint',
1304
+ description: 'Updates an existing agent endpoint by its ID. Only environment and outboundDialType can be modified.',
1305
+ stainlessPath: '(resource) agentEndpoint > (method) update',
1306
+ qualified: 'client.agentEndpoint.update',
1307
+ params: [
1308
+ 'endpointId: string;',
1309
+ 'environment?: string;',
1310
+ 'outboundDialHttpRequestDefinitionId?: string;',
1311
+ "outboundDialType?: 'NONE' | 'HTTP_REQUEST';",
1312
+ ],
1313
+ response: "{ data: { id: string; agentId: string; createdAt: string; direction: 'INCOMING' | 'OUTGOING' | 'INCOMING_AND_OUTGOING'; environment: string; outboundDialHttpRequestDefinitionId: string; outboundDialType: 'NONE' | 'HTTP_REQUEST'; type: 'PHONE' | 'WEBSOCKET' | 'LIVEKIT' | 'SMALL_WEBRTC' | 'ELEVENLABS_WS' | 'KORE' | 'GOOGLE_CES'; updatedAt: string; value: string; }; }",
1314
+ markdown: "## update\n\n`client.agentEndpoint.update(endpointId: string, environment?: string, outboundDialHttpRequestDefinitionId?: string, outboundDialType?: 'NONE' | 'HTTP_REQUEST'): { data: object; }`\n\n**put** `/v1/agent/endpoint/{endpointId}`\n\nUpdates an existing agent endpoint by its ID. Only environment and outboundDialType can be modified.\n\n### Parameters\n\n- `endpointId: string`\n\n- `environment?: string`\n Environment name\n\n- `outboundDialHttpRequestDefinitionId?: string`\n ID of the HTTP request definition for outbound dialing\n\n- `outboundDialType?: 'NONE' | 'HTTP_REQUEST'`\n Outbound dial type: NONE or HTTP_REQUEST\n\n### Returns\n\n- `{ data: { id: string; agentId: string; createdAt: string; direction: 'INCOMING' | 'OUTGOING' | 'INCOMING_AND_OUTGOING'; environment: string; outboundDialHttpRequestDefinitionId: string; outboundDialType: 'NONE' | 'HTTP_REQUEST'; type: 'PHONE' | 'WEBSOCKET' | 'LIVEKIT' | 'SMALL_WEBRTC' | 'ELEVENLABS_WS' | 'KORE' | 'GOOGLE_CES'; updatedAt: string; value: string; }; }`\n\n - `data: { id: string; agentId: string; createdAt: string; direction: 'INCOMING' | 'OUTGOING' | 'INCOMING_AND_OUTGOING'; environment: string; outboundDialHttpRequestDefinitionId: string; outboundDialType: 'NONE' | 'HTTP_REQUEST'; type: 'PHONE' | 'WEBSOCKET' | 'LIVEKIT' | 'SMALL_WEBRTC' | 'ELEVENLABS_WS' | 'KORE' | 'GOOGLE_CES'; updatedAt: string; value: string; }`\n\n### Example\n\n```typescript\nimport Roark from '@roarkanalytics/sdk';\n\nconst client = new Roark();\n\nconst agentEndpoint = await client.agentEndpoint.update('endpointId');\n\nconsole.log(agentEndpoint);\n```",
1315
+ perLanguage: {
1316
+ http: {
1317
+ example: 'curl https://api.roark.ai/v1/agent/endpoint/$ENDPOINT_ID \\\n -X PUT \\\n -H "Authorization: Bearer $ROARK_API_BEARER_TOKEN"',
1318
+ },
1319
+ python: {
1320
+ method: 'agent_endpoint.update',
1321
+ example: 'import os\nfrom roark_analytics import Roark\n\nclient = Roark(\n bearer_token=os.environ.get("ROARK_API_BEARER_TOKEN"), # This is the default and can be omitted\n)\nagent_endpoint = client.agent_endpoint.update(\n endpoint_id="endpointId",\n)\nprint(agent_endpoint.data)',
1322
+ },
1323
+ typescript: {
1324
+ method: 'client.agentEndpoint.update',
1325
+ example: "import Roark from '@roarkanalytics/sdk';\n\nconst client = new Roark({\n bearerToken: process.env['ROARK_API_BEARER_TOKEN'], // This is the default and can be omitted\n});\n\nconst agentEndpoint = await client.agentEndpoint.update('endpointId');\n\nconsole.log(agentEndpoint.data);",
1326
+ },
1327
+ },
1328
+ },
1329
+ {
1330
+ name: 'list',
1331
+ endpoint: '/v1/http-request-definition',
1332
+ httpMethod: 'get',
1333
+ summary: 'List HTTP request definitions',
1334
+ description: 'Returns a paginated list of HTTP request definitions for the authenticated project.',
1335
+ stainlessPath: '(resource) httpRequestDefinition > (method) list',
1336
+ qualified: 'client.httpRequestDefinition.list',
1337
+ params: ['after?: string;', 'limit?: number;'],
1338
+ response: "{ data: { id: string; body: string; createdAt: string; description: string; headers: object; method: 'POST' | 'PUT' | 'PATCH' | 'GET'; parsedBody: object | string; scope: 'AGENT_OUTBOUND_DIAL'; updatedAt: string; url: string; }[]; pagination: { hasMore: boolean; nextCursor: string; total: number; }; }",
1339
+ markdown: "## list\n\n`client.httpRequestDefinition.list(after?: string, limit?: number): { data: object[]; pagination: object; }`\n\n**get** `/v1/http-request-definition`\n\nReturns a paginated list of HTTP request definitions for the authenticated project.\n\n### Parameters\n\n- `after?: string`\n Cursor for pagination - definition ID to start after\n\n- `limit?: number`\n Maximum number of definitions to return (default: 20, max: 50)\n\n### Returns\n\n- `{ data: { id: string; body: string; createdAt: string; description: string; headers: object; method: 'POST' | 'PUT' | 'PATCH' | 'GET'; parsedBody: object | string; scope: 'AGENT_OUTBOUND_DIAL'; updatedAt: string; url: string; }[]; pagination: { hasMore: boolean; nextCursor: string; total: number; }; }`\n\n - `data: { id: string; body: string; createdAt: string; description: string; headers: object; method: 'POST' | 'PUT' | 'PATCH' | 'GET'; parsedBody: object | string; scope: 'AGENT_OUTBOUND_DIAL'; updatedAt: string; url: string; }[]`\n - `pagination: { hasMore: boolean; nextCursor: string; total: number; }`\n\n### Example\n\n```typescript\nimport Roark from '@roarkanalytics/sdk';\n\nconst client = new Roark();\n\nconst httpRequestDefinitions = await client.httpRequestDefinition.list();\n\nconsole.log(httpRequestDefinitions);\n```",
1340
+ perLanguage: {
1341
+ http: {
1342
+ example: 'curl https://api.roark.ai/v1/http-request-definition \\\n -H "Authorization: Bearer $ROARK_API_BEARER_TOKEN"',
1343
+ },
1344
+ python: {
1345
+ method: 'http_request_definition.list',
1346
+ example: 'import os\nfrom roark_analytics import Roark\n\nclient = Roark(\n bearer_token=os.environ.get("ROARK_API_BEARER_TOKEN"), # This is the default and can be omitted\n)\nhttp_request_definitions = client.http_request_definition.list()\nprint(http_request_definitions.data)',
1347
+ },
1348
+ typescript: {
1349
+ method: 'client.httpRequestDefinition.list',
1350
+ example: "import Roark from '@roarkanalytics/sdk';\n\nconst client = new Roark({\n bearerToken: process.env['ROARK_API_BEARER_TOKEN'], // This is the default and can be omitted\n});\n\nconst httpRequestDefinitions = await client.httpRequestDefinition.list();\n\nconsole.log(httpRequestDefinitions.data);",
1351
+ },
1352
+ },
1353
+ },
1354
+ {
1355
+ name: 'getById',
1356
+ endpoint: '/v1/http-request-definition/{definitionId}',
1357
+ httpMethod: 'get',
1358
+ summary: 'Get HTTP request definition by ID',
1359
+ description: 'Returns a specific HTTP request definition by its ID.',
1360
+ stainlessPath: '(resource) httpRequestDefinition > (method) getById',
1361
+ qualified: 'client.httpRequestDefinition.getByID',
1362
+ params: ['definitionId: string;'],
1363
+ response: "{ data: { id: string; body: string; createdAt: string; description: string; headers: object; method: 'POST' | 'PUT' | 'PATCH' | 'GET'; parsedBody: object | string; scope: 'AGENT_OUTBOUND_DIAL'; updatedAt: string; url: string; }; }",
1364
+ markdown: "## getById\n\n`client.httpRequestDefinition.getByID(definitionId: string): { data: object; }`\n\n**get** `/v1/http-request-definition/{definitionId}`\n\nReturns a specific HTTP request definition by its ID.\n\n### Parameters\n\n- `definitionId: string`\n\n### Returns\n\n- `{ data: { id: string; body: string; createdAt: string; description: string; headers: object; method: 'POST' | 'PUT' | 'PATCH' | 'GET'; parsedBody: object | string; scope: 'AGENT_OUTBOUND_DIAL'; updatedAt: string; url: string; }; }`\n\n - `data: { id: string; body: string; createdAt: string; description: string; headers: object; method: 'POST' | 'PUT' | 'PATCH' | 'GET'; parsedBody: object | string; scope: 'AGENT_OUTBOUND_DIAL'; updatedAt: string; url: string; }`\n\n### Example\n\n```typescript\nimport Roark from '@roarkanalytics/sdk';\n\nconst client = new Roark();\n\nconst response = await client.httpRequestDefinition.getByID('definitionId');\n\nconsole.log(response);\n```",
1365
+ perLanguage: {
1366
+ http: {
1367
+ example: 'curl https://api.roark.ai/v1/http-request-definition/$DEFINITION_ID \\\n -H "Authorization: Bearer $ROARK_API_BEARER_TOKEN"',
1368
+ },
1369
+ python: {
1370
+ method: 'http_request_definition.get_by_id',
1371
+ example: 'import os\nfrom roark_analytics import Roark\n\nclient = Roark(\n bearer_token=os.environ.get("ROARK_API_BEARER_TOKEN"), # This is the default and can be omitted\n)\nresponse = client.http_request_definition.get_by_id(\n "definitionId",\n)\nprint(response.data)',
1372
+ },
1373
+ typescript: {
1374
+ method: 'client.httpRequestDefinition.getByID',
1375
+ example: "import Roark from '@roarkanalytics/sdk';\n\nconst client = new Roark({\n bearerToken: process.env['ROARK_API_BEARER_TOKEN'], // This is the default and can be omitted\n});\n\nconst response = await client.httpRequestDefinition.getByID('definitionId');\n\nconsole.log(response.data);",
1376
+ },
1377
+ },
1378
+ },
1379
+ {
1380
+ name: 'create',
1381
+ endpoint: '/v1/http-request-definition',
1382
+ httpMethod: 'post',
1383
+ summary: 'Create HTTP request definition',
1384
+ description: 'Creates a new HTTP request definition. The signing secret is only returned in this response and cannot be retrieved later.',
1385
+ stainlessPath: '(resource) httpRequestDefinition > (method) create',
1386
+ qualified: 'client.httpRequestDefinition.create',
1387
+ params: [
1388
+ "scope: 'AGENT_OUTBOUND_DIAL';",
1389
+ 'url: string;',
1390
+ 'body?: string | object;',
1391
+ 'description?: string;',
1392
+ 'headers?: object;',
1393
+ "method?: 'POST' | 'PUT' | 'PATCH' | 'GET';",
1394
+ ],
1395
+ response: "{ data: { id: string; body: string; createdAt: string; description: string; headers: object; method: 'POST' | 'PUT' | 'PATCH' | 'GET'; parsedBody: object | string; scope: 'AGENT_OUTBOUND_DIAL'; signingSecret: string; updatedAt: string; url: string; }; }",
1396
+ markdown: "## create\n\n`client.httpRequestDefinition.create(scope: 'AGENT_OUTBOUND_DIAL', url: string, body?: string | object, description?: string, headers?: object, method?: 'POST' | 'PUT' | 'PATCH' | 'GET'): { data: object; }`\n\n**post** `/v1/http-request-definition`\n\nCreates a new HTTP request definition. The signing secret is only returned in this response and cannot be retrieved later.\n\n### Parameters\n\n- `scope: 'AGENT_OUTBOUND_DIAL'`\n Scope: AGENT_OUTBOUND_DIAL\n\n- `url: string`\n URL for the HTTP request\n\n- `body?: string | object`\n Request body template. Accepts a JSON object or a string with placeholders like {{phoneNumberToDial}}. Objects are serialized to JSON for storage.\n\n- `description?: string`\n Description of the HTTP request definition\n\n- `headers?: object`\n Request headers as key-value pairs\n\n- `method?: 'POST' | 'PUT' | 'PATCH' | 'GET'`\n HTTP method (default: POST)\n\n### Returns\n\n- `{ data: { id: string; body: string; createdAt: string; description: string; headers: object; method: 'POST' | 'PUT' | 'PATCH' | 'GET'; parsedBody: object | string; scope: 'AGENT_OUTBOUND_DIAL'; signingSecret: string; updatedAt: string; url: string; }; }`\n\n - `data: { id: string; body: string; createdAt: string; description: string; headers: object; method: 'POST' | 'PUT' | 'PATCH' | 'GET'; parsedBody: object | string; scope: 'AGENT_OUTBOUND_DIAL'; signingSecret: string; updatedAt: string; url: string; }`\n\n### Example\n\n```typescript\nimport Roark from '@roarkanalytics/sdk';\n\nconst client = new Roark();\n\nconst httpRequestDefinition = await client.httpRequestDefinition.create({ scope: 'AGENT_OUTBOUND_DIAL', url: 'https://example.com' });\n\nconsole.log(httpRequestDefinition);\n```",
1397
+ perLanguage: {
1398
+ http: {
1399
+ example: 'curl https://api.roark.ai/v1/http-request-definition \\\n -H \'Content-Type: application/json\' \\\n -H "Authorization: Bearer $ROARK_API_BEARER_TOKEN" \\\n -d \'{\n "scope": "AGENT_OUTBOUND_DIAL",\n "url": "https://example.com"\n }\'',
1400
+ },
1401
+ python: {
1402
+ method: 'http_request_definition.create',
1403
+ example: 'import os\nfrom roark_analytics import Roark\n\nclient = Roark(\n bearer_token=os.environ.get("ROARK_API_BEARER_TOKEN"), # This is the default and can be omitted\n)\nhttp_request_definition = client.http_request_definition.create(\n scope="AGENT_OUTBOUND_DIAL",\n url="https://example.com",\n)\nprint(http_request_definition.data)',
1404
+ },
1405
+ typescript: {
1406
+ method: 'client.httpRequestDefinition.create',
1407
+ example: "import Roark from '@roarkanalytics/sdk';\n\nconst client = new Roark({\n bearerToken: process.env['ROARK_API_BEARER_TOKEN'], // This is the default and can be omitted\n});\n\nconst httpRequestDefinition = await client.httpRequestDefinition.create({\n scope: 'AGENT_OUTBOUND_DIAL',\n url: 'https://example.com',\n});\n\nconsole.log(httpRequestDefinition.data);",
1408
+ },
1409
+ },
1410
+ },
1411
+ {
1412
+ name: 'update',
1413
+ endpoint: '/v1/http-request-definition/{definitionId}',
1414
+ httpMethod: 'put',
1415
+ summary: 'Update HTTP request definition',
1416
+ description: 'Updates an existing HTTP request definition.',
1417
+ stainlessPath: '(resource) httpRequestDefinition > (method) update',
1418
+ qualified: 'client.httpRequestDefinition.update',
1419
+ params: [
1420
+ 'definitionId: string;',
1421
+ 'body?: string | object;',
1422
+ 'description?: string;',
1423
+ 'headers?: object;',
1424
+ "method?: 'POST' | 'PUT' | 'PATCH' | 'GET';",
1425
+ 'url?: string;',
1426
+ ],
1427
+ response: "{ data: { id: string; body: string; createdAt: string; description: string; headers: object; method: 'POST' | 'PUT' | 'PATCH' | 'GET'; parsedBody: object | string; scope: 'AGENT_OUTBOUND_DIAL'; updatedAt: string; url: string; }; }",
1428
+ markdown: "## update\n\n`client.httpRequestDefinition.update(definitionId: string, body?: string | object, description?: string, headers?: object, method?: 'POST' | 'PUT' | 'PATCH' | 'GET', url?: string): { data: object; }`\n\n**put** `/v1/http-request-definition/{definitionId}`\n\nUpdates an existing HTTP request definition.\n\n### Parameters\n\n- `definitionId: string`\n\n- `body?: string | object`\n Request body template. Accepts a JSON object or a string with placeholders like {{phoneNumberToDial}}. Objects are serialized to JSON for storage.\n\n- `description?: string`\n Description of the HTTP request definition\n\n- `headers?: object`\n Request headers as key-value pairs\n\n- `method?: 'POST' | 'PUT' | 'PATCH' | 'GET'`\n HTTP method: POST, PUT, PATCH, or GET\n\n- `url?: string`\n URL for the HTTP request\n\n### Returns\n\n- `{ data: { id: string; body: string; createdAt: string; description: string; headers: object; method: 'POST' | 'PUT' | 'PATCH' | 'GET'; parsedBody: object | string; scope: 'AGENT_OUTBOUND_DIAL'; updatedAt: string; url: string; }; }`\n\n - `data: { id: string; body: string; createdAt: string; description: string; headers: object; method: 'POST' | 'PUT' | 'PATCH' | 'GET'; parsedBody: object | string; scope: 'AGENT_OUTBOUND_DIAL'; updatedAt: string; url: string; }`\n\n### Example\n\n```typescript\nimport Roark from '@roarkanalytics/sdk';\n\nconst client = new Roark();\n\nconst httpRequestDefinition = await client.httpRequestDefinition.update('definitionId');\n\nconsole.log(httpRequestDefinition);\n```",
1429
+ perLanguage: {
1430
+ http: {
1431
+ example: 'curl https://api.roark.ai/v1/http-request-definition/$DEFINITION_ID \\\n -X PUT \\\n -H "Authorization: Bearer $ROARK_API_BEARER_TOKEN"',
1432
+ },
1433
+ python: {
1434
+ method: 'http_request_definition.update',
1435
+ example: 'import os\nfrom roark_analytics import Roark\n\nclient = Roark(\n bearer_token=os.environ.get("ROARK_API_BEARER_TOKEN"), # This is the default and can be omitted\n)\nhttp_request_definition = client.http_request_definition.update(\n definition_id="definitionId",\n)\nprint(http_request_definition.data)',
1436
+ },
1437
+ typescript: {
1438
+ method: 'client.httpRequestDefinition.update',
1439
+ example: "import Roark from '@roarkanalytics/sdk';\n\nconst client = new Roark({\n bearerToken: process.env['ROARK_API_BEARER_TOKEN'], // This is the default and can be omitted\n});\n\nconst httpRequestDefinition = await client.httpRequestDefinition.update('definitionId');\n\nconsole.log(httpRequestDefinition.data);",
1440
+ },
1441
+ },
1442
+ },
1443
+ {
1444
+ name: 'list',
1445
+ endpoint: '/v1/webhook',
1446
+ httpMethod: 'get',
1447
+ summary: 'List webhooks',
1448
+ description: 'Returns a paginated list of webhooks with their event subscriptions.',
1449
+ stainlessPath: '(resource) webhook > (method) list',
1450
+ qualified: 'client.webhook.list',
1451
+ params: ['after?: string;', 'limit?: number;'],
1452
+ response: '{ data: { id: string; createdAt: string; description: string; events: string[]; headers: object; updatedAt: string; url: string; }[]; pagination: { hasMore: boolean; nextCursor: string; total: number; }; }',
1453
+ markdown: "## list\n\n`client.webhook.list(after?: string, limit?: number): { data: object[]; pagination: object; }`\n\n**get** `/v1/webhook`\n\nReturns a paginated list of webhooks with their event subscriptions.\n\n### Parameters\n\n- `after?: string`\n Cursor for pagination - webhook ID to start after\n\n- `limit?: number`\n Maximum number of webhooks to return (default: 20, max: 50)\n\n### Returns\n\n- `{ data: { id: string; createdAt: string; description: string; events: string[]; headers: object; updatedAt: string; url: string; }[]; pagination: { hasMore: boolean; nextCursor: string; total: number; }; }`\n\n - `data: { id: string; createdAt: string; description: string; events: string[]; headers: object; updatedAt: string; url: string; }[]`\n - `pagination: { hasMore: boolean; nextCursor: string; total: number; }`\n\n### Example\n\n```typescript\nimport Roark from '@roarkanalytics/sdk';\n\nconst client = new Roark();\n\nconst webhooks = await client.webhook.list();\n\nconsole.log(webhooks);\n```",
1454
+ perLanguage: {
1455
+ http: {
1456
+ example: 'curl https://api.roark.ai/v1/webhook \\\n -H "Authorization: Bearer $ROARK_API_BEARER_TOKEN"',
1457
+ },
1458
+ python: {
1459
+ method: 'webhook.list',
1460
+ example: 'import os\nfrom roark_analytics import Roark\n\nclient = Roark(\n bearer_token=os.environ.get("ROARK_API_BEARER_TOKEN"), # This is the default and can be omitted\n)\nwebhooks = client.webhook.list()\nprint(webhooks.data)',
1461
+ },
1462
+ typescript: {
1463
+ method: 'client.webhook.list',
1464
+ example: "import Roark from '@roarkanalytics/sdk';\n\nconst client = new Roark({\n bearerToken: process.env['ROARK_API_BEARER_TOKEN'], // This is the default and can be omitted\n});\n\nconst webhooks = await client.webhook.list();\n\nconsole.log(webhooks.data);",
1465
+ },
1466
+ },
1467
+ },
1468
+ {
1469
+ name: 'getById',
1470
+ endpoint: '/v1/webhook/{webhookId}',
1471
+ httpMethod: 'get',
1472
+ summary: 'Get webhook by ID',
1473
+ description: 'Returns a specific webhook with its event subscriptions.',
1474
+ stainlessPath: '(resource) webhook > (method) getById',
1475
+ qualified: 'client.webhook.getByID',
1476
+ params: ['webhookId: string;'],
1477
+ response: '{ data: { id: string; createdAt: string; description: string; events: string[]; headers: object; updatedAt: string; url: string; }; }',
1478
+ markdown: "## getById\n\n`client.webhook.getByID(webhookId: string): { data: object; }`\n\n**get** `/v1/webhook/{webhookId}`\n\nReturns a specific webhook with its event subscriptions.\n\n### Parameters\n\n- `webhookId: string`\n\n### Returns\n\n- `{ data: { id: string; createdAt: string; description: string; events: string[]; headers: object; updatedAt: string; url: string; }; }`\n\n - `data: { id: string; createdAt: string; description: string; events: string[]; headers: object; updatedAt: string; url: string; }`\n\n### Example\n\n```typescript\nimport Roark from '@roarkanalytics/sdk';\n\nconst client = new Roark();\n\nconst response = await client.webhook.getByID('webhookId');\n\nconsole.log(response);\n```",
1479
+ perLanguage: {
1480
+ http: {
1481
+ example: 'curl https://api.roark.ai/v1/webhook/$WEBHOOK_ID \\\n -H "Authorization: Bearer $ROARK_API_BEARER_TOKEN"',
1482
+ },
1483
+ python: {
1484
+ method: 'webhook.get_by_id',
1485
+ example: 'import os\nfrom roark_analytics import Roark\n\nclient = Roark(\n bearer_token=os.environ.get("ROARK_API_BEARER_TOKEN"), # This is the default and can be omitted\n)\nresponse = client.webhook.get_by_id(\n "webhookId",\n)\nprint(response.data)',
1486
+ },
1487
+ typescript: {
1488
+ method: 'client.webhook.getByID',
1489
+ example: "import Roark from '@roarkanalytics/sdk';\n\nconst client = new Roark({\n bearerToken: process.env['ROARK_API_BEARER_TOKEN'], // This is the default and can be omitted\n});\n\nconst response = await client.webhook.getByID('webhookId');\n\nconsole.log(response.data);",
1490
+ },
1491
+ },
1492
+ },
1493
+ {
1494
+ name: 'create',
1495
+ endpoint: '/v1/webhook',
1496
+ httpMethod: 'post',
1497
+ summary: 'Create webhook',
1498
+ description: 'Creates a new webhook with event subscriptions. The signing secret is only returned in this response.',
1499
+ stainlessPath: '(resource) webhook > (method) create',
1500
+ qualified: 'client.webhook.create',
1501
+ params: ['events: string[];', 'url: string;', 'description?: string;', 'headers?: object;'],
1502
+ response: '{ data: { id: string; createdAt: string; description: string; events: string[]; headers: object; signingSecret: string; updatedAt: string; url: string; }; }',
1503
+ markdown: "## create\n\n`client.webhook.create(events: string[], url: string, description?: string, headers?: object): { data: object; }`\n\n**post** `/v1/webhook`\n\nCreates a new webhook with event subscriptions. The signing secret is only returned in this response.\n\n### Parameters\n\n- `events: string[]`\n Event types to subscribe to (at least one required)\n\n- `url: string`\n Webhook URL\n\n- `description?: string`\n Webhook description\n\n- `headers?: object`\n Request headers (e.g. authorization tokens)\n\n### Returns\n\n- `{ data: { id: string; createdAt: string; description: string; events: string[]; headers: object; signingSecret: string; updatedAt: string; url: string; }; }`\n\n - `data: { id: string; createdAt: string; description: string; events: string[]; headers: object; signingSecret: string; updatedAt: string; url: string; }`\n\n### Example\n\n```typescript\nimport Roark from '@roarkanalytics/sdk';\n\nconst client = new Roark();\n\nconst webhook = await client.webhook.create({ events: ['CALL_ANALYSIS_COMPLETED'], url: 'https://example.com' });\n\nconsole.log(webhook);\n```",
1504
+ perLanguage: {
1505
+ http: {
1506
+ example: 'curl https://api.roark.ai/v1/webhook \\\n -H \'Content-Type: application/json\' \\\n -H "Authorization: Bearer $ROARK_API_BEARER_TOKEN" \\\n -d \'{\n "events": [\n "CALL_ANALYSIS_COMPLETED"\n ],\n "url": "https://example.com"\n }\'',
1507
+ },
1508
+ python: {
1509
+ method: 'webhook.create',
1510
+ example: 'import os\nfrom roark_analytics import Roark\n\nclient = Roark(\n bearer_token=os.environ.get("ROARK_API_BEARER_TOKEN"), # This is the default and can be omitted\n)\nwebhook = client.webhook.create(\n events=["CALL_ANALYSIS_COMPLETED"],\n url="https://example.com",\n)\nprint(webhook.data)',
1511
+ },
1512
+ typescript: {
1513
+ method: 'client.webhook.create',
1514
+ example: "import Roark from '@roarkanalytics/sdk';\n\nconst client = new Roark({\n bearerToken: process.env['ROARK_API_BEARER_TOKEN'], // This is the default and can be omitted\n});\n\nconst webhook = await client.webhook.create({\n events: ['CALL_ANALYSIS_COMPLETED'],\n url: 'https://example.com',\n});\n\nconsole.log(webhook.data);",
1515
+ },
1516
+ },
1517
+ },
1518
+ {
1519
+ name: 'delete',
1520
+ endpoint: '/v1/webhook/{webhookId}',
1521
+ httpMethod: 'delete',
1522
+ summary: 'Delete webhook',
1523
+ description: 'Deletes a webhook and all its event subscriptions.',
1524
+ stainlessPath: '(resource) webhook > (method) delete',
1525
+ qualified: 'client.webhook.delete',
1526
+ params: ['webhookId: string;'],
1527
+ response: '{ data: { success: boolean; }; }',
1528
+ markdown: "## delete\n\n`client.webhook.delete(webhookId: string): { data: object; }`\n\n**delete** `/v1/webhook/{webhookId}`\n\nDeletes a webhook and all its event subscriptions.\n\n### Parameters\n\n- `webhookId: string`\n\n### Returns\n\n- `{ data: { success: boolean; }; }`\n\n - `data: { success: boolean; }`\n\n### Example\n\n```typescript\nimport Roark from '@roarkanalytics/sdk';\n\nconst client = new Roark();\n\nconst webhook = await client.webhook.delete('webhookId');\n\nconsole.log(webhook);\n```",
1529
+ perLanguage: {
1530
+ http: {
1531
+ example: 'curl https://api.roark.ai/v1/webhook/$WEBHOOK_ID \\\n -X DELETE \\\n -H "Authorization: Bearer $ROARK_API_BEARER_TOKEN"',
1532
+ },
1533
+ python: {
1534
+ method: 'webhook.delete',
1535
+ example: 'import os\nfrom roark_analytics import Roark\n\nclient = Roark(\n bearer_token=os.environ.get("ROARK_API_BEARER_TOKEN"), # This is the default and can be omitted\n)\nwebhook = client.webhook.delete(\n "webhookId",\n)\nprint(webhook.data)',
1536
+ },
1537
+ typescript: {
1538
+ method: 'client.webhook.delete',
1539
+ example: "import Roark from '@roarkanalytics/sdk';\n\nconst client = new Roark({\n bearerToken: process.env['ROARK_API_BEARER_TOKEN'], // This is the default and can be omitted\n});\n\nconst webhook = await client.webhook.delete('webhookId');\n\nconsole.log(webhook.data);",
1540
+ },
1541
+ },
1542
+ },
1543
+ ];
1544
+ const EMBEDDED_READMES = [
1545
+ {
1546
+ language: 'python',
1547
+ content: '# Roark Python API library\n\n<!-- prettier-ignore -->\n[![PyPI version](https://img.shields.io/pypi/v/roark_analytics.svg?label=pypi%20(stable))](https://pypi.org/project/roark_analytics/)\n\nThe Roark Python library provides convenient access to the Roark REST API from any Python 3.9+\napplication. The library includes type definitions for all request params and response fields,\nand offers both synchronous and asynchronous clients powered by [httpx](https://github.com/encode/httpx).\n\n\n\nIt is generated with [Stainless](https://www.stainless.com/).\n\n## MCP Server\n\nUse the Roark MCP Server to enable AI assistants to interact with this API, allowing them to explore endpoints, make test requests, and use documentation to help integrate this SDK into your application.\n\n[![Add to Cursor](https://cursor.com/deeplink/mcp-install-dark.svg)](https://cursor.com/en-US/install-mcp?name=%40roarkanalytics%2Fsdk-mcp&config=eyJjb21tYW5kIjoibnB4IiwiYXJncyI6WyIteSIsIkByb2Fya2FuYWx5dGljcy9zZGstbWNwIl0sImVudiI6eyJST0FSS19BUElfQkVBUkVSX1RPS0VOIjoiTXkgQmVhcmVyIFRva2VuIn19)\n[![Install in VS Code](https://img.shields.io/badge/_-Add_to_VS_Code-blue?style=for-the-badge&logo=data:image/svg%2bxml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIGZpbGw9Im5vbmUiIHZpZXdCb3g9IjAgMCA0MCA0MCI+PHBhdGggZmlsbD0iI0VFRSIgZmlsbC1ydWxlPSJldmVub2RkIiBkPSJNMzAuMjM1IDM5Ljg4NGEyLjQ5MSAyLjQ5MSAwIDAgMS0xLjc4MS0uNzNMMTIuNyAyNC43OGwtMy40NiAyLjYyNC0zLjQwNiAyLjU4MmExLjY2NSAxLjY2NSAwIDAgMS0xLjA4Mi4zMzggMS42NjQgMS42NjQgMCAwIDEtMS4wNDYtLjQzMWwtMi4yLTJhMS42NjYgMS42NjYgMCAwIDEgMC0yLjQ2M0w3LjQ1OCAyMCA0LjY3IDE3LjQ1MyAxLjUwNyAxNC41N2ExLjY2NSAxLjY2NSAwIDAgMSAwLTIuNDYzbDIuMi0yYTEuNjY1IDEuNjY1IDAgMCAxIDIuMTMtLjA5N2w2Ljg2MyA1LjIwOUwyOC40NTIuODQ0YTIuNDg4IDIuNDg4IDAgMCAxIDEuODQxLS43MjljLjM1MS4wMDkuNjk5LjA5MSAxLjAxOS4yNDVsOC4yMzYgMy45NjFhMi41IDIuNSAwIDAgMSAxLjQxNSAyLjI1M3YuMDk5LS4wNDVWMzMuMzd2LS4wNDUuMDk1YTIuNTAxIDIuNTAxIDAgMCAxLTEuNDE2IDIuMjU3bC04LjIzNSAzLjk2MWEyLjQ5MiAyLjQ5MiAwIDAgMS0xLjA3Ny4yNDZabS43MTYtMjguOTQ3LTExLjk0OCA5LjA2MiAxMS45NTIgOS4wNjUtLjAwNC0xOC4xMjdaIi8+PC9zdmc+)](https://vscode.stainless.com/mcp/%7B%22name%22%3A%22%40roarkanalytics%2Fsdk-mcp%22%2C%22command%22%3A%22npx%22%2C%22args%22%3A%5B%22-y%22%2C%22%40roarkanalytics%2Fsdk-mcp%22%5D%2C%22env%22%3A%7B%22ROARK_API_BEARER_TOKEN%22%3A%22My%20Bearer%20Token%22%7D%7D)\n\n> Note: You may need to set environment variables in your MCP client.\n\n## Documentation\n\nThe REST API documentation can be found on [docs.roark.ai](https://docs.roark.ai). The full API of this library can be found in [api.md](api.md).\n\n## Installation\n\n```sh\n# install from PyPI\npip install roark_analytics\n```\n\n## Usage\n\nThe full API of this library can be found in [api.md](api.md).\n\n```python\nimport os\nfrom roark_analytics import Roark\n\nclient = Roark(\n bearer_token=os.environ.get("ROARK_API_BEARER_TOKEN"), # This is the default and can be omitted\n)\n\ncall = client.call.create(\n call_direction="INBOUND",\n interface_type="PHONE",\n recording_url="https://example.com",\n started_at="startedAt",\n)\nprint(call.data)\n```\n\nWhile you can provide a `bearer_token` keyword argument,\nwe recommend using [python-dotenv](https://pypi.org/project/python-dotenv/)\nto add `ROARK_API_BEARER_TOKEN="My Bearer Token"` to your `.env` file\nso that your Bearer Token is not stored in source control.\n\n## Async usage\n\nSimply import `AsyncRoark` instead of `Roark` and use `await` with each API call:\n\n```python\nimport os\nimport asyncio\nfrom roark_analytics import AsyncRoark\n\nclient = AsyncRoark(\n bearer_token=os.environ.get("ROARK_API_BEARER_TOKEN"), # This is the default and can be omitted\n)\n\nasync def main() -> None:\n call = await client.call.create(\n call_direction="INBOUND",\n interface_type="PHONE",\n recording_url="https://example.com",\n started_at="startedAt",\n )\n print(call.data)\n\nasyncio.run(main())\n```\n\nFunctionality between the synchronous and asynchronous clients is otherwise identical.\n\n### With aiohttp\n\nBy default, the async client uses `httpx` for HTTP requests. However, for improved concurrency performance you may also use `aiohttp` as the HTTP backend.\n\nYou can enable this by installing `aiohttp`:\n\n```sh\n# install from PyPI\npip install roark_analytics[aiohttp]\n```\n\nThen you can enable it by instantiating the client with `http_client=DefaultAioHttpClient()`:\n\n```python\nimport os\nimport asyncio\nfrom roark_analytics import DefaultAioHttpClient\nfrom roark_analytics import AsyncRoark\n\nasync def main() -> None:\n async with AsyncRoark(\n bearer_token=os.environ.get("ROARK_API_BEARER_TOKEN"), # This is the default and can be omitted\n http_client=DefaultAioHttpClient(),\n) as client:\n call = await client.call.create(\n call_direction="INBOUND",\n interface_type="PHONE",\n recording_url="https://example.com",\n started_at="startedAt",\n )\n print(call.data)\n\nasyncio.run(main())\n```\n\n\n\n## Using types\n\nNested request parameters are [TypedDicts](https://docs.python.org/3/library/typing.html#typing.TypedDict). Responses are [Pydantic models](https://docs.pydantic.dev) which also provide helper methods for things like:\n\n- Serializing back into JSON, `model.to_json()`\n- Converting to a dictionary, `model.to_dict()`\n\nTyped requests and responses provide autocomplete and documentation within your editor. If you would like to see type errors in VS Code to help catch bugs earlier, set `python.analysis.typeCheckingMode` to `basic`.\n\n\n\n## Nested params\n\nNested parameters are dictionaries, typed using `TypedDict`, for example:\n\n```python\nfrom roark_analytics import Roark\n\nclient = Roark()\n\ncall = client.call.create(\n call_direction="INBOUND",\n interface_type="PHONE",\n recording_url="https://example.com",\n started_at="startedAt",\n customer={\n "phone_number_e164": "phoneNumberE164"\n },\n)\nprint(call.customer)\n```\n\n\n\n## Handling errors\n\nWhen the library is unable to connect to the API (for example, due to network connection problems or a timeout), a subclass of `roark_analytics.APIConnectionError` is raised.\n\nWhen the API returns a non-success status code (that is, 4xx or 5xx\nresponse), a subclass of `roark_analytics.APIStatusError` is raised, containing `status_code` and `response` properties.\n\nAll errors inherit from `roark_analytics.APIError`.\n\n```python\nimport roark_analytics\nfrom roark_analytics import Roark\n\nclient = Roark()\n\ntry:\n client.call.create(\n call_direction="INBOUND",\n interface_type="PHONE",\n recording_url="https://example.com",\n started_at="startedAt",\n )\nexcept roark_analytics.APIConnectionError as e:\n print("The server could not be reached")\n print(e.__cause__) # an underlying Exception, likely raised within httpx.\nexcept roark_analytics.RateLimitError as e:\n print("A 429 status code was received; we should back off a bit.")\nexcept roark_analytics.APIStatusError as e:\n print("Another non-200-range status code was received")\n print(e.status_code)\n print(e.response)\n```\n\nError codes are as follows:\n\n| Status Code | Error Type |\n| ----------- | -------------------------- |\n| 400 | `BadRequestError` |\n| 401 | `AuthenticationError` |\n| 403 | `PermissionDeniedError` |\n| 404 | `NotFoundError` |\n| 422 | `UnprocessableEntityError` |\n| 429 | `RateLimitError` |\n| >=500 | `InternalServerError` |\n| N/A | `APIConnectionError` |\n\n### Retries\n\nCertain errors are automatically retried 2 times by default, with a short exponential backoff.\nConnection errors (for example, due to a network connectivity problem), 408 Request Timeout, 409 Conflict,\n429 Rate Limit, and >=500 Internal errors are all retried by default.\n\nYou can use the `max_retries` option to configure or disable retry settings:\n\n```python\nfrom roark_analytics import Roark\n\n# Configure the default for all requests:\nclient = Roark(\n # default is 2\n max_retries=0,\n)\n\n# Or, configure per-request:\nclient.with_options(max_retries = 5).call.create(\n call_direction="INBOUND",\n interface_type="PHONE",\n recording_url="https://example.com",\n started_at="startedAt",\n)\n```\n\n### Timeouts\n\nBy default requests time out after 1 minute. You can configure this with a `timeout` option,\nwhich accepts a float or an [`httpx.Timeout`](https://www.python-httpx.org/advanced/timeouts/#fine-tuning-the-configuration) object:\n\n```python\nfrom roark_analytics import Roark\n\n# Configure the default for all requests:\nclient = Roark(\n # 20 seconds (default is 1 minute)\n timeout=20.0,\n)\n\n# More granular control:\nclient = Roark(\n timeout=httpx.Timeout(60.0, read=5.0, write=10.0, connect=2.0),\n)\n\n# Override per-request:\nclient.with_options(timeout = 5.0).call.create(\n call_direction="INBOUND",\n interface_type="PHONE",\n recording_url="https://example.com",\n started_at="startedAt",\n)\n```\n\nOn timeout, an `APITimeoutError` is thrown.\n\nNote that requests that time out are [retried twice by default](#retries).\n\n\n\n## Advanced\n\n### Logging\n\nWe use the standard library [`logging`](https://docs.python.org/3/library/logging.html) module.\n\nYou can enable logging by setting the environment variable `ROARK_LOG` to `info`.\n\n```shell\n$ export ROARK_LOG=info\n```\n\nOr to `debug` for more verbose logging.\n\n### How to tell whether `None` means `null` or missing\n\nIn an API response, a field may be explicitly `null`, or missing entirely; in either case, its value is `None` in this library. You can differentiate the two cases with `.model_fields_set`:\n\n```py\nif response.my_field is None:\n if \'my_field\' not in response.model_fields_set:\n print(\'Got json like {}, without a "my_field" key present at all.\')\n else:\n print(\'Got json like {"my_field": null}.\')\n```\n\n### Accessing raw response data (e.g. headers)\n\nThe "raw" Response object can be accessed by prefixing `.with_raw_response.` to any HTTP method call, e.g.,\n\n```py\nfrom roark_analytics import Roark\n\nclient = Roark()\nresponse = client.call.with_raw_response.create(\n call_direction="INBOUND",\n interface_type="PHONE",\n recording_url="https://example.com",\n started_at="startedAt",\n)\nprint(response.headers.get(\'X-My-Header\'))\n\ncall = response.parse() # get the object that `call.create()` would have returned\nprint(call.data)\n```\n\nThese methods return an [`APIResponse`](https://github.com/roarkhq/sdk-roark-analytics-python/tree/main/src/roark_analytics/_response.py) object.\n\nThe async client returns an [`AsyncAPIResponse`](https://github.com/roarkhq/sdk-roark-analytics-python/tree/main/src/roark_analytics/_response.py) with the same structure, the only difference being `await`able methods for reading the response content.\n\n#### `.with_streaming_response`\n\nThe above interface eagerly reads the full response body when you make the request, which may not always be what you want.\n\nTo stream the response body, use `.with_streaming_response` instead, which requires a context manager and only reads the response body once you call `.read()`, `.text()`, `.json()`, `.iter_bytes()`, `.iter_text()`, `.iter_lines()` or `.parse()`. In the async client, these are async methods.\n\n```python\nwith client.call.with_streaming_response.create(\n call_direction="INBOUND",\n interface_type="PHONE",\n recording_url="https://example.com",\n started_at="startedAt",\n) as response :\n print(response.headers.get(\'X-My-Header\'))\n\n for line in response.iter_lines():\n print(line)\n```\n\nThe context manager is required so that the response will reliably be closed.\n\n### Making custom/undocumented requests\n\nThis library is typed for convenient access to the documented API.\n\nIf you need to access undocumented endpoints, params, or response properties, the library can still be used.\n\n#### Undocumented endpoints\n\nTo make requests to undocumented endpoints, you can make requests using `client.get`, `client.post`, and other\nhttp verbs. Options on the client will be respected (such as retries) when making this request.\n\n```py\nimport httpx\n\nresponse = client.post(\n "/foo",\n cast_to=httpx.Response,\n body={"my_param": True},\n)\n\nprint(response.headers.get("x-foo"))\n```\n\n#### Undocumented request params\n\nIf you want to explicitly send an extra param, you can do so with the `extra_query`, `extra_body`, and `extra_headers` request\noptions.\n\n#### Undocumented response properties\n\nTo access undocumented response properties, you can access the extra fields like `response.unknown_prop`. You\ncan also get all the extra fields on the Pydantic model as a dict with\n[`response.model_extra`](https://docs.pydantic.dev/latest/api/base_model/#pydantic.BaseModel.model_extra).\n\n### Configuring the HTTP client\n\nYou can directly override the [httpx client](https://www.python-httpx.org/api/#client) to customize it for your use case, including:\n\n- Support for [proxies](https://www.python-httpx.org/advanced/proxies/)\n- Custom [transports](https://www.python-httpx.org/advanced/transports/)\n- Additional [advanced](https://www.python-httpx.org/advanced/clients/) functionality\n\n```python\nimport httpx\nfrom roark_analytics import Roark, DefaultHttpxClient\n\nclient = Roark(\n # Or use the `ROARK_BASE_URL` env var\n base_url="http://my.test.server.example.com:8083",\n http_client=DefaultHttpxClient(proxy="http://my.test.proxy.example.com", transport=httpx.HTTPTransport(local_address="0.0.0.0")),\n)\n```\n\nYou can also customize the client on a per-request basis by using `with_options()`:\n\n```python\nclient.with_options(http_client=DefaultHttpxClient(...))\n```\n\n### Managing HTTP resources\n\nBy default the library closes underlying HTTP connections whenever the client is [garbage collected](https://docs.python.org/3/reference/datamodel.html#object.__del__). You can manually close the client using the `.close()` method if desired, or with a context manager that closes when exiting.\n\n```py\nfrom roark_analytics import Roark\n\nwith Roark() as client:\n # make requests here\n ...\n\n# HTTP client is now closed\n```\n\n## Versioning\n\nThis package generally follows [SemVer](https://semver.org/spec/v2.0.0.html) conventions, though certain backwards-incompatible changes may be released as minor versions:\n\n1. Changes that only affect static types, without breaking runtime behavior.\n2. Changes to library internals which are technically public but not intended or documented for external use. _(Please open a GitHub issue to let us know if you are relying on such internals.)_\n3. Changes that we do not expect to impact the vast majority of users in practice.\n\nWe take backwards-compatibility seriously and work hard to ensure you can rely on a smooth upgrade experience.\n\nWe are keen for your feedback; please open an [issue](https://www.github.com/roarkhq/sdk-roark-analytics-python/issues) with questions, bugs, or suggestions.\n\n### Determining the installed version\n\nIf you\'ve upgraded to the latest version but aren\'t seeing any new features you were expecting then your python environment is likely still using an older version.\n\nYou can determine the version that is being used at runtime with:\n\n```py\nimport roark_analytics\nprint(roark_analytics.__version__)\n```\n\n## Requirements\n\nPython 3.9 or higher.\n\n## Contributing\n\nSee [the contributing documentation](./CONTRIBUTING.md).\n',
1548
+ },
1549
+ {
1550
+ language: 'typescript',
1551
+ content: "# Roark TypeScript API Library\n\n[![NPM version](https://img.shields.io/npm/v/@roarkanalytics/sdk.svg?label=npm%20(stable))](https://npmjs.org/package/@roarkanalytics/sdk) ![npm bundle size](https://img.shields.io/bundlephobia/minzip/@roarkanalytics/sdk)\n\nThis library provides convenient access to the Roark REST API from server-side TypeScript or JavaScript.\n\n\n\nThe REST API documentation can be found on [docs.roark.ai](https://docs.roark.ai). The full API of this library can be found in [api.md](api.md).\n\nIt is generated with [Stainless](https://www.stainless.com/).\n\n## MCP Server\n\nUse the Roark MCP Server to enable AI assistants to interact with this API, allowing them to explore endpoints, make test requests, and use documentation to help integrate this SDK into your application.\n\n[![Add to Cursor](https://cursor.com/deeplink/mcp-install-dark.svg)](https://cursor.com/en-US/install-mcp?name=%40roarkanalytics%2Fsdk-mcp&config=eyJjb21tYW5kIjoibnB4IiwiYXJncyI6WyIteSIsIkByb2Fya2FuYWx5dGljcy9zZGstbWNwIl0sImVudiI6eyJST0FSS19BUElfQkVBUkVSX1RPS0VOIjoiTXkgQmVhcmVyIFRva2VuIn19)\n[![Install in VS Code](https://img.shields.io/badge/_-Add_to_VS_Code-blue?style=for-the-badge&logo=data:image/svg%2bxml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIGZpbGw9Im5vbmUiIHZpZXdCb3g9IjAgMCA0MCA0MCI+PHBhdGggZmlsbD0iI0VFRSIgZmlsbC1ydWxlPSJldmVub2RkIiBkPSJNMzAuMjM1IDM5Ljg4NGEyLjQ5MSAyLjQ5MSAwIDAgMS0xLjc4MS0uNzNMMTIuNyAyNC43OGwtMy40NiAyLjYyNC0zLjQwNiAyLjU4MmExLjY2NSAxLjY2NSAwIDAgMS0xLjA4Mi4zMzggMS42NjQgMS42NjQgMCAwIDEtMS4wNDYtLjQzMWwtMi4yLTJhMS42NjYgMS42NjYgMCAwIDEgMC0yLjQ2M0w3LjQ1OCAyMCA0LjY3IDE3LjQ1MyAxLjUwNyAxNC41N2ExLjY2NSAxLjY2NSAwIDAgMSAwLTIuNDYzbDIuMi0yYTEuNjY1IDEuNjY1IDAgMCAxIDIuMTMtLjA5N2w2Ljg2MyA1LjIwOUwyOC40NTIuODQ0YTIuNDg4IDIuNDg4IDAgMCAxIDEuODQxLS43MjljLjM1MS4wMDkuNjk5LjA5MSAxLjAxOS4yNDVsOC4yMzYgMy45NjFhMi41IDIuNSAwIDAgMSAxLjQxNSAyLjI1M3YuMDk5LS4wNDVWMzMuMzd2LS4wNDUuMDk1YTIuNTAxIDIuNTAxIDAgMCAxLTEuNDE2IDIuMjU3bC04LjIzNSAzLjk2MWEyLjQ5MiAyLjQ5MiAwIDAgMS0xLjA3Ny4yNDZabS43MTYtMjguOTQ3LTExLjk0OCA5LjA2MiAxMS45NTIgOS4wNjUtLjAwNC0xOC4xMjdaIi8+PC9zdmc+)](https://vscode.stainless.com/mcp/%7B%22name%22%3A%22%40roarkanalytics%2Fsdk-mcp%22%2C%22command%22%3A%22npx%22%2C%22args%22%3A%5B%22-y%22%2C%22%40roarkanalytics%2Fsdk-mcp%22%5D%2C%22env%22%3A%7B%22ROARK_API_BEARER_TOKEN%22%3A%22My%20Bearer%20Token%22%7D%7D)\n\n> Note: You may need to set environment variables in your MCP client.\n\n## Installation\n\n```sh\nnpm install @roarkanalytics/sdk\n```\n\n\n\n## Usage\n\nThe full API of this library can be found in [api.md](api.md).\n\n<!-- prettier-ignore -->\n```js\nimport Roark from '@roarkanalytics/sdk';\n\nconst client = new Roark({\n bearerToken: process.env['ROARK_API_BEARER_TOKEN'], // This is the default and can be omitted\n});\n\nconst call = await client.call.create({\n callDirection: 'INBOUND',\n interfaceType: 'PHONE',\n recordingUrl: 'https://example.com',\n startedAt: 'startedAt',\n});\n\nconsole.log(call.data);\n```\n\n\n\n### Request & Response types\n\nThis library includes TypeScript definitions for all request params and response fields. You may import and use them like so:\n\n<!-- prettier-ignore -->\n```ts\nimport Roark from '@roarkanalytics/sdk';\n\nconst client = new Roark({\n bearerToken: process.env['ROARK_API_BEARER_TOKEN'], // This is the default and can be omitted\n});\n\nconst params: Roark.CallCreateParams = {\n callDirection: 'INBOUND',\n interfaceType: 'PHONE',\n recordingUrl: 'https://example.com',\n startedAt: 'startedAt',\n};\nconst call: Roark.CallCreateResponse = await client.call.create(params);\n```\n\nDocumentation for each method, request param, and response field are available in docstrings and will appear on hover in most modern editors.\n\n\n\n\n\n## Handling errors\n\nWhen the library is unable to connect to the API,\nor if the API returns a non-success status code (i.e., 4xx or 5xx response),\na subclass of `APIError` will be thrown:\n\n<!-- prettier-ignore -->\n```ts\nconst call = await client.call\n .create({\n callDirection: 'INBOUND',\n interfaceType: 'PHONE',\n recordingUrl: 'https://example.com',\n startedAt: 'startedAt',\n })\n .catch(async (err) => {\n if (err instanceof Roark.APIError) {\n console.log(err.status); // 400\n console.log(err.name); // BadRequestError\n console.log(err.headers); // {server: 'nginx', ...}\n } else {\n throw err;\n }\n });\n```\n\nError codes are as follows:\n\n| Status Code | Error Type |\n| ----------- | -------------------------- |\n| 400 | `BadRequestError` |\n| 401 | `AuthenticationError` |\n| 403 | `PermissionDeniedError` |\n| 404 | `NotFoundError` |\n| 422 | `UnprocessableEntityError` |\n| 429 | `RateLimitError` |\n| >=500 | `InternalServerError` |\n| N/A | `APIConnectionError` |\n\n### Retries\n\nCertain errors will be automatically retried 2 times by default, with a short exponential backoff.\nConnection errors (for example, due to a network connectivity problem), 408 Request Timeout, 409 Conflict,\n429 Rate Limit, and >=500 Internal errors will all be retried by default.\n\nYou can use the `maxRetries` option to configure or disable this:\n\n<!-- prettier-ignore -->\n```js\n// Configure the default for all requests:\nconst client = new Roark({\n maxRetries: 0, // default is 2\n});\n\n// Or, configure per-request:\nawait client.call.create({\n callDirection: 'INBOUND',\n interfaceType: 'PHONE',\n recordingUrl: 'https://example.com',\n startedAt: 'startedAt',\n}, {\n maxRetries: 5,\n});\n```\n\n### Timeouts\n\nRequests time out after 1 minute by default. You can configure this with a `timeout` option:\n\n<!-- prettier-ignore -->\n```ts\n// Configure the default for all requests:\nconst client = new Roark({\n timeout: 20 * 1000, // 20 seconds (default is 1 minute)\n});\n\n// Override per-request:\nawait client.call.create({\n callDirection: 'INBOUND',\n interfaceType: 'PHONE',\n recordingUrl: 'https://example.com',\n startedAt: 'startedAt',\n}, {\n timeout: 5 * 1000,\n});\n```\n\nOn timeout, an `APIConnectionTimeoutError` is thrown.\n\nNote that requests which time out will be [retried twice by default](#retries).\n\n\n\n\n\n## Advanced Usage\n\n### Accessing raw Response data (e.g., headers)\n\nThe \"raw\" `Response` returned by `fetch()` can be accessed through the `.asResponse()` method on the `APIPromise` type that all methods return.\nThis method returns as soon as the headers for a successful response are received and does not consume the response body, so you are free to write custom parsing or streaming logic.\n\nYou can also use the `.withResponse()` method to get the raw `Response` along with the parsed data.\nUnlike `.asResponse()` this method consumes the body, returning once it is parsed.\n\n<!-- prettier-ignore -->\n```ts\nconst client = new Roark();\n\nconst response = await client.call\n .create({\n callDirection: 'INBOUND',\n interfaceType: 'PHONE',\n recordingUrl: 'https://example.com',\n startedAt: 'startedAt',\n })\n .asResponse();\nconsole.log(response.headers.get('X-My-Header'));\nconsole.log(response.statusText); // access the underlying Response object\n\nconst { data: call, response: raw } = await client.call\n .create({\n callDirection: 'INBOUND',\n interfaceType: 'PHONE',\n recordingUrl: 'https://example.com',\n startedAt: 'startedAt',\n })\n .withResponse();\nconsole.log(raw.headers.get('X-My-Header'));\nconsole.log(call.data);\n```\n\n### Logging\n\n> [!IMPORTANT]\n> All log messages are intended for debugging only. The format and content of log messages\n> may change between releases.\n\n#### Log levels\n\nThe log level can be configured in two ways:\n\n1. Via the `ROARK_LOG` environment variable\n2. Using the `logLevel` client option (overrides the environment variable if set)\n\n```ts\nimport Roark from '@roarkanalytics/sdk';\n\nconst client = new Roark({\n logLevel: 'debug', // Show all log messages\n});\n```\n\nAvailable log levels, from most to least verbose:\n\n- `'debug'` - Show debug messages, info, warnings, and errors\n- `'info'` - Show info messages, warnings, and errors\n- `'warn'` - Show warnings and errors (default)\n- `'error'` - Show only errors\n- `'off'` - Disable all logging\n\nAt the `'debug'` level, all HTTP requests and responses are logged, including headers and bodies.\nSome authentication-related headers are redacted, but sensitive data in request and response bodies\nmay still be visible.\n\n#### Custom logger\n\nBy default, this library logs to `globalThis.console`. You can also provide a custom logger.\nMost logging libraries are supported, including [pino](https://www.npmjs.com/package/pino), [winston](https://www.npmjs.com/package/winston), [bunyan](https://www.npmjs.com/package/bunyan), [consola](https://www.npmjs.com/package/consola), [signale](https://www.npmjs.com/package/signale), and [@std/log](https://jsr.io/@std/log). If your logger doesn't work, please open an issue.\n\nWhen providing a custom logger, the `logLevel` option still controls which messages are emitted, messages\nbelow the configured level will not be sent to your logger.\n\n```ts\nimport Roark from '@roarkanalytics/sdk';\nimport pino from 'pino';\n\nconst logger = pino();\n\nconst client = new Roark({\n logger: logger.child({ name: 'Roark' }),\n logLevel: 'debug', // Send all messages to pino, allowing it to filter\n});\n```\n\n### Making custom/undocumented requests\n\nThis library is typed for convenient access to the documented API. If you need to access undocumented\nendpoints, params, or response properties, the library can still be used.\n\n#### Undocumented endpoints\n\nTo make requests to undocumented endpoints, you can use `client.get`, `client.post`, and other HTTP verbs.\nOptions on the client, such as retries, will be respected when making these requests.\n\n```ts\nawait client.post('/some/path', {\n body: { some_prop: 'foo' },\n query: { some_query_arg: 'bar' },\n});\n```\n\n#### Undocumented request params\n\nTo make requests using undocumented parameters, you may use `// @ts-expect-error` on the undocumented\nparameter. This library doesn't validate at runtime that the request matches the type, so any extra values you\nsend will be sent as-is.\n\n```ts\nclient.call.create({\n // ...\n // @ts-expect-error baz is not yet public\n baz: 'undocumented option',\n});\n```\n\nFor requests with the `GET` verb, any extra params will be in the query, all other requests will send the\nextra param in the body.\n\nIf you want to explicitly send an extra argument, you can do so with the `query`, `body`, and `headers` request\noptions.\n\n#### Undocumented response properties\n\nTo access undocumented response properties, you may access the response object with `// @ts-expect-error` on\nthe response object, or cast the response object to the requisite type. Like the request params, we do not\nvalidate or strip extra properties from the response from the API.\n\n### Customizing the fetch client\n\nBy default, this library expects a global `fetch` function is defined.\n\nIf you want to use a different `fetch` function, you can either polyfill the global:\n\n```ts\nimport fetch from 'my-fetch';\n\nglobalThis.fetch = fetch;\n```\n\nOr pass it to the client:\n\n```ts\nimport Roark from '@roarkanalytics/sdk';\nimport fetch from 'my-fetch';\n\nconst client = new Roark({ fetch });\n```\n\n### Fetch options\n\nIf you want to set custom `fetch` options without overriding the `fetch` function, you can provide a `fetchOptions` object when instantiating the client or making a request. (Request-specific options override client options.)\n\n```ts\nimport Roark from '@roarkanalytics/sdk';\n\nconst client = new Roark({\n fetchOptions: {\n // `RequestInit` options\n },\n});\n```\n\n#### Configuring proxies\n\nTo modify proxy behavior, you can provide custom `fetchOptions` that add runtime-specific proxy\noptions to requests:\n\n<img src=\"https://raw.githubusercontent.com/stainless-api/sdk-assets/refs/heads/main/node.svg\" align=\"top\" width=\"18\" height=\"21\"> **Node** <sup>[[docs](https://github.com/nodejs/undici/blob/main/docs/docs/api/ProxyAgent.md#example---proxyagent-with-fetch)]</sup>\n\n```ts\nimport Roark from '@roarkanalytics/sdk';\nimport * as undici from 'undici';\n\nconst proxyAgent = new undici.ProxyAgent('http://localhost:8888');\nconst client = new Roark({\n fetchOptions: {\n dispatcher: proxyAgent,\n },\n});\n```\n\n<img src=\"https://raw.githubusercontent.com/stainless-api/sdk-assets/refs/heads/main/bun.svg\" align=\"top\" width=\"18\" height=\"21\"> **Bun** <sup>[[docs](https://bun.sh/guides/http/proxy)]</sup>\n\n```ts\nimport Roark from '@roarkanalytics/sdk';\n\nconst client = new Roark({\n fetchOptions: {\n proxy: 'http://localhost:8888',\n },\n});\n```\n\n<img src=\"https://raw.githubusercontent.com/stainless-api/sdk-assets/refs/heads/main/deno.svg\" align=\"top\" width=\"18\" height=\"21\"> **Deno** <sup>[[docs](https://docs.deno.com/api/deno/~/Deno.createHttpClient)]</sup>\n\n```ts\nimport Roark from 'npm:@roarkanalytics/sdk';\n\nconst httpClient = Deno.createHttpClient({ proxy: { url: 'http://localhost:8888' } });\nconst client = new Roark({\n fetchOptions: {\n client: httpClient,\n },\n});\n```\n\n## Frequently Asked Questions\n\n## Semantic versioning\n\nThis package generally follows [SemVer](https://semver.org/spec/v2.0.0.html) conventions, though certain backwards-incompatible changes may be released as minor versions:\n\n1. Changes that only affect static types, without breaking runtime behavior.\n2. Changes to library internals which are technically public but not intended or documented for external use. _(Please open a GitHub issue to let us know if you are relying on such internals.)_\n3. Changes that we do not expect to impact the vast majority of users in practice.\n\nWe take backwards-compatibility seriously and work hard to ensure you can rely on a smooth upgrade experience.\n\nWe are keen for your feedback; please open an [issue](https://www.github.com/roarkhq/sdk-roark-analytics-node/issues) with questions, bugs, or suggestions.\n\n## Requirements\n\nTypeScript >= 4.9 is supported.\n\nThe following runtimes are supported:\n\n- Web browsers (Up-to-date Chrome, Firefox, Safari, Edge, and more)\n- Node.js 20 LTS or later ([non-EOL](https://endoflife.date/nodejs)) versions.\n- Deno v1.28.0 or higher.\n- Bun 1.0 or later.\n- Cloudflare Workers.\n- Vercel Edge Runtime.\n- Jest 28 or greater with the `\"node\"` environment (`\"jsdom\"` is not supported at this time).\n- Nitro v2.6 or greater.\n\nNote that React Native is not supported at this time.\n\nIf you are interested in other runtime environments, please open or upvote an issue on GitHub.\n\n## Contributing\n\nSee [the contributing documentation](./CONTRIBUTING.md).\n",
1552
+ },
1553
+ ];
1554
+ const INDEX_OPTIONS = {
1555
+ fields: [
1556
+ 'name',
1557
+ 'endpoint',
1558
+ 'summary',
1559
+ 'description',
1560
+ 'qualified',
1561
+ 'stainlessPath',
1562
+ 'content',
1563
+ 'sectionContext',
1564
+ ],
1565
+ storeFields: ['kind', '_original'],
1566
+ searchOptions: {
1567
+ prefix: true,
1568
+ fuzzy: 0.1,
1569
+ boost: {
1570
+ name: 5,
1571
+ stainlessPath: 3,
1572
+ endpoint: 3,
1573
+ qualified: 3,
1574
+ summary: 2,
1575
+ content: 1,
1576
+ description: 1,
1577
+ },
1578
+ },
1579
+ };
1580
+ /**
1581
+ * Self-contained local search engine backed by MiniSearch.
1582
+ * Method data is embedded at SDK build time; prose documents
1583
+ * can be loaded from an optional docs directory at runtime.
1584
+ */
1585
+ class LocalDocsSearch {
1586
+ methodIndex;
1587
+ proseIndex;
1588
+ constructor() {
1589
+ this.methodIndex = new minisearch_1.default(INDEX_OPTIONS);
1590
+ this.proseIndex = new minisearch_1.default(INDEX_OPTIONS);
1591
+ }
1592
+ static async create(opts) {
1593
+ const instance = new LocalDocsSearch();
1594
+ instance.indexMethods(EMBEDDED_METHODS);
1595
+ for (const readme of EMBEDDED_READMES) {
1596
+ instance.indexProse(readme.content, `readme:${readme.language}`);
1597
+ }
1598
+ if (opts?.docsDir) {
1599
+ await instance.loadDocsDirectory(opts.docsDir);
1600
+ }
1601
+ return instance;
1602
+ }
1603
+ search(props) {
1604
+ const { query, language = 'typescript', detail = 'default', maxResults = 5, maxLength = 100_000 } = props;
1605
+ const useMarkdown = detail === 'verbose' || detail === 'high';
1606
+ // Search both indices and merge results by score.
1607
+ // Filter prose hits so language-tagged content (READMEs and docs with
1608
+ // frontmatter) only matches the requested language.
1609
+ const methodHits = this.methodIndex
1610
+ .search(query)
1611
+ .map((hit) => ({ ...hit, _kind: 'http_method' }));
1612
+ const proseHits = this.proseIndex
1613
+ .search(query)
1614
+ .filter((hit) => {
1615
+ const source = hit['_original']?.source;
1616
+ if (!source)
1617
+ return true;
1618
+ // Check for language-tagged sources: "readme:<lang>" or "lang:<lang>:<filename>"
1619
+ let taggedLang;
1620
+ if (source.startsWith('readme:'))
1621
+ taggedLang = source.slice('readme:'.length);
1622
+ else if (source.startsWith('lang:'))
1623
+ taggedLang = source.split(':')[1];
1624
+ if (!taggedLang)
1625
+ return true;
1626
+ return taggedLang === language || (language === 'javascript' && taggedLang === 'typescript');
1627
+ })
1628
+ .map((hit) => ({ ...hit, _kind: 'prose' }));
1629
+ const merged = [...methodHits, ...proseHits].sort((a, b) => b.score - a.score);
1630
+ const top = merged.slice(0, maxResults);
1631
+ const fullResults = [];
1632
+ for (const hit of top) {
1633
+ const original = hit['_original'];
1634
+ if (hit._kind === 'http_method') {
1635
+ const m = original;
1636
+ if (useMarkdown && m.markdown) {
1637
+ fullResults.push(m.markdown);
1638
+ }
1639
+ else {
1640
+ // Use per-language data when available, falling back to the
1641
+ // top-level fields (which are TypeScript-specific in the
1642
+ // legacy codepath).
1643
+ const langData = m.perLanguage?.[language];
1644
+ fullResults.push({
1645
+ method: langData?.method ?? m.qualified,
1646
+ summary: m.summary,
1647
+ description: m.description,
1648
+ endpoint: `${m.httpMethod.toUpperCase()} ${m.endpoint}`,
1649
+ ...(langData?.example ? { example: langData.example } : {}),
1650
+ ...(m.params ? { params: m.params } : {}),
1651
+ ...(m.response ? { response: m.response } : {}),
1652
+ });
1653
+ }
1654
+ }
1655
+ else {
1656
+ const c = original;
1657
+ fullResults.push({
1658
+ content: c.content,
1659
+ ...(c.source ? { source: c.source } : {}),
1660
+ });
1661
+ }
1662
+ }
1663
+ let totalLength = 0;
1664
+ const results = [];
1665
+ for (const result of fullResults) {
1666
+ const len = typeof result === 'string' ? result.length : JSON.stringify(result).length;
1667
+ totalLength += len;
1668
+ if (totalLength > maxLength)
1669
+ break;
1670
+ results.push(result);
1671
+ }
1672
+ if (results.length < fullResults.length) {
1673
+ results.unshift(`Truncated; showing ${results.length} of ${fullResults.length} results.`);
1674
+ }
1675
+ return { results };
1676
+ }
1677
+ indexMethods(methods) {
1678
+ const docs = methods.map((m, i) => ({
1679
+ id: `method-${i}`,
1680
+ kind: 'http_method',
1681
+ name: m.name,
1682
+ endpoint: m.endpoint,
1683
+ summary: m.summary,
1684
+ description: m.description,
1685
+ qualified: m.qualified,
1686
+ stainlessPath: m.stainlessPath,
1687
+ _original: m,
1688
+ }));
1689
+ if (docs.length > 0) {
1690
+ this.methodIndex.addAll(docs);
1691
+ }
1692
+ }
1693
+ async loadDocsDirectory(docsDir) {
1694
+ let entries;
1695
+ try {
1696
+ entries = await fs.readdir(docsDir, { withFileTypes: true });
1697
+ }
1698
+ catch (err) {
1699
+ (0, logger_1.getLogger)().warn({ err, docsDir }, 'Could not read docs directory');
1700
+ return;
1701
+ }
1702
+ const files = entries
1703
+ .filter((e) => e.isFile())
1704
+ .filter((e) => e.name.endsWith('.md') || e.name.endsWith('.markdown') || e.name.endsWith('.json'));
1705
+ for (const file of files) {
1706
+ try {
1707
+ const filePath = path.join(docsDir, file.name);
1708
+ const content = await fs.readFile(filePath, 'utf-8');
1709
+ if (file.name.endsWith('.json')) {
1710
+ const texts = extractTexts(JSON.parse(content));
1711
+ if (texts.length > 0) {
1712
+ this.indexProse(texts.join('\n\n'), file.name);
1713
+ }
1714
+ }
1715
+ else {
1716
+ // Parse optional YAML frontmatter for language tagging.
1717
+ // Files with a "language" field in frontmatter will only
1718
+ // surface in searches for that language.
1719
+ //
1720
+ // Example:
1721
+ // ---
1722
+ // language: python
1723
+ // ---
1724
+ // # Error handling in Python
1725
+ // ...
1726
+ const frontmatter = parseFrontmatter(content);
1727
+ const source = frontmatter.language ? `lang:${frontmatter.language}:${file.name}` : file.name;
1728
+ this.indexProse(content, source);
1729
+ }
1730
+ }
1731
+ catch (err) {
1732
+ (0, logger_1.getLogger)().warn({ err, file: file.name }, 'Failed to index docs file');
1733
+ }
1734
+ }
1735
+ }
1736
+ indexProse(markdown, source) {
1737
+ const chunks = chunkMarkdown(markdown);
1738
+ const baseId = this.proseIndex.documentCount;
1739
+ const docs = chunks.map((chunk, i) => ({
1740
+ id: `prose-${baseId + i}`,
1741
+ kind: 'prose',
1742
+ content: chunk.content,
1743
+ ...(chunk.sectionContext != null ? { sectionContext: chunk.sectionContext } : {}),
1744
+ _original: { ...chunk, source },
1745
+ }));
1746
+ if (docs.length > 0) {
1747
+ this.proseIndex.addAll(docs);
1748
+ }
1749
+ }
1750
+ }
1751
+ exports.LocalDocsSearch = LocalDocsSearch;
1752
+ /** Lightweight markdown chunker — splits on headers, chunks by word count. */
1753
+ function chunkMarkdown(markdown) {
1754
+ // Strip YAML frontmatter
1755
+ const stripped = markdown.replace(/^---\n[\s\S]*?\n---\n?/, '');
1756
+ const lines = stripped.split('\n');
1757
+ const chunks = [];
1758
+ const headers = [];
1759
+ let current = [];
1760
+ const flush = () => {
1761
+ const text = current.join('\n').trim();
1762
+ if (!text)
1763
+ return;
1764
+ const sectionContext = headers.length > 0 ? headers.join(' > ') : undefined;
1765
+ // Split into ~200-word chunks
1766
+ const words = text.split(/\s+/);
1767
+ for (let i = 0; i < words.length; i += 200) {
1768
+ const slice = words.slice(i, i + 200).join(' ');
1769
+ if (slice) {
1770
+ chunks.push({ content: slice, tag: 'p', ...(sectionContext != null ? { sectionContext } : {}) });
1771
+ }
1772
+ }
1773
+ current = [];
1774
+ };
1775
+ for (const line of lines) {
1776
+ const headerMatch = line.match(/^(#{1,6})\s+(.+)/);
1777
+ if (headerMatch) {
1778
+ flush();
1779
+ const level = headerMatch[1].length;
1780
+ const text = headerMatch[2].trim();
1781
+ while (headers.length >= level)
1782
+ headers.pop();
1783
+ headers.push(text);
1784
+ }
1785
+ else {
1786
+ current.push(line);
1787
+ }
1788
+ }
1789
+ flush();
1790
+ return chunks;
1791
+ }
1792
+ /** Recursively extracts string values from a JSON structure. */
1793
+ function extractTexts(data, depth = 0) {
1794
+ if (depth > 10)
1795
+ return [];
1796
+ if (typeof data === 'string')
1797
+ return data.trim() ? [data] : [];
1798
+ if (Array.isArray(data))
1799
+ return data.flatMap((item) => extractTexts(item, depth + 1));
1800
+ if (typeof data === 'object' && data !== null) {
1801
+ return Object.values(data).flatMap((v) => extractTexts(v, depth + 1));
1802
+ }
1803
+ return [];
1804
+ }
1805
+ /** Parses YAML frontmatter from a markdown string, extracting the language field if present. */
1806
+ function parseFrontmatter(markdown) {
1807
+ const match = markdown.match(/^---\n([\s\S]*?)\n---/);
1808
+ if (!match)
1809
+ return {};
1810
+ const body = match[1] ?? '';
1811
+ const langMatch = body.match(/^language:\s*(.+)$/m);
1812
+ return langMatch ? { language: langMatch[1].trim() } : {};
1813
+ }
1814
+ //# sourceMappingURL=local-docs-search.js.map