@roarkanalytics/sdk-mcp 5.16.0 → 5.19.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 (94) hide show
  1. package/CHANGELOG.md +21 -0
  2. package/client-headers.d.mts +2 -2
  3. package/client-headers.d.ts +2 -2
  4. package/client-headers.js +1 -1
  5. package/client-headers.mjs +1 -1
  6. package/code-tool-worker.d.mts.map +1 -1
  7. package/code-tool-worker.d.ts.map +1 -1
  8. package/code-tool-worker.js +8 -0
  9. package/code-tool-worker.js.map +1 -1
  10. package/code-tool-worker.mjs +8 -0
  11. package/code-tool-worker.mjs.map +1 -1
  12. package/directory-output-schemas.d.mts +139 -0
  13. package/directory-output-schemas.d.mts.map +1 -0
  14. package/directory-output-schemas.d.ts +139 -0
  15. package/directory-output-schemas.d.ts.map +1 -0
  16. package/directory-output-schemas.js +251 -0
  17. package/directory-output-schemas.js.map +1 -0
  18. package/directory-output-schemas.mjs +248 -0
  19. package/directory-output-schemas.mjs.map +1 -0
  20. package/directory-tools.d.mts +2 -0
  21. package/directory-tools.d.mts.map +1 -1
  22. package/directory-tools.d.ts +2 -0
  23. package/directory-tools.d.ts.map +1 -1
  24. package/directory-tools.js +282 -109
  25. package/directory-tools.js.map +1 -1
  26. package/directory-tools.mjs +281 -108
  27. package/directory-tools.mjs.map +1 -1
  28. package/docs-search-tool.d.mts +10 -3
  29. package/docs-search-tool.d.mts.map +1 -1
  30. package/docs-search-tool.d.ts +10 -3
  31. package/docs-search-tool.d.ts.map +1 -1
  32. package/docs-search-tool.js +36 -6
  33. package/docs-search-tool.js.map +1 -1
  34. package/docs-search-tool.mjs +34 -5
  35. package/docs-search-tool.mjs.map +1 -1
  36. package/http.d.mts.map +1 -1
  37. package/http.d.ts.map +1 -1
  38. package/http.js +8 -7
  39. package/http.js.map +1 -1
  40. package/http.mjs +9 -8
  41. package/http.mjs.map +1 -1
  42. package/local-docs-search.d.mts.map +1 -1
  43. package/local-docs-search.d.ts.map +1 -1
  44. package/local-docs-search.js +220 -8
  45. package/local-docs-search.js.map +1 -1
  46. package/local-docs-search.mjs +220 -8
  47. package/local-docs-search.mjs.map +1 -1
  48. package/methods.d.mts.map +1 -1
  49. package/methods.d.ts.map +1 -1
  50. package/methods.js +48 -0
  51. package/methods.js.map +1 -1
  52. package/methods.mjs +48 -0
  53. package/methods.mjs.map +1 -1
  54. package/oauth.d.mts +16 -1
  55. package/oauth.d.mts.map +1 -1
  56. package/oauth.d.ts +16 -1
  57. package/oauth.d.ts.map +1 -1
  58. package/oauth.js +24 -1
  59. package/oauth.js.map +1 -1
  60. package/oauth.mjs +22 -0
  61. package/oauth.mjs.map +1 -1
  62. package/options.d.mts +10 -0
  63. package/options.d.mts.map +1 -1
  64. package/options.d.ts +10 -0
  65. package/options.d.ts.map +1 -1
  66. package/options.js +29 -3
  67. package/options.js.map +1 -1
  68. package/options.mjs +27 -3
  69. package/options.mjs.map +1 -1
  70. package/package.json +12 -2
  71. package/server.d.mts.map +1 -1
  72. package/server.d.ts.map +1 -1
  73. package/server.js +8 -1
  74. package/server.js.map +1 -1
  75. package/server.mjs +8 -1
  76. package/server.mjs.map +1 -1
  77. package/src/client-headers.ts +1 -1
  78. package/src/code-tool-worker.ts +8 -0
  79. package/src/directory-output-schemas.ts +318 -0
  80. package/src/directory-tools.ts +322 -93
  81. package/src/docs-search-tool.ts +42 -6
  82. package/src/http.ts +9 -7
  83. package/src/local-docs-search.ts +261 -8
  84. package/src/methods.ts +48 -0
  85. package/src/oauth.ts +28 -1
  86. package/src/options.ts +30 -3
  87. package/src/server.ts +9 -1
  88. package/src/types.ts +1 -0
  89. package/types.d.mts +1 -0
  90. package/types.d.mts.map +1 -1
  91. package/types.d.ts +1 -0
  92. package/types.d.ts.map +1 -1
  93. package/types.js.map +1 -1
  94. package/types.mjs.map +1 -1
@@ -1,7 +1,7 @@
1
1
  // File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
2
2
 
3
3
  import { Tool } from '@modelcontextprotocol/sdk/types.js';
4
- import { Metadata, McpRequestContext, asTextContentResult } from './types';
4
+ import { Metadata, McpRequestContext, ToolCallResult, asTextContentResult } from './types';
5
5
  import { getLogger } from './logger';
6
6
  import type { LocalDocsSearch } from './local-docs-search';
7
7
 
@@ -22,25 +22,43 @@ export const tool: Tool = {
22
22
  properties: {
23
23
  query: {
24
24
  type: 'string',
25
- description: 'The query to search for.',
25
+ description:
26
+ 'What to look up, in plain words: a task, method, or parameter, such as "create a persona" or "list calls by agent".',
26
27
  },
27
28
  language: {
28
29
  type: 'string',
29
- description: 'The language for the SDK to search for.',
30
+ description:
31
+ 'SDK language the signatures and examples are shown in. http returns the REST endpoints.',
30
32
  enum: ['http', 'python', 'go', 'typescript', 'javascript', 'terraform', 'ruby', 'java', 'kotlin'],
31
33
  },
32
34
  detail: {
33
35
  type: 'string',
34
- description: 'The amount of detail to return.',
36
+ description:
37
+ 'How much to return for each match: default gives a summary, verbose the full reference. When omitted, default.',
35
38
  enum: ['default', 'verbose'],
36
39
  },
37
40
  },
38
41
  required: ['query', 'language'],
39
42
  },
43
+ outputSchema: {
44
+ type: 'object',
45
+ properties: {
46
+ results: {
47
+ type: 'array',
48
+ description:
49
+ 'Matches, best first. A method match is an object with method, summary, description, endpoint, and, when known, example, params, and response; with detail verbose it is the full Markdown reference as a string. A documentation match is an object with content and source. When results were cut to fit, the first entry is a string saying how many are shown.',
50
+ items: {},
51
+ },
52
+ },
53
+ required: ['results'],
54
+ },
55
+ // Reads a fixed documentation corpus, so the result depends only on the input.
40
56
  annotations: {
41
57
  title: 'Search Roark docs',
42
58
  readOnlyHint: true,
43
59
  destructiveHint: false,
60
+ idempotentHint: true,
61
+ openWorldHint: false,
44
62
  },
45
63
  };
46
64
 
@@ -122,6 +140,24 @@ async function searchRemote(args: Record<string, unknown>, reqContext: McpReques
122
140
  return resultBody;
123
141
  }
124
142
 
143
+ /**
144
+ * The local index returns `{ results }`, and so does this tool, as structuredContent and as JSON
145
+ * text. The hosted search (`--docs-search-mode=stainless-api`) returns a body whose shape this
146
+ * package does not define: a body that already has a `results` array passes through, an array
147
+ * becomes `results`, and anything else becomes its only entry.
148
+ */
149
+ export const asResults = (results: unknown): ToolCallResult => {
150
+ const alreadyWrapped =
151
+ typeof results === 'object' &&
152
+ results !== null &&
153
+ Array.isArray((results as { results?: unknown }).results);
154
+ const body =
155
+ alreadyWrapped ?
156
+ { results: (results as { results: unknown[] }).results }
157
+ : { results: Array.isArray(results) ? results : [results] };
158
+ return { ...asTextContentResult(body), structuredContent: body };
159
+ };
160
+
125
161
  export const handler = async ({
126
162
  reqContext,
127
163
  args,
@@ -132,10 +168,10 @@ export const handler = async ({
132
168
  const body = args ?? {};
133
169
 
134
170
  if (_localSearch) {
135
- return asTextContentResult(await searchLocal(body));
171
+ return asResults(await searchLocal(body));
136
172
  }
137
173
 
138
- return asTextContentResult(await searchRemote(body, reqContext));
174
+ return asResults(await searchRemote(body, reqContext));
139
175
  };
140
176
 
141
177
  export default { metadata, tool, handler };
package/src/http.ts CHANGED
@@ -12,6 +12,7 @@ import { getLogger } from './logger';
12
12
  import { McpOptions, toolSurfaceFor } from './options';
13
13
  import {
14
14
  Connector,
15
+ oauthConfigForRequest,
15
16
  ORIGIN_CONNECTOR,
16
17
  protectedResourceMetadata,
17
18
  requireBearer,
@@ -55,7 +56,8 @@ const newServer = async ({
55
56
  let authOptions: Partial<ClientOptions>;
56
57
  if (mcpOptions.oauth) {
57
58
  const connector = connectorFrom(req);
58
- const authorized = requireBearer(req, mcpOptions.oauth, connector);
59
+ const oauth = oauthConfigForRequest(mcpOptions.oauth, req);
60
+ const authorized = requireBearer(req, oauth, connector);
59
61
  // Presence is not validity. Ask customer-api whether the token is still live, so a revoked or
60
62
  // expired one is answered with 401 + WWW-Authenticate here - the signal a client needs to
61
63
  // re-run the OAuth flow - rather than completing the handshake and failing later inside a
@@ -64,7 +66,7 @@ const newServer = async ({
64
66
  // The base URL is resolved the way the SDK resolves it, NOT defaulted to prod: this server is
65
67
  // launched without `clientOptions`, so on any stage but prod a prod default would check the
66
68
  // token against a server that never issued it and refuse every request.
67
- await requireLiveBearer(authorized.bearerToken, mcpOptions.oauth, connector, {
69
+ await requireLiveBearer(authorized.bearerToken, oauth, connector, {
68
70
  baseURL: resolveApiBaseUrl(clientOptions),
69
71
  });
70
72
  authOptions = authorized;
@@ -289,13 +291,13 @@ export const streamableHTTPApp = ({
289
291
  // served in remote OAuth mode.
290
292
  if (mcpOptions.oauth) {
291
293
  const oauth = mcpOptions.oauth;
292
- app.get('/.well-known/oauth-protected-resource', (_req, res) => {
293
- res.status(200).json(protectedResourceMetadata(oauth));
294
+ app.get('/.well-known/oauth-protected-resource', (req, res) => {
295
+ res.status(200).json(protectedResourceMetadata(oauthConfigForRequest(oauth, req)));
294
296
  });
295
297
  // The single connector. Its `resource` carries no project, which is what tells the
296
298
  // authorization server to mint a credential for the person rather than for one project.
297
- app.get('/.well-known/oauth-protected-resource/mcp', (_req, res) => {
298
- res.status(200).json(protectedResourceMetadata(oauth, { kind: 'mcp' }));
299
+ app.get('/.well-known/oauth-protected-resource/mcp', (req, res) => {
300
+ res.status(200).json(protectedResourceMetadata(oauthConfigForRequest(oauth, req), { kind: 'mcp' }));
299
301
  });
300
302
  app.get('/.well-known/oauth-protected-resource/mcp/:projectId', (req, res) => {
301
303
  const projectId = req.params['projectId'];
@@ -303,7 +305,7 @@ export const streamableHTTPApp = ({
303
305
  .status(200)
304
306
  .json(
305
307
  protectedResourceMetadata(
306
- oauth,
308
+ oauthConfigForRequest(oauth, req),
307
309
  typeof projectId === 'string' ? { kind: 'project', projectId } : undefined,
308
310
  ),
309
311
  );
@@ -292,9 +292,9 @@ const EMBEDDED_METHODS: MethodEntry[] = [
292
292
  "status?: 'RINGING' | 'IN_PROGRESS' | 'ENDED';",
293
293
  ],
294
294
  response:
295
- "{ data: { id: string; callDirection: 'INBOUND' | 'OUTBOUND'; projectId: string; recordingUrlAccess: 'AVAILABLE' | 'NOT_AVAILABLE' | 'RESTRICTED'; startedAt: string; agents?: { id: string; agentVersionId?: string; endpoint?: object; }[]; createdAt?: string; customers?: { label?: string; phoneNumberE164?: string; }[]; durationMs?: number; endedAt?: string; endedStatus?: string; externalId?: 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; }; }",
295
+ "{ data: { id: string; callDirection: 'INBOUND' | 'OUTBOUND'; projectId: string; recordingUrlAccess: 'AVAILABLE' | 'NOT_AVAILABLE' | 'RESTRICTED'; startedAt: string; agents?: { id: string; agentVersionId?: string; endpoint?: object; }[]; createdAt?: string; customers?: { customerProfileId?: string; label?: string; phoneNumberE164?: string; }[]; durationMs?: number; endedAt?: string; endedStatus?: string; externalId?: 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; }; }",
296
296
  markdown:
297
- "## list\n\n`client.call.list(after?: string, agentId?: string, countedInResults?: 'true' | 'false', excludeHiddenRuns?: 'true' | 'false', limit?: number, properties?: object, searchText?: string, simulationRunPlanIds?: string, simulationRunPlanJobId?: string, simulationRunPlanJobIds?: 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. Pass agentId to keep calls for specific agents, or properties[agent_name][eq] when you only have the agent name. sortBy and sortDirection apply together with those filters.\n\n### Parameters\n\n- `after?: string`\n Cursor for pagination - use the nextCursor value from a previous response\n\n- `agentId?: string`\n Calls that include any of these agents. One id, or several separated by commas, at most 100. A call with more than one agent matches when any of them is listed. An id that is not an agent on a call in this project matches nothing. Combines with the other filters, including sortBy and sortDirection.\n\n- `countedInResults?: 'true' | 'false'`\n true: only simulated calls their run's results count (not invalidated, for example because the agent never spoke). false: only the simulated calls the results leave out, each invalidated. Live calls, and calls removed from their run, match neither.\n\n- `excludeHiddenRuns?: 'true' | 'false'`\n true: leave out calls from runs hidden from the runs list. Live calls stay in. false is the same as leaving it out.\n\n- `limit?: number`\n Maximum number of calls to return (default: 20, max: 100)\n\n- `properties?: object`\n Filter on properties, one entry per property name. properties[<name>][exists]=true keeps calls that have the property set (whatever the value), properties[<name>][exists]=false keeps calls missing it (never sent, sent as null, or removed). properties[<name>][eq]=<value> keeps calls whose value equals it, ignoring case. agent_name and agent_id are built in and read the agents linked to the call, not a stored snapshot: agent_name matches an agent name, agent_id matches an agent id (a UUID). A call with several agents matches when any of them does. A custom property the project has never stored matches no calls under eq. Names match the way properties are stored, so planTier and plan_tier are one property, and agentName is agent_name. At most 20 properties. A name taken by a built-in call filter, such as status, is rejected with 400. One operator per property.\n\n- `searchText?: string`\n Search text to filter calls by title, summary, or transcript\n\n- `simulationRunPlanIds?: string`\n Calls from every run of any of these run plans, comma-separated, at most 100\n\n- `simulationRunPlanJobId?: string`\n Filter by simulation run plan job ID to get all calls from a specific simulation batch\n\n- `simulationRunPlanJobIds?: string`\n Calls from any of these simulation runs (run plan job ids), comma-separated, at most 100\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; recordingUrlAccess: 'AVAILABLE' | 'NOT_AVAILABLE' | 'RESTRICTED'; startedAt: string; agents?: { id: string; agentVersionId?: string; endpoint?: object; }[]; createdAt?: string; customers?: { label?: string; phoneNumberE164?: string; }[]; durationMs?: number; endedAt?: string; endedStatus?: string; externalId?: 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; recordingUrlAccess: 'AVAILABLE' | 'NOT_AVAILABLE' | 'RESTRICTED'; startedAt: string; agents?: { id: string; agentVersionId?: string; endpoint?: { id: string; environment: string; phoneNumberE164?: string; }; }[]; createdAt?: string; customers?: { label?: string; phoneNumberE164?: string; }[]; durationMs?: number; endedAt?: string; endedStatus?: string; externalId?: 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```",
297
+ "## list\n\n`client.call.list(after?: string, agentId?: string, countedInResults?: 'true' | 'false', excludeHiddenRuns?: 'true' | 'false', limit?: number, properties?: object, searchText?: string, simulationRunPlanIds?: string, simulationRunPlanJobId?: string, simulationRunPlanJobIds?: 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. Pass agentId to keep calls for specific agents, or properties[agent_name][eq] when you only have the agent name. sortBy and sortDirection apply together with those filters.\n\n### Parameters\n\n- `after?: string`\n Cursor for pagination - use the nextCursor value from a previous response\n\n- `agentId?: string`\n Calls that include any of these agents. One id, or several separated by commas, at most 100. A call with more than one agent matches when any of them is listed. An id that is not an agent on a call in this project matches nothing. Combines with the other filters, including sortBy and sortDirection.\n\n- `countedInResults?: 'true' | 'false'`\n true: only simulated calls their run's results count (not invalidated, for example because the agent never spoke). false: only the simulated calls the results leave out, each invalidated. Live calls, and calls removed from their run, match neither.\n\n- `excludeHiddenRuns?: 'true' | 'false'`\n true: leave out calls from runs hidden from the runs list. Live calls stay in. false is the same as leaving it out.\n\n- `limit?: number`\n Maximum number of calls to return (default: 20, max: 100)\n\n- `properties?: object`\n Filter on properties, one entry per property name. properties[<name>][exists]=true keeps calls that have the property set (whatever the value), properties[<name>][exists]=false keeps calls missing it (never sent, sent as null, or removed). properties[<name>][eq]=<value> keeps calls whose value equals it, ignoring case. agent_name and agent_id are built in and read the agents linked to the call, not a stored snapshot: agent_name matches an agent name, agent_id matches an agent id (a UUID). A call with several agents matches when any of them does. A custom property the project has never stored matches no calls under eq. Names match the way properties are stored, so planTier and plan_tier are one property, and agentName is agent_name. At most 20 properties. A name taken by a built-in call filter, such as status, is rejected with 400. One operator per property.\n\n- `searchText?: string`\n Search text to filter calls by title, summary, or transcript\n\n- `simulationRunPlanIds?: string`\n Calls from every run of any of these run plans, comma-separated, at most 100\n\n- `simulationRunPlanJobId?: string`\n Filter by simulation run plan job ID to get all calls from a specific simulation batch\n\n- `simulationRunPlanJobIds?: string`\n Calls from any of these simulation runs (run plan job ids), comma-separated, at most 100\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; recordingUrlAccess: 'AVAILABLE' | 'NOT_AVAILABLE' | 'RESTRICTED'; startedAt: string; agents?: { id: string; agentVersionId?: string; endpoint?: object; }[]; createdAt?: string; customers?: { customerProfileId?: string; label?: string; phoneNumberE164?: string; }[]; durationMs?: number; endedAt?: string; endedStatus?: string; externalId?: 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; recordingUrlAccess: 'AVAILABLE' | 'NOT_AVAILABLE' | 'RESTRICTED'; startedAt: string; agents?: { id: string; agentVersionId?: string; endpoint?: { id: string; environment: string; phoneNumberE164?: string; }; }[]; createdAt?: string; customers?: { customerProfileId?: string; label?: string; phoneNumberE164?: string; }[]; durationMs?: number; endedAt?: string; endedStatus?: string; externalId?: 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```",
298
298
  perLanguage: {
299
299
  typescript: {
300
300
  method: 'client.call.list',
@@ -327,8 +327,8 @@ const EMBEDDED_METHODS: MethodEntry[] = [
327
327
  'startedAt: string;',
328
328
  'agent?: { roarkId: string; endpoint?: { id: string; } | { type: string; value: string; direction?: string; }; prompt?: { resolvedPrompt: string; }; };',
329
329
  'agents?: { roarkId: string; endpoint?: { id: string; } | { type: string; value: string; direction?: string; }; prompt?: { resolvedPrompt: string; }; }[];',
330
- 'customer?: { phoneNumberE164: string; label?: string; };',
331
- 'customers?: { phoneNumberE164: string; label?: string; }[];',
330
+ 'customer?: { phoneNumberE164: string; externalId?: string; label?: string; };',
331
+ 'customers?: { phoneNumberE164: string; externalId?: string; label?: string; }[];',
332
332
  'endedStatus?: string;',
333
333
  'externalId?: string;',
334
334
  'livekitRoomId?: string;',
@@ -339,9 +339,9 @@ const EMBEDDED_METHODS: MethodEntry[] = [
339
339
  'vapiCallId?: string;',
340
340
  ],
341
341
  response:
342
- "{ data: { id: string; agents: { id: string; agentVersionId?: string; endpoint?: object; }[]; callDirection: 'INBOUND' | 'OUTBOUND'; createdAt: string; customers: { label?: string; phoneNumberE164?: string; }[]; externalId: string; projectId: string; startedAt: string; status: 'RINGING' | 'IN_PROGRESS' | 'ENDED'; }; }",
342
+ "{ data: { id: string; agents: { id: string; agentVersionId?: string; endpoint?: object; }[]; callDirection: 'INBOUND' | 'OUTBOUND'; createdAt: string; customers: { customerProfileId?: string; label?: string; phoneNumberE164?: string; }[]; externalId: string; projectId: string; startedAt: string; status: 'RINGING' | 'IN_PROGRESS' | 'ENDED'; }; }",
343
343
  markdown:
344
- "## 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; }; }, agents?: { roarkId: 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, externalId?: string, livekitRoomId?: 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; payload?: object; } | { endOffsetMs: number; role: 'CUSTOMER'; startOffsetMs: number; text: string; customer?: { label?: string; phoneNumberE164?: string; }; languageCode?: string; payload?: object; }[], vapiCallId?: 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; }; }`\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; }; }[]`\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\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- `externalId?: string`\n A stable identifier from your own system (e.g. session ID, conversation ID) used to correlate this call with OpenTelemetry traces. Set the same value as a `roark.external_id` span or resource attribute on your traces and the matching trace will be linked automatically. Must be unique within a project.\n\n- `livekitRoomId?: string`\n The LiveKit Cloud room ID to link this call with OpenTelemetry trace data from LiveKit. Used for matching calls with OTEL traces.\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; payload?: object; } | { endOffsetMs: number; role: 'CUSTOMER'; startOffsetMs: number; text: string; customer?: { label?: string; phoneNumberE164?: string; }; languageCode?: string; payload?: object; }[]`\n List of transcript entries made during the call\n\n- `vapiCallId?: string`\n The Vapi call ID (UUID) to link this call with OpenTelemetry trace data from Vapi. Used for matching calls with OTEL traces.\n\n### Returns\n\n- `{ data: { id: string; agents: { id: string; agentVersionId?: string; endpoint?: object; }[]; callDirection: 'INBOUND' | 'OUTBOUND'; createdAt: string; customers: { label?: string; phoneNumberE164?: string; }[]; externalId: string; projectId: string; startedAt: string; status: 'RINGING' | 'IN_PROGRESS' | 'ENDED'; }; }`\n\n - `data: { id: string; agents: { id: string; agentVersionId?: string; endpoint?: { id: string; environment: string; phoneNumberE164?: string; }; }[]; callDirection: 'INBOUND' | 'OUTBOUND'; createdAt: string; customers: { label?: string; phoneNumberE164?: string; }[]; externalId: 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```",
344
+ "## 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; }; }, agents?: { roarkId: string; endpoint?: { id: string; } | { type: string; value: string; direction?: string; }; prompt?: { resolvedPrompt: string; }; }[], customer?: { phoneNumberE164: string; externalId?: string; label?: string; }, customers?: { phoneNumberE164: string; externalId?: string; label?: string; }[], endedStatus?: string, externalId?: string, livekitRoomId?: 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; payload?: object; } | { endOffsetMs: number; role: 'CUSTOMER'; startOffsetMs: number; text: string; customer?: { label?: string; phoneNumberE164?: string; }; languageCode?: string; payload?: object; }[], vapiCallId?: 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; }; }`\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; }; }[]`\n Agents participating in the call. Each agent requires identification and prompt information.\n\n- `customer?: { phoneNumberE164: string; externalId?: string; label?: string; }`\n Single customer participating in the call. Use this for simpler API when you have only one customer.\n\n- `customers?: { phoneNumberE164: string; externalId?: 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- `externalId?: string`\n A stable identifier from your own system (e.g. session ID, conversation ID) used to correlate this call with OpenTelemetry traces. Set the same value as a `roark.external_id` span or resource attribute on your traces and the matching trace will be linked automatically. Must be unique within a project.\n\n- `livekitRoomId?: string`\n The LiveKit Cloud room ID to link this call with OpenTelemetry trace data from LiveKit. Used for matching calls with OTEL traces.\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; payload?: object; } | { endOffsetMs: number; role: 'CUSTOMER'; startOffsetMs: number; text: string; customer?: { label?: string; phoneNumberE164?: string; }; languageCode?: string; payload?: object; }[]`\n List of transcript entries made during the call\n\n- `vapiCallId?: string`\n The Vapi call ID (UUID) to link this call with OpenTelemetry trace data from Vapi. Used for matching calls with OTEL traces.\n\n### Returns\n\n- `{ data: { id: string; agents: { id: string; agentVersionId?: string; endpoint?: object; }[]; callDirection: 'INBOUND' | 'OUTBOUND'; createdAt: string; customers: { customerProfileId?: string; label?: string; phoneNumberE164?: string; }[]; externalId: string; projectId: string; startedAt: string; status: 'RINGING' | 'IN_PROGRESS' | 'ENDED'; }; }`\n\n - `data: { id: string; agents: { id: string; agentVersionId?: string; endpoint?: { id: string; environment: string; phoneNumberE164?: string; }; }[]; callDirection: 'INBOUND' | 'OUTBOUND'; createdAt: string; customers: { customerProfileId?: string; label?: string; phoneNumberE164?: string; }[]; externalId: 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```",
345
345
  perLanguage: {
346
346
  typescript: {
347
347
  method: 'client.call.create',
@@ -369,9 +369,9 @@ const EMBEDDED_METHODS: MethodEntry[] = [
369
369
  qualified: 'client.call.getByID',
370
370
  params: ['callId: string;'],
371
371
  response:
372
- "{ data: { id: string; callDirection: 'INBOUND' | 'OUTBOUND'; projectId: string; recordingUrlAccess: 'AVAILABLE' | 'NOT_AVAILABLE' | 'RESTRICTED'; startedAt: string; agents?: { id: string; agentVersionId?: string; endpoint?: object; }[]; createdAt?: string; customers?: { label?: string; phoneNumberE164?: string; }[]; durationMs?: number; endedAt?: string; endedStatus?: string; externalId?: string; policyIds?: string[]; properties?: object; recordingUrl?: string; simulationJobId?: string; status?: 'RINGING' | 'IN_PROGRESS' | 'ENDED'; summary?: string; supersededByCallId?: string; title?: string; updatedAt?: string; }; }",
372
+ "{ data: { id: string; callDirection: 'INBOUND' | 'OUTBOUND'; projectId: string; recordingUrlAccess: 'AVAILABLE' | 'NOT_AVAILABLE' | 'RESTRICTED'; startedAt: string; agents?: { id: string; agentVersionId?: string; endpoint?: object; }[]; createdAt?: string; customers?: { customerProfileId?: string; label?: string; phoneNumberE164?: string; }[]; durationMs?: number; endedAt?: string; endedStatus?: string; externalId?: string; policyIds?: string[]; properties?: object; recordingUrl?: string; simulationJobId?: string; status?: 'RINGING' | 'IN_PROGRESS' | 'ENDED'; summary?: string; supersededByCallId?: string; title?: string; updatedAt?: string; }; }",
373
373
  markdown:
374
- "## 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; recordingUrlAccess: 'AVAILABLE' | 'NOT_AVAILABLE' | 'RESTRICTED'; startedAt: string; agents?: { id: string; agentVersionId?: string; endpoint?: object; }[]; createdAt?: string; customers?: { label?: string; phoneNumberE164?: string; }[]; durationMs?: number; endedAt?: string; endedStatus?: string; externalId?: 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; recordingUrlAccess: 'AVAILABLE' | 'NOT_AVAILABLE' | 'RESTRICTED'; startedAt: string; agents?: { id: string; agentVersionId?: string; endpoint?: { id: string; environment: string; phoneNumberE164?: string; }; }[]; createdAt?: string; customers?: { label?: string; phoneNumberE164?: string; }[]; durationMs?: number; endedAt?: string; endedStatus?: string; externalId?: 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```",
374
+ "## 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; recordingUrlAccess: 'AVAILABLE' | 'NOT_AVAILABLE' | 'RESTRICTED'; startedAt: string; agents?: { id: string; agentVersionId?: string; endpoint?: object; }[]; createdAt?: string; customers?: { customerProfileId?: string; label?: string; phoneNumberE164?: string; }[]; durationMs?: number; endedAt?: string; endedStatus?: string; externalId?: 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; recordingUrlAccess: 'AVAILABLE' | 'NOT_AVAILABLE' | 'RESTRICTED'; startedAt: string; agents?: { id: string; agentVersionId?: string; endpoint?: { id: string; environment: string; phoneNumberE164?: string; }; }[]; createdAt?: string; customers?: { customerProfileId?: string; label?: string; phoneNumberE164?: string; }[]; durationMs?: number; endedAt?: string; endedStatus?: string; externalId?: 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```",
375
375
  perLanguage: {
376
376
  typescript: {
377
377
  method: 'client.call.getByID',
@@ -3177,6 +3177,259 @@ const EMBEDDED_METHODS: MethodEntry[] = [
3177
3177
  },
3178
3178
  },
3179
3179
  },
3180
+ {
3181
+ name: 'list',
3182
+ endpoint: '/v1/customer-profile',
3183
+ httpMethod: 'get',
3184
+ summary: 'List customer profiles',
3185
+ description:
3186
+ 'Returns the people who have talked to your agents in this project. Customers we hold nothing about beyond their identifier are left out unless includeNoData is true.',
3187
+ stainlessPath: '(resource) customerProfile > (method) list',
3188
+ qualified: 'client.customerProfile.list',
3189
+ params: [
3190
+ 'agentId?: string;',
3191
+ 'fieldKey?: string;',
3192
+ "fieldOperator?: 'EQUALS' | 'NOT_EQUALS' | 'CONTAINS' | 'STARTS_WITH' | 'IS_SET' | 'IS_NOT_SET';",
3193
+ 'fieldValue?: string;',
3194
+ "includeNoData?: 'true' | 'false';",
3195
+ 'limit?: number;',
3196
+ "modality?: 'call' | 'chat';",
3197
+ 'page?: number;',
3198
+ 'search?: string;',
3199
+ 'sortBy?: string;',
3200
+ "sortDirection?: 'asc' | 'desc';",
3201
+ ],
3202
+ response:
3203
+ '{ data: { items: { id: string; agentIds: string[]; attributes: object[]; chatCount: number; conversationCount: number; displayName: string; externalId: string; firstSeenAt: string; lastSeenAt: string; notes: string; notesUpdatedAt: string; phoneNumberE164: string; summary: string; talkTimeMs: number; voiceCount: number; }[]; page: number; totalCount: number; }; }',
3204
+ markdown:
3205
+ "## list\n\n`client.customerProfile.list(agentId?: string, fieldKey?: string, fieldOperator?: 'EQUALS' | 'NOT_EQUALS' | 'CONTAINS' | 'STARTS_WITH' | 'IS_SET' | 'IS_NOT_SET', fieldValue?: string, includeNoData?: 'true' | 'false', limit?: number, modality?: 'call' | 'chat', page?: number, search?: string, sortBy?: string, sortDirection?: 'asc' | 'desc'): { data: object; }`\n\n**get** `/v1/customer-profile`\n\nReturns the people who have talked to your agents in this project. Customers we hold nothing about beyond their identifier are left out unless includeNoData is true.\n\n### Parameters\n\n- `agentId?: string`\n\n- `fieldKey?: string`\n Filter by this field. Use with fieldOperator and, unless checking presence, fieldValue.\n\n- `fieldOperator?: 'EQUALS' | 'NOT_EQUALS' | 'CONTAINS' | 'STARTS_WITH' | 'IS_SET' | 'IS_NOT_SET'`\n How fieldValue is compared, ignoring case. NOT_EQUALS includes customers without the field.\n\n- `fieldValue?: string`\n\n- `includeNoData?: 'true' | 'false'`\n Include customers we hold nothing about beyond their identifier. Defaults to false.\n\n- `limit?: number`\n\n- `modality?: 'call' | 'chat'`\n\n- `page?: number`\n\n- `search?: string`\n\n- `sortBy?: string`\n A column, or field.<KEY> (for example field.COMPANY) to sort by a field's value. Customers without a value sort last.\n\n- `sortDirection?: 'asc' | 'desc'`\n\n### Returns\n\n- `{ data: { items: { id: string; agentIds: string[]; attributes: object[]; chatCount: number; conversationCount: number; displayName: string; externalId: string; firstSeenAt: string; lastSeenAt: string; notes: string; notesUpdatedAt: string; phoneNumberE164: string; summary: string; talkTimeMs: number; voiceCount: number; }[]; page: number; totalCount: number; }; }`\n\n - `data: { items: { id: string; agentIds: string[]; attributes: { blockedValue: string; evidence: object; history: object[]; isLocked: boolean; key: string; observedAt: string; source: 'LIVE_EXTRACTION' | 'POST_CALL_EXTRACTION' | 'API' | 'USER'; value: string; }[]; chatCount: number; conversationCount: number; displayName: string; externalId: string; firstSeenAt: string; lastSeenAt: string; notes: string; notesUpdatedAt: string; phoneNumberE164: string; summary: string; talkTimeMs: number; voiceCount: number; }[]; page: number; totalCount: number; }`\n\n### Example\n\n```typescript\nimport Roark from '@roarkanalytics/sdk';\n\nconst client = new Roark();\n\nconst customerProfiles = await client.customerProfile.list();\n\nconsole.log(customerProfiles);\n```",
3206
+ perLanguage: {
3207
+ typescript: {
3208
+ method: 'client.customerProfile.list',
3209
+ example:
3210
+ "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 customerProfiles = await client.customerProfile.list();\n\nconsole.log(customerProfiles.data);",
3211
+ },
3212
+ python: {
3213
+ method: 'customer_profile.list',
3214
+ example:
3215
+ '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)\ncustomer_profiles = client.customer_profile.list()\nprint(customer_profiles.data)',
3216
+ },
3217
+ http: {
3218
+ example:
3219
+ 'curl https://api.roark.ai/v1/customer-profile \\\n -H "Authorization: Bearer $ROARK_API_BEARER_TOKEN"',
3220
+ },
3221
+ },
3222
+ },
3223
+ {
3224
+ name: 'getById',
3225
+ endpoint: '/v1/customer-profile/{customerProfileId}',
3226
+ httpMethod: 'get',
3227
+ summary: 'Get a customer profile',
3228
+ description: 'Get a customer profile',
3229
+ stainlessPath: '(resource) customerProfile > (method) getById',
3230
+ qualified: 'client.customerProfile.getByID',
3231
+ params: ['customerProfileId: string;'],
3232
+ response:
3233
+ "{ data: { id: string; agentIds: string[]; attributes: { blockedValue: string; evidence: object; history: object[]; isLocked: boolean; key: string; observedAt: string; source: 'LIVE_EXTRACTION' | 'POST_CALL_EXTRACTION' | 'API' | 'USER'; value: string; }[]; chatCount: number; conversationCount: number; displayName: string; externalId: string; firstSeenAt: string; lastSeenAt: string; notes: string; notesUpdatedAt: string; phoneNumberE164: string; summary: string; talkTimeMs: number; voiceCount: number; }; }",
3234
+ markdown:
3235
+ "## getById\n\n`client.customerProfile.getByID(customerProfileId: string): { data: object; }`\n\n**get** `/v1/customer-profile/{customerProfileId}`\n\nGet a customer profile\n\n### Parameters\n\n- `customerProfileId: string`\n\n### Returns\n\n- `{ data: { id: string; agentIds: string[]; attributes: { blockedValue: string; evidence: object; history: object[]; isLocked: boolean; key: string; observedAt: string; source: 'LIVE_EXTRACTION' | 'POST_CALL_EXTRACTION' | 'API' | 'USER'; value: string; }[]; chatCount: number; conversationCount: number; displayName: string; externalId: string; firstSeenAt: string; lastSeenAt: string; notes: string; notesUpdatedAt: string; phoneNumberE164: string; summary: string; talkTimeMs: number; voiceCount: number; }; }`\n\n - `data: { id: string; agentIds: string[]; attributes: { blockedValue: string; evidence: { callId: string; chatId: string; observedAt: string; offsetMs: number; quote: string; source: 'LIVE_EXTRACTION' | 'POST_CALL_EXTRACTION' | 'API' | 'USER'; value: string; }; history: { callId: string; chatId: string; observedAt: string; offsetMs: number; quote: string; source: 'LIVE_EXTRACTION' | 'POST_CALL_EXTRACTION' | 'API' | 'USER'; value: string; }[]; isLocked: boolean; key: string; observedAt: string; source: 'LIVE_EXTRACTION' | 'POST_CALL_EXTRACTION' | 'API' | 'USER'; value: string; }[]; chatCount: number; conversationCount: number; displayName: string; externalId: string; firstSeenAt: string; lastSeenAt: string; notes: string; notesUpdatedAt: string; phoneNumberE164: string; summary: string; talkTimeMs: number; voiceCount: number; }`\n\n### Example\n\n```typescript\nimport Roark from '@roarkanalytics/sdk';\n\nconst client = new Roark();\n\nconst response = await client.customerProfile.getByID('182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e');\n\nconsole.log(response);\n```",
3236
+ perLanguage: {
3237
+ typescript: {
3238
+ method: 'client.customerProfile.getByID',
3239
+ example:
3240
+ "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.customerProfile.getByID('182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e');\n\nconsole.log(response.data);",
3241
+ },
3242
+ python: {
3243
+ method: 'customer_profile.get_by_id',
3244
+ example:
3245
+ '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.customer_profile.get_by_id(\n "182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e",\n)\nprint(response.data)',
3246
+ },
3247
+ http: {
3248
+ example:
3249
+ 'curl https://api.roark.ai/v1/customer-profile/$CUSTOMER_PROFILE_ID \\\n -H "Authorization: Bearer $ROARK_API_BEARER_TOKEN"',
3250
+ },
3251
+ },
3252
+ },
3253
+ {
3254
+ name: 'delete',
3255
+ endpoint: '/v1/customer-profile/{customerProfileId}',
3256
+ httpMethod: 'delete',
3257
+ summary: 'Erase a customer profile',
3258
+ description:
3259
+ 'Permanently removes the profile, its fields, evidence and notes. Conversations are kept. A new conversation from the same identifier creates a new profile.',
3260
+ stainlessPath: '(resource) customerProfile > (method) delete',
3261
+ qualified: 'client.customerProfile.delete',
3262
+ params: ['customerProfileId: string;'],
3263
+ response: '{ data: { success: boolean; }; }',
3264
+ markdown:
3265
+ "## delete\n\n`client.customerProfile.delete(customerProfileId: string): { data: object; }`\n\n**delete** `/v1/customer-profile/{customerProfileId}`\n\nPermanently removes the profile, its fields, evidence and notes. Conversations are kept. A new conversation from the same identifier creates a new profile.\n\n### Parameters\n\n- `customerProfileId: 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 customerProfile = await client.customerProfile.delete('182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e');\n\nconsole.log(customerProfile);\n```",
3266
+ perLanguage: {
3267
+ typescript: {
3268
+ method: 'client.customerProfile.delete',
3269
+ example:
3270
+ "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 customerProfile = await client.customerProfile.delete('182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e');\n\nconsole.log(customerProfile.data);",
3271
+ },
3272
+ python: {
3273
+ method: 'customer_profile.delete',
3274
+ example:
3275
+ '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)\ncustomer_profile = client.customer_profile.delete(\n "182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e",\n)\nprint(customer_profile.data)',
3276
+ },
3277
+ http: {
3278
+ example:
3279
+ 'curl https://api.roark.ai/v1/customer-profile/$CUSTOMER_PROFILE_ID \\\n -X DELETE \\\n -H "Authorization: Bearer $ROARK_API_BEARER_TOKEN"',
3280
+ },
3281
+ },
3282
+ },
3283
+ {
3284
+ name: 'listConversations',
3285
+ endpoint: '/v1/customer-profile/{customerProfileId}/conversations',
3286
+ httpMethod: 'get',
3287
+ summary: "List a customer's conversations",
3288
+ description: 'Calls and chats with this customer, newest first.',
3289
+ stainlessPath: '(resource) customerProfile > (method) listConversations',
3290
+ qualified: 'client.customerProfile.listConversations',
3291
+ params: ['customerProfileId: string;', 'limit?: number;', 'page?: number;'],
3292
+ response:
3293
+ "{ data: { items: { id: string; conversationType: 'call' | 'chat'; durationMs: number; startedAt: string; summary: string; title: string; }[]; page: number; totalCount: number; }; }",
3294
+ markdown:
3295
+ "## listConversations\n\n`client.customerProfile.listConversations(customerProfileId: string, limit?: number, page?: number): { data: object; }`\n\n**get** `/v1/customer-profile/{customerProfileId}/conversations`\n\nCalls and chats with this customer, newest first.\n\n### Parameters\n\n- `customerProfileId: string`\n\n- `limit?: number`\n\n- `page?: number`\n\n### Returns\n\n- `{ data: { items: { id: string; conversationType: 'call' | 'chat'; durationMs: number; startedAt: string; summary: string; title: string; }[]; page: number; totalCount: number; }; }`\n\n - `data: { items: { id: string; conversationType: 'call' | 'chat'; durationMs: number; startedAt: string; summary: string; title: string; }[]; page: number; totalCount: number; }`\n\n### Example\n\n```typescript\nimport Roark from '@roarkanalytics/sdk';\n\nconst client = new Roark();\n\nconst response = await client.customerProfile.listConversations('customerProfileId');\n\nconsole.log(response);\n```",
3296
+ perLanguage: {
3297
+ typescript: {
3298
+ method: 'client.customerProfile.listConversations',
3299
+ example:
3300
+ "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.customerProfile.listConversations('customerProfileId');\n\nconsole.log(response.data);",
3301
+ },
3302
+ python: {
3303
+ method: 'customer_profile.list_conversations',
3304
+ example:
3305
+ '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.customer_profile.list_conversations(\n customer_profile_id="customerProfileId",\n)\nprint(response.data)',
3306
+ },
3307
+ http: {
3308
+ example:
3309
+ 'curl https://api.roark.ai/v1/customer-profile/$CUSTOMER_PROFILE_ID/conversations \\\n -H "Authorization: Bearer $ROARK_API_BEARER_TOKEN"',
3310
+ },
3311
+ },
3312
+ },
3313
+ {
3314
+ name: 'setAttribute',
3315
+ endpoint: '/v1/customer-profile/{customerProfileId}/attributes/{key}',
3316
+ httpMethod: 'put',
3317
+ summary: 'Set a customer profile field',
3318
+ description: 'Sets the value and locks the field, so newer conversations cannot change it.',
3319
+ stainlessPath: '(resource) customerProfile > (method) setAttribute',
3320
+ qualified: 'client.customerProfile.setAttribute',
3321
+ params: ['customerProfileId: string;', 'key: string;', 'value: string;'],
3322
+ response:
3323
+ "{ data: { id: string; agentIds: string[]; attributes: { blockedValue: string; evidence: object; history: object[]; isLocked: boolean; key: string; observedAt: string; source: 'LIVE_EXTRACTION' | 'POST_CALL_EXTRACTION' | 'API' | 'USER'; value: string; }[]; chatCount: number; conversationCount: number; displayName: string; externalId: string; firstSeenAt: string; lastSeenAt: string; notes: string; notesUpdatedAt: string; phoneNumberE164: string; summary: string; talkTimeMs: number; voiceCount: number; }; }",
3324
+ markdown:
3325
+ "## setAttribute\n\n`client.customerProfile.setAttribute(customerProfileId: string, key: string, value: string): { data: object; }`\n\n**put** `/v1/customer-profile/{customerProfileId}/attributes/{key}`\n\nSets the value and locks the field, so newer conversations cannot change it.\n\n### Parameters\n\n- `customerProfileId: string`\n\n- `key: string`\n\n- `value: string`\n The new value. Setting a field locks it, so newer conversations cannot change it.\n\n### Returns\n\n- `{ data: { id: string; agentIds: string[]; attributes: { blockedValue: string; evidence: object; history: object[]; isLocked: boolean; key: string; observedAt: string; source: 'LIVE_EXTRACTION' | 'POST_CALL_EXTRACTION' | 'API' | 'USER'; value: string; }[]; chatCount: number; conversationCount: number; displayName: string; externalId: string; firstSeenAt: string; lastSeenAt: string; notes: string; notesUpdatedAt: string; phoneNumberE164: string; summary: string; talkTimeMs: number; voiceCount: number; }; }`\n\n - `data: { id: string; agentIds: string[]; attributes: { blockedValue: string; evidence: { callId: string; chatId: string; observedAt: string; offsetMs: number; quote: string; source: 'LIVE_EXTRACTION' | 'POST_CALL_EXTRACTION' | 'API' | 'USER'; value: string; }; history: { callId: string; chatId: string; observedAt: string; offsetMs: number; quote: string; source: 'LIVE_EXTRACTION' | 'POST_CALL_EXTRACTION' | 'API' | 'USER'; value: string; }[]; isLocked: boolean; key: string; observedAt: string; source: 'LIVE_EXTRACTION' | 'POST_CALL_EXTRACTION' | 'API' | 'USER'; value: string; }[]; chatCount: number; conversationCount: number; displayName: string; externalId: string; firstSeenAt: string; lastSeenAt: string; notes: string; notesUpdatedAt: string; phoneNumberE164: string; summary: string; talkTimeMs: number; voiceCount: number; }`\n\n### Example\n\n```typescript\nimport Roark from '@roarkanalytics/sdk';\n\nconst client = new Roark();\n\nconst response = await client.customerProfile.setAttribute('FULL_NAME', {\n customerProfileId: '182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e',\n value: 'x',\n});\n\nconsole.log(response);\n```",
3326
+ perLanguage: {
3327
+ typescript: {
3328
+ method: 'client.customerProfile.setAttribute',
3329
+ example:
3330
+ "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.customerProfile.setAttribute('FULL_NAME', {\n customerProfileId: '182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e',\n value: 'x',\n});\n\nconsole.log(response.data);",
3331
+ },
3332
+ python: {
3333
+ method: 'customer_profile.set_attribute',
3334
+ example:
3335
+ '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.customer_profile.set_attribute(\n key="FULL_NAME",\n customer_profile_id="182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e",\n value="x",\n)\nprint(response.data)',
3336
+ },
3337
+ http: {
3338
+ example:
3339
+ 'curl https://api.roark.ai/v1/customer-profile/$CUSTOMER_PROFILE_ID/attributes/$KEY \\\n -X PUT \\\n -H \'Content-Type: application/json\' \\\n -H "Authorization: Bearer $ROARK_API_BEARER_TOKEN" \\\n -d \'{\n "value": "x"\n }\'',
3340
+ },
3341
+ },
3342
+ },
3343
+ {
3344
+ name: 'clearAttribute',
3345
+ endpoint: '/v1/customer-profile/{customerProfileId}/attributes/{key}',
3346
+ httpMethod: 'delete',
3347
+ summary: 'Clear a customer profile field',
3348
+ description: 'Removes the value and any lock, so a later conversation can fill it again.',
3349
+ stainlessPath: '(resource) customerProfile > (method) clearAttribute',
3350
+ qualified: 'client.customerProfile.clearAttribute',
3351
+ params: ['customerProfileId: string;', 'key: string;'],
3352
+ response:
3353
+ "{ data: { id: string; agentIds: string[]; attributes: { blockedValue: string; evidence: object; history: object[]; isLocked: boolean; key: string; observedAt: string; source: 'LIVE_EXTRACTION' | 'POST_CALL_EXTRACTION' | 'API' | 'USER'; value: string; }[]; chatCount: number; conversationCount: number; displayName: string; externalId: string; firstSeenAt: string; lastSeenAt: string; notes: string; notesUpdatedAt: string; phoneNumberE164: string; summary: string; talkTimeMs: number; voiceCount: number; }; }",
3354
+ markdown:
3355
+ "## clearAttribute\n\n`client.customerProfile.clearAttribute(customerProfileId: string, key: string): { data: object; }`\n\n**delete** `/v1/customer-profile/{customerProfileId}/attributes/{key}`\n\nRemoves the value and any lock, so a later conversation can fill it again.\n\n### Parameters\n\n- `customerProfileId: string`\n\n- `key: string`\n\n### Returns\n\n- `{ data: { id: string; agentIds: string[]; attributes: { blockedValue: string; evidence: object; history: object[]; isLocked: boolean; key: string; observedAt: string; source: 'LIVE_EXTRACTION' | 'POST_CALL_EXTRACTION' | 'API' | 'USER'; value: string; }[]; chatCount: number; conversationCount: number; displayName: string; externalId: string; firstSeenAt: string; lastSeenAt: string; notes: string; notesUpdatedAt: string; phoneNumberE164: string; summary: string; talkTimeMs: number; voiceCount: number; }; }`\n\n - `data: { id: string; agentIds: string[]; attributes: { blockedValue: string; evidence: { callId: string; chatId: string; observedAt: string; offsetMs: number; quote: string; source: 'LIVE_EXTRACTION' | 'POST_CALL_EXTRACTION' | 'API' | 'USER'; value: string; }; history: { callId: string; chatId: string; observedAt: string; offsetMs: number; quote: string; source: 'LIVE_EXTRACTION' | 'POST_CALL_EXTRACTION' | 'API' | 'USER'; value: string; }[]; isLocked: boolean; key: string; observedAt: string; source: 'LIVE_EXTRACTION' | 'POST_CALL_EXTRACTION' | 'API' | 'USER'; value: string; }[]; chatCount: number; conversationCount: number; displayName: string; externalId: string; firstSeenAt: string; lastSeenAt: string; notes: string; notesUpdatedAt: string; phoneNumberE164: string; summary: string; talkTimeMs: number; voiceCount: number; }`\n\n### Example\n\n```typescript\nimport Roark from '@roarkanalytics/sdk';\n\nconst client = new Roark();\n\nconst response = await client.customerProfile.clearAttribute('FULL_NAME', {\n customerProfileId: '182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e',\n});\n\nconsole.log(response);\n```",
3356
+ perLanguage: {
3357
+ typescript: {
3358
+ method: 'client.customerProfile.clearAttribute',
3359
+ example:
3360
+ "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.customerProfile.clearAttribute('FULL_NAME', {\n customerProfileId: '182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e',\n});\n\nconsole.log(response.data);",
3361
+ },
3362
+ python: {
3363
+ method: 'customer_profile.clear_attribute',
3364
+ example:
3365
+ '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.customer_profile.clear_attribute(\n "FULL_NAME",\n customer_profile_id="182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e",\n)\nprint(response.data)',
3366
+ },
3367
+ http: {
3368
+ example:
3369
+ 'curl https://api.roark.ai/v1/customer-profile/$CUSTOMER_PROFILE_ID/attributes/$KEY \\\n -X DELETE \\\n -H "Authorization: Bearer $ROARK_API_BEARER_TOKEN"',
3370
+ },
3371
+ },
3372
+ },
3373
+ {
3374
+ name: 'unlockAttribute',
3375
+ endpoint: '/v1/customer-profile/{customerProfileId}/attributes/{key}/unlock',
3376
+ httpMethod: 'post',
3377
+ summary: 'Unlock a customer profile field',
3378
+ description: 'Lets newer conversations change this field again. The current value stays until one does.',
3379
+ stainlessPath: '(resource) customerProfile > (method) unlockAttribute',
3380
+ qualified: 'client.customerProfile.unlockAttribute',
3381
+ params: ['customerProfileId: string;', 'key: string;'],
3382
+ response:
3383
+ "{ data: { id: string; agentIds: string[]; attributes: { blockedValue: string; evidence: object; history: object[]; isLocked: boolean; key: string; observedAt: string; source: 'LIVE_EXTRACTION' | 'POST_CALL_EXTRACTION' | 'API' | 'USER'; value: string; }[]; chatCount: number; conversationCount: number; displayName: string; externalId: string; firstSeenAt: string; lastSeenAt: string; notes: string; notesUpdatedAt: string; phoneNumberE164: string; summary: string; talkTimeMs: number; voiceCount: number; }; }",
3384
+ markdown:
3385
+ "## unlockAttribute\n\n`client.customerProfile.unlockAttribute(customerProfileId: string, key: string): { data: object; }`\n\n**post** `/v1/customer-profile/{customerProfileId}/attributes/{key}/unlock`\n\nLets newer conversations change this field again. The current value stays until one does.\n\n### Parameters\n\n- `customerProfileId: string`\n\n- `key: string`\n\n### Returns\n\n- `{ data: { id: string; agentIds: string[]; attributes: { blockedValue: string; evidence: object; history: object[]; isLocked: boolean; key: string; observedAt: string; source: 'LIVE_EXTRACTION' | 'POST_CALL_EXTRACTION' | 'API' | 'USER'; value: string; }[]; chatCount: number; conversationCount: number; displayName: string; externalId: string; firstSeenAt: string; lastSeenAt: string; notes: string; notesUpdatedAt: string; phoneNumberE164: string; summary: string; talkTimeMs: number; voiceCount: number; }; }`\n\n - `data: { id: string; agentIds: string[]; attributes: { blockedValue: string; evidence: { callId: string; chatId: string; observedAt: string; offsetMs: number; quote: string; source: 'LIVE_EXTRACTION' | 'POST_CALL_EXTRACTION' | 'API' | 'USER'; value: string; }; history: { callId: string; chatId: string; observedAt: string; offsetMs: number; quote: string; source: 'LIVE_EXTRACTION' | 'POST_CALL_EXTRACTION' | 'API' | 'USER'; value: string; }[]; isLocked: boolean; key: string; observedAt: string; source: 'LIVE_EXTRACTION' | 'POST_CALL_EXTRACTION' | 'API' | 'USER'; value: string; }[]; chatCount: number; conversationCount: number; displayName: string; externalId: string; firstSeenAt: string; lastSeenAt: string; notes: string; notesUpdatedAt: string; phoneNumberE164: string; summary: string; talkTimeMs: number; voiceCount: number; }`\n\n### Example\n\n```typescript\nimport Roark from '@roarkanalytics/sdk';\n\nconst client = new Roark();\n\nconst response = await client.customerProfile.unlockAttribute('FULL_NAME', {\n customerProfileId: '182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e',\n});\n\nconsole.log(response);\n```",
3386
+ perLanguage: {
3387
+ typescript: {
3388
+ method: 'client.customerProfile.unlockAttribute',
3389
+ example:
3390
+ "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.customerProfile.unlockAttribute('FULL_NAME', {\n customerProfileId: '182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e',\n});\n\nconsole.log(response.data);",
3391
+ },
3392
+ python: {
3393
+ method: 'customer_profile.unlock_attribute',
3394
+ example:
3395
+ '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.customer_profile.unlock_attribute(\n "FULL_NAME",\n customer_profile_id="182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e",\n)\nprint(response.data)',
3396
+ },
3397
+ http: {
3398
+ example:
3399
+ 'curl https://api.roark.ai/v1/customer-profile/$CUSTOMER_PROFILE_ID/attributes/$KEY/unlock \\\n -H "Authorization: Bearer $ROARK_API_BEARER_TOKEN"',
3400
+ },
3401
+ },
3402
+ },
3403
+ {
3404
+ name: 'updateNotes',
3405
+ endpoint: '/v1/customer-profile/{customerProfileId}/notes',
3406
+ httpMethod: 'put',
3407
+ summary: 'Update the notes on a customer profile',
3408
+ description: "Replaces your team's shared notes. Null or empty clears them. The last save wins.",
3409
+ stainlessPath: '(resource) customerProfile > (method) updateNotes',
3410
+ qualified: 'client.customerProfile.updateNotes',
3411
+ params: ['customerProfileId: string;', 'notes: string;'],
3412
+ response:
3413
+ "{ data: { id: string; agentIds: string[]; attributes: { blockedValue: string; evidence: object; history: object[]; isLocked: boolean; key: string; observedAt: string; source: 'LIVE_EXTRACTION' | 'POST_CALL_EXTRACTION' | 'API' | 'USER'; value: string; }[]; chatCount: number; conversationCount: number; displayName: string; externalId: string; firstSeenAt: string; lastSeenAt: string; notes: string; notesUpdatedAt: string; phoneNumberE164: string; summary: string; talkTimeMs: number; voiceCount: number; }; }",
3414
+ markdown:
3415
+ "## updateNotes\n\n`client.customerProfile.updateNotes(customerProfileId: string, notes: string): { data: object; }`\n\n**put** `/v1/customer-profile/{customerProfileId}/notes`\n\nReplaces your team's shared notes. Null or empty clears them. The last save wins.\n\n### Parameters\n\n- `customerProfileId: string`\n\n- `notes: string`\n Replaces the existing notes. Null or empty clears them.\n\n### Returns\n\n- `{ data: { id: string; agentIds: string[]; attributes: { blockedValue: string; evidence: object; history: object[]; isLocked: boolean; key: string; observedAt: string; source: 'LIVE_EXTRACTION' | 'POST_CALL_EXTRACTION' | 'API' | 'USER'; value: string; }[]; chatCount: number; conversationCount: number; displayName: string; externalId: string; firstSeenAt: string; lastSeenAt: string; notes: string; notesUpdatedAt: string; phoneNumberE164: string; summary: string; talkTimeMs: number; voiceCount: number; }; }`\n\n - `data: { id: string; agentIds: string[]; attributes: { blockedValue: string; evidence: { callId: string; chatId: string; observedAt: string; offsetMs: number; quote: string; source: 'LIVE_EXTRACTION' | 'POST_CALL_EXTRACTION' | 'API' | 'USER'; value: string; }; history: { callId: string; chatId: string; observedAt: string; offsetMs: number; quote: string; source: 'LIVE_EXTRACTION' | 'POST_CALL_EXTRACTION' | 'API' | 'USER'; value: string; }[]; isLocked: boolean; key: string; observedAt: string; source: 'LIVE_EXTRACTION' | 'POST_CALL_EXTRACTION' | 'API' | 'USER'; value: string; }[]; chatCount: number; conversationCount: number; displayName: string; externalId: string; firstSeenAt: string; lastSeenAt: string; notes: string; notesUpdatedAt: string; phoneNumberE164: string; summary: string; talkTimeMs: number; voiceCount: number; }`\n\n### Example\n\n```typescript\nimport Roark from '@roarkanalytics/sdk';\n\nconst client = new Roark();\n\nconst response = await client.customerProfile.updateNotes('182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e', {\n notes: 'notes',\n});\n\nconsole.log(response);\n```",
3416
+ perLanguage: {
3417
+ typescript: {
3418
+ method: 'client.customerProfile.updateNotes',
3419
+ example:
3420
+ "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.customerProfile.updateNotes('182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e', {\n notes: 'notes',\n});\n\nconsole.log(response.data);",
3421
+ },
3422
+ python: {
3423
+ method: 'customer_profile.update_notes',
3424
+ example:
3425
+ '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.customer_profile.update_notes(\n customer_profile_id="182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e",\n notes="notes",\n)\nprint(response.data)',
3426
+ },
3427
+ http: {
3428
+ example:
3429
+ 'curl https://api.roark.ai/v1/customer-profile/$CUSTOMER_PROFILE_ID/notes \\\n -X PUT \\\n -H \'Content-Type: application/json\' \\\n -H "Authorization: Bearer $ROARK_API_BEARER_TOKEN" \\\n -d \'{\n "notes": "notes"\n }\'',
3430
+ },
3431
+ },
3432
+ },
3180
3433
  {
3181
3434
  name: 'list',
3182
3435
  endpoint: '/v1/simulation/environment',
package/src/methods.ts CHANGED
@@ -568,6 +568,54 @@ export const sdkMethods: SdkMethod[] = [
568
568
  httpMethod: 'get',
569
569
  httpPath: '/v1/persona/{personaId}',
570
570
  },
571
+ {
572
+ clientCallName: 'client.customerProfile.list',
573
+ fullyQualifiedName: 'customerProfile.list',
574
+ httpMethod: 'get',
575
+ httpPath: '/v1/customer-profile',
576
+ },
577
+ {
578
+ clientCallName: 'client.customerProfile.delete',
579
+ fullyQualifiedName: 'customerProfile.delete',
580
+ httpMethod: 'delete',
581
+ httpPath: '/v1/customer-profile/{customerProfileId}',
582
+ },
583
+ {
584
+ clientCallName: 'client.customerProfile.clearAttribute',
585
+ fullyQualifiedName: 'customerProfile.clearAttribute',
586
+ httpMethod: 'delete',
587
+ httpPath: '/v1/customer-profile/{customerProfileId}/attributes/{key}',
588
+ },
589
+ {
590
+ clientCallName: 'client.customerProfile.getByID',
591
+ fullyQualifiedName: 'customerProfile.getByID',
592
+ httpMethod: 'get',
593
+ httpPath: '/v1/customer-profile/{customerProfileId}',
594
+ },
595
+ {
596
+ clientCallName: 'client.customerProfile.listConversations',
597
+ fullyQualifiedName: 'customerProfile.listConversations',
598
+ httpMethod: 'get',
599
+ httpPath: '/v1/customer-profile/{customerProfileId}/conversations',
600
+ },
601
+ {
602
+ clientCallName: 'client.customerProfile.setAttribute',
603
+ fullyQualifiedName: 'customerProfile.setAttribute',
604
+ httpMethod: 'put',
605
+ httpPath: '/v1/customer-profile/{customerProfileId}/attributes/{key}',
606
+ },
607
+ {
608
+ clientCallName: 'client.customerProfile.unlockAttribute',
609
+ fullyQualifiedName: 'customerProfile.unlockAttribute',
610
+ httpMethod: 'post',
611
+ httpPath: '/v1/customer-profile/{customerProfileId}/attributes/{key}/unlock',
612
+ },
613
+ {
614
+ clientCallName: 'client.customerProfile.updateNotes',
615
+ fullyQualifiedName: 'customerProfile.updateNotes',
616
+ httpMethod: 'put',
617
+ httpPath: '/v1/customer-profile/{customerProfileId}/notes',
618
+ },
571
619
  {
572
620
  clientCallName: 'client.simulationEnvironment.create',
573
621
  fullyQualifiedName: 'simulationEnvironment.create',