@segmentflow/segmentflow-mcp 0.7.0 → 0.9.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 (57) hide show
  1. package/auth.d.mts.map +1 -1
  2. package/auth.d.ts.map +1 -1
  3. package/code-tool-types.d.mts.map +1 -1
  4. package/code-tool-types.d.ts.map +1 -1
  5. package/code-tool-worker.d.mts.map +1 -1
  6. package/code-tool-worker.d.ts.map +1 -1
  7. package/code-tool-worker.js +36 -14
  8. package/code-tool-worker.js.map +1 -1
  9. package/code-tool-worker.mjs +36 -14
  10. package/code-tool-worker.mjs.map +1 -1
  11. package/code-tool.d.mts.map +1 -1
  12. package/code-tool.d.ts.map +1 -1
  13. package/code-tool.js +2 -2
  14. package/code-tool.mjs +2 -2
  15. package/code-tool.mjs.map +1 -1
  16. package/docs-search-tool.d.mts +2 -2
  17. package/docs-search-tool.d.mts.map +1 -1
  18. package/docs-search-tool.d.ts +2 -2
  19. package/docs-search-tool.d.ts.map +1 -1
  20. package/docs-search-tool.mjs.map +1 -1
  21. package/http.d.mts.map +1 -1
  22. package/http.d.ts.map +1 -1
  23. package/http.mjs.map +1 -1
  24. package/index.mjs.map +1 -1
  25. package/instructions.mjs.map +1 -1
  26. package/local-docs-search.d.mts.map +1 -1
  27. package/local-docs-search.d.ts.map +1 -1
  28. package/local-docs-search.js +1462 -179
  29. package/local-docs-search.js.map +1 -1
  30. package/local-docs-search.mjs +1462 -179
  31. package/local-docs-search.mjs.map +1 -1
  32. package/logger.d.mts.map +1 -1
  33. package/logger.d.ts.map +1 -1
  34. package/logger.mjs.map +1 -1
  35. package/methods.d.mts.map +1 -1
  36. package/methods.d.ts.map +1 -1
  37. package/methods.js +174 -42
  38. package/methods.js.map +1 -1
  39. package/methods.mjs +174 -42
  40. package/methods.mjs.map +1 -1
  41. package/options.mjs.map +1 -1
  42. package/package.json +2 -2
  43. package/server.d.mts.map +1 -1
  44. package/server.d.ts.map +1 -1
  45. package/server.js +1 -1
  46. package/server.mjs +1 -1
  47. package/server.mjs.map +1 -1
  48. package/src/code-tool-worker.ts +36 -14
  49. package/src/code-tool.ts +2 -2
  50. package/src/local-docs-search.ts +1730 -199
  51. package/src/methods.ts +174 -42
  52. package/src/server.ts +1 -1
  53. package/stdio.d.mts.map +1 -1
  54. package/stdio.d.ts.map +1 -1
  55. package/stdio.mjs.map +1 -1
  56. package/types.d.mts.map +1 -1
  57. package/types.d.ts.map +1 -1
@@ -44,332 +44,1615 @@ const path = __importStar(require("node:path"));
44
44
  const logger_1 = require("./logger.js");
45
45
  const EMBEDDED_METHODS = [
46
46
  {
47
- name: 'get_brand_kit',
48
- endpoint: '/api/v1/public/brand-kit',
47
+ name: 'list',
48
+ endpoint: '/api/v1/profiles',
49
+ httpMethod: 'post',
50
+ summary: 'List profiles',
51
+ description: 'Get paginated list of Profiles with optional filtering',
52
+ stainlessPath: '(resource) v1.profiles > (method) list',
53
+ qualified: 'client.v1.profiles.list',
54
+ params: [
55
+ 'cursor?: string;',
56
+ "deliverySuppressionReasonFilter?: 'HardBounced' | 'Complained' | 'SoftBounceSuppressed'[];",
57
+ "deliverySuppressionStatus?: 'eligible' | 'suppressed';",
58
+ "direction?: 'before' | 'after';",
59
+ 'limit?: number;',
60
+ 'profileIds?: string[];',
61
+ 'profilePropertyFilter?: { id: string; values: string[]; }[];',
62
+ 'search?: string;',
63
+ 'segmentFilter?: string[];',
64
+ "sourceFilter?: 'form_submission' | 'csv_import' | 'api_sync' | 'sdk' | 'manual_edit' | 'computed'[];",
65
+ ],
66
+ response: '{ profileCount: number; profiles: { id: string; createdAt: string; deliverySuppression: object; email: string; phone: string; properties: object; segments: object[]; sources: string[]; updatedAt: string; }[]; nextCursor?: string; previousCursor?: string; }',
67
+ markdown: "## list\n\n`client.v1.profiles.list(cursor?: string, deliverySuppressionReasonFilter?: 'HardBounced' | 'Complained' | 'SoftBounceSuppressed'[], deliverySuppressionStatus?: 'eligible' | 'suppressed', direction?: 'before' | 'after', limit?: number, profileIds?: string[], profilePropertyFilter?: { id: string; values: string[]; }[], search?: string, segmentFilter?: string[], sourceFilter?: 'form_submission' | 'csv_import' | 'api_sync' | 'sdk' | 'manual_edit' | 'computed'[]): { profileCount: number; profiles: profile[]; nextCursor?: string; previousCursor?: string; }`\n\n**post** `/api/v1/profiles`\n\nGet paginated list of Profiles with optional filtering\n\n### Parameters\n\n- `cursor?: string`\n Pagination cursor from previous response\n\n- `deliverySuppressionReasonFilter?: 'HardBounced' | 'Complained' | 'SoftBounceSuppressed'[]`\n Filter by current Delivery Suppression reason. Any reason filter implies suppressed Profiles.\n\n- `deliverySuppressionStatus?: 'eligible' | 'suppressed'`\n Filter by current Delivery Suppression status.\n\n- `direction?: 'before' | 'after'`\n Pagination direction (defaults to \"after\")\n\n- `limit?: number`\n Number of Profiles to return (defaults to 10)\n\n- `profileIds?: string[]`\n Filter by specific Profile IDs\n\n- `profilePropertyFilter?: { id: string; values: string[]; }[]`\n Filter by profile properties\n\n- `search?: string`\n Search Profiles by email, phone, or external ID (case-insensitive partial match)\n\n- `segmentFilter?: string[]`\n Filter by Segment IDs\n\n- `sourceFilter?: 'form_submission' | 'csv_import' | 'api_sync' | 'sdk' | 'manual_edit' | 'computed'[]`\n Filter by ingestion source. Values are the same as the dashboard's Source column.\n\n### Returns\n\n- `{ profileCount: number; profiles: { id: string; createdAt: string; deliverySuppression: object; email: string; phone: string; properties: object; segments: object[]; sources: string[]; updatedAt: string; }[]; nextCursor?: string; previousCursor?: string; }`\n POST /api/v1/profiles response — paginated Profiles\n\n - `profileCount: number`\n - `profiles: { id: string; createdAt: string; deliverySuppression: { email: string; reason: 'HardBounced' | 'Complained' | 'SoftBounceSuppressed'; suppressed: boolean; suppressedAt: string; }; email: string; phone: string; properties: object; segments: { id: string; name: string; type: string; }[]; sources: string[]; updatedAt: string; }[]`\n - `nextCursor?: string`\n - `previousCursor?: string`\n\n### Example\n\n```typescript\nimport SegmentflowAI from '@segmentflow/segmentflow-typescript';\n\nconst client = new SegmentflowAI();\n\nconst profileList = await client.v1.profiles.list();\n\nconsole.log(profileList);\n```",
68
+ perLanguage: {
69
+ typescript: {
70
+ method: 'client.v1.profiles.list',
71
+ example: "import SegmentflowAI from '@segmentflow/segmentflow-typescript';\n\nconst client = new SegmentflowAI({\n apiKey: process.env['SEGMENTFLOW_API_KEY'], // This is the default and can be omitted\n});\n\nconst profileList = await client.v1.profiles.list();\n\nconsole.log(profileList.profileCount);",
72
+ },
73
+ python: {
74
+ method: 'v1.profiles.list',
75
+ example: 'import os\nfrom segmentflow import SegmentflowAI\n\nclient = SegmentflowAI(\n api_key=os.environ.get("SEGMENTFLOW_API_KEY"), # This is the default and can be omitted\n)\nprofile_list = client.v1.profiles.list()\nprint(profile_list.profile_count)',
76
+ },
77
+ java: {
78
+ method: 'v1().profiles().list',
79
+ example: 'package com.segmentflow.api.example;\n\nimport com.segmentflow.api.client.SegmentflowAiClient;\nimport com.segmentflow.api.client.okhttp.SegmentflowAiOkHttpClient;\nimport com.segmentflow.api.models.v1.profiles.ProfileList;\nimport com.segmentflow.api.models.v1.profiles.ProfileListParams;\n\npublic final class Main {\n private Main() {}\n\n public static void main(String[] args) {\n SegmentflowAiClient client = SegmentflowAiOkHttpClient.fromEnv();\n\n ProfileList profileList = client.v1().profiles().list();\n }\n}',
80
+ },
81
+ go: {
82
+ method: 'client.V1.Profiles.List',
83
+ example: 'package main\n\nimport (\n\t"context"\n\t"fmt"\n\n\t"github.com/segmentflow/segmentflow-go"\n\t"github.com/segmentflow/segmentflow-go/option"\n)\n\nfunc main() {\n\tclient := segmentflow.NewClient(\n\t\toption.WithAPIKey("My API Key"),\n\t)\n\tprofileList, err := client.V1.Profiles.List(context.TODO(), segmentflow.V1ProfileListParams{})\n\tif err != nil {\n\t\tpanic(err.Error())\n\t}\n\tfmt.Printf("%+v\\n", profileList.ProfileCount)\n}\n',
84
+ },
85
+ cli: {
86
+ method: 'profiles list',
87
+ example: "segmentflow v1:profiles list \\\n --api-key 'My API Key'",
88
+ },
89
+ php: {
90
+ method: 'v1->profiles->list',
91
+ example: "<?php\n\nrequire_once dirname(__DIR__) . '/vendor/autoload.php';\n\n$client = new Client(apiKey: 'My API Key', environment: 'development');\n\n$profileList = $client->v1->profiles->list(\n cursor: 'cursor',\n deliverySuppressionReasonFilter: ['HardBounced'],\n deliverySuppressionStatus: 'eligible',\n direction: 'before',\n limit: 1,\n profileIDs: ['string'],\n profilePropertyFilter: [['id' => 'id', 'values' => ['string']]],\n search: 'search',\n segmentFilter: ['string'],\n sourceFilter: ['form_submission'],\n);\n\nvar_dump($profileList);",
92
+ },
93
+ http: {
94
+ example: 'curl https://api.segmentflow.ai/api/v1/profiles \\\n -X POST \\\n -H "x-api-key: $SEGMENTFLOW_API_KEY"',
95
+ },
96
+ },
97
+ },
98
+ {
99
+ name: 'retrieve',
100
+ endpoint: '/api/v1/profiles/{profileId}',
49
101
  httpMethod: 'get',
50
- summary: 'List brand kits',
51
- description: 'List brand kits',
52
- stainlessPath: '(resource) v1.public > (method) get_brand_kit',
53
- qualified: 'client.v1.public.getBrandKit',
54
- response: '{ brandKits: { id: string; companyName: string; createdAt: string; isPrimary: boolean; logoUrl: string; name: string; previewColors: string[]; primaryFont: string; slug: string; updatedAt: string; website: string; }[]; count: number; }',
55
- markdown: "## get_brand_kit\n\n`client.v1.public.getBrandKit(): { brandKits: object[]; count: number; }`\n\n**get** `/api/v1/public/brand-kit`\n\nList brand kits\n\n### Returns\n\n- `{ brandKits: { id: string; companyName: string; createdAt: string; isPrimary: boolean; logoUrl: string; name: string; previewColors: string[]; primaryFont: string; slug: string; updatedAt: string; website: string; }[]; count: number; }`\n\n - `brandKits: { id: string; companyName: string; createdAt: string; isPrimary: boolean; logoUrl: string; name: string; previewColors: string[]; primaryFont: string; slug: string; updatedAt: string; website: string; }[]`\n - `count: number`\n\n### Example\n\n```typescript\nimport SegmentflowAI from '@segmentflow/segmentflow-typescript';\n\nconst client = new SegmentflowAI();\n\nconst response = await client.v1.public.getBrandKit();\n\nconsole.log(response);\n```",
102
+ summary: 'Get profile',
103
+ description: 'Get a single Profile by ID',
104
+ stainlessPath: '(resource) v1.profiles > (method) retrieve',
105
+ qualified: 'client.v1.profiles.retrieve',
106
+ params: ['profileId: string;'],
107
+ response: "{ id: string; createdAt: string; deliverySuppression: { email: string; reason: 'HardBounced' | 'Complained' | 'SoftBounceSuppressed'; suppressed: boolean; suppressedAt: string; }; email: string; phone: string; properties: object; segments: { id: string; name: string; type: string; }[]; sources: string[]; updatedAt: string; }",
108
+ markdown: "## retrieve\n\n`client.v1.profiles.retrieve(profileId: string): { id: string; createdAt: string; deliverySuppression: object; email: string; phone: string; properties: object; segments: object[]; sources: string[]; updatedAt: string; }`\n\n**get** `/api/v1/profiles/{profileId}`\n\nGet a single Profile by ID\n\n### Parameters\n\n- `profileId: string`\n\n### Returns\n\n- `{ id: string; createdAt: string; deliverySuppression: { email: string; reason: 'HardBounced' | 'Complained' | 'SoftBounceSuppressed'; suppressed: boolean; suppressedAt: string; }; email: string; phone: string; properties: object; segments: { id: string; name: string; type: string; }[]; sources: string[]; updatedAt: string; }`\n Unified API view of a Profile row, with property data-lineage envelope and segment memberships.\n\n - `id: string`\n - `createdAt: string`\n - `deliverySuppression: { email: string; reason: 'HardBounced' | 'Complained' | 'SoftBounceSuppressed'; suppressed: boolean; suppressedAt: string; }`\n - `email: string`\n - `phone: string`\n - `properties: object`\n - `segments: { id: string; name: string; type: string; }[]`\n - `sources: string[]`\n - `updatedAt: string`\n\n### Example\n\n```typescript\nimport SegmentflowAI from '@segmentflow/segmentflow-typescript';\n\nconst client = new SegmentflowAI();\n\nconst profile = await client.v1.profiles.retrieve('x');\n\nconsole.log(profile);\n```",
109
+ perLanguage: {
110
+ typescript: {
111
+ method: 'client.v1.profiles.retrieve',
112
+ example: "import SegmentflowAI from '@segmentflow/segmentflow-typescript';\n\nconst client = new SegmentflowAI({\n apiKey: process.env['SEGMENTFLOW_API_KEY'], // This is the default and can be omitted\n});\n\nconst profile = await client.v1.profiles.retrieve('x');\n\nconsole.log(profile.id);",
113
+ },
114
+ python: {
115
+ method: 'v1.profiles.retrieve',
116
+ example: 'import os\nfrom segmentflow import SegmentflowAI\n\nclient = SegmentflowAI(\n api_key=os.environ.get("SEGMENTFLOW_API_KEY"), # This is the default and can be omitted\n)\nprofile = client.v1.profiles.retrieve(\n "x",\n)\nprint(profile.id)',
117
+ },
118
+ java: {
119
+ method: 'v1().profiles().retrieve',
120
+ example: 'package com.segmentflow.api.example;\n\nimport com.segmentflow.api.client.SegmentflowAiClient;\nimport com.segmentflow.api.client.okhttp.SegmentflowAiOkHttpClient;\nimport com.segmentflow.api.models.v1.profiles.Profile;\nimport com.segmentflow.api.models.v1.profiles.ProfileRetrieveParams;\n\npublic final class Main {\n private Main() {}\n\n public static void main(String[] args) {\n SegmentflowAiClient client = SegmentflowAiOkHttpClient.fromEnv();\n\n Profile profile = client.v1().profiles().retrieve("x");\n }\n}',
121
+ },
122
+ go: {
123
+ method: 'client.V1.Profiles.Get',
124
+ example: 'package main\n\nimport (\n\t"context"\n\t"fmt"\n\n\t"github.com/segmentflow/segmentflow-go"\n\t"github.com/segmentflow/segmentflow-go/option"\n)\n\nfunc main() {\n\tclient := segmentflow.NewClient(\n\t\toption.WithAPIKey("My API Key"),\n\t)\n\tprofile, err := client.V1.Profiles.Get(context.TODO(), "x")\n\tif err != nil {\n\t\tpanic(err.Error())\n\t}\n\tfmt.Printf("%+v\\n", profile.ID)\n}\n',
125
+ },
126
+ cli: {
127
+ method: 'profiles retrieve',
128
+ example: "segmentflow v1:profiles retrieve \\\n --api-key 'My API Key' \\\n --profile-id x",
129
+ },
130
+ php: {
131
+ method: 'v1->profiles->retrieve',
132
+ example: "<?php\n\nrequire_once dirname(__DIR__) . '/vendor/autoload.php';\n\n$client = new Client(apiKey: 'My API Key', environment: 'development');\n\n$profile = $client->v1->profiles->retrieve('x');\n\nvar_dump($profile);",
133
+ },
134
+ http: {
135
+ example: 'curl https://api.segmentflow.ai/api/v1/profiles/$PROFILE_ID \\\n -H "x-api-key: $SEGMENTFLOW_API_KEY"',
136
+ },
137
+ },
138
+ },
139
+ {
140
+ name: 'delete',
141
+ endpoint: '/api/v1/profiles/{profileId}',
142
+ httpMethod: 'delete',
143
+ summary: 'Delete profile',
144
+ description: 'Delete a single Profile. Nullifies IdentityBridge rows and cascades to related tables.',
145
+ stainlessPath: '(resource) v1.profiles > (method) delete',
146
+ qualified: 'client.v1.profiles.delete',
147
+ params: ['profileId: string;'],
148
+ response: 'null',
149
+ markdown: "## delete\n\n`client.v1.profiles.delete(profileId: string): null`\n\n**delete** `/api/v1/profiles/{profileId}`\n\nDelete a single Profile. Nullifies IdentityBridge rows and cascades to related tables.\n\n### Parameters\n\n- `profileId: string`\n\n### Returns\n\n- `null`\n\n### Example\n\n```typescript\nimport SegmentflowAI from '@segmentflow/segmentflow-typescript';\n\nconst client = new SegmentflowAI();\n\nconst profile = await client.v1.profiles.delete('x');\n\nconsole.log(profile);\n```",
150
+ perLanguage: {
151
+ typescript: {
152
+ method: 'client.v1.profiles.delete',
153
+ example: "import SegmentflowAI from '@segmentflow/segmentflow-typescript';\n\nconst client = new SegmentflowAI({\n apiKey: process.env['SEGMENTFLOW_API_KEY'], // This is the default and can be omitted\n});\n\nconst profile = await client.v1.profiles.delete('x');\n\nconsole.log(profile);",
154
+ },
155
+ python: {
156
+ method: 'v1.profiles.delete',
157
+ example: 'import os\nfrom segmentflow import SegmentflowAI\n\nclient = SegmentflowAI(\n api_key=os.environ.get("SEGMENTFLOW_API_KEY"), # This is the default and can be omitted\n)\nprofile = client.v1.profiles.delete(\n "x",\n)\nprint(profile)',
158
+ },
159
+ java: {
160
+ method: 'v1().profiles().delete',
161
+ example: 'package com.segmentflow.api.example;\n\nimport com.segmentflow.api.client.SegmentflowAiClient;\nimport com.segmentflow.api.client.okhttp.SegmentflowAiOkHttpClient;\nimport com.segmentflow.api.models.v1.profiles.ProfileDeleteParams;\nimport java.util.Optional;\n\npublic final class Main {\n private Main() {}\n\n public static void main(String[] args) {\n SegmentflowAiClient client = SegmentflowAiOkHttpClient.fromEnv();\n\n Optional<Void> profile = client.v1().profiles().delete("x");\n }\n}',
162
+ },
163
+ go: {
164
+ method: 'client.V1.Profiles.Delete',
165
+ example: 'package main\n\nimport (\n\t"context"\n\t"fmt"\n\n\t"github.com/segmentflow/segmentflow-go"\n\t"github.com/segmentflow/segmentflow-go/option"\n)\n\nfunc main() {\n\tclient := segmentflow.NewClient(\n\t\toption.WithAPIKey("My API Key"),\n\t)\n\tprofile, err := client.V1.Profiles.Delete(context.TODO(), "x")\n\tif err != nil {\n\t\tpanic(err.Error())\n\t}\n\tfmt.Printf("%+v\\n", profile)\n}\n',
166
+ },
167
+ cli: {
168
+ method: 'profiles delete',
169
+ example: "segmentflow v1:profiles delete \\\n --api-key 'My API Key' \\\n --profile-id x",
170
+ },
171
+ php: {
172
+ method: 'v1->profiles->delete',
173
+ example: "<?php\n\nrequire_once dirname(__DIR__) . '/vendor/autoload.php';\n\n$client = new Client(apiKey: 'My API Key', environment: 'development');\n\n$profile = $client->v1->profiles->delete('x');\n\nvar_dump($profile);",
174
+ },
175
+ http: {
176
+ example: 'curl https://api.segmentflow.ai/api/v1/profiles/$PROFILE_ID \\\n -X DELETE \\\n -H "x-api-key: $SEGMENTFLOW_API_KEY"',
177
+ },
178
+ },
179
+ },
180
+ {
181
+ name: 'bulk_delete',
182
+ endpoint: '/api/v1/profiles',
183
+ httpMethod: 'delete',
184
+ summary: 'Bulk delete profiles',
185
+ description: 'Delete multiple Profiles. Nullifies IdentityBridge rows and cascades to related tables.',
186
+ stainlessPath: '(resource) v1.profiles > (method) bulk_delete',
187
+ qualified: 'client.v1.profiles.bulkDelete',
188
+ params: ['ids: string[];'],
189
+ response: '{ deletedCount: number; }',
190
+ markdown: "## bulk_delete\n\n`client.v1.profiles.bulkDelete(ids: string[]): { deletedCount: number; }`\n\n**delete** `/api/v1/profiles`\n\nDelete multiple Profiles. Nullifies IdentityBridge rows and cascades to related tables.\n\n### Parameters\n\n- `ids: string[]`\n\n### Returns\n\n- `{ deletedCount: number; }`\n\n - `deletedCount: number`\n\n### Example\n\n```typescript\nimport SegmentflowAI from '@segmentflow/segmentflow-typescript';\n\nconst client = new SegmentflowAI();\n\nconst response = await client.v1.profiles.bulkDelete({ ids: ['x'] });\n\nconsole.log(response);\n```",
191
+ perLanguage: {
192
+ typescript: {
193
+ method: 'client.v1.profiles.bulkDelete',
194
+ example: "import SegmentflowAI from '@segmentflow/segmentflow-typescript';\n\nconst client = new SegmentflowAI({\n apiKey: process.env['SEGMENTFLOW_API_KEY'], // This is the default and can be omitted\n});\n\nconst response = await client.v1.profiles.bulkDelete({ ids: ['x'] });\n\nconsole.log(response.deletedCount);",
195
+ },
196
+ python: {
197
+ method: 'v1.profiles.bulk_delete',
198
+ example: 'import os\nfrom segmentflow import SegmentflowAI\n\nclient = SegmentflowAI(\n api_key=os.environ.get("SEGMENTFLOW_API_KEY"), # This is the default and can be omitted\n)\nresponse = client.v1.profiles.bulk_delete(\n ids=["x"],\n)\nprint(response.deleted_count)',
199
+ },
200
+ java: {
201
+ method: 'v1().profiles().bulkDelete',
202
+ example: 'package com.segmentflow.api.example;\n\nimport com.segmentflow.api.client.SegmentflowAiClient;\nimport com.segmentflow.api.client.okhttp.SegmentflowAiOkHttpClient;\nimport com.segmentflow.api.models.v1.profiles.ProfileBulkDeleteParams;\nimport com.segmentflow.api.models.v1.profiles.ProfileBulkDeleteResponse;\n\npublic final class Main {\n private Main() {}\n\n public static void main(String[] args) {\n SegmentflowAiClient client = SegmentflowAiOkHttpClient.fromEnv();\n\n ProfileBulkDeleteParams params = ProfileBulkDeleteParams.builder()\n .addId("x")\n .build();\n ProfileBulkDeleteResponse response = client.v1().profiles().bulkDelete(params);\n }\n}',
203
+ },
204
+ go: {
205
+ method: 'client.V1.Profiles.BulkDelete',
206
+ example: 'package main\n\nimport (\n\t"context"\n\t"fmt"\n\n\t"github.com/segmentflow/segmentflow-go"\n\t"github.com/segmentflow/segmentflow-go/option"\n)\n\nfunc main() {\n\tclient := segmentflow.NewClient(\n\t\toption.WithAPIKey("My API Key"),\n\t)\n\tresponse, err := client.V1.Profiles.BulkDelete(context.TODO(), segmentflow.V1ProfileBulkDeleteParams{\n\t\tIDs: []string{"x"},\n\t})\n\tif err != nil {\n\t\tpanic(err.Error())\n\t}\n\tfmt.Printf("%+v\\n", response.DeletedCount)\n}\n',
207
+ },
208
+ cli: {
209
+ method: 'profiles bulk_delete',
210
+ example: "segmentflow v1:profiles bulk-delete \\\n --api-key 'My API Key' \\\n --id x",
211
+ },
212
+ php: {
213
+ method: 'v1->profiles->bulkDelete',
214
+ example: "<?php\n\nrequire_once dirname(__DIR__) . '/vendor/autoload.php';\n\n$client = new Client(apiKey: 'My API Key', environment: 'development');\n\n$response = $client->v1->profiles->bulkDelete(ids: ['x']);\n\nvar_dump($response);",
215
+ },
216
+ http: {
217
+ example: 'curl https://api.segmentflow.ai/api/v1/profiles \\\n -X DELETE \\\n -H "x-api-key: $SEGMENTFLOW_API_KEY"',
218
+ },
219
+ },
220
+ },
221
+ {
222
+ name: 'get_subscriptions',
223
+ endpoint: '/api/v1/profiles/{profileId}/subscriptions',
224
+ httpMethod: 'get',
225
+ summary: 'Get profile subscriptions',
226
+ description: 'Get subscription group statuses for a Profile',
227
+ stainlessPath: '(resource) v1.profiles > (method) get_subscriptions',
228
+ qualified: 'client.v1.profiles.getSubscriptions',
229
+ params: ['profileId: string;'],
230
+ response: '{ profileId: string; subscriptionGroups: { id: string; isSubscribed: boolean; name: string; }[]; }',
231
+ markdown: "## get_subscriptions\n\n`client.v1.profiles.getSubscriptions(profileId: string): { profileId: string; subscriptionGroups: object[]; }`\n\n**get** `/api/v1/profiles/{profileId}/subscriptions`\n\nGet subscription group statuses for a Profile\n\n### Parameters\n\n- `profileId: string`\n\n### Returns\n\n- `{ profileId: string; subscriptionGroups: { id: string; isSubscribed: boolean; name: string; }[]; }`\n GET /api/v1/profiles/:profileId/subscriptions response — group statuses for one Profile\n\n - `profileId: string`\n - `subscriptionGroups: { id: string; isSubscribed: boolean; name: string; }[]`\n\n### Example\n\n```typescript\nimport SegmentflowAI from '@segmentflow/segmentflow-typescript';\n\nconst client = new SegmentflowAI();\n\nconst profileSubscriptions = await client.v1.profiles.getSubscriptions('x');\n\nconsole.log(profileSubscriptions);\n```",
232
+ perLanguage: {
233
+ typescript: {
234
+ method: 'client.v1.profiles.getSubscriptions',
235
+ example: "import SegmentflowAI from '@segmentflow/segmentflow-typescript';\n\nconst client = new SegmentflowAI({\n apiKey: process.env['SEGMENTFLOW_API_KEY'], // This is the default and can be omitted\n});\n\nconst profileSubscriptions = await client.v1.profiles.getSubscriptions('x');\n\nconsole.log(profileSubscriptions.profileId);",
236
+ },
237
+ python: {
238
+ method: 'v1.profiles.get_subscriptions',
239
+ example: 'import os\nfrom segmentflow import SegmentflowAI\n\nclient = SegmentflowAI(\n api_key=os.environ.get("SEGMENTFLOW_API_KEY"), # This is the default and can be omitted\n)\nprofile_subscriptions = client.v1.profiles.get_subscriptions(\n "x",\n)\nprint(profile_subscriptions.profile_id)',
240
+ },
241
+ java: {
242
+ method: 'v1().profiles().getSubscriptions',
243
+ example: 'package com.segmentflow.api.example;\n\nimport com.segmentflow.api.client.SegmentflowAiClient;\nimport com.segmentflow.api.client.okhttp.SegmentflowAiOkHttpClient;\nimport com.segmentflow.api.models.v1.profiles.ProfileGetSubscriptionsParams;\nimport com.segmentflow.api.models.v1.profiles.ProfileSubscriptions;\n\npublic final class Main {\n private Main() {}\n\n public static void main(String[] args) {\n SegmentflowAiClient client = SegmentflowAiOkHttpClient.fromEnv();\n\n ProfileSubscriptions profileSubscriptions = client.v1().profiles().getSubscriptions("x");\n }\n}',
244
+ },
245
+ go: {
246
+ method: 'client.V1.Profiles.GetSubscriptions',
247
+ example: 'package main\n\nimport (\n\t"context"\n\t"fmt"\n\n\t"github.com/segmentflow/segmentflow-go"\n\t"github.com/segmentflow/segmentflow-go/option"\n)\n\nfunc main() {\n\tclient := segmentflow.NewClient(\n\t\toption.WithAPIKey("My API Key"),\n\t)\n\tprofileSubscriptions, err := client.V1.Profiles.GetSubscriptions(context.TODO(), "x")\n\tif err != nil {\n\t\tpanic(err.Error())\n\t}\n\tfmt.Printf("%+v\\n", profileSubscriptions.ProfileID)\n}\n',
248
+ },
249
+ cli: {
250
+ method: 'profiles get_subscriptions',
251
+ example: "segmentflow v1:profiles get-subscriptions \\\n --api-key 'My API Key' \\\n --profile-id x",
252
+ },
253
+ php: {
254
+ method: 'v1->profiles->getSubscriptions',
255
+ example: "<?php\n\nrequire_once dirname(__DIR__) . '/vendor/autoload.php';\n\n$client = new Client(apiKey: 'My API Key', environment: 'development');\n\n$profileSubscriptions = $client->v1->profiles->getSubscriptions('x');\n\nvar_dump($profileSubscriptions);",
256
+ },
257
+ http: {
258
+ example: 'curl https://api.segmentflow.ai/api/v1/profiles/$PROFILE_ID/subscriptions \\\n -H "x-api-key: $SEGMENTFLOW_API_KEY"',
259
+ },
260
+ },
261
+ },
262
+ {
263
+ name: 'list',
264
+ endpoint: '/api/v1/assets',
265
+ httpMethod: 'get',
266
+ summary: '',
267
+ description: '',
268
+ stainlessPath: '(resource) v1.assets > (method) list',
269
+ qualified: 'client.v1.assets.list',
270
+ response: "{ assets: { id: string; altText: string; assetType: string; contentType: string; createdAt: string; description: string; filename: string; height: number; imageType: 'logo' | 'hero' | 'header' | 'product' | 'background' | 'icon' | 'other'; organizationId: string; s3Key: string; size: number; source: 'custom' | 'brand_kit' | 'product' | 'ai_chat'; tags: string[]; updatedAt: string; url: string; website: { id: string; name: string; }; websiteId: string; width: number; }[]; success: boolean; }",
271
+ markdown: "## list\n\n`client.v1.assets.list(): { assets: object[]; success: boolean; }`\n\n**get** `/api/v1/assets`\n\n### Returns\n\n- `{ assets: { id: string; altText: string; assetType: string; contentType: string; createdAt: string; description: string; filename: string; height: number; imageType: 'logo' | 'hero' | 'header' | 'product' | 'background' | 'icon' | 'other'; organizationId: string; s3Key: string; size: number; source: 'custom' | 'brand_kit' | 'product' | 'ai_chat'; tags: string[]; updatedAt: string; url: string; website: { id: string; name: string; }; websiteId: string; width: number; }[]; success: boolean; }`\n\n - `assets: { id: string; altText: string; assetType: string; contentType: string; createdAt: string; description: string; filename: string; height: number; imageType: 'logo' | 'hero' | 'header' | 'product' | 'background' | 'icon' | 'other'; organizationId: string; s3Key: string; size: number; source: 'custom' | 'brand_kit' | 'product' | 'ai_chat'; tags: string[]; updatedAt: string; url: string; website: { id: string; name: string; }; websiteId: string; width: number; }[]`\n - `success: boolean`\n\n### Example\n\n```typescript\nimport SegmentflowAI from '@segmentflow/segmentflow-typescript';\n\nconst client = new SegmentflowAI();\n\nconst assets = await client.v1.assets.list();\n\nconsole.log(assets);\n```",
272
+ perLanguage: {
273
+ typescript: {
274
+ method: 'client.v1.assets.list',
275
+ example: "import SegmentflowAI from '@segmentflow/segmentflow-typescript';\n\nconst client = new SegmentflowAI({\n apiKey: process.env['SEGMENTFLOW_API_KEY'], // This is the default and can be omitted\n});\n\nconst assets = await client.v1.assets.list();\n\nconsole.log(assets.assets);",
276
+ },
277
+ python: {
278
+ method: 'v1.assets.list',
279
+ example: 'import os\nfrom segmentflow import SegmentflowAI\n\nclient = SegmentflowAI(\n api_key=os.environ.get("SEGMENTFLOW_API_KEY"), # This is the default and can be omitted\n)\nassets = client.v1.assets.list()\nprint(assets.assets)',
280
+ },
281
+ java: {
282
+ method: 'v1().assets().list',
283
+ example: 'package com.segmentflow.api.example;\n\nimport com.segmentflow.api.client.SegmentflowAiClient;\nimport com.segmentflow.api.client.okhttp.SegmentflowAiOkHttpClient;\nimport com.segmentflow.api.models.v1.assets.AssetListParams;\nimport com.segmentflow.api.models.v1.assets.AssetListResponse;\n\npublic final class Main {\n private Main() {}\n\n public static void main(String[] args) {\n SegmentflowAiClient client = SegmentflowAiOkHttpClient.fromEnv();\n\n AssetListResponse assets = client.v1().assets().list();\n }\n}',
284
+ },
285
+ go: {
286
+ method: 'client.V1.Assets.List',
287
+ example: 'package main\n\nimport (\n\t"context"\n\t"fmt"\n\n\t"github.com/segmentflow/segmentflow-go"\n\t"github.com/segmentflow/segmentflow-go/option"\n)\n\nfunc main() {\n\tclient := segmentflow.NewClient(\n\t\toption.WithAPIKey("My API Key"),\n\t)\n\tassets, err := client.V1.Assets.List(context.TODO())\n\tif err != nil {\n\t\tpanic(err.Error())\n\t}\n\tfmt.Printf("%+v\\n", assets.Assets)\n}\n',
288
+ },
289
+ cli: {
290
+ method: 'assets list',
291
+ example: "segmentflow v1:assets list \\\n --api-key 'My API Key'",
292
+ },
293
+ php: {
294
+ method: 'v1->assets->list',
295
+ example: "<?php\n\nrequire_once dirname(__DIR__) . '/vendor/autoload.php';\n\n$client = new Client(apiKey: 'My API Key', environment: 'development');\n\n$assets = $client->v1->assets->list();\n\nvar_dump($assets);",
296
+ },
297
+ http: {
298
+ example: 'curl https://api.segmentflow.ai/api/v1/assets \\\n -H "x-api-key: $SEGMENTFLOW_API_KEY"',
299
+ },
300
+ },
301
+ },
302
+ {
303
+ name: 'create',
304
+ endpoint: '/api/v1/assets',
305
+ httpMethod: 'post',
306
+ summary: '',
307
+ description: '',
308
+ stainlessPath: '(resource) v1.assets > (method) create',
309
+ qualified: 'client.v1.assets.create',
310
+ params: [
311
+ 'contentType: string;',
312
+ 'filename: string;',
313
+ 's3Key: string;',
314
+ 'size: number;',
315
+ "assetType?: 'content-image' | 'content-document' | 'lead-magnet';",
316
+ "imageType?: 'logo' | 'hero' | 'header' | 'product' | 'background' | 'icon' | 'other';",
317
+ 'websiteId?: string;',
318
+ ],
319
+ response: "{ asset: { id: string; altText: string; assetType: string; contentType: string; createdAt: string; description: string; filename: string; height: number; imageType: 'logo' | 'hero' | 'header' | 'product' | 'background' | 'icon' | 'other'; organizationId: string; s3Key: string; size: number; source: 'custom' | 'brand_kit' | 'product' | 'ai_chat'; tags: string[]; updatedAt: string; url: string; website: { id: string; name: string; }; websiteId: string; width: number; }; success: boolean; }",
320
+ markdown: "## create\n\n`client.v1.assets.create(contentType: string, filename: string, s3Key: string, size: number, assetType?: 'content-image' | 'content-document' | 'lead-magnet', imageType?: 'logo' | 'hero' | 'header' | 'product' | 'background' | 'icon' | 'other', websiteId?: string): { asset: object; success: boolean; }`\n\n**post** `/api/v1/assets`\n\n### Parameters\n\n- `contentType: string`\n\n- `filename: string`\n\n- `s3Key: string`\n\n- `size: number`\n\n- `assetType?: 'content-image' | 'content-document' | 'lead-magnet'`\n\n- `imageType?: 'logo' | 'hero' | 'header' | 'product' | 'background' | 'icon' | 'other'`\n Category of image for use in email templates\n\n- `websiteId?: string`\n\n### Returns\n\n- `{ asset: { id: string; altText: string; assetType: string; contentType: string; createdAt: string; description: string; filename: string; height: number; imageType: 'logo' | 'hero' | 'header' | 'product' | 'background' | 'icon' | 'other'; organizationId: string; s3Key: string; size: number; source: 'custom' | 'brand_kit' | 'product' | 'ai_chat'; tags: string[]; updatedAt: string; url: string; website: { id: string; name: string; }; websiteId: string; width: number; }; success: boolean; }`\n\n - `asset: { id: string; altText: string; assetType: string; contentType: string; createdAt: string; description: string; filename: string; height: number; imageType: 'logo' | 'hero' | 'header' | 'product' | 'background' | 'icon' | 'other'; organizationId: string; s3Key: string; size: number; source: 'custom' | 'brand_kit' | 'product' | 'ai_chat'; tags: string[]; updatedAt: string; url: string; website: { id: string; name: string; }; websiteId: string; width: number; }`\n - `success: boolean`\n\n### Example\n\n```typescript\nimport SegmentflowAI from '@segmentflow/segmentflow-typescript';\n\nconst client = new SegmentflowAI();\n\nconst asset = await client.v1.assets.create({\n contentType: 'x',\n filename: 'x',\n s3Key: 'x',\n size: 0,\n});\n\nconsole.log(asset);\n```",
321
+ perLanguage: {
322
+ typescript: {
323
+ method: 'client.v1.assets.create',
324
+ example: "import SegmentflowAI from '@segmentflow/segmentflow-typescript';\n\nconst client = new SegmentflowAI({\n apiKey: process.env['SEGMENTFLOW_API_KEY'], // This is the default and can be omitted\n});\n\nconst asset = await client.v1.assets.create({\n contentType: 'x',\n filename: 'x',\n s3Key: 'x',\n size: 0,\n});\n\nconsole.log(asset.asset);",
325
+ },
326
+ python: {
327
+ method: 'v1.assets.create',
328
+ example: 'import os\nfrom segmentflow import SegmentflowAI\n\nclient = SegmentflowAI(\n api_key=os.environ.get("SEGMENTFLOW_API_KEY"), # This is the default and can be omitted\n)\nasset = client.v1.assets.create(\n content_type="x",\n filename="x",\n s3_key="x",\n size=0,\n)\nprint(asset.asset)',
329
+ },
330
+ java: {
331
+ method: 'v1().assets().create',
332
+ example: 'package com.segmentflow.api.example;\n\nimport com.segmentflow.api.client.SegmentflowAiClient;\nimport com.segmentflow.api.client.okhttp.SegmentflowAiOkHttpClient;\nimport com.segmentflow.api.models.v1.assets.AssetCreateParams;\nimport com.segmentflow.api.models.v1.assets.AssetCreateResponse;\n\npublic final class Main {\n private Main() {}\n\n public static void main(String[] args) {\n SegmentflowAiClient client = SegmentflowAiOkHttpClient.fromEnv();\n\n AssetCreateParams params = AssetCreateParams.builder()\n .contentType("x")\n .filename("x")\n .s3Key("x")\n .size(0.0)\n .build();\n AssetCreateResponse asset = client.v1().assets().create(params);\n }\n}',
333
+ },
334
+ go: {
335
+ method: 'client.V1.Assets.New',
336
+ example: 'package main\n\nimport (\n\t"context"\n\t"fmt"\n\n\t"github.com/segmentflow/segmentflow-go"\n\t"github.com/segmentflow/segmentflow-go/option"\n)\n\nfunc main() {\n\tclient := segmentflow.NewClient(\n\t\toption.WithAPIKey("My API Key"),\n\t)\n\tasset, err := client.V1.Assets.New(context.TODO(), segmentflow.V1AssetNewParams{\n\t\tContentType: "x",\n\t\tFilename: "x",\n\t\tS3Key: "x",\n\t\tSize: 0,\n\t})\n\tif err != nil {\n\t\tpanic(err.Error())\n\t}\n\tfmt.Printf("%+v\\n", asset.Asset)\n}\n',
337
+ },
338
+ cli: {
339
+ method: 'assets create',
340
+ example: "segmentflow v1:assets create \\\n --api-key 'My API Key' \\\n --content-type x \\\n --filename x \\\n --s3-key x \\\n --size 0",
341
+ },
342
+ php: {
343
+ method: 'v1->assets->create',
344
+ example: "<?php\n\nrequire_once dirname(__DIR__) . '/vendor/autoload.php';\n\n$client = new Client(apiKey: 'My API Key', environment: 'development');\n\n$asset = $client->v1->assets->create(\n contentType: 'x',\n filename: 'x',\n s3Key: 'x',\n size: 0,\n assetType: 'content-image',\n imageType: 'logo',\n websiteID: '182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e',\n);\n\nvar_dump($asset);",
345
+ },
346
+ http: {
347
+ example: 'curl https://api.segmentflow.ai/api/v1/assets \\\n -H \'Content-Type: application/json\' \\\n -H "x-api-key: $SEGMENTFLOW_API_KEY" \\\n -d \'{\n "contentType": "x",\n "filename": "x",\n "s3Key": "x",\n "size": 0\n }\'',
348
+ },
349
+ },
350
+ },
351
+ {
352
+ name: 'request_upload',
353
+ endpoint: '/api/v1/assets/upload-request',
354
+ httpMethod: 'post',
355
+ summary: '',
356
+ description: '',
357
+ stainlessPath: '(resource) v1.assets > (method) request_upload',
358
+ qualified: 'client.v1.assets.requestUpload',
359
+ params: [
360
+ 'contentType: string;',
361
+ 'filename: string;',
362
+ 'size: number;',
363
+ "assetType?: 'content-image' | 'content-document' | 'lead-magnet';",
364
+ ],
365
+ response: '{ assetId: string; expiresAt: string; headers: object; uploadUrl: string; }',
366
+ markdown: "## request_upload\n\n`client.v1.assets.requestUpload(contentType: string, filename: string, size: number, assetType?: 'content-image' | 'content-document' | 'lead-magnet'): { assetId: string; expiresAt: string; headers: object; uploadUrl: string; }`\n\n**post** `/api/v1/assets/upload-request`\n\n### Parameters\n\n- `contentType: string`\n\n- `filename: string`\n\n- `size: number`\n\n- `assetType?: 'content-image' | 'content-document' | 'lead-magnet'`\n\n### Returns\n\n- `{ assetId: string; expiresAt: string; headers: object; uploadUrl: string; }`\n\n - `assetId: string`\n - `expiresAt: string`\n - `headers: object`\n - `uploadUrl: string`\n\n### Example\n\n```typescript\nimport SegmentflowAI from '@segmentflow/segmentflow-typescript';\n\nconst client = new SegmentflowAI();\n\nconst response = await client.v1.assets.requestUpload({\n contentType: 'x',\n filename: 'x',\n size: 9007199254740991,\n});\n\nconsole.log(response);\n```",
56
367
  perLanguage: {
57
368
  typescript: {
58
- method: 'client.v1.public.getBrandKit',
59
- example: "import SegmentflowAI from '@segmentflow/segmentflow-typescript';\n\nconst client = new SegmentflowAI({\n apiKey: process.env['SEGMENTFLOW_API_KEY'], // This is the default and can be omitted\n});\n\nconst response = await client.v1.public.getBrandKit();\n\nconsole.log(response.brandKits);",
369
+ method: 'client.v1.assets.requestUpload',
370
+ example: "import SegmentflowAI from '@segmentflow/segmentflow-typescript';\n\nconst client = new SegmentflowAI({\n apiKey: process.env['SEGMENTFLOW_API_KEY'], // This is the default and can be omitted\n});\n\nconst response = await client.v1.assets.requestUpload({\n contentType: 'x',\n filename: 'x',\n size: 9007199254740991,\n});\n\nconsole.log(response.assetId);",
371
+ },
372
+ python: {
373
+ method: 'v1.assets.request_upload',
374
+ example: 'import os\nfrom segmentflow import SegmentflowAI\n\nclient = SegmentflowAI(\n api_key=os.environ.get("SEGMENTFLOW_API_KEY"), # This is the default and can be omitted\n)\nresponse = client.v1.assets.request_upload(\n content_type="x",\n filename="x",\n size=9007199254740991,\n)\nprint(response.asset_id)',
375
+ },
376
+ java: {
377
+ method: 'v1().assets().requestUpload',
378
+ example: 'package com.segmentflow.api.example;\n\nimport com.segmentflow.api.client.SegmentflowAiClient;\nimport com.segmentflow.api.client.okhttp.SegmentflowAiOkHttpClient;\nimport com.segmentflow.api.models.v1.assets.AssetRequestUploadParams;\nimport com.segmentflow.api.models.v1.assets.AssetRequestUploadResponse;\n\npublic final class Main {\n private Main() {}\n\n public static void main(String[] args) {\n SegmentflowAiClient client = SegmentflowAiOkHttpClient.fromEnv();\n\n AssetRequestUploadParams params = AssetRequestUploadParams.builder()\n .contentType("x")\n .filename("x")\n .size(9007199254740991L)\n .build();\n AssetRequestUploadResponse response = client.v1().assets().requestUpload(params);\n }\n}',
379
+ },
380
+ go: {
381
+ method: 'client.V1.Assets.RequestUpload',
382
+ example: 'package main\n\nimport (\n\t"context"\n\t"fmt"\n\n\t"github.com/segmentflow/segmentflow-go"\n\t"github.com/segmentflow/segmentflow-go/option"\n)\n\nfunc main() {\n\tclient := segmentflow.NewClient(\n\t\toption.WithAPIKey("My API Key"),\n\t)\n\tresponse, err := client.V1.Assets.RequestUpload(context.TODO(), segmentflow.V1AssetRequestUploadParams{\n\t\tContentType: "x",\n\t\tFilename: "x",\n\t\tSize: 9007199254740991,\n\t})\n\tif err != nil {\n\t\tpanic(err.Error())\n\t}\n\tfmt.Printf("%+v\\n", response.AssetID)\n}\n',
383
+ },
384
+ cli: {
385
+ method: 'assets request_upload',
386
+ example: "segmentflow v1:assets request-upload \\\n --api-key 'My API Key' \\\n --content-type x \\\n --filename x \\\n --size 9007199254740991",
387
+ },
388
+ php: {
389
+ method: 'v1->assets->requestUpload',
390
+ example: "<?php\n\nrequire_once dirname(__DIR__) . '/vendor/autoload.php';\n\n$client = new Client(apiKey: 'My API Key', environment: 'development');\n\n$response = $client->v1->assets->requestUpload(\n contentType: 'x',\n filename: 'x',\n size: 9007199254740991,\n assetType: 'content-image',\n);\n\nvar_dump($response);",
60
391
  },
61
392
  http: {
62
- example: 'curl https://api.segmentflow.ai/api/v1/public/brand-kit \\\n -H "x-api-key: $SEGMENTFLOW_API_KEY"',
393
+ example: 'curl https://api.segmentflow.ai/api/v1/assets/upload-request \\\n -H \'Content-Type: application/json\' \\\n -H "x-api-key: $SEGMENTFLOW_API_KEY" \\\n -d \'{\n "contentType": "x",\n "filename": "x",\n "size": 9007199254740991\n }\'',
63
394
  },
64
395
  },
65
396
  },
66
397
  {
67
- name: 'trigger',
68
- endpoint: '/api/v1/public/journeys/{id}/trigger',
398
+ name: 'get_upload_url',
399
+ endpoint: '/api/v1/assets/upload-url',
69
400
  httpMethod: 'post',
70
- summary: 'Trigger a journey for a profile',
71
- description: 'Start an API-triggerable journey for a single profile. Returns immediately; poll GET /journeys/runs/{runId} for status. Supports Idempotency-Key header.',
72
- stainlessPath: '(resource) v1.public.journeys > (method) trigger',
73
- qualified: 'client.v1.public.journeys.trigger',
401
+ summary: '',
402
+ description: '',
403
+ stainlessPath: '(resource) v1.assets > (method) get_upload_url',
404
+ qualified: 'client.v1.assets.getUploadURL',
405
+ params: [
406
+ "contentType: 'image/jpeg' | 'image/png' | 'text/csv' | 'application/vnd.ms-excel' | 'application/pdf';",
407
+ 'filename: string;',
408
+ 'size: number;',
409
+ "assetType?: 'content-image' | 'content-document' | 'lead-magnet';",
410
+ 'websiteId?: string;',
411
+ ],
412
+ response: '{ expiresIn: number; key: string; success: boolean; uploadUrl: string; }',
413
+ markdown: "## get_upload_url\n\n`client.v1.assets.getUploadURL(contentType: 'image/jpeg' | 'image/png' | 'text/csv' | 'application/vnd.ms-excel' | 'application/pdf', filename: string, size: number, assetType?: 'content-image' | 'content-document' | 'lead-magnet', websiteId?: string): { expiresIn: number; key: string; success: boolean; uploadUrl: string; }`\n\n**post** `/api/v1/assets/upload-url`\n\n### Parameters\n\n- `contentType: 'image/jpeg' | 'image/png' | 'text/csv' | 'application/vnd.ms-excel' | 'application/pdf'`\n\n- `filename: string`\n\n- `size: number`\n\n- `assetType?: 'content-image' | 'content-document' | 'lead-magnet'`\n\n- `websiteId?: string`\n\n### Returns\n\n- `{ expiresIn: number; key: string; success: boolean; uploadUrl: string; }`\n\n - `expiresIn: number`\n - `key: string`\n - `success: boolean`\n - `uploadUrl: string`\n\n### Example\n\n```typescript\nimport SegmentflowAI from '@segmentflow/segmentflow-typescript';\n\nconst client = new SegmentflowAI();\n\nconst response = await client.v1.assets.getUploadURL({\n contentType: 'image/jpeg',\n filename: 'x',\n size: 20971520,\n});\n\nconsole.log(response);\n```",
414
+ perLanguage: {
415
+ typescript: {
416
+ method: 'client.v1.assets.getUploadURL',
417
+ example: "import SegmentflowAI from '@segmentflow/segmentflow-typescript';\n\nconst client = new SegmentflowAI({\n apiKey: process.env['SEGMENTFLOW_API_KEY'], // This is the default and can be omitted\n});\n\nconst response = await client.v1.assets.getUploadURL({\n contentType: 'image/jpeg',\n filename: 'x',\n size: 20971520,\n});\n\nconsole.log(response.expiresIn);",
418
+ },
419
+ python: {
420
+ method: 'v1.assets.get_upload_url',
421
+ example: 'import os\nfrom segmentflow import SegmentflowAI\n\nclient = SegmentflowAI(\n api_key=os.environ.get("SEGMENTFLOW_API_KEY"), # This is the default and can be omitted\n)\nresponse = client.v1.assets.get_upload_url(\n content_type="image/jpeg",\n filename="x",\n size=20971520,\n)\nprint(response.expires_in)',
422
+ },
423
+ java: {
424
+ method: 'v1().assets().getUploadUrl',
425
+ example: 'package com.segmentflow.api.example;\n\nimport com.segmentflow.api.client.SegmentflowAiClient;\nimport com.segmentflow.api.client.okhttp.SegmentflowAiOkHttpClient;\nimport com.segmentflow.api.models.v1.assets.AssetGetUploadUrlParams;\nimport com.segmentflow.api.models.v1.assets.AssetGetUploadUrlResponse;\n\npublic final class Main {\n private Main() {}\n\n public static void main(String[] args) {\n SegmentflowAiClient client = SegmentflowAiOkHttpClient.fromEnv();\n\n AssetGetUploadUrlParams params = AssetGetUploadUrlParams.builder()\n .contentType(AssetGetUploadUrlParams.ContentType.IMAGE_JPEG)\n .filename("x")\n .size(20971520.0)\n .build();\n AssetGetUploadUrlResponse response = client.v1().assets().getUploadUrl(params);\n }\n}',
426
+ },
427
+ go: {
428
+ method: 'client.V1.Assets.GetUploadURL',
429
+ example: 'package main\n\nimport (\n\t"context"\n\t"fmt"\n\n\t"github.com/segmentflow/segmentflow-go"\n\t"github.com/segmentflow/segmentflow-go/option"\n)\n\nfunc main() {\n\tclient := segmentflow.NewClient(\n\t\toption.WithAPIKey("My API Key"),\n\t)\n\tresponse, err := client.V1.Assets.GetUploadURL(context.TODO(), segmentflow.V1AssetGetUploadURLParams{\n\t\tContentType: segmentflow.V1AssetGetUploadURLParamsContentTypeImageJpeg,\n\t\tFilename: "x",\n\t\tSize: 20971520,\n\t})\n\tif err != nil {\n\t\tpanic(err.Error())\n\t}\n\tfmt.Printf("%+v\\n", response.ExpiresIn)\n}\n',
430
+ },
431
+ cli: {
432
+ method: 'assets get_upload_url',
433
+ example: "segmentflow v1:assets get-upload-url \\\n --api-key 'My API Key' \\\n --content-type image/jpeg \\\n --filename x \\\n --size 20971520",
434
+ },
435
+ php: {
436
+ method: 'v1->assets->getUploadURL',
437
+ example: "<?php\n\nrequire_once dirname(__DIR__) . '/vendor/autoload.php';\n\n$client = new Client(apiKey: 'My API Key', environment: 'development');\n\n$response = $client->v1->assets->getUploadURL(\n contentType: 'image/jpeg',\n filename: 'x',\n size: 20971520,\n assetType: 'content-image',\n websiteID: '182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e',\n);\n\nvar_dump($response);",
438
+ },
439
+ http: {
440
+ example: 'curl https://api.segmentflow.ai/api/v1/assets/upload-url \\\n -H \'Content-Type: application/json\' \\\n -H "x-api-key: $SEGMENTFLOW_API_KEY" \\\n -d \'{\n "contentType": "image/jpeg",\n "filename": "x",\n "size": 20971520\n }\'',
441
+ },
442
+ },
443
+ },
444
+ {
445
+ name: 'finalize',
446
+ endpoint: '/api/v1/assets/{assetId}/finalize',
447
+ httpMethod: 'post',
448
+ summary: '',
449
+ description: '',
450
+ stainlessPath: '(resource) v1.assets > (method) finalize',
451
+ qualified: 'client.v1.assets.finalize',
452
+ params: [
453
+ 'assetId: string;',
454
+ 'altText?: string;',
455
+ 'description?: string;',
456
+ "imageType?: 'logo' | 'hero' | 'header' | 'product' | 'background' | 'icon' | 'other';",
457
+ ],
458
+ response: '{ asset: { id: string; contentType: string; createdAt: string; filename: string; height: number; size: number; url: string; width: number; }; }',
459
+ markdown: "## finalize\n\n`client.v1.assets.finalize(assetId: string, altText?: string, description?: string, imageType?: 'logo' | 'hero' | 'header' | 'product' | 'background' | 'icon' | 'other'): { asset: object; }`\n\n**post** `/api/v1/assets/{assetId}/finalize`\n\n### Parameters\n\n- `assetId: string`\n\n- `altText?: string`\n\n- `description?: string`\n\n- `imageType?: 'logo' | 'hero' | 'header' | 'product' | 'background' | 'icon' | 'other'`\n Category of image for use in email templates\n\n### Returns\n\n- `{ asset: { id: string; contentType: string; createdAt: string; filename: string; height: number; size: number; url: string; width: number; }; }`\n\n - `asset: { id: string; contentType: string; createdAt: string; filename: string; height: number; size: number; url: string; width: number; }`\n\n### Example\n\n```typescript\nimport SegmentflowAI from '@segmentflow/segmentflow-typescript';\n\nconst client = new SegmentflowAI();\n\nconst response = await client.v1.assets.finalize('182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e');\n\nconsole.log(response);\n```",
460
+ perLanguage: {
461
+ typescript: {
462
+ method: 'client.v1.assets.finalize',
463
+ example: "import SegmentflowAI from '@segmentflow/segmentflow-typescript';\n\nconst client = new SegmentflowAI({\n apiKey: process.env['SEGMENTFLOW_API_KEY'], // This is the default and can be omitted\n});\n\nconst response = await client.v1.assets.finalize('182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e');\n\nconsole.log(response.asset);",
464
+ },
465
+ python: {
466
+ method: 'v1.assets.finalize',
467
+ example: 'import os\nfrom segmentflow import SegmentflowAI\n\nclient = SegmentflowAI(\n api_key=os.environ.get("SEGMENTFLOW_API_KEY"), # This is the default and can be omitted\n)\nresponse = client.v1.assets.finalize(\n asset_id="182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e",\n)\nprint(response.asset)',
468
+ },
469
+ java: {
470
+ method: 'v1().assets().finalize',
471
+ example: 'package com.segmentflow.api.example;\n\nimport com.segmentflow.api.client.SegmentflowAiClient;\nimport com.segmentflow.api.client.okhttp.SegmentflowAiOkHttpClient;\nimport com.segmentflow.api.models.v1.assets.AssetFinalizeParams;\nimport com.segmentflow.api.models.v1.assets.AssetFinalizeResponse;\n\npublic final class Main {\n private Main() {}\n\n public static void main(String[] args) {\n SegmentflowAiClient client = SegmentflowAiOkHttpClient.fromEnv();\n\n AssetFinalizeResponse response = client.v1().assets().finalize("182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e");\n }\n}',
472
+ },
473
+ go: {
474
+ method: 'client.V1.Assets.Finalize',
475
+ example: 'package main\n\nimport (\n\t"context"\n\t"fmt"\n\n\t"github.com/segmentflow/segmentflow-go"\n\t"github.com/segmentflow/segmentflow-go/option"\n)\n\nfunc main() {\n\tclient := segmentflow.NewClient(\n\t\toption.WithAPIKey("My API Key"),\n\t)\n\tresponse, err := client.V1.Assets.Finalize(\n\t\tcontext.TODO(),\n\t\t"182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e",\n\t\tsegmentflow.V1AssetFinalizeParams{},\n\t)\n\tif err != nil {\n\t\tpanic(err.Error())\n\t}\n\tfmt.Printf("%+v\\n", response.Asset)\n}\n',
476
+ },
477
+ cli: {
478
+ method: 'assets finalize',
479
+ example: "segmentflow v1:assets finalize \\\n --api-key 'My API Key' \\\n --asset-id 182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e",
480
+ },
481
+ php: {
482
+ method: 'v1->assets->finalize',
483
+ example: "<?php\n\nrequire_once dirname(__DIR__) . '/vendor/autoload.php';\n\n$client = new Client(apiKey: 'My API Key', environment: 'development');\n\n$response = $client->v1->assets->finalize(\n '182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e',\n altText: 'altText',\n description: 'description',\n imageType: 'logo',\n);\n\nvar_dump($response);",
484
+ },
485
+ http: {
486
+ example: 'curl https://api.segmentflow.ai/api/v1/assets/$ASSET_ID/finalize \\\n -X POST \\\n -H "x-api-key: $SEGMENTFLOW_API_KEY"',
487
+ },
488
+ },
489
+ },
490
+ {
491
+ name: 'update_metadata',
492
+ endpoint: '/api/v1/assets/{id}',
493
+ httpMethod: 'patch',
494
+ summary: '',
495
+ description: '',
496
+ stainlessPath: '(resource) v1.assets > (method) update_metadata',
497
+ qualified: 'client.v1.assets.updateMetadata',
74
498
  params: [
75
499
  'id: string;',
76
- 'profile: { anonymousId?: string; email?: string; userId?: string; };',
77
- 'variables?: object;',
500
+ 'altText?: string;',
501
+ 'description?: string;',
502
+ "imageType?: 'logo' | 'hero' | 'header' | 'product' | 'background' | 'icon' | 'other';",
503
+ 'tags?: string[];',
78
504
  ],
79
- response: "{ runId: string; status: 'queued' | 'running' | 'completed' | 'failed' | 'exited'; }",
80
- markdown: "## trigger\n\n`client.v1.public.journeys.trigger(id: string, profile: { anonymousId?: string; email?: string; userId?: string; }, variables?: object): { runId: string; status: 'queued' | 'running' | 'completed' | 'failed' | 'exited'; }`\n\n**post** `/api/v1/public/journeys/{id}/trigger`\n\nStart an API-triggerable journey for a single profile. Returns immediately; poll GET /journeys/runs/{runId} for status. Supports Idempotency-Key header.\n\n### Parameters\n\n- `id: string`\n\n- `profile: { anonymousId?: string; email?: string; userId?: string; }`\n - `anonymousId?: string`\n - `email?: string`\n - `userId?: string`\n\n- `variables?: object`\n\n### Returns\n\n- `{ runId: string; status: 'queued' | 'running' | 'completed' | 'failed' | 'exited'; }`\n\n - `runId: string`\n - `status: 'queued' | 'running' | 'completed' | 'failed' | 'exited'`\n\n### Example\n\n```typescript\nimport SegmentflowAI from '@segmentflow/segmentflow-typescript';\n\nconst client = new SegmentflowAI();\n\nconst response = await client.v1.public.journeys.trigger('182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e', { profile: {} });\n\nconsole.log(response);\n```",
505
+ response: "{ asset: { id: string; altText: string; assetType: string; contentType: string; createdAt: string; description: string; filename: string; height: number; imageType: 'logo' | 'hero' | 'header' | 'product' | 'background' | 'icon' | 'other'; organizationId: string; s3Key: string; size: number; source: 'custom' | 'brand_kit' | 'product' | 'ai_chat'; tags: string[]; updatedAt: string; url: string; website: { id: string; name: string; }; websiteId: string; width: number; }; success: boolean; }",
506
+ markdown: "## update_metadata\n\n`client.v1.assets.updateMetadata(id: string, altText?: string, description?: string, imageType?: 'logo' | 'hero' | 'header' | 'product' | 'background' | 'icon' | 'other', tags?: string[]): { asset: object; success: boolean; }`\n\n**patch** `/api/v1/assets/{id}`\n\n### Parameters\n\n- `id: string`\n\n- `altText?: string`\n\n- `description?: string`\n\n- `imageType?: 'logo' | 'hero' | 'header' | 'product' | 'background' | 'icon' | 'other'`\n Category of image for use in email templates\n\n- `tags?: string[]`\n\n### Returns\n\n- `{ asset: { id: string; altText: string; assetType: string; contentType: string; createdAt: string; description: string; filename: string; height: number; imageType: 'logo' | 'hero' | 'header' | 'product' | 'background' | 'icon' | 'other'; organizationId: string; s3Key: string; size: number; source: 'custom' | 'brand_kit' | 'product' | 'ai_chat'; tags: string[]; updatedAt: string; url: string; website: { id: string; name: string; }; websiteId: string; width: number; }; success: boolean; }`\n\n - `asset: { id: string; altText: string; assetType: string; contentType: string; createdAt: string; description: string; filename: string; height: number; imageType: 'logo' | 'hero' | 'header' | 'product' | 'background' | 'icon' | 'other'; organizationId: string; s3Key: string; size: number; source: 'custom' | 'brand_kit' | 'product' | 'ai_chat'; tags: string[]; updatedAt: string; url: string; website: { id: string; name: string; }; websiteId: string; width: number; }`\n - `success: boolean`\n\n### Example\n\n```typescript\nimport SegmentflowAI from '@segmentflow/segmentflow-typescript';\n\nconst client = new SegmentflowAI();\n\nconst response = await client.v1.assets.updateMetadata('182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e');\n\nconsole.log(response);\n```",
81
507
  perLanguage: {
82
508
  typescript: {
83
- method: 'client.v1.public.journeys.trigger',
84
- example: "import SegmentflowAI from '@segmentflow/segmentflow-typescript';\n\nconst client = new SegmentflowAI({\n apiKey: process.env['SEGMENTFLOW_API_KEY'], // This is the default and can be omitted\n});\n\nconst response = await client.v1.public.journeys.trigger('182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e', {\n profile: {},\n});\n\nconsole.log(response.runId);",
509
+ method: 'client.v1.assets.updateMetadata',
510
+ example: "import SegmentflowAI from '@segmentflow/segmentflow-typescript';\n\nconst client = new SegmentflowAI({\n apiKey: process.env['SEGMENTFLOW_API_KEY'], // This is the default and can be omitted\n});\n\nconst response = await client.v1.assets.updateMetadata('182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e');\n\nconsole.log(response.asset);",
511
+ },
512
+ python: {
513
+ method: 'v1.assets.update_metadata',
514
+ example: 'import os\nfrom segmentflow import SegmentflowAI\n\nclient = SegmentflowAI(\n api_key=os.environ.get("SEGMENTFLOW_API_KEY"), # This is the default and can be omitted\n)\nresponse = client.v1.assets.update_metadata(\n id="182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e",\n)\nprint(response.asset)',
515
+ },
516
+ java: {
517
+ method: 'v1().assets().updateMetadata',
518
+ example: 'package com.segmentflow.api.example;\n\nimport com.segmentflow.api.client.SegmentflowAiClient;\nimport com.segmentflow.api.client.okhttp.SegmentflowAiOkHttpClient;\nimport com.segmentflow.api.models.v1.assets.AssetUpdateMetadataParams;\nimport com.segmentflow.api.models.v1.assets.AssetUpdateMetadataResponse;\n\npublic final class Main {\n private Main() {}\n\n public static void main(String[] args) {\n SegmentflowAiClient client = SegmentflowAiOkHttpClient.fromEnv();\n\n AssetUpdateMetadataResponse response = client.v1().assets().updateMetadata("182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e");\n }\n}',
519
+ },
520
+ go: {
521
+ method: 'client.V1.Assets.UpdateMetadata',
522
+ example: 'package main\n\nimport (\n\t"context"\n\t"fmt"\n\n\t"github.com/segmentflow/segmentflow-go"\n\t"github.com/segmentflow/segmentflow-go/option"\n)\n\nfunc main() {\n\tclient := segmentflow.NewClient(\n\t\toption.WithAPIKey("My API Key"),\n\t)\n\tresponse, err := client.V1.Assets.UpdateMetadata(\n\t\tcontext.TODO(),\n\t\t"182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e",\n\t\tsegmentflow.V1AssetUpdateMetadataParams{},\n\t)\n\tif err != nil {\n\t\tpanic(err.Error())\n\t}\n\tfmt.Printf("%+v\\n", response.Asset)\n}\n',
523
+ },
524
+ cli: {
525
+ method: 'assets update_metadata',
526
+ example: "segmentflow v1:assets update-metadata \\\n --api-key 'My API Key' \\\n --id 182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e",
527
+ },
528
+ php: {
529
+ method: 'v1->assets->updateMetadata',
530
+ example: "<?php\n\nrequire_once dirname(__DIR__) . '/vendor/autoload.php';\n\n$client = new Client(apiKey: 'My API Key', environment: 'development');\n\n$response = $client->v1->assets->updateMetadata(\n '182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e',\n altText: 'altText',\n description: 'description',\n imageType: 'logo',\n tags: ['string'],\n);\n\nvar_dump($response);",
85
531
  },
86
532
  http: {
87
- example: 'curl https://api.segmentflow.ai/api/v1/public/journeys/$ID/trigger \\\n -H \'Content-Type: application/json\' \\\n -H "x-api-key: $SEGMENTFLOW_API_KEY" \\\n -d \'{\n "profile": {}\n }\'',
533
+ example: 'curl https://api.segmentflow.ai/api/v1/assets/$ID \\\n -X PATCH \\\n -H "x-api-key: $SEGMENTFLOW_API_KEY"',
88
534
  },
89
535
  },
90
536
  },
91
537
  {
92
- name: 'get_run_status',
93
- endpoint: '/api/v1/public/journeys/runs/{runId}',
538
+ name: 'delete',
539
+ endpoint: '/api/v1/assets/{id}',
540
+ httpMethod: 'delete',
541
+ summary: '',
542
+ description: '',
543
+ stainlessPath: '(resource) v1.assets > (method) delete',
544
+ qualified: 'client.v1.assets.delete',
545
+ params: ['id: string;'],
546
+ response: '{ message: string; success: boolean; }',
547
+ markdown: "## delete\n\n`client.v1.assets.delete(id: string): { message: string; success: boolean; }`\n\n**delete** `/api/v1/assets/{id}`\n\n### Parameters\n\n- `id: string`\n\n### Returns\n\n- `{ message: string; success: boolean; }`\n\n - `message: string`\n - `success: boolean`\n\n### Example\n\n```typescript\nimport SegmentflowAI from '@segmentflow/segmentflow-typescript';\n\nconst client = new SegmentflowAI();\n\nconst asset = await client.v1.assets.delete('182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e');\n\nconsole.log(asset);\n```",
548
+ perLanguage: {
549
+ typescript: {
550
+ method: 'client.v1.assets.delete',
551
+ example: "import SegmentflowAI from '@segmentflow/segmentflow-typescript';\n\nconst client = new SegmentflowAI({\n apiKey: process.env['SEGMENTFLOW_API_KEY'], // This is the default and can be omitted\n});\n\nconst asset = await client.v1.assets.delete('182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e');\n\nconsole.log(asset.message);",
552
+ },
553
+ python: {
554
+ method: 'v1.assets.delete',
555
+ example: 'import os\nfrom segmentflow import SegmentflowAI\n\nclient = SegmentflowAI(\n api_key=os.environ.get("SEGMENTFLOW_API_KEY"), # This is the default and can be omitted\n)\nasset = client.v1.assets.delete(\n "182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e",\n)\nprint(asset.message)',
556
+ },
557
+ java: {
558
+ method: 'v1().assets().delete',
559
+ example: 'package com.segmentflow.api.example;\n\nimport com.segmentflow.api.client.SegmentflowAiClient;\nimport com.segmentflow.api.client.okhttp.SegmentflowAiOkHttpClient;\nimport com.segmentflow.api.models.v1.assets.AssetDeleteParams;\nimport com.segmentflow.api.models.v1.assets.AssetDeleteResponse;\n\npublic final class Main {\n private Main() {}\n\n public static void main(String[] args) {\n SegmentflowAiClient client = SegmentflowAiOkHttpClient.fromEnv();\n\n AssetDeleteResponse asset = client.v1().assets().delete("182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e");\n }\n}',
560
+ },
561
+ go: {
562
+ method: 'client.V1.Assets.Delete',
563
+ example: 'package main\n\nimport (\n\t"context"\n\t"fmt"\n\n\t"github.com/segmentflow/segmentflow-go"\n\t"github.com/segmentflow/segmentflow-go/option"\n)\n\nfunc main() {\n\tclient := segmentflow.NewClient(\n\t\toption.WithAPIKey("My API Key"),\n\t)\n\tasset, err := client.V1.Assets.Delete(context.TODO(), "182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e")\n\tif err != nil {\n\t\tpanic(err.Error())\n\t}\n\tfmt.Printf("%+v\\n", asset.Message)\n}\n',
564
+ },
565
+ cli: {
566
+ method: 'assets delete',
567
+ example: "segmentflow v1:assets delete \\\n --api-key 'My API Key' \\\n --id 182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e",
568
+ },
569
+ php: {
570
+ method: 'v1->assets->delete',
571
+ example: "<?php\n\nrequire_once dirname(__DIR__) . '/vendor/autoload.php';\n\n$client = new Client(apiKey: 'My API Key', environment: 'development');\n\n$asset = $client->v1->assets->delete('182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e');\n\nvar_dump($asset);",
572
+ },
573
+ http: {
574
+ example: 'curl https://api.segmentflow.ai/api/v1/assets/$ID \\\n -X DELETE \\\n -H "x-api-key: $SEGMENTFLOW_API_KEY"',
575
+ },
576
+ },
577
+ },
578
+ {
579
+ name: 'list',
580
+ endpoint: '/api/v1/brand-kit',
94
581
  httpMethod: 'get',
95
- summary: 'Get journey run status',
96
- description: 'Fetch the status of a journey run previously created via POST /journeys/{id}/trigger.',
97
- stainlessPath: '(resource) v1.public.journeys > (method) get_run_status',
98
- qualified: 'client.v1.public.journeys.getRunStatus',
99
- params: ['runId: string;'],
100
- response: "{ completedAt: string; error: string; journeyId: string; profileId: string; runId: string; status: 'queued' | 'running' | 'completed' | 'failed' | 'exited'; triggeredAt: string; }",
101
- markdown: "## get_run_status\n\n`client.v1.public.journeys.getRunStatus(runId: string): { completedAt: string; error: string; journeyId: string; profileId: string; runId: string; status: 'queued' | 'running' | 'completed' | 'failed' | 'exited'; triggeredAt: string; }`\n\n**get** `/api/v1/public/journeys/runs/{runId}`\n\nFetch the status of a journey run previously created via POST /journeys/{id}/trigger.\n\n### Parameters\n\n- `runId: string`\n\n### Returns\n\n- `{ completedAt: string; error: string; journeyId: string; profileId: string; runId: string; status: 'queued' | 'running' | 'completed' | 'failed' | 'exited'; triggeredAt: string; }`\n\n - `completedAt: string`\n - `error: string`\n - `journeyId: string`\n - `profileId: string`\n - `runId: string`\n - `status: 'queued' | 'running' | 'completed' | 'failed' | 'exited'`\n - `triggeredAt: string`\n\n### Example\n\n```typescript\nimport SegmentflowAI from '@segmentflow/segmentflow-typescript';\n\nconst client = new SegmentflowAI();\n\nconst response = await client.v1.public.journeys.getRunStatus('182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e');\n\nconsole.log(response);\n```",
582
+ summary: '',
583
+ description: '',
584
+ stainlessPath: '(resource) v1.brand_kit > (method) list',
585
+ qualified: 'client.v1.brandKit.list',
586
+ response: "{ brandKits: { id: string; colorCount: number; companyName: string; createdAt: string; extractionStatus: 'Extracting' | 'ExtractionFailed'; hasLogo: boolean; isPrimary: boolean; logoUrl: string; name: string; previewColors: string[]; primaryFont: string; slug: string; updatedAt: string; website: string; }[]; count: number; message: string; success: boolean; }",
587
+ markdown: "## list\n\n`client.v1.brandKit.list(): { brandKits: brand_kit_summary[]; count: number; message: string; success: boolean; }`\n\n**get** `/api/v1/brand-kit`\n\n### Returns\n\n- `{ brandKits: { id: string; colorCount: number; companyName: string; createdAt: string; extractionStatus: 'Extracting' | 'ExtractionFailed'; hasLogo: boolean; isPrimary: boolean; logoUrl: string; name: string; previewColors: string[]; primaryFont: string; slug: string; updatedAt: string; website: string; }[]; count: number; message: string; success: boolean; }`\n\n - `brandKits: { id: string; colorCount: number; companyName: string; createdAt: string; extractionStatus: 'Extracting' | 'ExtractionFailed'; hasLogo: boolean; isPrimary: boolean; logoUrl: string; name: string; previewColors: string[]; primaryFont: string; slug: string; updatedAt: string; website: string; }[]`\n - `count: number`\n - `message: string`\n - `success: boolean`\n\n### Example\n\n```typescript\nimport SegmentflowAI from '@segmentflow/segmentflow-typescript';\n\nconst client = new SegmentflowAI();\n\nconst brandKits = await client.v1.brandKit.list();\n\nconsole.log(brandKits);\n```",
102
588
  perLanguage: {
103
589
  typescript: {
104
- method: 'client.v1.public.journeys.getRunStatus',
105
- example: "import SegmentflowAI from '@segmentflow/segmentflow-typescript';\n\nconst client = new SegmentflowAI({\n apiKey: process.env['SEGMENTFLOW_API_KEY'], // This is the default and can be omitted\n});\n\nconst response = await client.v1.public.journeys.getRunStatus(\n '182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e',\n);\n\nconsole.log(response.completedAt);",
590
+ method: 'client.v1.brandKit.list',
591
+ example: "import SegmentflowAI from '@segmentflow/segmentflow-typescript';\n\nconst client = new SegmentflowAI({\n apiKey: process.env['SEGMENTFLOW_API_KEY'], // This is the default and can be omitted\n});\n\nconst brandKits = await client.v1.brandKit.list();\n\nconsole.log(brandKits.brandKits);",
592
+ },
593
+ python: {
594
+ method: 'v1.brand_kit.list',
595
+ example: 'import os\nfrom segmentflow import SegmentflowAI\n\nclient = SegmentflowAI(\n api_key=os.environ.get("SEGMENTFLOW_API_KEY"), # This is the default and can be omitted\n)\nbrand_kits = client.v1.brand_kit.list()\nprint(brand_kits.brand_kits)',
596
+ },
597
+ java: {
598
+ method: 'v1().brandKit().list',
599
+ example: 'package com.segmentflow.api.example;\n\nimport com.segmentflow.api.client.SegmentflowAiClient;\nimport com.segmentflow.api.client.okhttp.SegmentflowAiOkHttpClient;\nimport com.segmentflow.api.models.v1.brandkit.BrandKitListParams;\nimport com.segmentflow.api.models.v1.brandkit.BrandKitListResponse;\n\npublic final class Main {\n private Main() {}\n\n public static void main(String[] args) {\n SegmentflowAiClient client = SegmentflowAiOkHttpClient.fromEnv();\n\n BrandKitListResponse brandKits = client.v1().brandKit().list();\n }\n}',
600
+ },
601
+ go: {
602
+ method: 'client.V1.BrandKit.List',
603
+ example: 'package main\n\nimport (\n\t"context"\n\t"fmt"\n\n\t"github.com/segmentflow/segmentflow-go"\n\t"github.com/segmentflow/segmentflow-go/option"\n)\n\nfunc main() {\n\tclient := segmentflow.NewClient(\n\t\toption.WithAPIKey("My API Key"),\n\t)\n\tbrandKits, err := client.V1.BrandKit.List(context.TODO())\n\tif err != nil {\n\t\tpanic(err.Error())\n\t}\n\tfmt.Printf("%+v\\n", brandKits.BrandKits)\n}\n',
604
+ },
605
+ cli: {
606
+ method: 'brand_kit list',
607
+ example: "segmentflow v1:brand-kit list \\\n --api-key 'My API Key'",
608
+ },
609
+ php: {
610
+ method: 'v1->brandKit->list',
611
+ example: "<?php\n\nrequire_once dirname(__DIR__) . '/vendor/autoload.php';\n\n$client = new Client(apiKey: 'My API Key', environment: 'development');\n\n$brandKits = $client->v1->brandKit->list();\n\nvar_dump($brandKits);",
106
612
  },
107
613
  http: {
108
- example: 'curl https://api.segmentflow.ai/api/v1/public/journeys/runs/$RUN_ID \\\n -H "x-api-key: $SEGMENTFLOW_API_KEY"',
614
+ example: 'curl https://api.segmentflow.ai/api/v1/brand-kit \\\n -H "x-api-key: $SEGMENTFLOW_API_KEY"',
109
615
  },
110
616
  },
111
617
  },
112
618
  {
113
619
  name: 'create',
114
- endpoint: '/api/v1/public/broadcasts',
620
+ endpoint: '/api/v1/brand-kit',
115
621
  httpMethod: 'post',
116
- summary: 'Create and send a broadcast',
117
- description: 'Create a broadcast and send immediately. v1 does not support scheduledAt; providing it returns 501. Supports Idempotency-Key header.',
118
- stainlessPath: '(resource) v1.public.broadcasts > (method) create',
119
- qualified: 'client.v1.public.broadcasts.create',
622
+ summary: '',
623
+ description: '',
624
+ stainlessPath: '(resource) v1.brand_kit > (method) create',
625
+ qualified: 'client.v1.brandKit.create',
120
626
  params: [
121
627
  'name: string;',
122
- 'segmentId: string;',
123
- 'templateId: string;',
124
- 'scheduledAt?: string;',
125
- 'subject?: string;',
628
+ "brandKit?: { _metadata?: { lastUpdated: string; source: 'firecrawl' | 'manual'; }; address?: string; authors?: { id: string; bio: string; name: string; avatarS3Key?: string; avatarUrl?: string; badges?: { id?: string; alt?: string; height?: number; imageS3Key?: string; imageUrl?: string; label?: string; width?: number; }[]; email?: string; homepage?: string; phone?: string; role?: string; tags?: string[]; }[]; blogUrl?: string; brandMessage?: string; brandSummary?: string; colorArray?: string[]; colors?: string[]; colorsPalette?: { accent?: string[]; background?: string[]; border?: string[]; error?: string[]; link?: string[]; primary?: string[]; secondary?: string[]; success?: string[]; text?: string[]; warning?: string[]; }; companyDescription?: string; companyName?: string; components?: { buttonPrimary?: { background?: string; borderColor?: string; borderRadius?: string; focusBorderColor?: string; fontWeight?: string; padding?: string; textColor?: string; }; buttonSecondary?: { background?: string; borderColor?: string; borderRadius?: string; focusBorderColor?: string; fontWeight?: string; padding?: string; textColor?: string; }; input?: { background?: string; borderColor?: string; borderRadius?: string; focusBorderColor?: string; fontWeight?: string; padding?: string; textColor?: string; }; link?: { background?: string; borderColor?: string; borderRadius?: string; focusBorderColor?: string; fontWeight?: string; padding?: string; textColor?: string; }; }; contactEmail?: string; copyright?: string; disclaimers?: string; emailFonts?: { code?: { family: string; original: string; classification?: 'sans-serif' | 'serif' | 'slab-serif' | 'monospace'; fontStack?: string; googleFontsUrl?: string; isSystem?: boolean; weights?: number[]; }; heading?: { family: string; original: string; classification?: 'sans-serif' | 'serif' | 'slab-serif' | 'monospace'; fontStack?: string; googleFontsUrl?: string; isSystem?: boolean; weights?: number[]; }; primary?: { family: string; original: string; classification?: 'sans-serif' | 'serif' | 'slab-serif' | 'monospace'; fontStack?: string; googleFontsUrl?: string; isSystem?: boolean; weights?: number[]; }; }; extractedAt?: string; extractedBy?: string; fontArray?: string[]; fonts?: string[]; footer?: string; footerFeatures?: string; icons?: { primaryColor?: string; style?: string; }; imageGuidelines?: { heroHeight?: number; heroWidth?: number; logoAlignment?: 'left' | 'center' | 'right'; logoHeight?: number; logoWidth?: number; maxContentWidth?: number; thumbnailSize?: number; }; images?: { additional?: string[]; favicon?: string; faviconRejection?: { measured: { height: number; width: number; }; reason: 'too_small' | 'too_large' | 'bad_aspect_ratio'; required: { maxAspectRatio: number; maxHeight: number; maxWidth: number; minAspectRatio: number; minHeight: number; minWidth: number; }; }; faviconS3Key?: string; faviconSourceUrl?: string; logo?: string; logoDimensions?: { height: number; width: number; }; logoRejection?: { measured: { height: number; width: number; }; reason: 'too_small' | 'too_large' | 'bad_aspect_ratio'; required: { maxAspectRatio: number; maxHeight: number; maxWidth: number; minAspectRatio: number; minHeight: number; minWidth: number; }; }; logoS3Key?: string; logoSourceUrl?: string; ogImage?: string; ogImageRejection?: { measured: { height: number; width: number; }; reason: 'too_small' | 'too_large' | 'bad_aspect_ratio'; required: { maxAspectRatio: number; maxHeight: number; maxWidth: number; minAspectRatio: number; minHeight: number; minWidth: number; }; }; ogImageS3Key?: string; ogImageSourceUrl?: string; socialLogos?: object; }; industry?: string; keyMessages?: string[]; kitName?: string; landingPagePurpose?: string; languages?: string[]; logos?: string[]; name?: string; personality?: { tone?: string; traits?: string[]; }; phone?: string; salutationFallback?: string; socials?: { discord?: string; facebook?: string; github?: string; instagram?: string; linkedin?: string; pinterest?: string; tiktok?: string; twitter?: string; youtube?: string; }; socialSize?: 'sm' | 'md' | 'lg'; socialStyle?: 'brand-circle' | 'mono-light' | 'mono-dark' | 'outline-mono' | 'brand-glyph'; tagline?: string; themeMode?: 'light' | 'dark' | 'auto'; toneOfVoice?: string; typography?: { baseUnit?: number; borderRadius?: string; fontSizes?: object; fontStacks?: object; fontWeights?: object; lineHeights?: object; spacing?: { gridGutter?: number; margins?: object; padding?: object; }; }; website?: string; };",
629
+ 'slug?: string;',
630
+ 'website?: string;',
126
631
  ],
127
- response: "{ broadcastId: string; status: 'NotStarted' | 'InProgress' | 'Triggered' | 'Sent' | 'Failed' | 'Archived' | 'Warming' | 'Paused'; }",
128
- markdown: "## create\n\n`client.v1.public.broadcasts.create(name: string, segmentId: string, templateId: string, scheduledAt?: string, subject?: string): { broadcastId: string; status: broadcast_status; }`\n\n**post** `/api/v1/public/broadcasts`\n\nCreate a broadcast and send immediately. v1 does not support scheduledAt; providing it returns 501. Supports Idempotency-Key header.\n\n### Parameters\n\n- `name: string`\n\n- `segmentId: string`\n\n- `templateId: string`\n\n- `scheduledAt?: string`\n\n- `subject?: string`\n\n### Returns\n\n- `{ broadcastId: string; status: 'NotStarted' | 'InProgress' | 'Triggered' | 'Sent' | 'Failed' | 'Archived' | 'Warming' | 'Paused'; }`\n\n - `broadcastId: string`\n - `status: 'NotStarted' | 'InProgress' | 'Triggered' | 'Sent' | 'Failed' | 'Archived' | 'Warming' | 'Paused'`\n\n### Example\n\n```typescript\nimport SegmentflowAI from '@segmentflow/segmentflow-typescript';\n\nconst client = new SegmentflowAI();\n\nconst broadcast = await client.v1.public.broadcasts.create({\n name: 'x',\n segmentId: '182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e',\n templateId: '182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e',\n});\n\nconsole.log(broadcast);\n```",
632
+ response: '{ brandId: string; message: string; slug: string; success: boolean; }',
633
+ markdown: "## create\n\n`client.v1.brandKit.create(name: string, brandKit?: { _metadata?: { lastUpdated: string; source: 'firecrawl' | 'manual'; }; address?: string; authors?: { id: string; bio: string; name: string; avatarS3Key?: string; avatarUrl?: string; badges?: object[]; email?: string; homepage?: string; phone?: string; role?: string; tags?: string[]; }[]; blogUrl?: string; brandMessage?: string; brandSummary?: string; colorArray?: string[]; colors?: string[]; colorsPalette?: { accent?: string[]; background?: string[]; border?: string[]; error?: string[]; link?: string[]; primary?: string[]; secondary?: string[]; success?: string[]; text?: string[]; warning?: string[]; }; companyDescription?: string; companyName?: string; components?: { buttonPrimary?: object; buttonSecondary?: object; input?: object; link?: object; }; contactEmail?: string; copyright?: string; disclaimers?: string; emailFonts?: { code?: object; heading?: object; primary?: object; }; extractedAt?: string; extractedBy?: string; fontArray?: string[]; fonts?: string[]; footer?: string; footerFeatures?: string; icons?: { primaryColor?: string; style?: string; }; imageGuidelines?: { heroHeight?: number; heroWidth?: number; logoAlignment?: 'left' | 'center' | 'right'; logoHeight?: number; logoWidth?: number; maxContentWidth?: number; thumbnailSize?: number; }; images?: { additional?: string[]; favicon?: string; faviconRejection?: object; faviconS3Key?: string; faviconSourceUrl?: string; logo?: string; logoDimensions?: object; logoRejection?: object; logoS3Key?: string; logoSourceUrl?: string; ogImage?: string; ogImageRejection?: object; ogImageS3Key?: string; ogImageSourceUrl?: string; socialLogos?: object; }; industry?: string; keyMessages?: string[]; kitName?: string; landingPagePurpose?: string; languages?: string[]; logos?: string[]; name?: string; personality?: { tone?: string; traits?: string[]; }; phone?: string; salutationFallback?: string; socials?: { discord?: string; facebook?: string; github?: string; instagram?: string; linkedin?: string; pinterest?: string; tiktok?: string; twitter?: string; youtube?: string; }; socialSize?: 'sm' | 'md' | 'lg'; socialStyle?: 'brand-circle' | 'mono-light' | 'mono-dark' | 'outline-mono' | 'brand-glyph'; tagline?: string; themeMode?: 'light' | 'dark' | 'auto'; toneOfVoice?: string; typography?: { baseUnit?: number; borderRadius?: string; fontSizes?: object; fontStacks?: object; fontWeights?: object; lineHeights?: object; spacing?: object; }; website?: string; }, slug?: string, website?: string): { brandId: string; message: string; slug: string; success: boolean; }`\n\n**post** `/api/v1/brand-kit`\n\n### Parameters\n\n- `name: string`\n\n- `brandKit?: { _metadata?: { lastUpdated: string; source: 'firecrawl' | 'manual'; }; address?: string; authors?: { id: string; bio: string; name: string; avatarS3Key?: string; avatarUrl?: string; badges?: { id?: string; alt?: string; height?: number; imageS3Key?: string; imageUrl?: string; label?: string; width?: number; }[]; email?: string; homepage?: string; phone?: string; role?: string; tags?: string[]; }[]; blogUrl?: string; brandMessage?: string; brandSummary?: string; colorArray?: string[]; colors?: string[]; colorsPalette?: { accent?: string[]; background?: string[]; border?: string[]; error?: string[]; link?: string[]; primary?: string[]; secondary?: string[]; success?: string[]; text?: string[]; warning?: string[]; }; companyDescription?: string; companyName?: string; components?: { buttonPrimary?: { background?: string; borderColor?: string; borderRadius?: string; focusBorderColor?: string; fontWeight?: string; padding?: string; textColor?: string; }; buttonSecondary?: { background?: string; borderColor?: string; borderRadius?: string; focusBorderColor?: string; fontWeight?: string; padding?: string; textColor?: string; }; input?: { background?: string; borderColor?: string; borderRadius?: string; focusBorderColor?: string; fontWeight?: string; padding?: string; textColor?: string; }; link?: { background?: string; borderColor?: string; borderRadius?: string; focusBorderColor?: string; fontWeight?: string; padding?: string; textColor?: string; }; }; contactEmail?: string; copyright?: string; disclaimers?: string; emailFonts?: { code?: { family: string; original: string; classification?: 'sans-serif' | 'serif' | 'slab-serif' | 'monospace'; fontStack?: string; googleFontsUrl?: string; isSystem?: boolean; weights?: number[]; }; heading?: { family: string; original: string; classification?: 'sans-serif' | 'serif' | 'slab-serif' | 'monospace'; fontStack?: string; googleFontsUrl?: string; isSystem?: boolean; weights?: number[]; }; primary?: { family: string; original: string; classification?: 'sans-serif' | 'serif' | 'slab-serif' | 'monospace'; fontStack?: string; googleFontsUrl?: string; isSystem?: boolean; weights?: number[]; }; }; extractedAt?: string; extractedBy?: string; fontArray?: string[]; fonts?: string[]; footer?: string; footerFeatures?: string; icons?: { primaryColor?: string; style?: string; }; imageGuidelines?: { heroHeight?: number; heroWidth?: number; logoAlignment?: 'left' | 'center' | 'right'; logoHeight?: number; logoWidth?: number; maxContentWidth?: number; thumbnailSize?: number; }; images?: { additional?: string[]; favicon?: string; faviconRejection?: { measured: { height: number; width: number; }; reason: 'too_small' | 'too_large' | 'bad_aspect_ratio'; required: { maxAspectRatio: number; maxHeight: number; maxWidth: number; minAspectRatio: number; minHeight: number; minWidth: number; }; }; faviconS3Key?: string; faviconSourceUrl?: string; logo?: string; logoDimensions?: { height: number; width: number; }; logoRejection?: { measured: { height: number; width: number; }; reason: 'too_small' | 'too_large' | 'bad_aspect_ratio'; required: { maxAspectRatio: number; maxHeight: number; maxWidth: number; minAspectRatio: number; minHeight: number; minWidth: number; }; }; logoS3Key?: string; logoSourceUrl?: string; ogImage?: string; ogImageRejection?: { measured: { height: number; width: number; }; reason: 'too_small' | 'too_large' | 'bad_aspect_ratio'; required: { maxAspectRatio: number; maxHeight: number; maxWidth: number; minAspectRatio: number; minHeight: number; minWidth: number; }; }; ogImageS3Key?: string; ogImageSourceUrl?: string; socialLogos?: object; }; industry?: string; keyMessages?: string[]; kitName?: string; landingPagePurpose?: string; languages?: string[]; logos?: string[]; name?: string; personality?: { tone?: string; traits?: string[]; }; phone?: string; salutationFallback?: string; socials?: { discord?: string; facebook?: string; github?: string; instagram?: string; linkedin?: string; pinterest?: string; tiktok?: string; twitter?: string; youtube?: string; }; socialSize?: 'sm' | 'md' | 'lg'; socialStyle?: 'brand-circle' | 'mono-light' | 'mono-dark' | 'outline-mono' | 'brand-glyph'; tagline?: string; themeMode?: 'light' | 'dark' | 'auto'; toneOfVoice?: string; typography?: { baseUnit?: number; borderRadius?: string; fontSizes?: object; fontStacks?: object; fontWeights?: object; lineHeights?: object; spacing?: { gridGutter?: number; margins?: object; padding?: object; }; }; website?: string; }`\n Complete brand identity data: colors, fonts, logos, social links, UI components, legal copy, and extraction metadata\n - `_metadata?: { lastUpdated: string; source: 'firecrawl' | 'manual'; }`\n - `address?: string`\n - `authors?: { id: string; bio: string; name: string; avatarS3Key?: string; avatarUrl?: string; badges?: { id?: string; alt?: string; height?: number; imageS3Key?: string; imageUrl?: string; label?: string; width?: number; }[]; email?: string; homepage?: string; phone?: string; role?: string; tags?: string[]; }[]`\n - `blogUrl?: string`\n - `brandMessage?: string`\n - `brandSummary?: string`\n - `colorArray?: string[]`\n - `colors?: string[]`\n - `colorsPalette?: { accent?: string[]; background?: string[]; border?: string[]; error?: string[]; link?: string[]; primary?: string[]; secondary?: string[]; success?: string[]; text?: string[]; warning?: string[]; }`\n Categorised color palette: primary, secondary, accent, background, text, border, link, success, warning, error\n - `companyDescription?: string`\n - `companyName?: string`\n - `components?: { buttonPrimary?: { background?: string; borderColor?: string; borderRadius?: string; focusBorderColor?: string; fontWeight?: string; padding?: string; textColor?: string; }; buttonSecondary?: { background?: string; borderColor?: string; borderRadius?: string; focusBorderColor?: string; fontWeight?: string; padding?: string; textColor?: string; }; input?: { background?: string; borderColor?: string; borderRadius?: string; focusBorderColor?: string; fontWeight?: string; padding?: string; textColor?: string; }; link?: { background?: string; borderColor?: string; borderRadius?: string; focusBorderColor?: string; fontWeight?: string; padding?: string; textColor?: string; }; }`\n UI component styles for email CTAs and forms: buttonPrimary, buttonSecondary, input, link\n - `contactEmail?: string`\n - `copyright?: string`\n - `disclaimers?: string`\n - `emailFonts?: { code?: { family: string; original: string; classification?: 'sans-serif' | 'serif' | 'slab-serif' | 'monospace'; fontStack?: string; googleFontsUrl?: string; isSystem?: boolean; weights?: number[]; }; heading?: { family: string; original: string; classification?: 'sans-serif' | 'serif' | 'slab-serif' | 'monospace'; fontStack?: string; googleFontsUrl?: string; isSystem?: boolean; weights?: number[]; }; primary?: { family: string; original: string; classification?: 'sans-serif' | 'serif' | 'slab-serif' | 'monospace'; fontStack?: string; googleFontsUrl?: string; isSystem?: boolean; weights?: number[]; }; }`\n - `extractedAt?: string`\n - `extractedBy?: string`\n - `fontArray?: string[]`\n - `fonts?: string[]`\n - `footer?: string`\n - `footerFeatures?: string`\n - `icons?: { primaryColor?: string; style?: string; }`\n Icon system information: style (outline/filled) and primary icon color\n - `imageGuidelines?: { heroHeight?: number; heroWidth?: number; logoAlignment?: 'left' | 'center' | 'right'; logoHeight?: number; logoWidth?: number; maxContentWidth?: number; thumbnailSize?: number; }`\n - `images?: { additional?: string[]; favicon?: string; faviconRejection?: { measured: { height: number; width: number; }; reason: 'too_small' | 'too_large' | 'bad_aspect_ratio'; required: { maxAspectRatio: number; maxHeight: number; maxWidth: number; minAspectRatio: number; minHeight: number; minWidth: number; }; }; faviconS3Key?: string; faviconSourceUrl?: string; logo?: string; logoDimensions?: { height: number; width: number; }; logoRejection?: { measured: { height: number; width: number; }; reason: 'too_small' | 'too_large' | 'bad_aspect_ratio'; required: { maxAspectRatio: number; maxHeight: number; maxWidth: number; minAspectRatio: number; minHeight: number; minWidth: number; }; }; logoS3Key?: string; logoSourceUrl?: string; ogImage?: string; ogImageRejection?: { measured: { height: number; width: number; }; reason: 'too_small' | 'too_large' | 'bad_aspect_ratio'; required: { maxAspectRatio: number; maxHeight: number; maxWidth: number; minAspectRatio: number; minHeight: number; minWidth: number; }; }; ogImageS3Key?: string; ogImageSourceUrl?: string; socialLogos?: object; }`\n Brand image assets: logo, favicon, ogImage, additional images, S3 keys, and social platform logos\n - `industry?: string`\n - `keyMessages?: string[]`\n - `kitName?: string`\n - `landingPagePurpose?: string`\n - `languages?: string[]`\n - `logos?: string[]`\n - `name?: string`\n - `personality?: { tone?: string; traits?: string[]; }`\n Brand personality traits: tone of voice and target audience descriptors\n - `phone?: string`\n - `salutationFallback?: string`\n - `socials?: { discord?: string; facebook?: string; github?: string; instagram?: string; linkedin?: string; pinterest?: string; tiktok?: string; twitter?: string; youtube?: string; }`\n Social media profile URLs: twitter, facebook, linkedin, instagram, youtube, github, tiktok, pinterest, discord\n - `socialSize?: 'sm' | 'md' | 'lg'`\n Brand-wide size axis (sm / md / lg) that scales every social-icon footer in recipe-compiled emails. Compiler-only — never authored by the AI agent.\n - `socialStyle?: 'brand-circle' | 'mono-light' | 'mono-dark' | 'outline-mono' | 'brand-glyph'`\n Brand-wide preset that drives every social-icon footer in recipe-compiled emails. Compiler-only — never authored by the AI agent.\n - `tagline?: string`\n - `themeMode?: 'light' | 'dark' | 'auto'`\n - `toneOfVoice?: string`\n - `typography?: { baseUnit?: number; borderRadius?: string; fontSizes?: object; fontStacks?: object; fontWeights?: object; lineHeights?: object; spacing?: { gridGutter?: number; margins?: object; padding?: object; }; }`\n Typography specifications: font sizes, weights, line heights, stacks, and spacing sub-system\n - `website?: string`\n\n- `slug?: string`\n\n- `website?: string`\n\n### Returns\n\n- `{ brandId: string; message: string; slug: string; success: boolean; }`\n\n - `brandId: string`\n - `message: string`\n - `slug: string`\n - `success: boolean`\n\n### Example\n\n```typescript\nimport SegmentflowAI from '@segmentflow/segmentflow-typescript';\n\nconst client = new SegmentflowAI();\n\nconst brandKit = await client.v1.brandKit.create({ name: 'name' });\n\nconsole.log(brandKit);\n```",
634
+ perLanguage: {
635
+ typescript: {
636
+ method: 'client.v1.brandKit.create',
637
+ example: "import SegmentflowAI from '@segmentflow/segmentflow-typescript';\n\nconst client = new SegmentflowAI({\n apiKey: process.env['SEGMENTFLOW_API_KEY'], // This is the default and can be omitted\n});\n\nconst brandKit = await client.v1.brandKit.create({ name: 'name' });\n\nconsole.log(brandKit.brandId);",
638
+ },
639
+ python: {
640
+ method: 'v1.brand_kit.create',
641
+ example: 'import os\nfrom segmentflow import SegmentflowAI\n\nclient = SegmentflowAI(\n api_key=os.environ.get("SEGMENTFLOW_API_KEY"), # This is the default and can be omitted\n)\nbrand_kit = client.v1.brand_kit.create(\n name="name",\n)\nprint(brand_kit.brand_id)',
642
+ },
643
+ java: {
644
+ method: 'v1().brandKit().create',
645
+ example: 'package com.segmentflow.api.example;\n\nimport com.segmentflow.api.client.SegmentflowAiClient;\nimport com.segmentflow.api.client.okhttp.SegmentflowAiOkHttpClient;\nimport com.segmentflow.api.models.v1.brandkit.BrandKitCreateParams;\nimport com.segmentflow.api.models.v1.brandkit.BrandKitCreateResponse;\n\npublic final class Main {\n private Main() {}\n\n public static void main(String[] args) {\n SegmentflowAiClient client = SegmentflowAiOkHttpClient.fromEnv();\n\n BrandKitCreateParams params = BrandKitCreateParams.builder()\n .name("name")\n .build();\n BrandKitCreateResponse brandKit = client.v1().brandKit().create(params);\n }\n}',
646
+ },
647
+ go: {
648
+ method: 'client.V1.BrandKit.New',
649
+ example: 'package main\n\nimport (\n\t"context"\n\t"fmt"\n\n\t"github.com/segmentflow/segmentflow-go"\n\t"github.com/segmentflow/segmentflow-go/option"\n)\n\nfunc main() {\n\tclient := segmentflow.NewClient(\n\t\toption.WithAPIKey("My API Key"),\n\t)\n\tbrandKit, err := client.V1.BrandKit.New(context.TODO(), segmentflow.V1BrandKitNewParams{\n\t\tName: "name",\n\t})\n\tif err != nil {\n\t\tpanic(err.Error())\n\t}\n\tfmt.Printf("%+v\\n", brandKit.BrandID)\n}\n',
650
+ },
651
+ cli: {
652
+ method: 'brand_kit create',
653
+ example: "segmentflow v1:brand-kit create \\\n --api-key 'My API Key' \\\n --name name",
654
+ },
655
+ php: {
656
+ method: 'v1->brandKit->create',
657
+ example: "<?php\n\nrequire_once dirname(__DIR__) . '/vendor/autoload.php';\n\n$client = new Client(apiKey: 'My API Key', environment: 'development');\n\n$brandKit = $client->v1->brandKit->create(\n name: 'name',\n brandKit: [\n '_metadata' => ['lastUpdated' => 'lastUpdated', 'source' => 'firecrawl'],\n 'address' => 'address',\n 'authors' => [\n [\n 'id' => 'id',\n 'bio' => 'bio',\n 'name' => 'name',\n 'avatarS3Key' => 'avatarS3Key',\n 'avatarURL' => 'avatarUrl',\n 'badges' => [\n [\n 'id' => 'id',\n 'alt' => 'alt',\n 'height' => 0,\n 'imageS3Key' => 'imageS3Key',\n 'imageURL' => 'imageUrl',\n 'label' => 'label',\n 'width' => 0,\n ],\n ],\n 'email' => 'email',\n 'homepage' => 'homepage',\n 'phone' => 'phone',\n 'role' => 'role',\n 'tags' => ['string'],\n ],\n ],\n 'blogURL' => 'blogUrl',\n 'brandMessage' => 'brandMessage',\n 'brandSummary' => 'brandSummary',\n 'colorArray' => ['string'],\n 'colors' => ['string'],\n 'colorsPalette' => [\n 'accent' => ['string'],\n 'background' => ['string'],\n 'border' => ['string'],\n 'error' => ['string'],\n 'link' => ['string'],\n 'primary' => ['string'],\n 'secondary' => ['string'],\n 'success' => ['string'],\n 'text' => ['string'],\n 'warning' => ['string'],\n ],\n 'companyDescription' => 'companyDescription',\n 'companyName' => 'companyName',\n 'components' => [\n 'buttonPrimary' => [\n 'background' => 'background',\n 'borderColor' => 'borderColor',\n 'borderRadius' => 'borderRadius',\n 'focusBorderColor' => 'focusBorderColor',\n 'fontWeight' => 'fontWeight',\n 'padding' => 'padding',\n 'textColor' => 'textColor',\n ],\n 'buttonSecondary' => [\n 'background' => 'background',\n 'borderColor' => 'borderColor',\n 'borderRadius' => 'borderRadius',\n 'focusBorderColor' => 'focusBorderColor',\n 'fontWeight' => 'fontWeight',\n 'padding' => 'padding',\n 'textColor' => 'textColor',\n ],\n 'input' => [\n 'background' => 'background',\n 'borderColor' => 'borderColor',\n 'borderRadius' => 'borderRadius',\n 'focusBorderColor' => 'focusBorderColor',\n 'fontWeight' => 'fontWeight',\n 'padding' => 'padding',\n 'textColor' => 'textColor',\n ],\n 'link' => [\n 'background' => 'background',\n 'borderColor' => 'borderColor',\n 'borderRadius' => 'borderRadius',\n 'focusBorderColor' => 'focusBorderColor',\n 'fontWeight' => 'fontWeight',\n 'padding' => 'padding',\n 'textColor' => 'textColor',\n ],\n ],\n 'contactEmail' => 'contactEmail',\n 'copyright' => 'copyright',\n 'disclaimers' => 'disclaimers',\n 'emailFonts' => [\n 'code' => [\n 'family' => 'family',\n 'original' => 'original',\n 'classification' => 'sans-serif',\n 'fontStack' => 'fontStack',\n 'googleFontsURL' => 'googleFontsUrl',\n 'isSystem' => true,\n 'weights' => [0],\n ],\n 'heading' => [\n 'family' => 'family',\n 'original' => 'original',\n 'classification' => 'sans-serif',\n 'fontStack' => 'fontStack',\n 'googleFontsURL' => 'googleFontsUrl',\n 'isSystem' => true,\n 'weights' => [0],\n ],\n 'primary' => [\n 'family' => 'family',\n 'original' => 'original',\n 'classification' => 'sans-serif',\n 'fontStack' => 'fontStack',\n 'googleFontsURL' => 'googleFontsUrl',\n 'isSystem' => true,\n 'weights' => [0],\n ],\n ],\n 'extractedAt' => 'extractedAt',\n 'extractedBy' => 'extractedBy',\n 'fontArray' => ['string'],\n 'fonts' => ['string'],\n 'footer' => 'footer',\n 'footerFeatures' => 'footerFeatures',\n 'icons' => ['primaryColor' => 'primaryColor', 'style' => 'style'],\n 'imageGuidelines' => [\n 'heroHeight' => 0,\n 'heroWidth' => 0,\n 'logoAlignment' => 'left',\n 'logoHeight' => 0,\n 'logoWidth' => 0,\n 'maxContentWidth' => 0,\n 'thumbnailSize' => 0,\n ],\n 'images' => [\n 'additional' => ['string'],\n 'favicon' => 'favicon',\n 'faviconRejection' => [\n 'measured' => ['height' => 0, 'width' => 0],\n 'reason' => 'too_small',\n 'required' => [\n 'maxAspectRatio' => 0,\n 'maxHeight' => 0,\n 'maxWidth' => 0,\n 'minAspectRatio' => 0,\n 'minHeight' => 0,\n 'minWidth' => 0,\n ],\n ],\n 'faviconS3Key' => 'faviconS3Key',\n 'faviconSourceURL' => 'faviconSourceUrl',\n 'logo' => 'logo',\n 'logoDimensions' => ['height' => 0, 'width' => 0],\n 'logoRejection' => [\n 'measured' => ['height' => 0, 'width' => 0],\n 'reason' => 'too_small',\n 'required' => [\n 'maxAspectRatio' => 0,\n 'maxHeight' => 0,\n 'maxWidth' => 0,\n 'minAspectRatio' => 0,\n 'minHeight' => 0,\n 'minWidth' => 0,\n ],\n ],\n 'logoS3Key' => 'logoS3Key',\n 'logoSourceURL' => 'logoSourceUrl',\n 'ogImage' => 'ogImage',\n 'ogImageRejection' => [\n 'measured' => ['height' => 0, 'width' => 0],\n 'reason' => 'too_small',\n 'required' => [\n 'maxAspectRatio' => 0,\n 'maxHeight' => 0,\n 'maxWidth' => 0,\n 'minAspectRatio' => 0,\n 'minHeight' => 0,\n 'minWidth' => 0,\n ],\n ],\n 'ogImageS3Key' => 'ogImageS3Key',\n 'ogImageSourceURL' => 'ogImageSourceUrl',\n 'socialLogos' => ['foo' => 'string'],\n ],\n 'industry' => 'industry',\n 'keyMessages' => ['string'],\n 'kitName' => 'kitName',\n 'landingPagePurpose' => 'landingPagePurpose',\n 'languages' => ['string'],\n 'logos' => ['string'],\n 'name' => 'name',\n 'personality' => ['tone' => 'tone', 'traits' => ['string']],\n 'phone' => 'phone',\n 'salutationFallback' => 'salutationFallback',\n 'socials' => [\n 'discord' => 'discord',\n 'facebook' => 'facebook',\n 'github' => 'github',\n 'instagram' => 'instagram',\n 'linkedin' => 'linkedin',\n 'pinterest' => 'pinterest',\n 'tiktok' => 'tiktok',\n 'twitter' => 'twitter',\n 'youtube' => 'youtube',\n ],\n 'socialSize' => 'sm',\n 'socialStyle' => 'brand-circle',\n 'tagline' => 'tagline',\n 'themeMode' => 'light',\n 'toneOfVoice' => 'toneOfVoice',\n 'typography' => [\n 'baseUnit' => 0,\n 'borderRadius' => 'borderRadius',\n 'fontSizes' => ['foo' => 'string'],\n 'fontStacks' => ['foo' => ['string']],\n 'fontWeights' => ['foo' => 'string'],\n 'lineHeights' => ['foo' => 'string'],\n 'spacing' => [\n 'gridGutter' => 0, 'margins' => ['foo' => 0], 'padding' => ['foo' => 0]\n ],\n ],\n 'website' => 'website',\n ],\n slug: 'slug',\n website: 'https://example.com',\n);\n\nvar_dump($brandKit);",
658
+ },
659
+ http: {
660
+ example: 'curl https://api.segmentflow.ai/api/v1/brand-kit \\\n -H \'Content-Type: application/json\' \\\n -H "x-api-key: $SEGMENTFLOW_API_KEY" \\\n -d \'{\n "name": "name"\n }\'',
661
+ },
662
+ },
663
+ },
664
+ {
665
+ name: 'retrieve',
666
+ endpoint: '/api/v1/brand-kit/{brandId}',
667
+ httpMethod: 'get',
668
+ summary: '',
669
+ description: '',
670
+ stainlessPath: '(resource) v1.brand_kit > (method) retrieve',
671
+ qualified: 'client.v1.brandKit.retrieve',
672
+ params: ['brandId: string;'],
673
+ response: "{ brandKit: { _metadata?: object; address?: string; authors?: object[]; blogUrl?: string; brandMessage?: string; brandSummary?: string; colorArray?: string[]; colors?: string[]; colorsPalette?: object; companyDescription?: string; companyName?: string; components?: object; contactEmail?: string; copyright?: string; disclaimers?: string; emailFonts?: object; extractedAt?: string; extractedBy?: string; fontArray?: string[]; fonts?: string[]; footer?: string; footerFeatures?: string; icons?: object; imageGuidelines?: object; images?: object; industry?: string; keyMessages?: string[]; kitName?: string; landingPagePurpose?: string; languages?: object; logos?: string[]; name?: string; personality?: object; phone?: string; salutationFallback?: string; socials?: object; socialSize?: 'sm' | 'md' | 'lg'; socialStyle?: 'brand-circle' | 'mono-light' | 'mono-dark' | 'outline-mono' | 'brand-glyph'; tagline?: string; themeMode?: 'light' | 'dark' | 'auto'; toneOfVoice?: string; typography?: object; website?: string; }; brandMeta: { id: string; isPrimary: boolean; name: string; slug: string; }; message: string; success: boolean; }",
674
+ markdown: "## retrieve\n\n`client.v1.brandKit.retrieve(brandId: string): { brandKit: brand_kit; brandMeta: object; message: string; success: boolean; }`\n\n**get** `/api/v1/brand-kit/{brandId}`\n\n### Parameters\n\n- `brandId: string`\n\n### Returns\n\n- `{ brandKit: { _metadata?: object; address?: string; authors?: object[]; blogUrl?: string; brandMessage?: string; brandSummary?: string; colorArray?: string[]; colors?: string[]; colorsPalette?: object; companyDescription?: string; companyName?: string; components?: object; contactEmail?: string; copyright?: string; disclaimers?: string; emailFonts?: object; extractedAt?: string; extractedBy?: string; fontArray?: string[]; fonts?: string[]; footer?: string; footerFeatures?: string; icons?: object; imageGuidelines?: object; images?: object; industry?: string; keyMessages?: string[]; kitName?: string; landingPagePurpose?: string; languages?: object; logos?: string[]; name?: string; personality?: object; phone?: string; salutationFallback?: string; socials?: object; socialSize?: 'sm' | 'md' | 'lg'; socialStyle?: 'brand-circle' | 'mono-light' | 'mono-dark' | 'outline-mono' | 'brand-glyph'; tagline?: string; themeMode?: 'light' | 'dark' | 'auto'; toneOfVoice?: string; typography?: object; website?: string; }; brandMeta: { id: string; isPrimary: boolean; name: string; slug: string; }; message: string; success: boolean; }`\n\n - `brandKit: { _metadata?: { lastUpdated: string; source: 'firecrawl' | 'manual'; }; address?: string; authors?: { id: string; bio: string; name: string; avatarS3Key?: string; avatarUrl?: string; badges?: { id?: string; alt?: string; height?: number; imageS3Key?: string; imageUrl?: string; label?: string; width?: number; }[]; email?: string; homepage?: string; phone?: string; role?: string; tags?: string[]; }[]; blogUrl?: string; brandMessage?: string; brandSummary?: string; colorArray?: string[]; colors?: string[]; colorsPalette?: { accent?: string[]; background?: string[]; border?: string[]; error?: string[]; link?: string[]; primary?: string[]; secondary?: string[]; success?: string[]; text?: string[]; warning?: string[]; }; companyDescription?: string; companyName?: string; components?: { buttonPrimary?: { background?: string; borderColor?: string; borderRadius?: string; focusBorderColor?: string; fontWeight?: string; padding?: string; textColor?: string; }; buttonSecondary?: { background?: string; borderColor?: string; borderRadius?: string; focusBorderColor?: string; fontWeight?: string; padding?: string; textColor?: string; }; input?: { background?: string; borderColor?: string; borderRadius?: string; focusBorderColor?: string; fontWeight?: string; padding?: string; textColor?: string; }; link?: { background?: string; borderColor?: string; borderRadius?: string; focusBorderColor?: string; fontWeight?: string; padding?: string; textColor?: string; }; }; contactEmail?: string; copyright?: string; disclaimers?: string; emailFonts?: { code?: { family: string; original: string; classification?: 'sans-serif' | 'serif' | 'slab-serif' | 'monospace'; fontStack?: string; googleFontsUrl?: string; isSystem?: boolean; weights?: number[]; }; heading?: { family: string; original: string; classification?: 'sans-serif' | 'serif' | 'slab-serif' | 'monospace'; fontStack?: string; googleFontsUrl?: string; isSystem?: boolean; weights?: number[]; }; primary?: { family: string; original: string; classification?: 'sans-serif' | 'serif' | 'slab-serif' | 'monospace'; fontStack?: string; googleFontsUrl?: string; isSystem?: boolean; weights?: number[]; }; }; extractedAt?: string; extractedBy?: string; fontArray?: string[]; fonts?: string[]; footer?: string; footerFeatures?: string; icons?: { primaryColor?: string; style?: string; }; imageGuidelines?: { heroHeight?: number; heroWidth?: number; logoAlignment?: 'left' | 'center' | 'right'; logoHeight?: number; logoWidth?: number; maxContentWidth?: number; thumbnailSize?: number; }; images?: { additional?: string[]; favicon?: string; faviconRejection?: { measured: object; reason: 'too_small' | 'too_large' | 'bad_aspect_ratio'; required: object; }; faviconS3Key?: string; faviconSourceUrl?: string; logo?: string; logoDimensions?: { height: number; width: number; }; logoRejection?: { measured: object; reason: 'too_small' | 'too_large' | 'bad_aspect_ratio'; required: object; }; logoS3Key?: string; logoSourceUrl?: string; ogImage?: string; ogImageRejection?: { measured: object; reason: 'too_small' | 'too_large' | 'bad_aspect_ratio'; required: object; }; ogImageS3Key?: string; ogImageSourceUrl?: string; socialLogos?: object; }; industry?: string; keyMessages?: string[]; kitName?: string; landingPagePurpose?: string; languages?: object; logos?: string[]; name?: string; personality?: { tone?: string; traits?: string[]; }; phone?: string; salutationFallback?: string; socials?: { discord?: string; facebook?: string; github?: string; instagram?: string; linkedin?: string; pinterest?: string; tiktok?: string; twitter?: string; youtube?: string; }; socialSize?: 'sm' | 'md' | 'lg'; socialStyle?: 'brand-circle' | 'mono-light' | 'mono-dark' | 'outline-mono' | 'brand-glyph'; tagline?: string; themeMode?: 'light' | 'dark' | 'auto'; toneOfVoice?: string; typography?: { baseUnit?: number; borderRadius?: string; fontSizes?: object; fontStacks?: object; fontWeights?: object; lineHeights?: object; spacing?: { gridGutter?: number; margins?: object; padding?: object; }; }; website?: string; }`\n - `brandMeta: { id: string; isPrimary: boolean; name: string; slug: string; }`\n - `message: string`\n - `success: boolean`\n\n### Example\n\n```typescript\nimport SegmentflowAI from '@segmentflow/segmentflow-typescript';\n\nconst client = new SegmentflowAI();\n\nconst brandKit = await client.v1.brandKit.retrieve('182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e');\n\nconsole.log(brandKit);\n```",
675
+ perLanguage: {
676
+ typescript: {
677
+ method: 'client.v1.brandKit.retrieve',
678
+ example: "import SegmentflowAI from '@segmentflow/segmentflow-typescript';\n\nconst client = new SegmentflowAI({\n apiKey: process.env['SEGMENTFLOW_API_KEY'], // This is the default and can be omitted\n});\n\nconst brandKit = await client.v1.brandKit.retrieve('182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e');\n\nconsole.log(brandKit.brandKit);",
679
+ },
680
+ python: {
681
+ method: 'v1.brand_kit.retrieve',
682
+ example: 'import os\nfrom segmentflow import SegmentflowAI\n\nclient = SegmentflowAI(\n api_key=os.environ.get("SEGMENTFLOW_API_KEY"), # This is the default and can be omitted\n)\nbrand_kit = client.v1.brand_kit.retrieve(\n "182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e",\n)\nprint(brand_kit.brand_kit)',
683
+ },
684
+ java: {
685
+ method: 'v1().brandKit().retrieve',
686
+ example: 'package com.segmentflow.api.example;\n\nimport com.segmentflow.api.client.SegmentflowAiClient;\nimport com.segmentflow.api.client.okhttp.SegmentflowAiOkHttpClient;\nimport com.segmentflow.api.models.v1.brandkit.BrandKitRetrieveParams;\nimport com.segmentflow.api.models.v1.brandkit.BrandKitRetrieveResponse;\n\npublic final class Main {\n private Main() {}\n\n public static void main(String[] args) {\n SegmentflowAiClient client = SegmentflowAiOkHttpClient.fromEnv();\n\n BrandKitRetrieveResponse brandKit = client.v1().brandKit().retrieve("182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e");\n }\n}',
687
+ },
688
+ go: {
689
+ method: 'client.V1.BrandKit.Get',
690
+ example: 'package main\n\nimport (\n\t"context"\n\t"fmt"\n\n\t"github.com/segmentflow/segmentflow-go"\n\t"github.com/segmentflow/segmentflow-go/option"\n)\n\nfunc main() {\n\tclient := segmentflow.NewClient(\n\t\toption.WithAPIKey("My API Key"),\n\t)\n\tbrandKit, err := client.V1.BrandKit.Get(context.TODO(), "182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e")\n\tif err != nil {\n\t\tpanic(err.Error())\n\t}\n\tfmt.Printf("%+v\\n", brandKit.BrandKit)\n}\n',
691
+ },
692
+ cli: {
693
+ method: 'brand_kit retrieve',
694
+ example: "segmentflow v1:brand-kit retrieve \\\n --api-key 'My API Key' \\\n --brand-id 182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e",
695
+ },
696
+ php: {
697
+ method: 'v1->brandKit->retrieve',
698
+ example: "<?php\n\nrequire_once dirname(__DIR__) . '/vendor/autoload.php';\n\n$client = new Client(apiKey: 'My API Key', environment: 'development');\n\n$brandKit = $client->v1->brandKit->retrieve(\n '182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e'\n);\n\nvar_dump($brandKit);",
699
+ },
700
+ http: {
701
+ example: 'curl https://api.segmentflow.ai/api/v1/brand-kit/$BRAND_ID \\\n -H "x-api-key: $SEGMENTFLOW_API_KEY"',
702
+ },
703
+ },
704
+ },
705
+ {
706
+ name: 'update',
707
+ endpoint: '/api/v1/brand-kit/{brandId}',
708
+ httpMethod: 'put',
709
+ summary: '',
710
+ description: '',
711
+ stainlessPath: '(resource) v1.brand_kit > (method) update',
712
+ qualified: 'client.v1.brandKit.update',
713
+ params: [
714
+ 'brandId: string;',
715
+ "brandKit: { _metadata?: { lastUpdated: string; source: 'firecrawl' | 'manual'; }; address?: string; authors?: { id: string; bio: string; name: string; avatarS3Key?: string; avatarUrl?: string; badges?: { id?: string; alt?: string; height?: number; imageS3Key?: string; imageUrl?: string; label?: string; width?: number; }[]; email?: string; homepage?: string; phone?: string; role?: string; tags?: string[]; }[]; blogUrl?: string; brandMessage?: string; brandSummary?: string; colorArray?: string[]; colors?: string[]; colorsPalette?: { accent?: string[]; background?: string[]; border?: string[]; error?: string[]; link?: string[]; primary?: string[]; secondary?: string[]; success?: string[]; text?: string[]; warning?: string[]; }; companyDescription?: string; companyName?: string; components?: { buttonPrimary?: { background?: string; borderColor?: string; borderRadius?: string; focusBorderColor?: string; fontWeight?: string; padding?: string; textColor?: string; }; buttonSecondary?: { background?: string; borderColor?: string; borderRadius?: string; focusBorderColor?: string; fontWeight?: string; padding?: string; textColor?: string; }; input?: { background?: string; borderColor?: string; borderRadius?: string; focusBorderColor?: string; fontWeight?: string; padding?: string; textColor?: string; }; link?: { background?: string; borderColor?: string; borderRadius?: string; focusBorderColor?: string; fontWeight?: string; padding?: string; textColor?: string; }; }; contactEmail?: string; copyright?: string; disclaimers?: string; emailFonts?: { code?: { family: string; original: string; classification?: 'sans-serif' | 'serif' | 'slab-serif' | 'monospace'; fontStack?: string; googleFontsUrl?: string; isSystem?: boolean; weights?: number[]; }; heading?: { family: string; original: string; classification?: 'sans-serif' | 'serif' | 'slab-serif' | 'monospace'; fontStack?: string; googleFontsUrl?: string; isSystem?: boolean; weights?: number[]; }; primary?: { family: string; original: string; classification?: 'sans-serif' | 'serif' | 'slab-serif' | 'monospace'; fontStack?: string; googleFontsUrl?: string; isSystem?: boolean; weights?: number[]; }; }; extractedAt?: string; extractedBy?: string; fontArray?: string[]; fonts?: string[]; footer?: string; footerFeatures?: string; icons?: { primaryColor?: string; style?: string; }; imageGuidelines?: { heroHeight?: number; heroWidth?: number; logoAlignment?: 'left' | 'center' | 'right'; logoHeight?: number; logoWidth?: number; maxContentWidth?: number; thumbnailSize?: number; }; images?: { additional?: string[]; favicon?: string; faviconRejection?: { measured: { height: number; width: number; }; reason: 'too_small' | 'too_large' | 'bad_aspect_ratio'; required: { maxAspectRatio: number; maxHeight: number; maxWidth: number; minAspectRatio: number; minHeight: number; minWidth: number; }; }; faviconS3Key?: string; faviconSourceUrl?: string; logo?: string; logoDimensions?: { height: number; width: number; }; logoRejection?: { measured: { height: number; width: number; }; reason: 'too_small' | 'too_large' | 'bad_aspect_ratio'; required: { maxAspectRatio: number; maxHeight: number; maxWidth: number; minAspectRatio: number; minHeight: number; minWidth: number; }; }; logoS3Key?: string; logoSourceUrl?: string; ogImage?: string; ogImageRejection?: { measured: { height: number; width: number; }; reason: 'too_small' | 'too_large' | 'bad_aspect_ratio'; required: { maxAspectRatio: number; maxHeight: number; maxWidth: number; minAspectRatio: number; minHeight: number; minWidth: number; }; }; ogImageS3Key?: string; ogImageSourceUrl?: string; socialLogos?: object; }; industry?: string; keyMessages?: string[]; kitName?: string; landingPagePurpose?: string; languages?: string[]; logos?: string[]; name?: string; personality?: { tone?: string; traits?: string[]; }; phone?: string; salutationFallback?: string; socials?: { discord?: string; facebook?: string; github?: string; instagram?: string; linkedin?: string; pinterest?: string; tiktok?: string; twitter?: string; youtube?: string; }; socialSize?: 'sm' | 'md' | 'lg'; socialStyle?: 'brand-circle' | 'mono-light' | 'mono-dark' | 'outline-mono' | 'brand-glyph'; tagline?: string; themeMode?: 'light' | 'dark' | 'auto'; toneOfVoice?: string; typography?: { baseUnit?: number; borderRadius?: string; fontSizes?: object; fontStacks?: object; fontWeights?: object; lineHeights?: object; spacing?: { gridGutter?: number; margins?: object; padding?: object; }; }; website?: string; };",
716
+ ],
717
+ response: "{ message: string; success: boolean; warnings?: { tokenIds: string[]; type: 'missing_legal_required'; }[]; }",
718
+ markdown: "## update\n\n`client.v1.brandKit.update(brandId: string, brandKit: { _metadata?: { lastUpdated: string; source: 'firecrawl' | 'manual'; }; address?: string; authors?: { id: string; bio: string; name: string; avatarS3Key?: string; avatarUrl?: string; badges?: object[]; email?: string; homepage?: string; phone?: string; role?: string; tags?: string[]; }[]; blogUrl?: string; brandMessage?: string; brandSummary?: string; colorArray?: string[]; colors?: string[]; colorsPalette?: { accent?: string[]; background?: string[]; border?: string[]; error?: string[]; link?: string[]; primary?: string[]; secondary?: string[]; success?: string[]; text?: string[]; warning?: string[]; }; companyDescription?: string; companyName?: string; components?: { buttonPrimary?: object; buttonSecondary?: object; input?: object; link?: object; }; contactEmail?: string; copyright?: string; disclaimers?: string; emailFonts?: { code?: object; heading?: object; primary?: object; }; extractedAt?: string; extractedBy?: string; fontArray?: string[]; fonts?: string[]; footer?: string; footerFeatures?: string; icons?: { primaryColor?: string; style?: string; }; imageGuidelines?: { heroHeight?: number; heroWidth?: number; logoAlignment?: 'left' | 'center' | 'right'; logoHeight?: number; logoWidth?: number; maxContentWidth?: number; thumbnailSize?: number; }; images?: { additional?: string[]; favicon?: string; faviconRejection?: object; faviconS3Key?: string; faviconSourceUrl?: string; logo?: string; logoDimensions?: object; logoRejection?: object; logoS3Key?: string; logoSourceUrl?: string; ogImage?: string; ogImageRejection?: object; ogImageS3Key?: string; ogImageSourceUrl?: string; socialLogos?: object; }; industry?: string; keyMessages?: string[]; kitName?: string; landingPagePurpose?: string; languages?: string[]; logos?: string[]; name?: string; personality?: { tone?: string; traits?: string[]; }; phone?: string; salutationFallback?: string; socials?: { discord?: string; facebook?: string; github?: string; instagram?: string; linkedin?: string; pinterest?: string; tiktok?: string; twitter?: string; youtube?: string; }; socialSize?: 'sm' | 'md' | 'lg'; socialStyle?: 'brand-circle' | 'mono-light' | 'mono-dark' | 'outline-mono' | 'brand-glyph'; tagline?: string; themeMode?: 'light' | 'dark' | 'auto'; toneOfVoice?: string; typography?: { baseUnit?: number; borderRadius?: string; fontSizes?: object; fontStacks?: object; fontWeights?: object; lineHeights?: object; spacing?: object; }; website?: string; }): { message: string; success: boolean; warnings?: object[]; }`\n\n**put** `/api/v1/brand-kit/{brandId}`\n\n### Parameters\n\n- `brandId: string`\n\n- `brandKit: { _metadata?: { lastUpdated: string; source: 'firecrawl' | 'manual'; }; address?: string; authors?: { id: string; bio: string; name: string; avatarS3Key?: string; avatarUrl?: string; badges?: { id?: string; alt?: string; height?: number; imageS3Key?: string; imageUrl?: string; label?: string; width?: number; }[]; email?: string; homepage?: string; phone?: string; role?: string; tags?: string[]; }[]; blogUrl?: string; brandMessage?: string; brandSummary?: string; colorArray?: string[]; colors?: string[]; colorsPalette?: { accent?: string[]; background?: string[]; border?: string[]; error?: string[]; link?: string[]; primary?: string[]; secondary?: string[]; success?: string[]; text?: string[]; warning?: string[]; }; companyDescription?: string; companyName?: string; components?: { buttonPrimary?: { background?: string; borderColor?: string; borderRadius?: string; focusBorderColor?: string; fontWeight?: string; padding?: string; textColor?: string; }; buttonSecondary?: { background?: string; borderColor?: string; borderRadius?: string; focusBorderColor?: string; fontWeight?: string; padding?: string; textColor?: string; }; input?: { background?: string; borderColor?: string; borderRadius?: string; focusBorderColor?: string; fontWeight?: string; padding?: string; textColor?: string; }; link?: { background?: string; borderColor?: string; borderRadius?: string; focusBorderColor?: string; fontWeight?: string; padding?: string; textColor?: string; }; }; contactEmail?: string; copyright?: string; disclaimers?: string; emailFonts?: { code?: { family: string; original: string; classification?: 'sans-serif' | 'serif' | 'slab-serif' | 'monospace'; fontStack?: string; googleFontsUrl?: string; isSystem?: boolean; weights?: number[]; }; heading?: { family: string; original: string; classification?: 'sans-serif' | 'serif' | 'slab-serif' | 'monospace'; fontStack?: string; googleFontsUrl?: string; isSystem?: boolean; weights?: number[]; }; primary?: { family: string; original: string; classification?: 'sans-serif' | 'serif' | 'slab-serif' | 'monospace'; fontStack?: string; googleFontsUrl?: string; isSystem?: boolean; weights?: number[]; }; }; extractedAt?: string; extractedBy?: string; fontArray?: string[]; fonts?: string[]; footer?: string; footerFeatures?: string; icons?: { primaryColor?: string; style?: string; }; imageGuidelines?: { heroHeight?: number; heroWidth?: number; logoAlignment?: 'left' | 'center' | 'right'; logoHeight?: number; logoWidth?: number; maxContentWidth?: number; thumbnailSize?: number; }; images?: { additional?: string[]; favicon?: string; faviconRejection?: { measured: { height: number; width: number; }; reason: 'too_small' | 'too_large' | 'bad_aspect_ratio'; required: { maxAspectRatio: number; maxHeight: number; maxWidth: number; minAspectRatio: number; minHeight: number; minWidth: number; }; }; faviconS3Key?: string; faviconSourceUrl?: string; logo?: string; logoDimensions?: { height: number; width: number; }; logoRejection?: { measured: { height: number; width: number; }; reason: 'too_small' | 'too_large' | 'bad_aspect_ratio'; required: { maxAspectRatio: number; maxHeight: number; maxWidth: number; minAspectRatio: number; minHeight: number; minWidth: number; }; }; logoS3Key?: string; logoSourceUrl?: string; ogImage?: string; ogImageRejection?: { measured: { height: number; width: number; }; reason: 'too_small' | 'too_large' | 'bad_aspect_ratio'; required: { maxAspectRatio: number; maxHeight: number; maxWidth: number; minAspectRatio: number; minHeight: number; minWidth: number; }; }; ogImageS3Key?: string; ogImageSourceUrl?: string; socialLogos?: object; }; industry?: string; keyMessages?: string[]; kitName?: string; landingPagePurpose?: string; languages?: string[]; logos?: string[]; name?: string; personality?: { tone?: string; traits?: string[]; }; phone?: string; salutationFallback?: string; socials?: { discord?: string; facebook?: string; github?: string; instagram?: string; linkedin?: string; pinterest?: string; tiktok?: string; twitter?: string; youtube?: string; }; socialSize?: 'sm' | 'md' | 'lg'; socialStyle?: 'brand-circle' | 'mono-light' | 'mono-dark' | 'outline-mono' | 'brand-glyph'; tagline?: string; themeMode?: 'light' | 'dark' | 'auto'; toneOfVoice?: string; typography?: { baseUnit?: number; borderRadius?: string; fontSizes?: object; fontStacks?: object; fontWeights?: object; lineHeights?: object; spacing?: { gridGutter?: number; margins?: object; padding?: object; }; }; website?: string; }`\n Complete brand identity data: colors, fonts, logos, social links, UI components, legal copy, and extraction metadata\n - `_metadata?: { lastUpdated: string; source: 'firecrawl' | 'manual'; }`\n - `address?: string`\n - `authors?: { id: string; bio: string; name: string; avatarS3Key?: string; avatarUrl?: string; badges?: { id?: string; alt?: string; height?: number; imageS3Key?: string; imageUrl?: string; label?: string; width?: number; }[]; email?: string; homepage?: string; phone?: string; role?: string; tags?: string[]; }[]`\n - `blogUrl?: string`\n - `brandMessage?: string`\n - `brandSummary?: string`\n - `colorArray?: string[]`\n - `colors?: string[]`\n - `colorsPalette?: { accent?: string[]; background?: string[]; border?: string[]; error?: string[]; link?: string[]; primary?: string[]; secondary?: string[]; success?: string[]; text?: string[]; warning?: string[]; }`\n Categorised color palette: primary, secondary, accent, background, text, border, link, success, warning, error\n - `companyDescription?: string`\n - `companyName?: string`\n - `components?: { buttonPrimary?: { background?: string; borderColor?: string; borderRadius?: string; focusBorderColor?: string; fontWeight?: string; padding?: string; textColor?: string; }; buttonSecondary?: { background?: string; borderColor?: string; borderRadius?: string; focusBorderColor?: string; fontWeight?: string; padding?: string; textColor?: string; }; input?: { background?: string; borderColor?: string; borderRadius?: string; focusBorderColor?: string; fontWeight?: string; padding?: string; textColor?: string; }; link?: { background?: string; borderColor?: string; borderRadius?: string; focusBorderColor?: string; fontWeight?: string; padding?: string; textColor?: string; }; }`\n UI component styles for email CTAs and forms: buttonPrimary, buttonSecondary, input, link\n - `contactEmail?: string`\n - `copyright?: string`\n - `disclaimers?: string`\n - `emailFonts?: { code?: { family: string; original: string; classification?: 'sans-serif' | 'serif' | 'slab-serif' | 'monospace'; fontStack?: string; googleFontsUrl?: string; isSystem?: boolean; weights?: number[]; }; heading?: { family: string; original: string; classification?: 'sans-serif' | 'serif' | 'slab-serif' | 'monospace'; fontStack?: string; googleFontsUrl?: string; isSystem?: boolean; weights?: number[]; }; primary?: { family: string; original: string; classification?: 'sans-serif' | 'serif' | 'slab-serif' | 'monospace'; fontStack?: string; googleFontsUrl?: string; isSystem?: boolean; weights?: number[]; }; }`\n - `extractedAt?: string`\n - `extractedBy?: string`\n - `fontArray?: string[]`\n - `fonts?: string[]`\n - `footer?: string`\n - `footerFeatures?: string`\n - `icons?: { primaryColor?: string; style?: string; }`\n Icon system information: style (outline/filled) and primary icon color\n - `imageGuidelines?: { heroHeight?: number; heroWidth?: number; logoAlignment?: 'left' | 'center' | 'right'; logoHeight?: number; logoWidth?: number; maxContentWidth?: number; thumbnailSize?: number; }`\n - `images?: { additional?: string[]; favicon?: string; faviconRejection?: { measured: { height: number; width: number; }; reason: 'too_small' | 'too_large' | 'bad_aspect_ratio'; required: { maxAspectRatio: number; maxHeight: number; maxWidth: number; minAspectRatio: number; minHeight: number; minWidth: number; }; }; faviconS3Key?: string; faviconSourceUrl?: string; logo?: string; logoDimensions?: { height: number; width: number; }; logoRejection?: { measured: { height: number; width: number; }; reason: 'too_small' | 'too_large' | 'bad_aspect_ratio'; required: { maxAspectRatio: number; maxHeight: number; maxWidth: number; minAspectRatio: number; minHeight: number; minWidth: number; }; }; logoS3Key?: string; logoSourceUrl?: string; ogImage?: string; ogImageRejection?: { measured: { height: number; width: number; }; reason: 'too_small' | 'too_large' | 'bad_aspect_ratio'; required: { maxAspectRatio: number; maxHeight: number; maxWidth: number; minAspectRatio: number; minHeight: number; minWidth: number; }; }; ogImageS3Key?: string; ogImageSourceUrl?: string; socialLogos?: object; }`\n Brand image assets: logo, favicon, ogImage, additional images, S3 keys, and social platform logos\n - `industry?: string`\n - `keyMessages?: string[]`\n - `kitName?: string`\n - `landingPagePurpose?: string`\n - `languages?: string[]`\n - `logos?: string[]`\n - `name?: string`\n - `personality?: { tone?: string; traits?: string[]; }`\n Brand personality traits: tone of voice and target audience descriptors\n - `phone?: string`\n - `salutationFallback?: string`\n - `socials?: { discord?: string; facebook?: string; github?: string; instagram?: string; linkedin?: string; pinterest?: string; tiktok?: string; twitter?: string; youtube?: string; }`\n Social media profile URLs: twitter, facebook, linkedin, instagram, youtube, github, tiktok, pinterest, discord\n - `socialSize?: 'sm' | 'md' | 'lg'`\n Brand-wide size axis (sm / md / lg) that scales every social-icon footer in recipe-compiled emails. Compiler-only — never authored by the AI agent.\n - `socialStyle?: 'brand-circle' | 'mono-light' | 'mono-dark' | 'outline-mono' | 'brand-glyph'`\n Brand-wide preset that drives every social-icon footer in recipe-compiled emails. Compiler-only — never authored by the AI agent.\n - `tagline?: string`\n - `themeMode?: 'light' | 'dark' | 'auto'`\n - `toneOfVoice?: string`\n - `typography?: { baseUnit?: number; borderRadius?: string; fontSizes?: object; fontStacks?: object; fontWeights?: object; lineHeights?: object; spacing?: { gridGutter?: number; margins?: object; padding?: object; }; }`\n Typography specifications: font sizes, weights, line heights, stacks, and spacing sub-system\n - `website?: string`\n\n### Returns\n\n- `{ message: string; success: boolean; warnings?: { tokenIds: string[]; type: 'missing_legal_required'; }[]; }`\n\n - `message: string`\n - `success: boolean`\n - `warnings?: { tokenIds: string[]; type: 'missing_legal_required'; }[]`\n\n### Example\n\n```typescript\nimport SegmentflowAI from '@segmentflow/segmentflow-typescript';\n\nconst client = new SegmentflowAI();\n\nconst brandKit = await client.v1.brandKit.update('182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e', { brandKit: {} });\n\nconsole.log(brandKit);\n```",
719
+ perLanguage: {
720
+ typescript: {
721
+ method: 'client.v1.brandKit.update',
722
+ example: "import SegmentflowAI from '@segmentflow/segmentflow-typescript';\n\nconst client = new SegmentflowAI({\n apiKey: process.env['SEGMENTFLOW_API_KEY'], // This is the default and can be omitted\n});\n\nconst brandKit = await client.v1.brandKit.update('182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e', {\n brandKit: {},\n});\n\nconsole.log(brandKit.message);",
723
+ },
724
+ python: {
725
+ method: 'v1.brand_kit.update',
726
+ example: 'import os\nfrom segmentflow import SegmentflowAI\n\nclient = SegmentflowAI(\n api_key=os.environ.get("SEGMENTFLOW_API_KEY"), # This is the default and can be omitted\n)\nbrand_kit = client.v1.brand_kit.update(\n brand_id="182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e",\n brand_kit={},\n)\nprint(brand_kit.message)',
727
+ },
728
+ java: {
729
+ method: 'v1().brandKit().update',
730
+ example: 'package com.segmentflow.api.example;\n\nimport com.segmentflow.api.client.SegmentflowAiClient;\nimport com.segmentflow.api.client.okhttp.SegmentflowAiOkHttpClient;\nimport com.segmentflow.api.models.v1.brandkit.BrandKitUpdateParams;\nimport com.segmentflow.api.models.v1.brandkit.BrandKitUpdateResponse;\n\npublic final class Main {\n private Main() {}\n\n public static void main(String[] args) {\n SegmentflowAiClient client = SegmentflowAiOkHttpClient.fromEnv();\n\n BrandKitUpdateParams params = BrandKitUpdateParams.builder()\n .brandId("182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e")\n .brandKit(BrandKitUpdateParams.BrandKit.builder().build())\n .build();\n BrandKitUpdateResponse brandKit = client.v1().brandKit().update(params);\n }\n}',
731
+ },
732
+ go: {
733
+ method: 'client.V1.BrandKit.Update',
734
+ example: 'package main\n\nimport (\n\t"context"\n\t"fmt"\n\n\t"github.com/segmentflow/segmentflow-go"\n\t"github.com/segmentflow/segmentflow-go/option"\n)\n\nfunc main() {\n\tclient := segmentflow.NewClient(\n\t\toption.WithAPIKey("My API Key"),\n\t)\n\tbrandKit, err := client.V1.BrandKit.Update(\n\t\tcontext.TODO(),\n\t\t"182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e",\n\t\tsegmentflow.V1BrandKitUpdateParams{\n\t\t\tBrandKit: segmentflow.V1BrandKitUpdateParamsBrandKit{},\n\t\t},\n\t)\n\tif err != nil {\n\t\tpanic(err.Error())\n\t}\n\tfmt.Printf("%+v\\n", brandKit.Message)\n}\n',
735
+ },
736
+ cli: {
737
+ method: 'brand_kit update',
738
+ example: "segmentflow v1:brand-kit update \\\n --api-key 'My API Key' \\\n --brand-id 182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e \\\n --brand-kit '{}'",
739
+ },
740
+ php: {
741
+ method: 'v1->brandKit->update',
742
+ example: "<?php\n\nrequire_once dirname(__DIR__) . '/vendor/autoload.php';\n\n$client = new Client(apiKey: 'My API Key', environment: 'development');\n\n$brandKit = $client->v1->brandKit->update(\n '182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e',\n brandKit: [\n '_metadata' => ['lastUpdated' => 'lastUpdated', 'source' => 'firecrawl'],\n 'address' => 'address',\n 'authors' => [\n [\n 'id' => 'id',\n 'bio' => 'bio',\n 'name' => 'name',\n 'avatarS3Key' => 'avatarS3Key',\n 'avatarURL' => 'avatarUrl',\n 'badges' => [\n [\n 'id' => 'id',\n 'alt' => 'alt',\n 'height' => 0,\n 'imageS3Key' => 'imageS3Key',\n 'imageURL' => 'imageUrl',\n 'label' => 'label',\n 'width' => 0,\n ],\n ],\n 'email' => 'email',\n 'homepage' => 'homepage',\n 'phone' => 'phone',\n 'role' => 'role',\n 'tags' => ['string'],\n ],\n ],\n 'blogURL' => 'blogUrl',\n 'brandMessage' => 'brandMessage',\n 'brandSummary' => 'brandSummary',\n 'colorArray' => ['string'],\n 'colors' => ['string'],\n 'colorsPalette' => [\n 'accent' => ['string'],\n 'background' => ['string'],\n 'border' => ['string'],\n 'error' => ['string'],\n 'link' => ['string'],\n 'primary' => ['string'],\n 'secondary' => ['string'],\n 'success' => ['string'],\n 'text' => ['string'],\n 'warning' => ['string'],\n ],\n 'companyDescription' => 'companyDescription',\n 'companyName' => 'companyName',\n 'components' => [\n 'buttonPrimary' => [\n 'background' => 'background',\n 'borderColor' => 'borderColor',\n 'borderRadius' => 'borderRadius',\n 'focusBorderColor' => 'focusBorderColor',\n 'fontWeight' => 'fontWeight',\n 'padding' => 'padding',\n 'textColor' => 'textColor',\n ],\n 'buttonSecondary' => [\n 'background' => 'background',\n 'borderColor' => 'borderColor',\n 'borderRadius' => 'borderRadius',\n 'focusBorderColor' => 'focusBorderColor',\n 'fontWeight' => 'fontWeight',\n 'padding' => 'padding',\n 'textColor' => 'textColor',\n ],\n 'input' => [\n 'background' => 'background',\n 'borderColor' => 'borderColor',\n 'borderRadius' => 'borderRadius',\n 'focusBorderColor' => 'focusBorderColor',\n 'fontWeight' => 'fontWeight',\n 'padding' => 'padding',\n 'textColor' => 'textColor',\n ],\n 'link' => [\n 'background' => 'background',\n 'borderColor' => 'borderColor',\n 'borderRadius' => 'borderRadius',\n 'focusBorderColor' => 'focusBorderColor',\n 'fontWeight' => 'fontWeight',\n 'padding' => 'padding',\n 'textColor' => 'textColor',\n ],\n ],\n 'contactEmail' => 'contactEmail',\n 'copyright' => 'copyright',\n 'disclaimers' => 'disclaimers',\n 'emailFonts' => [\n 'code' => [\n 'family' => 'family',\n 'original' => 'original',\n 'classification' => 'sans-serif',\n 'fontStack' => 'fontStack',\n 'googleFontsURL' => 'googleFontsUrl',\n 'isSystem' => true,\n 'weights' => [0],\n ],\n 'heading' => [\n 'family' => 'family',\n 'original' => 'original',\n 'classification' => 'sans-serif',\n 'fontStack' => 'fontStack',\n 'googleFontsURL' => 'googleFontsUrl',\n 'isSystem' => true,\n 'weights' => [0],\n ],\n 'primary' => [\n 'family' => 'family',\n 'original' => 'original',\n 'classification' => 'sans-serif',\n 'fontStack' => 'fontStack',\n 'googleFontsURL' => 'googleFontsUrl',\n 'isSystem' => true,\n 'weights' => [0],\n ],\n ],\n 'extractedAt' => 'extractedAt',\n 'extractedBy' => 'extractedBy',\n 'fontArray' => ['string'],\n 'fonts' => ['string'],\n 'footer' => 'footer',\n 'footerFeatures' => 'footerFeatures',\n 'icons' => ['primaryColor' => 'primaryColor', 'style' => 'style'],\n 'imageGuidelines' => [\n 'heroHeight' => 0,\n 'heroWidth' => 0,\n 'logoAlignment' => 'left',\n 'logoHeight' => 0,\n 'logoWidth' => 0,\n 'maxContentWidth' => 0,\n 'thumbnailSize' => 0,\n ],\n 'images' => [\n 'additional' => ['string'],\n 'favicon' => 'favicon',\n 'faviconRejection' => [\n 'measured' => ['height' => 0, 'width' => 0],\n 'reason' => 'too_small',\n 'required' => [\n 'maxAspectRatio' => 0,\n 'maxHeight' => 0,\n 'maxWidth' => 0,\n 'minAspectRatio' => 0,\n 'minHeight' => 0,\n 'minWidth' => 0,\n ],\n ],\n 'faviconS3Key' => 'faviconS3Key',\n 'faviconSourceURL' => 'faviconSourceUrl',\n 'logo' => 'logo',\n 'logoDimensions' => ['height' => 0, 'width' => 0],\n 'logoRejection' => [\n 'measured' => ['height' => 0, 'width' => 0],\n 'reason' => 'too_small',\n 'required' => [\n 'maxAspectRatio' => 0,\n 'maxHeight' => 0,\n 'maxWidth' => 0,\n 'minAspectRatio' => 0,\n 'minHeight' => 0,\n 'minWidth' => 0,\n ],\n ],\n 'logoS3Key' => 'logoS3Key',\n 'logoSourceURL' => 'logoSourceUrl',\n 'ogImage' => 'ogImage',\n 'ogImageRejection' => [\n 'measured' => ['height' => 0, 'width' => 0],\n 'reason' => 'too_small',\n 'required' => [\n 'maxAspectRatio' => 0,\n 'maxHeight' => 0,\n 'maxWidth' => 0,\n 'minAspectRatio' => 0,\n 'minHeight' => 0,\n 'minWidth' => 0,\n ],\n ],\n 'ogImageS3Key' => 'ogImageS3Key',\n 'ogImageSourceURL' => 'ogImageSourceUrl',\n 'socialLogos' => ['foo' => 'string'],\n ],\n 'industry' => 'industry',\n 'keyMessages' => ['string'],\n 'kitName' => 'kitName',\n 'landingPagePurpose' => 'landingPagePurpose',\n 'languages' => ['string'],\n 'logos' => ['string'],\n 'name' => 'name',\n 'personality' => ['tone' => 'tone', 'traits' => ['string']],\n 'phone' => 'phone',\n 'salutationFallback' => 'salutationFallback',\n 'socials' => [\n 'discord' => 'discord',\n 'facebook' => 'facebook',\n 'github' => 'github',\n 'instagram' => 'instagram',\n 'linkedin' => 'linkedin',\n 'pinterest' => 'pinterest',\n 'tiktok' => 'tiktok',\n 'twitter' => 'twitter',\n 'youtube' => 'youtube',\n ],\n 'socialSize' => 'sm',\n 'socialStyle' => 'brand-circle',\n 'tagline' => 'tagline',\n 'themeMode' => 'light',\n 'toneOfVoice' => 'toneOfVoice',\n 'typography' => [\n 'baseUnit' => 0,\n 'borderRadius' => 'borderRadius',\n 'fontSizes' => ['foo' => 'string'],\n 'fontStacks' => ['foo' => ['string']],\n 'fontWeights' => ['foo' => 'string'],\n 'lineHeights' => ['foo' => 'string'],\n 'spacing' => [\n 'gridGutter' => 0, 'margins' => ['foo' => 0], 'padding' => ['foo' => 0]\n ],\n ],\n 'website' => 'website',\n ],\n);\n\nvar_dump($brandKit);",
743
+ },
744
+ http: {
745
+ example: 'curl https://api.segmentflow.ai/api/v1/brand-kit/$BRAND_ID \\\n -X PUT \\\n -H \'Content-Type: application/json\' \\\n -H "x-api-key: $SEGMENTFLOW_API_KEY" \\\n -d \'{\n "brandKit": {}\n }\'',
746
+ },
747
+ },
748
+ },
749
+ {
750
+ name: 'rename',
751
+ endpoint: '/api/v1/brand-kit/{brandId}',
752
+ httpMethod: 'patch',
753
+ summary: '',
754
+ description: '',
755
+ stainlessPath: '(resource) v1.brand_kit > (method) rename',
756
+ qualified: 'client.v1.brandKit.rename',
757
+ params: ['brandId: string;', 'name: string;'],
758
+ response: '{ message: string; name: string; slug: string; success: boolean; }',
759
+ markdown: "## rename\n\n`client.v1.brandKit.rename(brandId: string, name: string): { message: string; name: string; slug: string; success: boolean; }`\n\n**patch** `/api/v1/brand-kit/{brandId}`\n\n### Parameters\n\n- `brandId: string`\n\n- `name: string`\n\n### Returns\n\n- `{ message: string; name: string; slug: string; success: boolean; }`\n\n - `message: string`\n - `name: string`\n - `slug: string`\n - `success: boolean`\n\n### Example\n\n```typescript\nimport SegmentflowAI from '@segmentflow/segmentflow-typescript';\n\nconst client = new SegmentflowAI();\n\nconst response = await client.v1.brandKit.rename('182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e', { name: 'name' });\n\nconsole.log(response);\n```",
129
760
  perLanguage: {
130
761
  typescript: {
131
- method: 'client.v1.public.broadcasts.create',
132
- example: "import SegmentflowAI from '@segmentflow/segmentflow-typescript';\n\nconst client = new SegmentflowAI({\n apiKey: process.env['SEGMENTFLOW_API_KEY'], // This is the default and can be omitted\n});\n\nconst broadcast = await client.v1.public.broadcasts.create({\n name: 'x',\n segmentId: '182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e',\n templateId: '182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e',\n});\n\nconsole.log(broadcast.broadcastId);",
762
+ method: 'client.v1.brandKit.rename',
763
+ example: "import SegmentflowAI from '@segmentflow/segmentflow-typescript';\n\nconst client = new SegmentflowAI({\n apiKey: process.env['SEGMENTFLOW_API_KEY'], // This is the default and can be omitted\n});\n\nconst response = await client.v1.brandKit.rename('182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e', {\n name: 'name',\n});\n\nconsole.log(response.message);",
764
+ },
765
+ python: {
766
+ method: 'v1.brand_kit.rename',
767
+ example: 'import os\nfrom segmentflow import SegmentflowAI\n\nclient = SegmentflowAI(\n api_key=os.environ.get("SEGMENTFLOW_API_KEY"), # This is the default and can be omitted\n)\nresponse = client.v1.brand_kit.rename(\n brand_id="182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e",\n name="name",\n)\nprint(response.message)',
768
+ },
769
+ java: {
770
+ method: 'v1().brandKit().rename',
771
+ example: 'package com.segmentflow.api.example;\n\nimport com.segmentflow.api.client.SegmentflowAiClient;\nimport com.segmentflow.api.client.okhttp.SegmentflowAiOkHttpClient;\nimport com.segmentflow.api.models.v1.brandkit.BrandKitRenameParams;\nimport com.segmentflow.api.models.v1.brandkit.BrandKitRenameResponse;\n\npublic final class Main {\n private Main() {}\n\n public static void main(String[] args) {\n SegmentflowAiClient client = SegmentflowAiOkHttpClient.fromEnv();\n\n BrandKitRenameParams params = BrandKitRenameParams.builder()\n .brandId("182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e")\n .name("name")\n .build();\n BrandKitRenameResponse response = client.v1().brandKit().rename(params);\n }\n}',
772
+ },
773
+ go: {
774
+ method: 'client.V1.BrandKit.Rename',
775
+ example: 'package main\n\nimport (\n\t"context"\n\t"fmt"\n\n\t"github.com/segmentflow/segmentflow-go"\n\t"github.com/segmentflow/segmentflow-go/option"\n)\n\nfunc main() {\n\tclient := segmentflow.NewClient(\n\t\toption.WithAPIKey("My API Key"),\n\t)\n\tresponse, err := client.V1.BrandKit.Rename(\n\t\tcontext.TODO(),\n\t\t"182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e",\n\t\tsegmentflow.V1BrandKitRenameParams{\n\t\t\tName: "name",\n\t\t},\n\t)\n\tif err != nil {\n\t\tpanic(err.Error())\n\t}\n\tfmt.Printf("%+v\\n", response.Message)\n}\n',
776
+ },
777
+ cli: {
778
+ method: 'brand_kit rename',
779
+ example: "segmentflow v1:brand-kit rename \\\n --api-key 'My API Key' \\\n --brand-id 182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e \\\n --name name",
780
+ },
781
+ php: {
782
+ method: 'v1->brandKit->rename',
783
+ example: "<?php\n\nrequire_once dirname(__DIR__) . '/vendor/autoload.php';\n\n$client = new Client(apiKey: 'My API Key', environment: 'development');\n\n$response = $client->v1->brandKit->rename(\n '182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e', name: 'name'\n);\n\nvar_dump($response);",
133
784
  },
134
785
  http: {
135
- example: 'curl https://api.segmentflow.ai/api/v1/public/broadcasts \\\n -H \'Content-Type: application/json\' \\\n -H "x-api-key: $SEGMENTFLOW_API_KEY" \\\n -d \'{\n "name": "x",\n "segmentId": "182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e",\n "templateId": "182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e"\n }\'',
786
+ example: 'curl https://api.segmentflow.ai/api/v1/brand-kit/$BRAND_ID \\\n -X PATCH \\\n -H \'Content-Type: application/json\' \\\n -H "x-api-key: $SEGMENTFLOW_API_KEY" \\\n -d \'{\n "name": "name"\n }\'',
136
787
  },
137
788
  },
138
789
  },
139
790
  {
140
- name: 'cancel',
141
- endpoint: '/api/v1/public/broadcasts/{id}/cancel',
791
+ name: 'delete',
792
+ endpoint: '/api/v1/brand-kit/{brandId}',
793
+ httpMethod: 'delete',
794
+ summary: '',
795
+ description: '',
796
+ stainlessPath: '(resource) v1.brand_kit > (method) delete',
797
+ qualified: 'client.v1.brandKit.delete',
798
+ params: ['brandId: string;'],
799
+ response: '{ message: string; success: boolean; templatesReassigned?: number; }',
800
+ markdown: "## delete\n\n`client.v1.brandKit.delete(brandId: string): { message: string; success: boolean; templatesReassigned?: number; }`\n\n**delete** `/api/v1/brand-kit/{brandId}`\n\n### Parameters\n\n- `brandId: string`\n\n### Returns\n\n- `{ message: string; success: boolean; templatesReassigned?: number; }`\n\n - `message: string`\n - `success: boolean`\n - `templatesReassigned?: number`\n\n### Example\n\n```typescript\nimport SegmentflowAI from '@segmentflow/segmentflow-typescript';\n\nconst client = new SegmentflowAI();\n\nconst brandKit = await client.v1.brandKit.delete('182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e');\n\nconsole.log(brandKit);\n```",
801
+ perLanguage: {
802
+ typescript: {
803
+ method: 'client.v1.brandKit.delete',
804
+ example: "import SegmentflowAI from '@segmentflow/segmentflow-typescript';\n\nconst client = new SegmentflowAI({\n apiKey: process.env['SEGMENTFLOW_API_KEY'], // This is the default and can be omitted\n});\n\nconst brandKit = await client.v1.brandKit.delete('182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e');\n\nconsole.log(brandKit.message);",
805
+ },
806
+ python: {
807
+ method: 'v1.brand_kit.delete',
808
+ example: 'import os\nfrom segmentflow import SegmentflowAI\n\nclient = SegmentflowAI(\n api_key=os.environ.get("SEGMENTFLOW_API_KEY"), # This is the default and can be omitted\n)\nbrand_kit = client.v1.brand_kit.delete(\n "182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e",\n)\nprint(brand_kit.message)',
809
+ },
810
+ java: {
811
+ method: 'v1().brandKit().delete',
812
+ example: 'package com.segmentflow.api.example;\n\nimport com.segmentflow.api.client.SegmentflowAiClient;\nimport com.segmentflow.api.client.okhttp.SegmentflowAiOkHttpClient;\nimport com.segmentflow.api.models.v1.brandkit.BrandKitDeleteParams;\nimport com.segmentflow.api.models.v1.brandkit.BrandKitDeleteResponse;\n\npublic final class Main {\n private Main() {}\n\n public static void main(String[] args) {\n SegmentflowAiClient client = SegmentflowAiOkHttpClient.fromEnv();\n\n BrandKitDeleteResponse brandKit = client.v1().brandKit().delete("182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e");\n }\n}',
813
+ },
814
+ go: {
815
+ method: 'client.V1.BrandKit.Delete',
816
+ example: 'package main\n\nimport (\n\t"context"\n\t"fmt"\n\n\t"github.com/segmentflow/segmentflow-go"\n\t"github.com/segmentflow/segmentflow-go/option"\n)\n\nfunc main() {\n\tclient := segmentflow.NewClient(\n\t\toption.WithAPIKey("My API Key"),\n\t)\n\tbrandKit, err := client.V1.BrandKit.Delete(context.TODO(), "182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e")\n\tif err != nil {\n\t\tpanic(err.Error())\n\t}\n\tfmt.Printf("%+v\\n", brandKit.Message)\n}\n',
817
+ },
818
+ cli: {
819
+ method: 'brand_kit delete',
820
+ example: "segmentflow v1:brand-kit delete \\\n --api-key 'My API Key' \\\n --brand-id 182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e",
821
+ },
822
+ php: {
823
+ method: 'v1->brandKit->delete',
824
+ example: "<?php\n\nrequire_once dirname(__DIR__) . '/vendor/autoload.php';\n\n$client = new Client(apiKey: 'My API Key', environment: 'development');\n\n$brandKit = $client->v1->brandKit->delete(\n '182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e'\n);\n\nvar_dump($brandKit);",
825
+ },
826
+ http: {
827
+ example: 'curl https://api.segmentflow.ai/api/v1/brand-kit/$BRAND_ID \\\n -X DELETE \\\n -H "x-api-key: $SEGMENTFLOW_API_KEY"',
828
+ },
829
+ },
830
+ },
831
+ {
832
+ name: 'extract',
833
+ endpoint: '/api/v1/brand-kit/extract',
142
834
  httpMethod: 'post',
143
- summary: 'Cancel an in-flight broadcast',
144
- description: 'Cancel all in-flight workflows for a broadcast and mark it Failed. Idempotent — noop (still 200) on broadcasts in terminal states.',
145
- stainlessPath: '(resource) v1.public.broadcasts > (method) cancel',
146
- qualified: 'client.v1.public.broadcasts.cancel',
147
- params: ['id: string;'],
148
- response: "{ broadcastId: string; status: 'NotStarted' | 'InProgress' | 'Triggered' | 'Sent' | 'Failed' | 'Archived' | 'Warming' | 'Paused'; }",
149
- markdown: "## cancel\n\n`client.v1.public.broadcasts.cancel(id: string): { broadcastId: string; status: broadcast_status; }`\n\n**post** `/api/v1/public/broadcasts/{id}/cancel`\n\nCancel all in-flight workflows for a broadcast and mark it Failed. Idempotent — noop (still 200) on broadcasts in terminal states.\n\n### Parameters\n\n- `id: string`\n\n### Returns\n\n- `{ broadcastId: string; status: 'NotStarted' | 'InProgress' | 'Triggered' | 'Sent' | 'Failed' | 'Archived' | 'Warming' | 'Paused'; }`\n\n - `broadcastId: string`\n - `status: 'NotStarted' | 'InProgress' | 'Triggered' | 'Sent' | 'Failed' | 'Archived' | 'Warming' | 'Paused'`\n\n### Example\n\n```typescript\nimport SegmentflowAI from '@segmentflow/segmentflow-typescript';\n\nconst client = new SegmentflowAI();\n\nconst response = await client.v1.public.broadcasts.cancel('182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e');\n\nconsole.log(response);\n```",
835
+ summary: '',
836
+ description: '',
837
+ stainlessPath: '(resource) v1.brand_kit > (method) extract',
838
+ qualified: 'client.v1.brandKit.extract',
839
+ params: ['websiteUrl: string;'],
840
+ response: '{ message: string; success: boolean; workflowId: string; brandId?: string; }',
841
+ markdown: "## extract\n\n`client.v1.brandKit.extract(websiteUrl: string): { message: string; success: boolean; workflowId: string; brandId?: string; }`\n\n**post** `/api/v1/brand-kit/extract`\n\n### Parameters\n\n- `websiteUrl: string`\n\n### Returns\n\n- `{ message: string; success: boolean; workflowId: string; brandId?: string; }`\n\n - `message: string`\n - `success: boolean`\n - `workflowId: string`\n - `brandId?: string`\n\n### Example\n\n```typescript\nimport SegmentflowAI from '@segmentflow/segmentflow-typescript';\n\nconst client = new SegmentflowAI();\n\nconst response = await client.v1.brandKit.extract({ websiteUrl: 'https://example.com' });\n\nconsole.log(response);\n```",
842
+ perLanguage: {
843
+ typescript: {
844
+ method: 'client.v1.brandKit.extract',
845
+ example: "import SegmentflowAI from '@segmentflow/segmentflow-typescript';\n\nconst client = new SegmentflowAI({\n apiKey: process.env['SEGMENTFLOW_API_KEY'], // This is the default and can be omitted\n});\n\nconst response = await client.v1.brandKit.extract({ websiteUrl: 'https://example.com' });\n\nconsole.log(response.message);",
846
+ },
847
+ python: {
848
+ method: 'v1.brand_kit.extract',
849
+ example: 'import os\nfrom segmentflow import SegmentflowAI\n\nclient = SegmentflowAI(\n api_key=os.environ.get("SEGMENTFLOW_API_KEY"), # This is the default and can be omitted\n)\nresponse = client.v1.brand_kit.extract(\n website_url="https://example.com",\n)\nprint(response.message)',
850
+ },
851
+ java: {
852
+ method: 'v1().brandKit().extract',
853
+ example: 'package com.segmentflow.api.example;\n\nimport com.segmentflow.api.client.SegmentflowAiClient;\nimport com.segmentflow.api.client.okhttp.SegmentflowAiOkHttpClient;\nimport com.segmentflow.api.models.v1.brandkit.BrandKitExtractParams;\nimport com.segmentflow.api.models.v1.brandkit.BrandKitExtractResponse;\n\npublic final class Main {\n private Main() {}\n\n public static void main(String[] args) {\n SegmentflowAiClient client = SegmentflowAiOkHttpClient.fromEnv();\n\n BrandKitExtractParams params = BrandKitExtractParams.builder()\n .websiteUrl("https://example.com")\n .build();\n BrandKitExtractResponse response = client.v1().brandKit().extract(params);\n }\n}',
854
+ },
855
+ go: {
856
+ method: 'client.V1.BrandKit.Extract',
857
+ example: 'package main\n\nimport (\n\t"context"\n\t"fmt"\n\n\t"github.com/segmentflow/segmentflow-go"\n\t"github.com/segmentflow/segmentflow-go/option"\n)\n\nfunc main() {\n\tclient := segmentflow.NewClient(\n\t\toption.WithAPIKey("My API Key"),\n\t)\n\tresponse, err := client.V1.BrandKit.Extract(context.TODO(), segmentflow.V1BrandKitExtractParams{\n\t\tWebsiteURL: "https://example.com",\n\t})\n\tif err != nil {\n\t\tpanic(err.Error())\n\t}\n\tfmt.Printf("%+v\\n", response.Message)\n}\n',
858
+ },
859
+ cli: {
860
+ method: 'brand_kit extract',
861
+ example: "segmentflow v1:brand-kit extract \\\n --api-key 'My API Key' \\\n --website-url https://example.com",
862
+ },
863
+ php: {
864
+ method: 'v1->brandKit->extract',
865
+ example: "<?php\n\nrequire_once dirname(__DIR__) . '/vendor/autoload.php';\n\n$client = new Client(apiKey: 'My API Key', environment: 'development');\n\n$response = $client->v1->brandKit->extract(websiteURL: 'https://example.com');\n\nvar_dump($response);",
866
+ },
867
+ http: {
868
+ example: 'curl https://api.segmentflow.ai/api/v1/brand-kit/extract \\\n -H \'Content-Type: application/json\' \\\n -H "x-api-key: $SEGMENTFLOW_API_KEY" \\\n -d \'{\n "websiteUrl": "https://example.com"\n }\'',
869
+ },
870
+ },
871
+ },
872
+ {
873
+ name: 'extract_into',
874
+ endpoint: '/api/v1/brand-kit/{brandId}/extract',
875
+ httpMethod: 'post',
876
+ summary: '',
877
+ description: '',
878
+ stainlessPath: '(resource) v1.brand_kit > (method) extract_into',
879
+ qualified: 'client.v1.brandKit.extractInto',
880
+ params: ['brandId: string;', 'websiteUrl: string;'],
881
+ response: '{ message: string; success: boolean; workflowId: string; brandId?: string; }',
882
+ markdown: "## extract_into\n\n`client.v1.brandKit.extractInto(brandId: string, websiteUrl: string): { message: string; success: boolean; workflowId: string; brandId?: string; }`\n\n**post** `/api/v1/brand-kit/{brandId}/extract`\n\n### Parameters\n\n- `brandId: string`\n\n- `websiteUrl: string`\n\n### Returns\n\n- `{ message: string; success: boolean; workflowId: string; brandId?: string; }`\n\n - `message: string`\n - `success: boolean`\n - `workflowId: string`\n - `brandId?: string`\n\n### Example\n\n```typescript\nimport SegmentflowAI from '@segmentflow/segmentflow-typescript';\n\nconst client = new SegmentflowAI();\n\nconst response = await client.v1.brandKit.extractInto('182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e', { websiteUrl: 'https://example.com' });\n\nconsole.log(response);\n```",
150
883
  perLanguage: {
151
884
  typescript: {
152
- method: 'client.v1.public.broadcasts.cancel',
153
- example: "import SegmentflowAI from '@segmentflow/segmentflow-typescript';\n\nconst client = new SegmentflowAI({\n apiKey: process.env['SEGMENTFLOW_API_KEY'], // This is the default and can be omitted\n});\n\nconst response = await client.v1.public.broadcasts.cancel('182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e');\n\nconsole.log(response.broadcastId);",
885
+ method: 'client.v1.brandKit.extractInto',
886
+ example: "import SegmentflowAI from '@segmentflow/segmentflow-typescript';\n\nconst client = new SegmentflowAI({\n apiKey: process.env['SEGMENTFLOW_API_KEY'], // This is the default and can be omitted\n});\n\nconst response = await client.v1.brandKit.extractInto('182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e', {\n websiteUrl: 'https://example.com',\n});\n\nconsole.log(response.message);",
887
+ },
888
+ python: {
889
+ method: 'v1.brand_kit.extract_into',
890
+ example: 'import os\nfrom segmentflow import SegmentflowAI\n\nclient = SegmentflowAI(\n api_key=os.environ.get("SEGMENTFLOW_API_KEY"), # This is the default and can be omitted\n)\nresponse = client.v1.brand_kit.extract_into(\n brand_id="182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e",\n website_url="https://example.com",\n)\nprint(response.message)',
891
+ },
892
+ java: {
893
+ method: 'v1().brandKit().extractInto',
894
+ example: 'package com.segmentflow.api.example;\n\nimport com.segmentflow.api.client.SegmentflowAiClient;\nimport com.segmentflow.api.client.okhttp.SegmentflowAiOkHttpClient;\nimport com.segmentflow.api.models.v1.brandkit.BrandKitExtractIntoParams;\nimport com.segmentflow.api.models.v1.brandkit.BrandKitExtractIntoResponse;\n\npublic final class Main {\n private Main() {}\n\n public static void main(String[] args) {\n SegmentflowAiClient client = SegmentflowAiOkHttpClient.fromEnv();\n\n BrandKitExtractIntoParams params = BrandKitExtractIntoParams.builder()\n .brandId("182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e")\n .websiteUrl("https://example.com")\n .build();\n BrandKitExtractIntoResponse response = client.v1().brandKit().extractInto(params);\n }\n}',
895
+ },
896
+ go: {
897
+ method: 'client.V1.BrandKit.ExtractInto',
898
+ example: 'package main\n\nimport (\n\t"context"\n\t"fmt"\n\n\t"github.com/segmentflow/segmentflow-go"\n\t"github.com/segmentflow/segmentflow-go/option"\n)\n\nfunc main() {\n\tclient := segmentflow.NewClient(\n\t\toption.WithAPIKey("My API Key"),\n\t)\n\tresponse, err := client.V1.BrandKit.ExtractInto(\n\t\tcontext.TODO(),\n\t\t"182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e",\n\t\tsegmentflow.V1BrandKitExtractIntoParams{\n\t\t\tWebsiteURL: "https://example.com",\n\t\t},\n\t)\n\tif err != nil {\n\t\tpanic(err.Error())\n\t}\n\tfmt.Printf("%+v\\n", response.Message)\n}\n',
899
+ },
900
+ cli: {
901
+ method: 'brand_kit extract_into',
902
+ example: "segmentflow v1:brand-kit extract-into \\\n --api-key 'My API Key' \\\n --brand-id 182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e \\\n --website-url https://example.com",
903
+ },
904
+ php: {
905
+ method: 'v1->brandKit->extractInto',
906
+ example: "<?php\n\nrequire_once dirname(__DIR__) . '/vendor/autoload.php';\n\n$client = new Client(apiKey: 'My API Key', environment: 'development');\n\n$response = $client->v1->brandKit->extractInto(\n '182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e', websiteURL: 'https://example.com'\n);\n\nvar_dump($response);",
154
907
  },
155
908
  http: {
156
- example: 'curl https://api.segmentflow.ai/api/v1/public/broadcasts/$ID/cancel \\\n -X POST \\\n -H "x-api-key: $SEGMENTFLOW_API_KEY"',
909
+ example: 'curl https://api.segmentflow.ai/api/v1/brand-kit/$BRAND_ID/extract \\\n -H \'Content-Type: application/json\' \\\n -H "x-api-key: $SEGMENTFLOW_API_KEY" \\\n -d \'{\n "websiteUrl": "https://example.com"\n }\'',
157
910
  },
158
911
  },
159
912
  },
160
913
  {
161
- name: 'prepare',
162
- endpoint: '/api/v1/public/broadcasts/prepare',
914
+ name: 'clear',
915
+ endpoint: '/api/v1/brand-kit/{brandId}/clear',
163
916
  httpMethod: 'post',
164
- summary: 'Prepare a broadcast (dry-run, returns preparedSendId)',
165
- description: 'Validate a broadcast draft and return a preparedSendId + audience snapshot. Bytes go nowhere until you redeem the id with /broadcasts/send-prepared. preparedSendIds expire after 15 minutes and are bound to the (organization, user) pair that created them.',
166
- stainlessPath: '(resource) v1.public.broadcasts > (method) prepare',
167
- qualified: 'client.v1.public.broadcasts.prepare',
168
- params: ['name: string;', 'segmentId: string;', 'templateId: string;', 'subject?: string;'],
169
- response: '{ audienceCount: number; expiresAt: string; preparedSendId: string; senderProfile: { id: string; fromEmail: string; name: string; }; subjectPreview: string; }',
170
- markdown: "## prepare\n\n`client.v1.public.broadcasts.prepare(name: string, segmentId: string, templateId: string, subject?: string): { audienceCount: number; expiresAt: string; preparedSendId: string; senderProfile: object; subjectPreview: string; }`\n\n**post** `/api/v1/public/broadcasts/prepare`\n\nValidate a broadcast draft and return a preparedSendId + audience snapshot. Bytes go nowhere until you redeem the id with /broadcasts/send-prepared. preparedSendIds expire after 15 minutes and are bound to the (organization, user) pair that created them.\n\n### Parameters\n\n- `name: string`\n\n- `segmentId: string`\n\n- `templateId: string`\n\n- `subject?: string`\n\n### Returns\n\n- `{ audienceCount: number; expiresAt: string; preparedSendId: string; senderProfile: { id: string; fromEmail: string; name: string; }; subjectPreview: string; }`\n\n - `audienceCount: number`\n - `expiresAt: string`\n - `preparedSendId: string`\n - `senderProfile: { id: string; fromEmail: string; name: string; }`\n - `subjectPreview: string`\n\n### Example\n\n```typescript\nimport SegmentflowAI from '@segmentflow/segmentflow-typescript';\n\nconst client = new SegmentflowAI();\n\nconst response = await client.v1.public.broadcasts.prepare({\n name: 'x',\n segmentId: '182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e',\n templateId: '182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e',\n});\n\nconsole.log(response);\n```",
917
+ summary: '',
918
+ description: '',
919
+ stainlessPath: '(resource) v1.brand_kit > (method) clear',
920
+ qualified: 'client.v1.brandKit.clear',
921
+ params: ['brandId: string;'],
922
+ response: '{ message: string; success: boolean; }',
923
+ markdown: "## clear\n\n`client.v1.brandKit.clear(brandId: string): { message: string; success: boolean; }`\n\n**post** `/api/v1/brand-kit/{brandId}/clear`\n\n### Parameters\n\n- `brandId: string`\n\n### Returns\n\n- `{ message: string; success: boolean; }`\n\n - `message: string`\n - `success: boolean`\n\n### Example\n\n```typescript\nimport SegmentflowAI from '@segmentflow/segmentflow-typescript';\n\nconst client = new SegmentflowAI();\n\nconst response = await client.v1.brandKit.clear('182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e');\n\nconsole.log(response);\n```",
171
924
  perLanguage: {
172
925
  typescript: {
173
- method: 'client.v1.public.broadcasts.prepare',
174
- example: "import SegmentflowAI from '@segmentflow/segmentflow-typescript';\n\nconst client = new SegmentflowAI({\n apiKey: process.env['SEGMENTFLOW_API_KEY'], // This is the default and can be omitted\n});\n\nconst response = await client.v1.public.broadcasts.prepare({\n name: 'x',\n segmentId: '182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e',\n templateId: '182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e',\n});\n\nconsole.log(response.audienceCount);",
926
+ method: 'client.v1.brandKit.clear',
927
+ example: "import SegmentflowAI from '@segmentflow/segmentflow-typescript';\n\nconst client = new SegmentflowAI({\n apiKey: process.env['SEGMENTFLOW_API_KEY'], // This is the default and can be omitted\n});\n\nconst response = await client.v1.brandKit.clear('182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e');\n\nconsole.log(response.message);",
928
+ },
929
+ python: {
930
+ method: 'v1.brand_kit.clear',
931
+ example: 'import os\nfrom segmentflow import SegmentflowAI\n\nclient = SegmentflowAI(\n api_key=os.environ.get("SEGMENTFLOW_API_KEY"), # This is the default and can be omitted\n)\nresponse = client.v1.brand_kit.clear(\n "182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e",\n)\nprint(response.message)',
932
+ },
933
+ java: {
934
+ method: 'v1().brandKit().clear',
935
+ example: 'package com.segmentflow.api.example;\n\nimport com.segmentflow.api.client.SegmentflowAiClient;\nimport com.segmentflow.api.client.okhttp.SegmentflowAiOkHttpClient;\nimport com.segmentflow.api.models.v1.brandkit.BrandKitClearParams;\nimport com.segmentflow.api.models.v1.brandkit.BrandKitClearResponse;\n\npublic final class Main {\n private Main() {}\n\n public static void main(String[] args) {\n SegmentflowAiClient client = SegmentflowAiOkHttpClient.fromEnv();\n\n BrandKitClearResponse response = client.v1().brandKit().clear("182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e");\n }\n}',
936
+ },
937
+ go: {
938
+ method: 'client.V1.BrandKit.Clear',
939
+ example: 'package main\n\nimport (\n\t"context"\n\t"fmt"\n\n\t"github.com/segmentflow/segmentflow-go"\n\t"github.com/segmentflow/segmentflow-go/option"\n)\n\nfunc main() {\n\tclient := segmentflow.NewClient(\n\t\toption.WithAPIKey("My API Key"),\n\t)\n\tresponse, err := client.V1.BrandKit.Clear(context.TODO(), "182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e")\n\tif err != nil {\n\t\tpanic(err.Error())\n\t}\n\tfmt.Printf("%+v\\n", response.Message)\n}\n',
940
+ },
941
+ cli: {
942
+ method: 'brand_kit clear',
943
+ example: "segmentflow v1:brand-kit clear \\\n --api-key 'My API Key' \\\n --brand-id 182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e",
944
+ },
945
+ php: {
946
+ method: 'v1->brandKit->clear',
947
+ example: "<?php\n\nrequire_once dirname(__DIR__) . '/vendor/autoload.php';\n\n$client = new Client(apiKey: 'My API Key', environment: 'development');\n\n$response = $client->v1->brandKit->clear(\n '182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e'\n);\n\nvar_dump($response);",
175
948
  },
176
949
  http: {
177
- example: 'curl https://api.segmentflow.ai/api/v1/public/broadcasts/prepare \\\n -H \'Content-Type: application/json\' \\\n -H "x-api-key: $SEGMENTFLOW_API_KEY" \\\n -d \'{\n "name": "x",\n "segmentId": "182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e",\n "templateId": "182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e"\n }\'',
950
+ example: 'curl https://api.segmentflow.ai/api/v1/brand-kit/$BRAND_ID/clear \\\n -X POST \\\n -H "x-api-key: $SEGMENTFLOW_API_KEY"',
178
951
  },
179
952
  },
180
953
  },
181
954
  {
182
- name: 'send_prepared',
183
- endpoint: '/api/v1/public/broadcasts/send-prepared',
955
+ name: 'set_default',
956
+ endpoint: '/api/v1/brand-kit/{brandId}/set-default',
184
957
  httpMethod: 'post',
185
- summary: 'Redeem a preparedSendId and trigger the broadcast',
186
- description: "Atomically consumes a preparedSendId and starts the broadcast. One-time use — repeated calls with the same id replay the original response (idempotent), they never start a second send. Caller (organization, user) must match the prepare call. Requires the API key's `allowSends` metadata flag.",
187
- stainlessPath: '(resource) v1.public.broadcasts > (method) send_prepared',
188
- qualified: 'client.v1.public.broadcasts.sendPrepared',
189
- params: ['preparedSendId: string;'],
190
- response: "{ broadcastId: string; firstRedeem: boolean; status: 'NotStarted' | 'InProgress' | 'Triggered' | 'Sent' | 'Failed' | 'Archived' | 'Warming' | 'Paused'; }",
191
- markdown: "## send_prepared\n\n`client.v1.public.broadcasts.sendPrepared(preparedSendId: string): { broadcastId: string; firstRedeem: boolean; status: broadcast_status; }`\n\n**post** `/api/v1/public/broadcasts/send-prepared`\n\nAtomically consumes a preparedSendId and starts the broadcast. One-time use — repeated calls with the same id replay the original response (idempotent), they never start a second send. Caller (organization, user) must match the prepare call. Requires the API key's `allowSends` metadata flag.\n\n### Parameters\n\n- `preparedSendId: string`\n\n### Returns\n\n- `{ broadcastId: string; firstRedeem: boolean; status: 'NotStarted' | 'InProgress' | 'Triggered' | 'Sent' | 'Failed' | 'Archived' | 'Warming' | 'Paused'; }`\n\n - `broadcastId: string`\n - `firstRedeem: boolean`\n - `status: 'NotStarted' | 'InProgress' | 'Triggered' | 'Sent' | 'Failed' | 'Archived' | 'Warming' | 'Paused'`\n\n### Example\n\n```typescript\nimport SegmentflowAI from '@segmentflow/segmentflow-typescript';\n\nconst client = new SegmentflowAI();\n\nconst response = await client.v1.public.broadcasts.sendPrepared({ preparedSendId: '182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e' });\n\nconsole.log(response);\n```",
958
+ summary: '',
959
+ description: '',
960
+ stainlessPath: '(resource) v1.brand_kit > (method) set_default',
961
+ qualified: 'client.v1.brandKit.setDefault',
962
+ params: ['brandId: string;'],
963
+ response: '{ message: string; success: boolean; }',
964
+ markdown: "## set_default\n\n`client.v1.brandKit.setDefault(brandId: string): { message: string; success: boolean; }`\n\n**post** `/api/v1/brand-kit/{brandId}/set-default`\n\n### Parameters\n\n- `brandId: string`\n\n### Returns\n\n- `{ message: string; success: boolean; }`\n\n - `message: string`\n - `success: boolean`\n\n### Example\n\n```typescript\nimport SegmentflowAI from '@segmentflow/segmentflow-typescript';\n\nconst client = new SegmentflowAI();\n\nconst response = await client.v1.brandKit.setDefault('182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e');\n\nconsole.log(response);\n```",
192
965
  perLanguage: {
193
966
  typescript: {
194
- method: 'client.v1.public.broadcasts.sendPrepared',
195
- example: "import SegmentflowAI from '@segmentflow/segmentflow-typescript';\n\nconst client = new SegmentflowAI({\n apiKey: process.env['SEGMENTFLOW_API_KEY'], // This is the default and can be omitted\n});\n\nconst response = await client.v1.public.broadcasts.sendPrepared({\n preparedSendId: '182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e',\n});\n\nconsole.log(response.broadcastId);",
967
+ method: 'client.v1.brandKit.setDefault',
968
+ example: "import SegmentflowAI from '@segmentflow/segmentflow-typescript';\n\nconst client = new SegmentflowAI({\n apiKey: process.env['SEGMENTFLOW_API_KEY'], // This is the default and can be omitted\n});\n\nconst response = await client.v1.brandKit.setDefault('182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e');\n\nconsole.log(response.message);",
969
+ },
970
+ python: {
971
+ method: 'v1.brand_kit.set_default',
972
+ example: 'import os\nfrom segmentflow import SegmentflowAI\n\nclient = SegmentflowAI(\n api_key=os.environ.get("SEGMENTFLOW_API_KEY"), # This is the default and can be omitted\n)\nresponse = client.v1.brand_kit.set_default(\n "182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e",\n)\nprint(response.message)',
973
+ },
974
+ java: {
975
+ method: 'v1().brandKit().setDefault',
976
+ example: 'package com.segmentflow.api.example;\n\nimport com.segmentflow.api.client.SegmentflowAiClient;\nimport com.segmentflow.api.client.okhttp.SegmentflowAiOkHttpClient;\nimport com.segmentflow.api.models.v1.brandkit.BrandKitSetDefaultParams;\nimport com.segmentflow.api.models.v1.brandkit.BrandKitSetDefaultResponse;\n\npublic final class Main {\n private Main() {}\n\n public static void main(String[] args) {\n SegmentflowAiClient client = SegmentflowAiOkHttpClient.fromEnv();\n\n BrandKitSetDefaultResponse response = client.v1().brandKit().setDefault("182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e");\n }\n}',
977
+ },
978
+ go: {
979
+ method: 'client.V1.BrandKit.SetDefault',
980
+ example: 'package main\n\nimport (\n\t"context"\n\t"fmt"\n\n\t"github.com/segmentflow/segmentflow-go"\n\t"github.com/segmentflow/segmentflow-go/option"\n)\n\nfunc main() {\n\tclient := segmentflow.NewClient(\n\t\toption.WithAPIKey("My API Key"),\n\t)\n\tresponse, err := client.V1.BrandKit.SetDefault(context.TODO(), "182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e")\n\tif err != nil {\n\t\tpanic(err.Error())\n\t}\n\tfmt.Printf("%+v\\n", response.Message)\n}\n',
981
+ },
982
+ cli: {
983
+ method: 'brand_kit set_default',
984
+ example: "segmentflow v1:brand-kit set-default \\\n --api-key 'My API Key' \\\n --brand-id 182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e",
985
+ },
986
+ php: {
987
+ method: 'v1->brandKit->setDefault',
988
+ example: "<?php\n\nrequire_once dirname(__DIR__) . '/vendor/autoload.php';\n\n$client = new Client(apiKey: 'My API Key', environment: 'development');\n\n$response = $client->v1->brandKit->setDefault(\n '182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e'\n);\n\nvar_dump($response);",
196
989
  },
197
990
  http: {
198
- example: 'curl https://api.segmentflow.ai/api/v1/public/broadcasts/send-prepared \\\n -H \'Content-Type: application/json\' \\\n -H "x-api-key: $SEGMENTFLOW_API_KEY" \\\n -d \'{\n "preparedSendId": "182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e"\n }\'',
991
+ example: 'curl https://api.segmentflow.ai/api/v1/brand-kit/$BRAND_ID/set-default \\\n -X POST \\\n -H "x-api-key: $SEGMENTFLOW_API_KEY"',
199
992
  },
200
993
  },
201
994
  },
202
995
  {
203
- name: 'get_status',
204
- endpoint: '/api/v1/public/broadcasts/{id}',
996
+ name: 'get_extraction_progress',
997
+ endpoint: '/api/v1/brand-kit/{brandId}/extraction-progress',
205
998
  httpMethod: 'get',
206
- summary: 'Get broadcast status + stats',
207
- description: 'Get broadcast status + stats',
208
- stainlessPath: '(resource) v1.public.broadcasts > (method) get_status',
209
- qualified: 'client.v1.public.broadcasts.getStatus',
210
- params: ['id: string;'],
211
- response: "{ id: string; completedAt: string; name: string; scheduledAt: string; startedAt: string; stats: { failed: number; queued: number; sent: number; }; status: 'NotStarted' | 'InProgress' | 'Triggered' | 'Sent' | 'Failed' | 'Archived' | 'Warming' | 'Paused'; }",
212
- markdown: "## get_status\n\n`client.v1.public.broadcasts.getStatus(id: string): { id: string; completedAt: string; name: string; scheduledAt: string; startedAt: string; stats: object; status: broadcast_status; }`\n\n**get** `/api/v1/public/broadcasts/{id}`\n\nGet broadcast status + stats\n\n### Parameters\n\n- `id: string`\n\n### Returns\n\n- `{ id: string; completedAt: string; name: string; scheduledAt: string; startedAt: string; stats: { failed: number; queued: number; sent: number; }; status: 'NotStarted' | 'InProgress' | 'Triggered' | 'Sent' | 'Failed' | 'Archived' | 'Warming' | 'Paused'; }`\n\n - `id: string`\n - `completedAt: string`\n - `name: string`\n - `scheduledAt: string`\n - `startedAt: string`\n - `stats: { failed: number; queued: number; sent: number; }`\n - `status: 'NotStarted' | 'InProgress' | 'Triggered' | 'Sent' | 'Failed' | 'Archived' | 'Warming' | 'Paused'`\n\n### Example\n\n```typescript\nimport SegmentflowAI from '@segmentflow/segmentflow-typescript';\n\nconst client = new SegmentflowAI();\n\nconst response = await client.v1.public.broadcasts.getStatus('182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e');\n\nconsole.log(response);\n```",
999
+ summary: 'Get brand kit extraction progress',
1000
+ description: 'Query step-level progress for the brand kit extraction workflow. Returns the current step, completed steps, and completion/failure state. Falls back to a DB-derived summary when the workflow has completed and no longer exists in Temporal.',
1001
+ stainlessPath: '(resource) v1.brand_kit > (method) get_extraction_progress',
1002
+ qualified: 'client.v1.brandKit.getExtractionProgress',
1003
+ params: ['brandId: string;'],
1004
+ response: '{ completedSteps: number; currentStep: string; isComplete: boolean; isFailed: boolean; totalSteps: number; error?: string; }',
1005
+ markdown: "## get_extraction_progress\n\n`client.v1.brandKit.getExtractionProgress(brandId: string): { completedSteps: number; currentStep: string; isComplete: boolean; isFailed: boolean; totalSteps: number; error?: string; }`\n\n**get** `/api/v1/brand-kit/{brandId}/extraction-progress`\n\nQuery step-level progress for the brand kit extraction workflow. Returns the current step, completed steps, and completion/failure state. Falls back to a DB-derived summary when the workflow has completed and no longer exists in Temporal.\n\n### Parameters\n\n- `brandId: string`\n\n### Returns\n\n- `{ completedSteps: number; currentStep: string; isComplete: boolean; isFailed: boolean; totalSteps: number; error?: string; }`\n\n - `completedSteps: number`\n - `currentStep: string`\n - `isComplete: boolean`\n - `isFailed: boolean`\n - `totalSteps: number`\n - `error?: string`\n\n### Example\n\n```typescript\nimport SegmentflowAI from '@segmentflow/segmentflow-typescript';\n\nconst client = new SegmentflowAI();\n\nconst response = await client.v1.brandKit.getExtractionProgress('182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e');\n\nconsole.log(response);\n```",
213
1006
  perLanguage: {
214
1007
  typescript: {
215
- method: 'client.v1.public.broadcasts.getStatus',
216
- example: "import SegmentflowAI from '@segmentflow/segmentflow-typescript';\n\nconst client = new SegmentflowAI({\n apiKey: process.env['SEGMENTFLOW_API_KEY'], // This is the default and can be omitted\n});\n\nconst response = await client.v1.public.broadcasts.getStatus(\n '182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e',\n);\n\nconsole.log(response.id);",
1008
+ method: 'client.v1.brandKit.getExtractionProgress',
1009
+ example: "import SegmentflowAI from '@segmentflow/segmentflow-typescript';\n\nconst client = new SegmentflowAI({\n apiKey: process.env['SEGMENTFLOW_API_KEY'], // This is the default and can be omitted\n});\n\nconst response = await client.v1.brandKit.getExtractionProgress(\n '182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e',\n);\n\nconsole.log(response.completedSteps);",
1010
+ },
1011
+ python: {
1012
+ method: 'v1.brand_kit.get_extraction_progress',
1013
+ example: 'import os\nfrom segmentflow import SegmentflowAI\n\nclient = SegmentflowAI(\n api_key=os.environ.get("SEGMENTFLOW_API_KEY"), # This is the default and can be omitted\n)\nresponse = client.v1.brand_kit.get_extraction_progress(\n "182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e",\n)\nprint(response.completed_steps)',
1014
+ },
1015
+ java: {
1016
+ method: 'v1().brandKit().getExtractionProgress',
1017
+ example: 'package com.segmentflow.api.example;\n\nimport com.segmentflow.api.client.SegmentflowAiClient;\nimport com.segmentflow.api.client.okhttp.SegmentflowAiOkHttpClient;\nimport com.segmentflow.api.models.v1.brandkit.BrandKitGetExtractionProgressParams;\nimport com.segmentflow.api.models.v1.brandkit.BrandKitGetExtractionProgressResponse;\n\npublic final class Main {\n private Main() {}\n\n public static void main(String[] args) {\n SegmentflowAiClient client = SegmentflowAiOkHttpClient.fromEnv();\n\n BrandKitGetExtractionProgressResponse response = client.v1().brandKit().getExtractionProgress("182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e");\n }\n}',
1018
+ },
1019
+ go: {
1020
+ method: 'client.V1.BrandKit.GetExtractionProgress',
1021
+ example: 'package main\n\nimport (\n\t"context"\n\t"fmt"\n\n\t"github.com/segmentflow/segmentflow-go"\n\t"github.com/segmentflow/segmentflow-go/option"\n)\n\nfunc main() {\n\tclient := segmentflow.NewClient(\n\t\toption.WithAPIKey("My API Key"),\n\t)\n\tresponse, err := client.V1.BrandKit.GetExtractionProgress(context.TODO(), "182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e")\n\tif err != nil {\n\t\tpanic(err.Error())\n\t}\n\tfmt.Printf("%+v\\n", response.CompletedSteps)\n}\n',
1022
+ },
1023
+ cli: {
1024
+ method: 'brand_kit get_extraction_progress',
1025
+ example: "segmentflow v1:brand-kit get-extraction-progress \\\n --api-key 'My API Key' \\\n --brand-id 182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e",
1026
+ },
1027
+ php: {
1028
+ method: 'v1->brandKit->getExtractionProgress',
1029
+ example: "<?php\n\nrequire_once dirname(__DIR__) . '/vendor/autoload.php';\n\n$client = new Client(apiKey: 'My API Key', environment: 'development');\n\n$response = $client->v1->brandKit->getExtractionProgress(\n '182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e'\n);\n\nvar_dump($response);",
217
1030
  },
218
1031
  http: {
219
- example: 'curl https://api.segmentflow.ai/api/v1/public/broadcasts/$ID \\\n -H "x-api-key: $SEGMENTFLOW_API_KEY"',
1032
+ example: 'curl https://api.segmentflow.ai/api/v1/brand-kit/$BRAND_ID/extraction-progress \\\n -H "x-api-key: $SEGMENTFLOW_API_KEY"',
220
1033
  },
221
1034
  },
222
1035
  },
223
1036
  {
224
1037
  name: 'list',
225
- endpoint: '/api/v1/public/templates',
1038
+ endpoint: '/api/v1/templates',
226
1039
  httpMethod: 'get',
227
- summary: 'List email templates',
228
- description: 'List email templates',
229
- stainlessPath: '(resource) v1.public.templates > (method) list',
230
- qualified: 'client.v1.public.templates.list',
1040
+ summary: 'List templates',
1041
+ description: 'Get all templates for the organization',
1042
+ stainlessPath: '(resource) v1.templates > (method) list',
1043
+ qualified: 'client.v1.templates.list',
231
1044
  params: [
232
- 'cursor?: string;',
233
- 'limit?: number;',
234
- 'pageSize?: number;',
235
1045
  "purpose?: 'General' | 'Newsletter' | 'Promotional' | 'Transactional' | 'LeadMagnetDelivery';",
236
- "status?: 'Active' | 'Archived';",
1046
+ "status?: 'Active' | 'Archived'[];",
237
1047
  ],
238
- response: "{ id: string; createdAt: string; isComplete: boolean; language: string; name: string; purpose: 'General' | 'Newsletter' | 'Promotional' | 'Transactional' | 'LeadMagnetDelivery'; status: 'Active' | 'Archived'; type: string; updatedAt: string; }[]",
239
- markdown: "## list\n\n`client.v1.public.templates.list(cursor?: string, limit?: number, pageSize?: number, purpose?: 'General' | 'Newsletter' | 'Promotional' | 'Transactional' | 'LeadMagnetDelivery', status?: 'Active' | 'Archived'): { id: string; createdAt: string; isComplete: boolean; language: string; name: string; purpose: 'General' | 'Newsletter' | 'Promotional' | 'Transactional' | 'LeadMagnetDelivery'; status: template_status; type: string; updatedAt: string; }[]`\n\n**get** `/api/v1/public/templates`\n\nList email templates\n\n### Parameters\n\n- `cursor?: string`\n\n- `limit?: number`\n\n- `pageSize?: number`\n\n- `purpose?: 'General' | 'Newsletter' | 'Promotional' | 'Transactional' | 'LeadMagnetDelivery'`\n\n- `status?: 'Active' | 'Archived'`\n Lifecycle status of a message template (Active or Archived)\n\n### Returns\n\n- `{ id: string; createdAt: string; isComplete: boolean; language: string; name: string; purpose: 'General' | 'Newsletter' | 'Promotional' | 'Transactional' | 'LeadMagnetDelivery'; status: 'Active' | 'Archived'; type: string; updatedAt: string; }[]`\n\n### Example\n\n```typescript\nimport SegmentflowAI from '@segmentflow/segmentflow-typescript';\n\nconst client = new SegmentflowAI();\n\nconst templates = await client.v1.public.templates.list();\n\nconsole.log(templates);\n```",
1048
+ response: "{ id: string; createdAt: string; generationStatus: 'Idle' | 'Generating' | 'Failed'; isComplete: boolean; language: string; lastGeneratedAt: string; lastGenerationError: string; name: string; organizationId: string; purpose: 'General' | 'Newsletter' | 'Promotional' | 'Transactional' | 'LeadMagnetDelivery'; status: 'Active' | 'Archived'; type: string; updatedAt: string; defaultSegmentId?: string; emailContentsType?: 'Code'; source?: string; statusBeforeArchive?: 'Active' | 'Archived'; website?: { id: string; name: string; }; websiteId?: string; }[]",
1049
+ markdown: "## list\n\n`client.v1.templates.list(purpose?: 'General' | 'Newsletter' | 'Promotional' | 'Transactional' | 'LeadMagnetDelivery', status?: 'Active' | 'Archived'[]): { id: string; createdAt: string; generationStatus: 'Idle' | 'Generating' | 'Failed'; isComplete: boolean; language: string; lastGeneratedAt: string; lastGenerationError: string; name: string; organizationId: string; purpose: 'General' | 'Newsletter' | 'Promotional' | 'Transactional' | 'LeadMagnetDelivery'; status: 'Active' | 'Archived'; type: string; updatedAt: string; defaultSegmentId?: string; emailContentsType?: 'Code'; source?: string; statusBeforeArchive?: 'Active' | 'Archived'; website?: object; websiteId?: string; }[]`\n\n**get** `/api/v1/templates`\n\nGet all templates for the organization\n\n### Parameters\n\n- `purpose?: 'General' | 'Newsletter' | 'Promotional' | 'Transactional' | 'LeadMagnetDelivery'`\n\n- `status?: 'Active' | 'Archived'[]`\n\n### Returns\n\n- `{ id: string; createdAt: string; generationStatus: 'Idle' | 'Generating' | 'Failed'; isComplete: boolean; language: string; lastGeneratedAt: string; lastGenerationError: string; name: string; organizationId: string; purpose: 'General' | 'Newsletter' | 'Promotional' | 'Transactional' | 'LeadMagnetDelivery'; status: 'Active' | 'Archived'; type: string; updatedAt: string; defaultSegmentId?: string; emailContentsType?: 'Code'; source?: string; statusBeforeArchive?: 'Active' | 'Archived'; website?: { id: string; name: string; }; websiteId?: string; }[]`\n\n### Example\n\n```typescript\nimport SegmentflowAI from '@segmentflow/segmentflow-typescript';\n\nconst client = new SegmentflowAI();\n\nconst templates = await client.v1.templates.list();\n\nconsole.log(templates);\n```",
240
1050
  perLanguage: {
241
1051
  typescript: {
242
- method: 'client.v1.public.templates.list',
243
- example: "import SegmentflowAI from '@segmentflow/segmentflow-typescript';\n\nconst client = new SegmentflowAI({\n apiKey: process.env['SEGMENTFLOW_API_KEY'], // This is the default and can be omitted\n});\n\nconst templates = await client.v1.public.templates.list();\n\nconsole.log(templates);",
1052
+ method: 'client.v1.templates.list',
1053
+ example: "import SegmentflowAI from '@segmentflow/segmentflow-typescript';\n\nconst client = new SegmentflowAI({\n apiKey: process.env['SEGMENTFLOW_API_KEY'], // This is the default and can be omitted\n});\n\nconst templates = await client.v1.templates.list();\n\nconsole.log(templates);",
1054
+ },
1055
+ python: {
1056
+ method: 'v1.templates.list',
1057
+ example: 'import os\nfrom segmentflow import SegmentflowAI\n\nclient = SegmentflowAI(\n api_key=os.environ.get("SEGMENTFLOW_API_KEY"), # This is the default and can be omitted\n)\ntemplates = client.v1.templates.list()\nprint(templates)',
1058
+ },
1059
+ java: {
1060
+ method: 'v1().templates().list',
1061
+ example: 'package com.segmentflow.api.example;\n\nimport com.segmentflow.api.client.SegmentflowAiClient;\nimport com.segmentflow.api.client.okhttp.SegmentflowAiOkHttpClient;\nimport com.segmentflow.api.models.v1.templates.TemplateListParams;\nimport com.segmentflow.api.models.v1.templates.TemplateListResponse;\n\npublic final class Main {\n private Main() {}\n\n public static void main(String[] args) {\n SegmentflowAiClient client = SegmentflowAiOkHttpClient.fromEnv();\n\n List<TemplateListResponse> templates = client.v1().templates().list();\n }\n}',
1062
+ },
1063
+ go: {
1064
+ method: 'client.V1.Templates.List',
1065
+ example: 'package main\n\nimport (\n\t"context"\n\t"fmt"\n\n\t"github.com/segmentflow/segmentflow-go"\n\t"github.com/segmentflow/segmentflow-go/option"\n)\n\nfunc main() {\n\tclient := segmentflow.NewClient(\n\t\toption.WithAPIKey("My API Key"),\n\t)\n\ttemplates, err := client.V1.Templates.List(context.TODO(), segmentflow.V1TemplateListParams{})\n\tif err != nil {\n\t\tpanic(err.Error())\n\t}\n\tfmt.Printf("%+v\\n", templates)\n}\n',
1066
+ },
1067
+ cli: {
1068
+ method: 'templates list',
1069
+ example: "segmentflow v1:templates list \\\n --api-key 'My API Key'",
1070
+ },
1071
+ php: {
1072
+ method: 'v1->templates->list',
1073
+ example: "<?php\n\nrequire_once dirname(__DIR__) . '/vendor/autoload.php';\n\n$client = new Client(apiKey: 'My API Key', environment: 'development');\n\n$templates = $client->v1->templates->list(\n purpose: 'General', status: ['Active']\n);\n\nvar_dump($templates);",
244
1074
  },
245
1075
  http: {
246
- example: 'curl https://api.segmentflow.ai/api/v1/public/templates \\\n -H "x-api-key: $SEGMENTFLOW_API_KEY"',
1076
+ example: 'curl https://api.segmentflow.ai/api/v1/templates \\\n -H "x-api-key: $SEGMENTFLOW_API_KEY"',
247
1077
  },
248
1078
  },
249
1079
  },
250
1080
  {
251
- name: 'get',
252
- endpoint: '/api/v1/public/templates/{id}',
1081
+ name: 'create',
1082
+ endpoint: '/api/v1/templates',
1083
+ httpMethod: 'post',
1084
+ summary: 'Create template',
1085
+ description: 'Create template',
1086
+ stainlessPath: '(resource) v1.templates > (method) create',
1087
+ qualified: 'client.v1.templates.create',
1088
+ params: [
1089
+ 'name: string;',
1090
+ 'type: string;',
1091
+ 'id?: string;',
1092
+ 'brandKitId?: string;',
1093
+ 'defaultSegmentId?: string;',
1094
+ "definition?: { body: { elements: object; root: string; }; codeFormat: 'json'; emailContentsType: 'Code'; type: 'Email'; from?: string; preheader?: string; renderVariables?: object; replyTo?: string; sensitiveTransactionalVariablePaths?: string[]; subject?: string; };",
1095
+ 'language?: string;',
1096
+ "purpose?: 'General' | 'Newsletter' | 'Promotional' | 'Transactional' | 'LeadMagnetDelivery';",
1097
+ 'senderProfileId?: string;',
1098
+ 'subType?: string;',
1099
+ ],
1100
+ response: "{ id: string; brandKitId: string; createdAt: string; defaultSegmentId: string; language: string; name: string; organizationId: string; purpose: 'General' | 'Newsletter' | 'Promotional' | 'Transactional' | 'LeadMagnetDelivery'; senderProfileId: string; source: string; type: string; updatedAt: string; currentSnapshotId?: string; definition?: { body: { elements: object; root: string; }; codeFormat: 'json'; emailContentsType: 'Code'; from: string; subject: string; type: 'Email'; preheader?: string; renderVariables?: object; replyTo?: string; sensitiveTransactionalVariablePaths?: string[]; }; }",
1101
+ markdown: "## create\n\n`client.v1.templates.create(name: string, type: string, id?: string, brandKitId?: string, defaultSegmentId?: string, definition?: { body: { elements: object; root: string; }; codeFormat: 'json'; emailContentsType: 'Code'; type: 'Email'; from?: string; preheader?: string; renderVariables?: object; replyTo?: string; sensitiveTransactionalVariablePaths?: string[]; subject?: string; }, language?: string, purpose?: 'General' | 'Newsletter' | 'Promotional' | 'Transactional' | 'LeadMagnetDelivery', senderProfileId?: string, subType?: string): { id: string; brandKitId: string; createdAt: string; defaultSegmentId: string; language: string; name: string; organizationId: string; purpose: 'General' | 'Newsletter' | 'Promotional' | 'Transactional' | 'LeadMagnetDelivery'; senderProfileId: string; source: string; type: string; updatedAt: string; currentSnapshotId?: string; definition?: object; }`\n\n**post** `/api/v1/templates`\n\nCreate template\n\n### Parameters\n\n- `name: string`\n\n- `type: string`\n\n- `id?: string`\n\n- `brandKitId?: string`\n\n- `defaultSegmentId?: string`\n\n- `definition?: { body: { elements: object; root: string; }; codeFormat: 'json'; emailContentsType: 'Code'; type: 'Email'; from?: string; preheader?: string; renderVariables?: object; replyTo?: string; sensitiveTransactionalVariablePaths?: string[]; subject?: string; }`\n - `body: { elements: object; root: string; }`\n - `codeFormat: 'json'`\n - `emailContentsType: 'Code'`\n - `type: 'Email'`\n - `from?: string`\n - `preheader?: string`\n - `renderVariables?: object`\n - `replyTo?: string`\n - `sensitiveTransactionalVariablePaths?: string[]`\n - `subject?: string`\n\n- `language?: string`\n\n- `purpose?: 'General' | 'Newsletter' | 'Promotional' | 'Transactional' | 'LeadMagnetDelivery'`\n\n- `senderProfileId?: string`\n\n- `subType?: string`\n\n### Returns\n\n- `{ id: string; brandKitId: string; createdAt: string; defaultSegmentId: string; language: string; name: string; organizationId: string; purpose: 'General' | 'Newsletter' | 'Promotional' | 'Transactional' | 'LeadMagnetDelivery'; senderProfileId: string; source: string; type: string; updatedAt: string; currentSnapshotId?: string; definition?: { body: { elements: object; root: string; }; codeFormat: 'json'; emailContentsType: 'Code'; from: string; subject: string; type: 'Email'; preheader?: string; renderVariables?: object; replyTo?: string; sensitiveTransactionalVariablePaths?: string[]; }; }`\n\n - `id: string`\n - `brandKitId: string`\n - `createdAt: string`\n - `defaultSegmentId: string`\n - `language: string`\n - `name: string`\n - `organizationId: string`\n - `purpose: 'General' | 'Newsletter' | 'Promotional' | 'Transactional' | 'LeadMagnetDelivery'`\n - `senderProfileId: string`\n - `source: string`\n - `type: string`\n - `updatedAt: string`\n - `currentSnapshotId?: string`\n - `definition?: { body: { elements: object; root: string; }; codeFormat: 'json'; emailContentsType: 'Code'; from: string; subject: string; type: 'Email'; preheader?: string; renderVariables?: object; replyTo?: string; sensitiveTransactionalVariablePaths?: string[]; }`\n\n### Example\n\n```typescript\nimport SegmentflowAI from '@segmentflow/segmentflow-typescript';\n\nconst client = new SegmentflowAI();\n\nconst template = await client.v1.templates.create({ name: 'name', type: 'type' });\n\nconsole.log(template);\n```",
1102
+ perLanguage: {
1103
+ typescript: {
1104
+ method: 'client.v1.templates.create',
1105
+ example: "import SegmentflowAI from '@segmentflow/segmentflow-typescript';\n\nconst client = new SegmentflowAI({\n apiKey: process.env['SEGMENTFLOW_API_KEY'], // This is the default and can be omitted\n});\n\nconst template = await client.v1.templates.create({ name: 'name', type: 'type' });\n\nconsole.log(template.id);",
1106
+ },
1107
+ python: {
1108
+ method: 'v1.templates.create',
1109
+ example: 'import os\nfrom segmentflow import SegmentflowAI\n\nclient = SegmentflowAI(\n api_key=os.environ.get("SEGMENTFLOW_API_KEY"), # This is the default and can be omitted\n)\ntemplate = client.v1.templates.create(\n name="name",\n type="type",\n)\nprint(template.id)',
1110
+ },
1111
+ java: {
1112
+ method: 'v1().templates().create',
1113
+ example: 'package com.segmentflow.api.example;\n\nimport com.segmentflow.api.client.SegmentflowAiClient;\nimport com.segmentflow.api.client.okhttp.SegmentflowAiOkHttpClient;\nimport com.segmentflow.api.models.v1.templates.TemplateCreateParams;\nimport com.segmentflow.api.models.v1.templates.TemplateCreateResponse;\n\npublic final class Main {\n private Main() {}\n\n public static void main(String[] args) {\n SegmentflowAiClient client = SegmentflowAiOkHttpClient.fromEnv();\n\n TemplateCreateParams params = TemplateCreateParams.builder()\n .name("name")\n .type("type")\n .build();\n TemplateCreateResponse template = client.v1().templates().create(params);\n }\n}',
1114
+ },
1115
+ go: {
1116
+ method: 'client.V1.Templates.New',
1117
+ example: 'package main\n\nimport (\n\t"context"\n\t"fmt"\n\n\t"github.com/segmentflow/segmentflow-go"\n\t"github.com/segmentflow/segmentflow-go/option"\n)\n\nfunc main() {\n\tclient := segmentflow.NewClient(\n\t\toption.WithAPIKey("My API Key"),\n\t)\n\ttemplate, err := client.V1.Templates.New(context.TODO(), segmentflow.V1TemplateNewParams{\n\t\tName: "name",\n\t\tType: "type",\n\t})\n\tif err != nil {\n\t\tpanic(err.Error())\n\t}\n\tfmt.Printf("%+v\\n", template.ID)\n}\n',
1118
+ },
1119
+ cli: {
1120
+ method: 'templates create',
1121
+ example: "segmentflow v1:templates create \\\n --api-key 'My API Key' \\\n --name name \\\n --type type",
1122
+ },
1123
+ php: {
1124
+ method: 'v1->templates->create',
1125
+ example: "<?php\n\nrequire_once dirname(__DIR__) . '/vendor/autoload.php';\n\n$client = new Client(apiKey: 'My API Key', environment: 'development');\n\n$template = $client->v1->templates->create(\n name: 'name',\n type: 'type',\n id: '182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e',\n brandKitID: '182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e',\n defaultSegmentID: '182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e',\n definition: [\n 'body' => [\n 'elements' => [\n 'foo' => [\n 'type' => 'x', 'children' => ['string'], 'props' => ['foo' => 'bar']\n ],\n ],\n 'root' => 'x',\n ],\n 'codeFormat' => 'json',\n 'emailContentsType' => 'Code',\n 'type' => 'Email',\n 'from' => 'from',\n 'preheader' => 'preheader',\n 'renderVariables' => ['foo' => 'bar'],\n 'replyTo' => 'replyTo',\n 'sensitiveTransactionalVariablePaths' => ['x'],\n 'subject' => 'subject',\n ],\n language: 'xx',\n purpose: 'General',\n senderProfileID: '182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e',\n subType: 'subType',\n);\n\nvar_dump($template);",
1126
+ },
1127
+ http: {
1128
+ example: 'curl https://api.segmentflow.ai/api/v1/templates \\\n -H \'Content-Type: application/json\' \\\n -H "x-api-key: $SEGMENTFLOW_API_KEY" \\\n -d \'{\n "name": "name",\n "type": "type"\n }\'',
1129
+ },
1130
+ },
1131
+ },
1132
+ {
1133
+ name: 'retrieve',
1134
+ endpoint: '/api/v1/templates/{id}',
253
1135
  httpMethod: 'get',
254
- summary: 'Get an email template by id',
255
- description: 'Get an email template by id',
256
- stainlessPath: '(resource) v1.public.templates > (method) get',
257
- qualified: 'client.v1.public.templates.get',
1136
+ summary: 'Get template',
1137
+ description: 'Get template',
1138
+ stainlessPath: '(resource) v1.templates > (method) retrieve',
1139
+ qualified: 'client.v1.templates.retrieve',
258
1140
  params: ['id: string;'],
259
- response: "{ id: string; createdAt: string; isComplete: boolean; language: string; name: string; purpose: 'General' | 'Newsletter' | 'Promotional' | 'Transactional' | 'LeadMagnetDelivery'; status: 'Active' | 'Archived'; type: string; updatedAt: string; }",
260
- markdown: "## get\n\n`client.v1.public.templates.get(id: string): { id: string; createdAt: string; isComplete: boolean; language: string; name: string; purpose: 'General' | 'Newsletter' | 'Promotional' | 'Transactional' | 'LeadMagnetDelivery'; status: template_status; type: string; updatedAt: string; }`\n\n**get** `/api/v1/public/templates/{id}`\n\nGet an email template by id\n\n### Parameters\n\n- `id: string`\n\n### Returns\n\n- `{ id: string; createdAt: string; isComplete: boolean; language: string; name: string; purpose: 'General' | 'Newsletter' | 'Promotional' | 'Transactional' | 'LeadMagnetDelivery'; status: 'Active' | 'Archived'; type: string; updatedAt: string; }`\n\n - `id: string`\n - `createdAt: string`\n - `isComplete: boolean`\n - `language: string`\n - `name: string`\n - `purpose: 'General' | 'Newsletter' | 'Promotional' | 'Transactional' | 'LeadMagnetDelivery'`\n - `status: 'Active' | 'Archived'`\n - `type: string`\n - `updatedAt: string`\n\n### Example\n\n```typescript\nimport SegmentflowAI from '@segmentflow/segmentflow-typescript';\n\nconst client = new SegmentflowAI();\n\nconst template = await client.v1.public.templates.get('182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e');\n\nconsole.log(template);\n```",
1141
+ response: "{ id: string; brandKitId: string; createdAt: string; defaultSegmentId: string; language: string; name: string; organizationId: string; purpose: 'General' | 'Newsletter' | 'Promotional' | 'Transactional' | 'LeadMagnetDelivery'; senderProfileId: string; source: string; type: string; updatedAt: string; currentSnapshotId?: string; definition?: { body: { elements: object; root: string; }; codeFormat: 'json'; emailContentsType: 'Code'; from: string; subject: string; type: 'Email'; preheader?: string; renderVariables?: object; replyTo?: string; sensitiveTransactionalVariablePaths?: string[]; }; }",
1142
+ markdown: "## retrieve\n\n`client.v1.templates.retrieve(id: string): { id: string; brandKitId: string; createdAt: string; defaultSegmentId: string; language: string; name: string; organizationId: string; purpose: 'General' | 'Newsletter' | 'Promotional' | 'Transactional' | 'LeadMagnetDelivery'; senderProfileId: string; source: string; type: string; updatedAt: string; currentSnapshotId?: string; definition?: object; }`\n\n**get** `/api/v1/templates/{id}`\n\nGet template\n\n### Parameters\n\n- `id: string`\n\n### Returns\n\n- `{ id: string; brandKitId: string; createdAt: string; defaultSegmentId: string; language: string; name: string; organizationId: string; purpose: 'General' | 'Newsletter' | 'Promotional' | 'Transactional' | 'LeadMagnetDelivery'; senderProfileId: string; source: string; type: string; updatedAt: string; currentSnapshotId?: string; definition?: { body: { elements: object; root: string; }; codeFormat: 'json'; emailContentsType: 'Code'; from: string; subject: string; type: 'Email'; preheader?: string; renderVariables?: object; replyTo?: string; sensitiveTransactionalVariablePaths?: string[]; }; }`\n\n - `id: string`\n - `brandKitId: string`\n - `createdAt: string`\n - `defaultSegmentId: string`\n - `language: string`\n - `name: string`\n - `organizationId: string`\n - `purpose: 'General' | 'Newsletter' | 'Promotional' | 'Transactional' | 'LeadMagnetDelivery'`\n - `senderProfileId: string`\n - `source: string`\n - `type: string`\n - `updatedAt: string`\n - `currentSnapshotId?: string`\n - `definition?: { body: { elements: object; root: string; }; codeFormat: 'json'; emailContentsType: 'Code'; from: string; subject: string; type: 'Email'; preheader?: string; renderVariables?: object; replyTo?: string; sensitiveTransactionalVariablePaths?: string[]; }`\n\n### Example\n\n```typescript\nimport SegmentflowAI from '@segmentflow/segmentflow-typescript';\n\nconst client = new SegmentflowAI();\n\nconst template = await client.v1.templates.retrieve('182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e');\n\nconsole.log(template);\n```",
261
1143
  perLanguage: {
262
1144
  typescript: {
263
- method: 'client.v1.public.templates.get',
264
- example: "import SegmentflowAI from '@segmentflow/segmentflow-typescript';\n\nconst client = new SegmentflowAI({\n apiKey: process.env['SEGMENTFLOW_API_KEY'], // This is the default and can be omitted\n});\n\nconst template = await client.v1.public.templates.get('182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e');\n\nconsole.log(template.id);",
1145
+ method: 'client.v1.templates.retrieve',
1146
+ example: "import SegmentflowAI from '@segmentflow/segmentflow-typescript';\n\nconst client = new SegmentflowAI({\n apiKey: process.env['SEGMENTFLOW_API_KEY'], // This is the default and can be omitted\n});\n\nconst template = await client.v1.templates.retrieve('182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e');\n\nconsole.log(template.id);",
1147
+ },
1148
+ python: {
1149
+ method: 'v1.templates.retrieve',
1150
+ example: 'import os\nfrom segmentflow import SegmentflowAI\n\nclient = SegmentflowAI(\n api_key=os.environ.get("SEGMENTFLOW_API_KEY"), # This is the default and can be omitted\n)\ntemplate = client.v1.templates.retrieve(\n "182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e",\n)\nprint(template.id)',
1151
+ },
1152
+ java: {
1153
+ method: 'v1().templates().retrieve',
1154
+ example: 'package com.segmentflow.api.example;\n\nimport com.segmentflow.api.client.SegmentflowAiClient;\nimport com.segmentflow.api.client.okhttp.SegmentflowAiOkHttpClient;\nimport com.segmentflow.api.models.v1.templates.TemplateRetrieveParams;\nimport com.segmentflow.api.models.v1.templates.TemplateRetrieveResponse;\n\npublic final class Main {\n private Main() {}\n\n public static void main(String[] args) {\n SegmentflowAiClient client = SegmentflowAiOkHttpClient.fromEnv();\n\n TemplateRetrieveResponse template = client.v1().templates().retrieve("182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e");\n }\n}',
1155
+ },
1156
+ go: {
1157
+ method: 'client.V1.Templates.Get',
1158
+ example: 'package main\n\nimport (\n\t"context"\n\t"fmt"\n\n\t"github.com/segmentflow/segmentflow-go"\n\t"github.com/segmentflow/segmentflow-go/option"\n)\n\nfunc main() {\n\tclient := segmentflow.NewClient(\n\t\toption.WithAPIKey("My API Key"),\n\t)\n\ttemplate, err := client.V1.Templates.Get(context.TODO(), "182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e")\n\tif err != nil {\n\t\tpanic(err.Error())\n\t}\n\tfmt.Printf("%+v\\n", template.ID)\n}\n',
1159
+ },
1160
+ cli: {
1161
+ method: 'templates retrieve',
1162
+ example: "segmentflow v1:templates retrieve \\\n --api-key 'My API Key' \\\n --id 182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e",
1163
+ },
1164
+ php: {
1165
+ method: 'v1->templates->retrieve',
1166
+ example: "<?php\n\nrequire_once dirname(__DIR__) . '/vendor/autoload.php';\n\n$client = new Client(apiKey: 'My API Key', environment: 'development');\n\n$template = $client->v1->templates->retrieve(\n '182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e'\n);\n\nvar_dump($template);",
265
1167
  },
266
1168
  http: {
267
- example: 'curl https://api.segmentflow.ai/api/v1/public/templates/$ID \\\n -H "x-api-key: $SEGMENTFLOW_API_KEY"',
1169
+ example: 'curl https://api.segmentflow.ai/api/v1/templates/$ID \\\n -H "x-api-key: $SEGMENTFLOW_API_KEY"',
268
1170
  },
269
1171
  },
270
1172
  },
271
1173
  {
272
- name: 'list',
273
- endpoint: '/api/v1/public/segments',
274
- httpMethod: 'get',
275
- summary: 'List segments',
276
- description: 'List segments',
277
- stainlessPath: '(resource) v1.public.segments > (method) list',
278
- qualified: 'client.v1.public.segments.list',
1174
+ name: 'update',
1175
+ endpoint: '/api/v1/templates/{id}',
1176
+ httpMethod: 'put',
1177
+ summary: 'Update template',
1178
+ description: 'Update template',
1179
+ stainlessPath: '(resource) v1.templates > (method) update',
1180
+ qualified: 'client.v1.templates.update',
279
1181
  params: [
280
- "membershipType?: 'computed' | 'static';",
281
- "status?: 'NotStarted' | 'Running' | 'Paused' | 'Archived';",
1182
+ 'id: string;',
1183
+ 'brandKitId?: string;',
1184
+ 'defaultSegmentId?: string;',
1185
+ "definition?: { body: { elements: object; root: string; }; codeFormat: 'json'; emailContentsType: 'Code'; type: 'Email'; from?: string; preheader?: string; renderVariables?: object; replyTo?: string; sensitiveTransactionalVariablePaths?: string[]; subject?: string; };",
1186
+ 'language?: string;',
1187
+ 'name?: string;',
1188
+ "purpose?: 'General' | 'Newsletter' | 'Promotional' | 'Transactional' | 'LeadMagnetDelivery';",
1189
+ 'senderProfileId?: string;',
1190
+ 'subType?: string;',
282
1191
  ],
283
- response: "{ id: string; createdAt: string; lastComputedAt: string; membershipType: 'computed' | 'static'; name: string; status: 'NotStarted' | 'Running' | 'Paused' | 'Archived'; updatedAt: string; userCount: number; }[]",
284
- markdown: "## list\n\n`client.v1.public.segments.list(membershipType?: 'computed' | 'static', status?: 'NotStarted' | 'Running' | 'Paused' | 'Archived'): { id: string; createdAt: string; lastComputedAt: string; membershipType: 'computed' | 'static'; name: string; status: 'NotStarted' | 'Running' | 'Paused' | 'Archived'; updatedAt: string; userCount: number; }[]`\n\n**get** `/api/v1/public/segments`\n\nList segments\n\n### Parameters\n\n- `membershipType?: 'computed' | 'static'`\n How segment membership is determined (computed or static)\n\n- `status?: 'NotStarted' | 'Running' | 'Paused' | 'Archived'`\n Lifecycle status of a segment\n\n### Returns\n\n- `{ id: string; createdAt: string; lastComputedAt: string; membershipType: 'computed' | 'static'; name: string; status: 'NotStarted' | 'Running' | 'Paused' | 'Archived'; updatedAt: string; userCount: number; }[]`\n\n### Example\n\n```typescript\nimport SegmentflowAI from '@segmentflow/segmentflow-typescript';\n\nconst client = new SegmentflowAI();\n\nconst segments = await client.v1.public.segments.list();\n\nconsole.log(segments);\n```",
1192
+ response: "{ id: string; brandKitId: string; createdAt: string; defaultSegmentId: string; language: string; name: string; organizationId: string; purpose: 'General' | 'Newsletter' | 'Promotional' | 'Transactional' | 'LeadMagnetDelivery'; senderProfileId: string; source: string; type: string; updatedAt: string; currentSnapshotId?: string; definition?: { body: { elements: object; root: string; }; codeFormat: 'json'; emailContentsType: 'Code'; from: string; subject: string; type: 'Email'; preheader?: string; renderVariables?: object; replyTo?: string; sensitiveTransactionalVariablePaths?: string[]; }; }",
1193
+ markdown: "## update\n\n`client.v1.templates.update(id: string, brandKitId?: string, defaultSegmentId?: string, definition?: { body: { elements: object; root: string; }; codeFormat: 'json'; emailContentsType: 'Code'; type: 'Email'; from?: string; preheader?: string; renderVariables?: object; replyTo?: string; sensitiveTransactionalVariablePaths?: string[]; subject?: string; }, language?: string, name?: string, purpose?: 'General' | 'Newsletter' | 'Promotional' | 'Transactional' | 'LeadMagnetDelivery', senderProfileId?: string, subType?: string): { id: string; brandKitId: string; createdAt: string; defaultSegmentId: string; language: string; name: string; organizationId: string; purpose: 'General' | 'Newsletter' | 'Promotional' | 'Transactional' | 'LeadMagnetDelivery'; senderProfileId: string; source: string; type: string; updatedAt: string; currentSnapshotId?: string; definition?: object; }`\n\n**put** `/api/v1/templates/{id}`\n\nUpdate template\n\n### Parameters\n\n- `id: string`\n\n- `brandKitId?: string`\n\n- `defaultSegmentId?: string`\n\n- `definition?: { body: { elements: object; root: string; }; codeFormat: 'json'; emailContentsType: 'Code'; type: 'Email'; from?: string; preheader?: string; renderVariables?: object; replyTo?: string; sensitiveTransactionalVariablePaths?: string[]; subject?: string; }`\n - `body: { elements: object; root: string; }`\n - `codeFormat: 'json'`\n - `emailContentsType: 'Code'`\n - `type: 'Email'`\n - `from?: string`\n - `preheader?: string`\n - `renderVariables?: object`\n - `replyTo?: string`\n - `sensitiveTransactionalVariablePaths?: string[]`\n - `subject?: string`\n\n- `language?: string`\n\n- `name?: string`\n\n- `purpose?: 'General' | 'Newsletter' | 'Promotional' | 'Transactional' | 'LeadMagnetDelivery'`\n\n- `senderProfileId?: string`\n\n- `subType?: string`\n\n### Returns\n\n- `{ id: string; brandKitId: string; createdAt: string; defaultSegmentId: string; language: string; name: string; organizationId: string; purpose: 'General' | 'Newsletter' | 'Promotional' | 'Transactional' | 'LeadMagnetDelivery'; senderProfileId: string; source: string; type: string; updatedAt: string; currentSnapshotId?: string; definition?: { body: { elements: object; root: string; }; codeFormat: 'json'; emailContentsType: 'Code'; from: string; subject: string; type: 'Email'; preheader?: string; renderVariables?: object; replyTo?: string; sensitiveTransactionalVariablePaths?: string[]; }; }`\n\n - `id: string`\n - `brandKitId: string`\n - `createdAt: string`\n - `defaultSegmentId: string`\n - `language: string`\n - `name: string`\n - `organizationId: string`\n - `purpose: 'General' | 'Newsletter' | 'Promotional' | 'Transactional' | 'LeadMagnetDelivery'`\n - `senderProfileId: string`\n - `source: string`\n - `type: string`\n - `updatedAt: string`\n - `currentSnapshotId?: string`\n - `definition?: { body: { elements: object; root: string; }; codeFormat: 'json'; emailContentsType: 'Code'; from: string; subject: string; type: 'Email'; preheader?: string; renderVariables?: object; replyTo?: string; sensitiveTransactionalVariablePaths?: string[]; }`\n\n### Example\n\n```typescript\nimport SegmentflowAI from '@segmentflow/segmentflow-typescript';\n\nconst client = new SegmentflowAI();\n\nconst template = await client.v1.templates.update('182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e');\n\nconsole.log(template);\n```",
1194
+ perLanguage: {
1195
+ typescript: {
1196
+ method: 'client.v1.templates.update',
1197
+ example: "import SegmentflowAI from '@segmentflow/segmentflow-typescript';\n\nconst client = new SegmentflowAI({\n apiKey: process.env['SEGMENTFLOW_API_KEY'], // This is the default and can be omitted\n});\n\nconst template = await client.v1.templates.update('182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e');\n\nconsole.log(template.id);",
1198
+ },
1199
+ python: {
1200
+ method: 'v1.templates.update',
1201
+ example: 'import os\nfrom segmentflow import SegmentflowAI\n\nclient = SegmentflowAI(\n api_key=os.environ.get("SEGMENTFLOW_API_KEY"), # This is the default and can be omitted\n)\ntemplate = client.v1.templates.update(\n id="182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e",\n)\nprint(template.id)',
1202
+ },
1203
+ java: {
1204
+ method: 'v1().templates().update',
1205
+ example: 'package com.segmentflow.api.example;\n\nimport com.segmentflow.api.client.SegmentflowAiClient;\nimport com.segmentflow.api.client.okhttp.SegmentflowAiOkHttpClient;\nimport com.segmentflow.api.models.v1.templates.TemplateUpdateParams;\nimport com.segmentflow.api.models.v1.templates.TemplateUpdateResponse;\n\npublic final class Main {\n private Main() {}\n\n public static void main(String[] args) {\n SegmentflowAiClient client = SegmentflowAiOkHttpClient.fromEnv();\n\n TemplateUpdateResponse template = client.v1().templates().update("182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e");\n }\n}',
1206
+ },
1207
+ go: {
1208
+ method: 'client.V1.Templates.Update',
1209
+ example: 'package main\n\nimport (\n\t"context"\n\t"fmt"\n\n\t"github.com/segmentflow/segmentflow-go"\n\t"github.com/segmentflow/segmentflow-go/option"\n)\n\nfunc main() {\n\tclient := segmentflow.NewClient(\n\t\toption.WithAPIKey("My API Key"),\n\t)\n\ttemplate, err := client.V1.Templates.Update(\n\t\tcontext.TODO(),\n\t\t"182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e",\n\t\tsegmentflow.V1TemplateUpdateParams{},\n\t)\n\tif err != nil {\n\t\tpanic(err.Error())\n\t}\n\tfmt.Printf("%+v\\n", template.ID)\n}\n',
1210
+ },
1211
+ cli: {
1212
+ method: 'templates update',
1213
+ example: "segmentflow v1:templates update \\\n --api-key 'My API Key' \\\n --id 182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e",
1214
+ },
1215
+ php: {
1216
+ method: 'v1->templates->update',
1217
+ example: "<?php\n\nrequire_once dirname(__DIR__) . '/vendor/autoload.php';\n\n$client = new Client(apiKey: 'My API Key', environment: 'development');\n\n$template = $client->v1->templates->update(\n '182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e',\n brandKitID: '182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e',\n defaultSegmentID: '182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e',\n definition: [\n 'body' => [\n 'elements' => [\n 'foo' => [\n 'type' => 'x', 'children' => ['string'], 'props' => ['foo' => 'bar']\n ],\n ],\n 'root' => 'x',\n ],\n 'codeFormat' => 'json',\n 'emailContentsType' => 'Code',\n 'type' => 'Email',\n 'from' => 'from',\n 'preheader' => 'preheader',\n 'renderVariables' => ['foo' => 'bar'],\n 'replyTo' => 'replyTo',\n 'sensitiveTransactionalVariablePaths' => ['x'],\n 'subject' => 'subject',\n ],\n language: 'xx',\n name: 'name',\n purpose: 'General',\n senderProfileID: '182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e',\n subType: 'subType',\n);\n\nvar_dump($template);",
1218
+ },
1219
+ http: {
1220
+ example: 'curl https://api.segmentflow.ai/api/v1/templates/$ID \\\n -X PUT \\\n -H "x-api-key: $SEGMENTFLOW_API_KEY"',
1221
+ },
1222
+ },
1223
+ },
1224
+ {
1225
+ name: 'delete',
1226
+ endpoint: '/api/v1/templates/{id}',
1227
+ httpMethod: 'delete',
1228
+ summary: 'Delete template',
1229
+ description: 'Delete template',
1230
+ stainlessPath: '(resource) v1.templates > (method) delete',
1231
+ qualified: 'client.v1.templates.delete',
1232
+ params: ['id: string;'],
1233
+ response: 'null',
1234
+ markdown: "## delete\n\n`client.v1.templates.delete(id: string): null`\n\n**delete** `/api/v1/templates/{id}`\n\nDelete template\n\n### Parameters\n\n- `id: string`\n\n### Returns\n\n- `null`\n\n### Example\n\n```typescript\nimport SegmentflowAI from '@segmentflow/segmentflow-typescript';\n\nconst client = new SegmentflowAI();\n\nconst template = await client.v1.templates.delete('182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e');\n\nconsole.log(template);\n```",
1235
+ perLanguage: {
1236
+ typescript: {
1237
+ method: 'client.v1.templates.delete',
1238
+ example: "import SegmentflowAI from '@segmentflow/segmentflow-typescript';\n\nconst client = new SegmentflowAI({\n apiKey: process.env['SEGMENTFLOW_API_KEY'], // This is the default and can be omitted\n});\n\nconst template = await client.v1.templates.delete('182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e');\n\nconsole.log(template);",
1239
+ },
1240
+ python: {
1241
+ method: 'v1.templates.delete',
1242
+ example: 'import os\nfrom segmentflow import SegmentflowAI\n\nclient = SegmentflowAI(\n api_key=os.environ.get("SEGMENTFLOW_API_KEY"), # This is the default and can be omitted\n)\ntemplate = client.v1.templates.delete(\n "182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e",\n)\nprint(template)',
1243
+ },
1244
+ java: {
1245
+ method: 'v1().templates().delete',
1246
+ example: 'package com.segmentflow.api.example;\n\nimport com.segmentflow.api.client.SegmentflowAiClient;\nimport com.segmentflow.api.client.okhttp.SegmentflowAiOkHttpClient;\nimport com.segmentflow.api.models.v1.templates.TemplateDeleteParams;\nimport java.util.Optional;\n\npublic final class Main {\n private Main() {}\n\n public static void main(String[] args) {\n SegmentflowAiClient client = SegmentflowAiOkHttpClient.fromEnv();\n\n Optional<Void> template = client.v1().templates().delete("182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e");\n }\n}',
1247
+ },
1248
+ go: {
1249
+ method: 'client.V1.Templates.Delete',
1250
+ example: 'package main\n\nimport (\n\t"context"\n\t"fmt"\n\n\t"github.com/segmentflow/segmentflow-go"\n\t"github.com/segmentflow/segmentflow-go/option"\n)\n\nfunc main() {\n\tclient := segmentflow.NewClient(\n\t\toption.WithAPIKey("My API Key"),\n\t)\n\ttemplate, err := client.V1.Templates.Delete(context.TODO(), "182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e")\n\tif err != nil {\n\t\tpanic(err.Error())\n\t}\n\tfmt.Printf("%+v\\n", template)\n}\n',
1251
+ },
1252
+ cli: {
1253
+ method: 'templates delete',
1254
+ example: "segmentflow v1:templates delete \\\n --api-key 'My API Key' \\\n --id 182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e",
1255
+ },
1256
+ php: {
1257
+ method: 'v1->templates->delete',
1258
+ example: "<?php\n\nrequire_once dirname(__DIR__) . '/vendor/autoload.php';\n\n$client = new Client(apiKey: 'My API Key', environment: 'development');\n\n$template = $client->v1->templates->delete(\n '182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e'\n);\n\nvar_dump($template);",
1259
+ },
1260
+ http: {
1261
+ example: 'curl https://api.segmentflow.ai/api/v1/templates/$ID \\\n -X DELETE \\\n -H "x-api-key: $SEGMENTFLOW_API_KEY"',
1262
+ },
1263
+ },
1264
+ },
1265
+ {
1266
+ name: 'duplicate',
1267
+ endpoint: '/api/v1/templates/{id}/duplicate',
1268
+ httpMethod: 'post',
1269
+ summary: 'Duplicate template',
1270
+ description: 'Create an editable copy of an existing template in the current organization',
1271
+ stainlessPath: '(resource) v1.templates > (method) duplicate',
1272
+ qualified: 'client.v1.templates.duplicate',
1273
+ params: ['id: string;'],
1274
+ response: "{ id: string; brandKitId: string; createdAt: string; defaultSegmentId: string; language: string; name: string; organizationId: string; purpose: 'General' | 'Newsletter' | 'Promotional' | 'Transactional' | 'LeadMagnetDelivery'; senderProfileId: string; source: string; type: string; updatedAt: string; currentSnapshotId?: string; definition?: { body: { elements: object; root: string; }; codeFormat: 'json'; emailContentsType: 'Code'; from: string; subject: string; type: 'Email'; preheader?: string; renderVariables?: object; replyTo?: string; sensitiveTransactionalVariablePaths?: string[]; }; }",
1275
+ markdown: "## duplicate\n\n`client.v1.templates.duplicate(id: string): { id: string; brandKitId: string; createdAt: string; defaultSegmentId: string; language: string; name: string; organizationId: string; purpose: 'General' | 'Newsletter' | 'Promotional' | 'Transactional' | 'LeadMagnetDelivery'; senderProfileId: string; source: string; type: string; updatedAt: string; currentSnapshotId?: string; definition?: object; }`\n\n**post** `/api/v1/templates/{id}/duplicate`\n\nCreate an editable copy of an existing template in the current organization\n\n### Parameters\n\n- `id: string`\n\n### Returns\n\n- `{ id: string; brandKitId: string; createdAt: string; defaultSegmentId: string; language: string; name: string; organizationId: string; purpose: 'General' | 'Newsletter' | 'Promotional' | 'Transactional' | 'LeadMagnetDelivery'; senderProfileId: string; source: string; type: string; updatedAt: string; currentSnapshotId?: string; definition?: { body: { elements: object; root: string; }; codeFormat: 'json'; emailContentsType: 'Code'; from: string; subject: string; type: 'Email'; preheader?: string; renderVariables?: object; replyTo?: string; sensitiveTransactionalVariablePaths?: string[]; }; }`\n\n - `id: string`\n - `brandKitId: string`\n - `createdAt: string`\n - `defaultSegmentId: string`\n - `language: string`\n - `name: string`\n - `organizationId: string`\n - `purpose: 'General' | 'Newsletter' | 'Promotional' | 'Transactional' | 'LeadMagnetDelivery'`\n - `senderProfileId: string`\n - `source: string`\n - `type: string`\n - `updatedAt: string`\n - `currentSnapshotId?: string`\n - `definition?: { body: { elements: object; root: string; }; codeFormat: 'json'; emailContentsType: 'Code'; from: string; subject: string; type: 'Email'; preheader?: string; renderVariables?: object; replyTo?: string; sensitiveTransactionalVariablePaths?: string[]; }`\n\n### Example\n\n```typescript\nimport SegmentflowAI from '@segmentflow/segmentflow-typescript';\n\nconst client = new SegmentflowAI();\n\nconst response = await client.v1.templates.duplicate('182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e');\n\nconsole.log(response);\n```",
285
1276
  perLanguage: {
286
1277
  typescript: {
287
- method: 'client.v1.public.segments.list',
288
- example: "import SegmentflowAI from '@segmentflow/segmentflow-typescript';\n\nconst client = new SegmentflowAI({\n apiKey: process.env['SEGMENTFLOW_API_KEY'], // This is the default and can be omitted\n});\n\nconst segments = await client.v1.public.segments.list();\n\nconsole.log(segments);",
1278
+ method: 'client.v1.templates.duplicate',
1279
+ example: "import SegmentflowAI from '@segmentflow/segmentflow-typescript';\n\nconst client = new SegmentflowAI({\n apiKey: process.env['SEGMENTFLOW_API_KEY'], // This is the default and can be omitted\n});\n\nconst response = await client.v1.templates.duplicate('182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e');\n\nconsole.log(response.id);",
1280
+ },
1281
+ python: {
1282
+ method: 'v1.templates.duplicate',
1283
+ example: 'import os\nfrom segmentflow import SegmentflowAI\n\nclient = SegmentflowAI(\n api_key=os.environ.get("SEGMENTFLOW_API_KEY"), # This is the default and can be omitted\n)\nresponse = client.v1.templates.duplicate(\n "182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e",\n)\nprint(response.id)',
1284
+ },
1285
+ java: {
1286
+ method: 'v1().templates().duplicate',
1287
+ example: 'package com.segmentflow.api.example;\n\nimport com.segmentflow.api.client.SegmentflowAiClient;\nimport com.segmentflow.api.client.okhttp.SegmentflowAiOkHttpClient;\nimport com.segmentflow.api.models.v1.templates.TemplateDuplicateParams;\nimport com.segmentflow.api.models.v1.templates.TemplateDuplicateResponse;\n\npublic final class Main {\n private Main() {}\n\n public static void main(String[] args) {\n SegmentflowAiClient client = SegmentflowAiOkHttpClient.fromEnv();\n\n TemplateDuplicateResponse response = client.v1().templates().duplicate("182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e");\n }\n}',
1288
+ },
1289
+ go: {
1290
+ method: 'client.V1.Templates.Duplicate',
1291
+ example: 'package main\n\nimport (\n\t"context"\n\t"fmt"\n\n\t"github.com/segmentflow/segmentflow-go"\n\t"github.com/segmentflow/segmentflow-go/option"\n)\n\nfunc main() {\n\tclient := segmentflow.NewClient(\n\t\toption.WithAPIKey("My API Key"),\n\t)\n\tresponse, err := client.V1.Templates.Duplicate(context.TODO(), "182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e")\n\tif err != nil {\n\t\tpanic(err.Error())\n\t}\n\tfmt.Printf("%+v\\n", response.ID)\n}\n',
1292
+ },
1293
+ cli: {
1294
+ method: 'templates duplicate',
1295
+ example: "segmentflow v1:templates duplicate \\\n --api-key 'My API Key' \\\n --id 182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e",
1296
+ },
1297
+ php: {
1298
+ method: 'v1->templates->duplicate',
1299
+ example: "<?php\n\nrequire_once dirname(__DIR__) . '/vendor/autoload.php';\n\n$client = new Client(apiKey: 'My API Key', environment: 'development');\n\n$response = $client->v1->templates->duplicate(\n '182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e'\n);\n\nvar_dump($response);",
289
1300
  },
290
1301
  http: {
291
- example: 'curl https://api.segmentflow.ai/api/v1/public/segments \\\n -H "x-api-key: $SEGMENTFLOW_API_KEY"',
1302
+ example: 'curl https://api.segmentflow.ai/api/v1/templates/$ID/duplicate \\\n -X POST \\\n -H "x-api-key: $SEGMENTFLOW_API_KEY"',
292
1303
  },
293
1304
  },
294
1305
  },
295
1306
  {
296
- name: 'preview',
297
- endpoint: '/api/v1/public/segments/{id}/preview',
1307
+ name: 'archive',
1308
+ endpoint: '/api/v1/templates/{id}/archive',
298
1309
  httpMethod: 'post',
299
- summary: 'Preview segment audience count',
300
- description: "Recompile the segment's live definition and count matching users from api.user_event. Bypasses the cached segment_membership table.",
301
- stainlessPath: '(resource) v1.public.segments > (method) preview',
302
- qualified: 'client.v1.public.segments.preview',
1310
+ summary: 'Archive template',
1311
+ description: 'Archive template',
1312
+ stainlessPath: '(resource) v1.templates > (method) archive',
1313
+ qualified: 'client.v1.templates.archive',
303
1314
  params: ['id: string;'],
304
- response: '{ matchedUserCount: number; previewedAt: string; }',
305
- markdown: "## preview\n\n`client.v1.public.segments.preview(id: string): { matchedUserCount: number; previewedAt: string; }`\n\n**post** `/api/v1/public/segments/{id}/preview`\n\nRecompile the segment's live definition and count matching users from api.user_event. Bypasses the cached segment_membership table.\n\n### Parameters\n\n- `id: string`\n\n### Returns\n\n- `{ matchedUserCount: number; previewedAt: string; }`\n\n - `matchedUserCount: number`\n - `previewedAt: string`\n\n### Example\n\n```typescript\nimport SegmentflowAI from '@segmentflow/segmentflow-typescript';\n\nconst client = new SegmentflowAI();\n\nconst response = await client.v1.public.segments.preview('182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e');\n\nconsole.log(response);\n```",
1315
+ response: "{ id: string; createdAt: string; name: string; organizationId: string; status: 'Active' | 'Archived'; type: string; updatedAt: string; statusBeforeArchive?: 'Active' | 'Archived'; }",
1316
+ markdown: "## archive\n\n`client.v1.templates.archive(id: string): { id: string; createdAt: string; name: string; organizationId: string; status: 'Active' | 'Archived'; type: string; updatedAt: string; statusBeforeArchive?: 'Active' | 'Archived'; }`\n\n**post** `/api/v1/templates/{id}/archive`\n\nArchive template\n\n### Parameters\n\n- `id: string`\n\n### Returns\n\n- `{ id: string; createdAt: string; name: string; organizationId: string; status: 'Active' | 'Archived'; type: string; updatedAt: string; statusBeforeArchive?: 'Active' | 'Archived'; }`\n\n - `id: string`\n - `createdAt: string`\n - `name: string`\n - `organizationId: string`\n - `status: 'Active' | 'Archived'`\n - `type: string`\n - `updatedAt: string`\n - `statusBeforeArchive?: 'Active' | 'Archived'`\n\n### Example\n\n```typescript\nimport SegmentflowAI from '@segmentflow/segmentflow-typescript';\n\nconst client = new SegmentflowAI();\n\nconst response = await client.v1.templates.archive('182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e');\n\nconsole.log(response);\n```",
306
1317
  perLanguage: {
307
1318
  typescript: {
308
- method: 'client.v1.public.segments.preview',
309
- example: "import SegmentflowAI from '@segmentflow/segmentflow-typescript';\n\nconst client = new SegmentflowAI({\n apiKey: process.env['SEGMENTFLOW_API_KEY'], // This is the default and can be omitted\n});\n\nconst response = await client.v1.public.segments.preview('182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e');\n\nconsole.log(response.matchedUserCount);",
1319
+ method: 'client.v1.templates.archive',
1320
+ example: "import SegmentflowAI from '@segmentflow/segmentflow-typescript';\n\nconst client = new SegmentflowAI({\n apiKey: process.env['SEGMENTFLOW_API_KEY'], // This is the default and can be omitted\n});\n\nconst response = await client.v1.templates.archive('182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e');\n\nconsole.log(response.id);",
1321
+ },
1322
+ python: {
1323
+ method: 'v1.templates.archive',
1324
+ example: 'import os\nfrom segmentflow import SegmentflowAI\n\nclient = SegmentflowAI(\n api_key=os.environ.get("SEGMENTFLOW_API_KEY"), # This is the default and can be omitted\n)\nresponse = client.v1.templates.archive(\n "182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e",\n)\nprint(response.id)',
1325
+ },
1326
+ java: {
1327
+ method: 'v1().templates().archive',
1328
+ example: 'package com.segmentflow.api.example;\n\nimport com.segmentflow.api.client.SegmentflowAiClient;\nimport com.segmentflow.api.client.okhttp.SegmentflowAiOkHttpClient;\nimport com.segmentflow.api.models.v1.templates.TemplateArchiveParams;\nimport com.segmentflow.api.models.v1.templates.TemplateArchiveResponse;\n\npublic final class Main {\n private Main() {}\n\n public static void main(String[] args) {\n SegmentflowAiClient client = SegmentflowAiOkHttpClient.fromEnv();\n\n TemplateArchiveResponse response = client.v1().templates().archive("182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e");\n }\n}',
1329
+ },
1330
+ go: {
1331
+ method: 'client.V1.Templates.Archive',
1332
+ example: 'package main\n\nimport (\n\t"context"\n\t"fmt"\n\n\t"github.com/segmentflow/segmentflow-go"\n\t"github.com/segmentflow/segmentflow-go/option"\n)\n\nfunc main() {\n\tclient := segmentflow.NewClient(\n\t\toption.WithAPIKey("My API Key"),\n\t)\n\tresponse, err := client.V1.Templates.Archive(context.TODO(), "182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e")\n\tif err != nil {\n\t\tpanic(err.Error())\n\t}\n\tfmt.Printf("%+v\\n", response.ID)\n}\n',
1333
+ },
1334
+ cli: {
1335
+ method: 'templates archive',
1336
+ example: "segmentflow v1:templates archive \\\n --api-key 'My API Key' \\\n --id 182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e",
1337
+ },
1338
+ php: {
1339
+ method: 'v1->templates->archive',
1340
+ example: "<?php\n\nrequire_once dirname(__DIR__) . '/vendor/autoload.php';\n\n$client = new Client(apiKey: 'My API Key', environment: 'development');\n\n$response = $client->v1->templates->archive(\n '182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e'\n);\n\nvar_dump($response);",
310
1341
  },
311
1342
  http: {
312
- example: 'curl https://api.segmentflow.ai/api/v1/public/segments/$ID/preview \\\n -X POST \\\n -H "x-api-key: $SEGMENTFLOW_API_KEY"',
1343
+ example: 'curl https://api.segmentflow.ai/api/v1/templates/$ID/archive \\\n -X POST \\\n -H "x-api-key: $SEGMENTFLOW_API_KEY"',
313
1344
  },
314
1345
  },
315
1346
  },
316
1347
  {
317
- name: 'request_upload',
318
- endpoint: '/api/v1/public/assets/upload-request',
1348
+ name: 'unarchive',
1349
+ endpoint: '/api/v1/templates/{id}/unarchive',
1350
+ httpMethod: 'post',
1351
+ summary: 'Unarchive template',
1352
+ description: 'Unarchive template',
1353
+ stainlessPath: '(resource) v1.templates > (method) unarchive',
1354
+ qualified: 'client.v1.templates.unarchive',
1355
+ params: ['id: string;'],
1356
+ response: "{ id: string; createdAt: string; name: string; organizationId: string; status: 'Active' | 'Archived'; type: string; updatedAt: string; statusBeforeArchive?: 'Active' | 'Archived'; }",
1357
+ markdown: "## unarchive\n\n`client.v1.templates.unarchive(id: string): { id: string; createdAt: string; name: string; organizationId: string; status: 'Active' | 'Archived'; type: string; updatedAt: string; statusBeforeArchive?: 'Active' | 'Archived'; }`\n\n**post** `/api/v1/templates/{id}/unarchive`\n\nUnarchive template\n\n### Parameters\n\n- `id: string`\n\n### Returns\n\n- `{ id: string; createdAt: string; name: string; organizationId: string; status: 'Active' | 'Archived'; type: string; updatedAt: string; statusBeforeArchive?: 'Active' | 'Archived'; }`\n\n - `id: string`\n - `createdAt: string`\n - `name: string`\n - `organizationId: string`\n - `status: 'Active' | 'Archived'`\n - `type: string`\n - `updatedAt: string`\n - `statusBeforeArchive?: 'Active' | 'Archived'`\n\n### Example\n\n```typescript\nimport SegmentflowAI from '@segmentflow/segmentflow-typescript';\n\nconst client = new SegmentflowAI();\n\nconst response = await client.v1.templates.unarchive('182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e');\n\nconsole.log(response);\n```",
1358
+ perLanguage: {
1359
+ typescript: {
1360
+ method: 'client.v1.templates.unarchive',
1361
+ example: "import SegmentflowAI from '@segmentflow/segmentflow-typescript';\n\nconst client = new SegmentflowAI({\n apiKey: process.env['SEGMENTFLOW_API_KEY'], // This is the default and can be omitted\n});\n\nconst response = await client.v1.templates.unarchive('182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e');\n\nconsole.log(response.id);",
1362
+ },
1363
+ python: {
1364
+ method: 'v1.templates.unarchive',
1365
+ example: 'import os\nfrom segmentflow import SegmentflowAI\n\nclient = SegmentflowAI(\n api_key=os.environ.get("SEGMENTFLOW_API_KEY"), # This is the default and can be omitted\n)\nresponse = client.v1.templates.unarchive(\n "182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e",\n)\nprint(response.id)',
1366
+ },
1367
+ java: {
1368
+ method: 'v1().templates().unarchive',
1369
+ example: 'package com.segmentflow.api.example;\n\nimport com.segmentflow.api.client.SegmentflowAiClient;\nimport com.segmentflow.api.client.okhttp.SegmentflowAiOkHttpClient;\nimport com.segmentflow.api.models.v1.templates.TemplateUnarchiveParams;\nimport com.segmentflow.api.models.v1.templates.TemplateUnarchiveResponse;\n\npublic final class Main {\n private Main() {}\n\n public static void main(String[] args) {\n SegmentflowAiClient client = SegmentflowAiOkHttpClient.fromEnv();\n\n TemplateUnarchiveResponse response = client.v1().templates().unarchive("182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e");\n }\n}',
1370
+ },
1371
+ go: {
1372
+ method: 'client.V1.Templates.Unarchive',
1373
+ example: 'package main\n\nimport (\n\t"context"\n\t"fmt"\n\n\t"github.com/segmentflow/segmentflow-go"\n\t"github.com/segmentflow/segmentflow-go/option"\n)\n\nfunc main() {\n\tclient := segmentflow.NewClient(\n\t\toption.WithAPIKey("My API Key"),\n\t)\n\tresponse, err := client.V1.Templates.Unarchive(context.TODO(), "182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e")\n\tif err != nil {\n\t\tpanic(err.Error())\n\t}\n\tfmt.Printf("%+v\\n", response.ID)\n}\n',
1374
+ },
1375
+ cli: {
1376
+ method: 'templates unarchive',
1377
+ example: "segmentflow v1:templates unarchive \\\n --api-key 'My API Key' \\\n --id 182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e",
1378
+ },
1379
+ php: {
1380
+ method: 'v1->templates->unarchive',
1381
+ example: "<?php\n\nrequire_once dirname(__DIR__) . '/vendor/autoload.php';\n\n$client = new Client(apiKey: 'My API Key', environment: 'development');\n\n$response = $client->v1->templates->unarchive(\n '182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e'\n);\n\nvar_dump($response);",
1382
+ },
1383
+ http: {
1384
+ example: 'curl https://api.segmentflow.ai/api/v1/templates/$ID/unarchive \\\n -X POST \\\n -H "x-api-key: $SEGMENTFLOW_API_KEY"',
1385
+ },
1386
+ },
1387
+ },
1388
+ {
1389
+ name: 'create',
1390
+ endpoint: '/api/v1/broadcasts',
319
1391
  httpMethod: 'post',
320
- summary: 'Request a presigned asset upload',
321
- description: 'Pre-mints an asset id and returns a presigned S3 PUT URL. Upload the bytes with the returned headers, then call /assets/{assetId}/finalize.',
322
- stainlessPath: '(resource) v1.public.assets > (method) request_upload',
323
- qualified: 'client.v1.public.assets.requestUpload',
1392
+ summary: 'Create broadcast',
1393
+ description: 'Create a Broadcast for a Segment. Inline content creates a saved Email Template first; templateId reuses an existing Template. Set send=true to send immediately, or combine send=true with scheduledAt to schedule.',
1394
+ stainlessPath: '(resource) v1.broadcasts > (method) create',
1395
+ qualified: 'client.v1.broadcasts.create',
324
1396
  params: [
325
- 'contentType: string;',
326
- 'filename: string;',
327
- 'size: number;',
328
- "assetType?: 'content-image' | 'content-document' | 'lead-magnet';",
1397
+ 'from?: string;',
1398
+ 'html?: string;',
1399
+ 'name?: string;',
1400
+ 'replyTo?: string | string[];',
1401
+ 'scheduledAt?: string;',
1402
+ 'segmentId?: string;',
1403
+ 'send?: boolean;',
1404
+ 'subject?: string;',
1405
+ 'subscriptionGroupId?: string;',
1406
+ 'templateId?: string;',
1407
+ 'text?: string;',
1408
+ 'topicId?: string;',
329
1409
  ],
330
- response: '{ assetId: string; expiresAt: string; headers: object; uploadUrl: string; }',
331
- markdown: "## request_upload\n\n`client.v1.public.assets.requestUpload(contentType: string, filename: string, size: number, assetType?: 'content-image' | 'content-document' | 'lead-magnet'): { assetId: string; expiresAt: string; headers: object; uploadUrl: string; }`\n\n**post** `/api/v1/public/assets/upload-request`\n\nPre-mints an asset id and returns a presigned S3 PUT URL. Upload the bytes with the returned headers, then call /assets/{assetId}/finalize.\n\n### Parameters\n\n- `contentType: string`\n\n- `filename: string`\n\n- `size: number`\n\n- `assetType?: 'content-image' | 'content-document' | 'lead-magnet'`\n\n### Returns\n\n- `{ assetId: string; expiresAt: string; headers: object; uploadUrl: string; }`\n\n - `assetId: string`\n - `expiresAt: string`\n - `headers: object`\n - `uploadUrl: string`\n\n### Example\n\n```typescript\nimport SegmentflowAI from '@segmentflow/segmentflow-typescript';\n\nconst client = new SegmentflowAI();\n\nconst response = await client.v1.public.assets.requestUpload({\n contentType: 'x',\n filename: 'x',\n size: 9007199254740991,\n});\n\nconsole.log(response);\n```",
1410
+ response: '{ id: string; }',
1411
+ markdown: '## create\n\n`client.v1.broadcasts.create(from?: string, html?: string, name?: string, replyTo?: string | string[], scheduledAt?: string, segmentId?: string, send?: boolean, subject?: string, subscriptionGroupId?: string, templateId?: string, text?: string, topicId?: string): { id: string; }`\n\n**post** `/api/v1/broadcasts`\n\nCreate a Broadcast for a Segment. Inline content creates a saved Email Template first; templateId reuses an existing Template. Set send=true to send immediately, or combine send=true with scheduledAt to schedule.\n\n### Parameters\n\n- `from?: string`\n Sender email address. Friendly names may use "Name <sender@example.com>".\n\n- `html?: string`\n\n- `name?: string`\n\n- `replyTo?: string | string[]`\n\n- `scheduledAt?: string`\n\n- `segmentId?: string`\n\n- `send?: boolean`\n\n- `subject?: string`\n\n- `subscriptionGroupId?: string`\n\n- `templateId?: string`\n\n- `text?: string`\n\n- `topicId?: string`\n\n### Returns\n\n- `{ id: string; }`\n\n - `id: string`\n\n### Example\n\n```typescript\nimport SegmentflowAI from \'@segmentflow/segmentflow-typescript\';\n\nconst client = new SegmentflowAI();\n\nconst broadcast = await client.v1.broadcasts.create();\n\nconsole.log(broadcast);\n```',
332
1412
  perLanguage: {
333
1413
  typescript: {
334
- method: 'client.v1.public.assets.requestUpload',
335
- example: "import SegmentflowAI from '@segmentflow/segmentflow-typescript';\n\nconst client = new SegmentflowAI({\n apiKey: process.env['SEGMENTFLOW_API_KEY'], // This is the default and can be omitted\n});\n\nconst response = await client.v1.public.assets.requestUpload({\n contentType: 'x',\n filename: 'x',\n size: 9007199254740991,\n});\n\nconsole.log(response.assetId);",
1414
+ method: 'client.v1.broadcasts.create',
1415
+ example: "import SegmentflowAI from '@segmentflow/segmentflow-typescript';\n\nconst client = new SegmentflowAI({\n apiKey: process.env['SEGMENTFLOW_API_KEY'], // This is the default and can be omitted\n});\n\nconst broadcast = await client.v1.broadcasts.create();\n\nconsole.log(broadcast.id);",
1416
+ },
1417
+ python: {
1418
+ method: 'v1.broadcasts.create',
1419
+ example: 'import os\nfrom segmentflow import SegmentflowAI\n\nclient = SegmentflowAI(\n api_key=os.environ.get("SEGMENTFLOW_API_KEY"), # This is the default and can be omitted\n)\nbroadcast = client.v1.broadcasts.create()\nprint(broadcast.id)',
1420
+ },
1421
+ java: {
1422
+ method: 'v1().broadcasts().create',
1423
+ example: 'package com.segmentflow.api.example;\n\nimport com.segmentflow.api.client.SegmentflowAiClient;\nimport com.segmentflow.api.client.okhttp.SegmentflowAiOkHttpClient;\nimport com.segmentflow.api.models.v1.broadcasts.BroadcastCreateParams;\nimport com.segmentflow.api.models.v1.broadcasts.BroadcastCreateResponse;\n\npublic final class Main {\n private Main() {}\n\n public static void main(String[] args) {\n SegmentflowAiClient client = SegmentflowAiOkHttpClient.fromEnv();\n\n BroadcastCreateResponse broadcast = client.v1().broadcasts().create();\n }\n}',
1424
+ },
1425
+ go: {
1426
+ method: 'client.V1.Broadcasts.New',
1427
+ example: 'package main\n\nimport (\n\t"context"\n\t"fmt"\n\n\t"github.com/segmentflow/segmentflow-go"\n\t"github.com/segmentflow/segmentflow-go/option"\n)\n\nfunc main() {\n\tclient := segmentflow.NewClient(\n\t\toption.WithAPIKey("My API Key"),\n\t)\n\tbroadcast, err := client.V1.Broadcasts.New(context.TODO(), segmentflow.V1BroadcastNewParams{})\n\tif err != nil {\n\t\tpanic(err.Error())\n\t}\n\tfmt.Printf("%+v\\n", broadcast.ID)\n}\n',
1428
+ },
1429
+ cli: {
1430
+ method: 'broadcasts create',
1431
+ example: "segmentflow v1:broadcasts create \\\n --api-key 'My API Key'",
1432
+ },
1433
+ php: {
1434
+ method: 'v1->broadcasts->create',
1435
+ example: "<?php\n\nrequire_once dirname(__DIR__) . '/vendor/autoload.php';\n\n$client = new Client(apiKey: 'My API Key', environment: 'development');\n\n$broadcast = $client->v1->broadcasts->create(\n from: 'x',\n html: 'x',\n name: 'x',\n replyTo: 'dev@stainless.com',\n scheduledAt: 'x',\n segmentID: '182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e',\n send: true,\n subject: 'x',\n subscriptionGroupID: '182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e',\n templateID: '182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e',\n text: 'text',\n topicID: '182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e',\n);\n\nvar_dump($broadcast);",
336
1436
  },
337
1437
  http: {
338
- example: 'curl https://api.segmentflow.ai/api/v1/public/assets/upload-request \\\n -H \'Content-Type: application/json\' \\\n -H "x-api-key: $SEGMENTFLOW_API_KEY" \\\n -d \'{\n "contentType": "x",\n "filename": "x",\n "size": 9007199254740991\n }\'',
1438
+ example: 'curl https://api.segmentflow.ai/api/v1/broadcasts \\\n -X POST \\\n -H "x-api-key: $SEGMENTFLOW_API_KEY"',
339
1439
  },
340
1440
  },
341
1441
  },
342
1442
  {
343
- name: 'finalize_upload',
344
- endpoint: '/api/v1/public/assets/{id}/finalize',
1443
+ name: 'send',
1444
+ endpoint: '/api/v1/emails',
345
1445
  httpMethod: 'post',
346
- summary: 'Finalize a presigned upload',
347
- description: 'Verifies the bytes landed in S3, strips EXIF/GPS metadata, extracts dimensions, and commits the asset row.',
348
- stainlessPath: '(resource) v1.public.assets > (method) finalize_upload',
349
- qualified: 'client.v1.public.assets.finalizeUpload',
1446
+ summary: 'Send email',
1447
+ description: 'Create one EmailSend from a saved email template and enqueue delivery.',
1448
+ stainlessPath: '(resource) v1.emails > (method) send',
1449
+ qualified: 'client.v1.emails.send',
350
1450
  params: [
351
- 'id: string;',
352
- 'altText?: string;',
353
- 'description?: string;',
354
- "imageType?: 'logo' | 'hero' | 'header' | 'product' | 'background' | 'icon' | 'other';",
1451
+ 'templateId: string;',
1452
+ 'idempotency-key: string;',
1453
+ 'bcc?: string | string[];',
1454
+ 'cc?: string | string[];',
1455
+ 'data?: object;',
1456
+ 'from?: string;',
1457
+ 'profileId?: string;',
1458
+ 'replyTo?: string;',
1459
+ 'senderProfileId?: string;',
1460
+ 'subject?: string;',
1461
+ 'subscriptionGroupId?: string;',
1462
+ 'to?: { email?: string; externalId?: string; };',
1463
+ 'tracking?: { clicks?: boolean; };',
355
1464
  ],
356
- response: '{ asset: { id: string; contentType: string; createdAt: string; filename: string; height: number; size: number; url: string; width: number; }; }',
357
- markdown: "## finalize_upload\n\n`client.v1.public.assets.finalizeUpload(id: string, altText?: string, description?: string, imageType?: 'logo' | 'hero' | 'header' | 'product' | 'background' | 'icon' | 'other'): { asset: object; }`\n\n**post** `/api/v1/public/assets/{id}/finalize`\n\nVerifies the bytes landed in S3, strips EXIF/GPS metadata, extracts dimensions, and commits the asset row.\n\n### Parameters\n\n- `id: string`\n\n- `altText?: string`\n\n- `description?: string`\n\n- `imageType?: 'logo' | 'hero' | 'header' | 'product' | 'background' | 'icon' | 'other'`\n Category of image for use in email templates\n\n### Returns\n\n- `{ asset: { id: string; contentType: string; createdAt: string; filename: string; height: number; size: number; url: string; width: number; }; }`\n\n - `asset: { id: string; contentType: string; createdAt: string; filename: string; height: number; size: number; url: string; width: number; }`\n\n### Example\n\n```typescript\nimport SegmentflowAI from '@segmentflow/segmentflow-typescript';\n\nconst client = new SegmentflowAI();\n\nconst response = await client.v1.public.assets.finalizeUpload('182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e');\n\nconsole.log(response);\n```",
1465
+ response: "{ id: string; cc: { email: string; name: string; }[]; createdAt: string; failureMessage: string; failureReason: 'WorkerFailed' | 'ProviderRejected' | 'RenderFailed' | 'Unknown'; from: { email: string; name: string; }; messageId: string; profileId: string; replyTo: { email: string; name: string; }; senderProfileId: string; skippedReason: string; status: 'Queued' | 'Processing' | 'Sent' | 'Failed' | 'Skipped'; subject: string; subscriptionGroupId: string; templateId: string; templateSnapshotId: string; to: { email: string; }; updatedAt: string; }",
1466
+ markdown: "## send\n\n`client.v1.emails.send(templateId: string, idempotency-key: string, bcc?: string | string[], cc?: string | string[], data?: object, from?: string, profileId?: string, replyTo?: string, senderProfileId?: string, subject?: string, subscriptionGroupId?: string, to?: { email?: string; externalId?: string; }, tracking?: { clicks?: boolean; }): { id: string; cc: object[]; createdAt: string; failureMessage: string; failureReason: 'WorkerFailed' | 'ProviderRejected' | 'RenderFailed' | 'Unknown'; from: object; messageId: string; profileId: string; replyTo: object; senderProfileId: string; skippedReason: string; status: 'Queued' | 'Processing' | 'Sent' | 'Failed' | 'Skipped'; subject: string; subscriptionGroupId: string; templateId: string; templateSnapshotId: string; to: object; updatedAt: string; }`\n\n**post** `/api/v1/emails`\n\nCreate one EmailSend from a saved email template and enqueue delivery.\n\n### Parameters\n\n- `templateId: string`\n Exact saved Email Template id to snapshot and render.\n\n- `idempotency-key: string`\n\n- `bcc?: string | string[]`\n Hidden copied recipients. Persisted for retry/provider handoff but never returned by public responses.\n\n- `cc?: string | string[]`\n Visible copied recipients. Persisted and handed to the email provider.\n\n- `data?: object`\n One-send email payload exposed to templates under /data/*.\n\n- `from?: string`\n Optional sender override. Accepts a bare email or \"Name <email@example.com>\" and must match a verified SenderProfile email.\n\n- `profileId?: string`\n Optional primary recipient Profile id. When to.email is absent, the Profile canonical email is used for delivery.\n\n- `replyTo?: string`\n Optional reply-to override. Accepts a single bare email or \"Name <email@example.com>\" and must use a verified sender domain owned by the organization.\n\n- `senderProfileId?: string`\n Optional transactional SenderProfile override. Defaults to the template SenderProfile.\n\n- `subject?: string`\n Optional final subject override. When omitted, the Template subject is frozen onto the EmailSend.\n\n- `subscriptionGroupId?: string`\n Optional SubscriptionGroup gate. If supplied, the send is skipped when the recipient is not subscribed according to the group's OptIn/OptOut policy.\n\n- `to?: { email?: string; externalId?: string; }`\n Recipient identity. This identifies or creates a Profile but does not update durable Profile Properties.\n - `email?: string`\n Recipient email address. Stored normalized in the send record.\n - `externalId?: string`\n Safe caller-owned recipient identifier used to link or create the Profile.\n\n- `tracking?: { clicks?: boolean; }`\n Per-send tracking preferences.\n - `clicks?: boolean`\n Enable or disable click tracking for this send.\n\n### Returns\n\n- `{ id: string; cc: { email: string; name: string; }[]; createdAt: string; failureMessage: string; failureReason: 'WorkerFailed' | 'ProviderRejected' | 'RenderFailed' | 'Unknown'; from: { email: string; name: string; }; messageId: string; profileId: string; replyTo: { email: string; name: string; }; senderProfileId: string; skippedReason: string; status: 'Queued' | 'Processing' | 'Sent' | 'Failed' | 'Skipped'; subject: string; subscriptionGroupId: string; templateId: string; templateSnapshotId: string; to: { email: string; }; updatedAt: string; }`\n\n - `id: string`\n - `cc: { email: string; name: string; }[]`\n - `createdAt: string`\n - `failureMessage: string`\n - `failureReason: 'WorkerFailed' | 'ProviderRejected' | 'RenderFailed' | 'Unknown'`\n - `from: { email: string; name: string; }`\n - `messageId: string`\n - `profileId: string`\n - `replyTo: { email: string; name: string; }`\n - `senderProfileId: string`\n - `skippedReason: string`\n - `status: 'Queued' | 'Processing' | 'Sent' | 'Failed' | 'Skipped'`\n - `subject: string`\n - `subscriptionGroupId: string`\n - `templateId: string`\n - `templateSnapshotId: string`\n - `to: { email: string; }`\n - `updatedAt: string`\n\n### Example\n\n```typescript\nimport SegmentflowAI from '@segmentflow/segmentflow-typescript';\n\nconst client = new SegmentflowAI();\n\nconst response = await client.v1.emails.send({ templateId: '182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e', 'idempotency-key': 'x' });\n\nconsole.log(response);\n```",
358
1467
  perLanguage: {
359
1468
  typescript: {
360
- method: 'client.v1.public.assets.finalizeUpload',
361
- example: "import SegmentflowAI from '@segmentflow/segmentflow-typescript';\n\nconst client = new SegmentflowAI({\n apiKey: process.env['SEGMENTFLOW_API_KEY'], // This is the default and can be omitted\n});\n\nconst response = await client.v1.public.assets.finalizeUpload(\n '182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e',\n);\n\nconsole.log(response.asset);",
1469
+ method: 'client.v1.emails.send',
1470
+ example: "import SegmentflowAI from '@segmentflow/segmentflow-typescript';\n\nconst client = new SegmentflowAI({\n apiKey: process.env['SEGMENTFLOW_API_KEY'], // This is the default and can be omitted\n});\n\nconst response = await client.v1.emails.send({\n templateId: '182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e',\n 'idempotency-key': 'x',\n});\n\nconsole.log(response.id);",
1471
+ },
1472
+ python: {
1473
+ method: 'v1.emails.send',
1474
+ example: 'import os\nfrom segmentflow import SegmentflowAI\n\nclient = SegmentflowAI(\n api_key=os.environ.get("SEGMENTFLOW_API_KEY"), # This is the default and can be omitted\n)\nresponse = client.v1.emails.send(\n template_id="182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e",\n idempotency_key="x",\n)\nprint(response.id)',
1475
+ },
1476
+ java: {
1477
+ method: 'v1().emails().send',
1478
+ example: 'package com.segmentflow.api.example;\n\nimport com.segmentflow.api.client.SegmentflowAiClient;\nimport com.segmentflow.api.client.okhttp.SegmentflowAiOkHttpClient;\nimport com.segmentflow.api.models.v1.emails.EmailSendParams;\nimport com.segmentflow.api.models.v1.emails.EmailSendResponse;\n\npublic final class Main {\n private Main() {}\n\n public static void main(String[] args) {\n SegmentflowAiClient client = SegmentflowAiOkHttpClient.fromEnv();\n\n EmailSendParams params = EmailSendParams.builder()\n .idempotencyKey("x")\n .templateId("182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e")\n .build();\n EmailSendResponse response = client.v1().emails().send(params);\n }\n}',
1479
+ },
1480
+ go: {
1481
+ method: 'client.V1.Emails.Send',
1482
+ example: 'package main\n\nimport (\n\t"context"\n\t"fmt"\n\n\t"github.com/segmentflow/segmentflow-go"\n\t"github.com/segmentflow/segmentflow-go/option"\n)\n\nfunc main() {\n\tclient := segmentflow.NewClient(\n\t\toption.WithAPIKey("My API Key"),\n\t)\n\tresponse, err := client.V1.Emails.Send(context.TODO(), segmentflow.V1EmailSendParams{\n\t\tTemplateID: "182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e",\n\t\tIdempotencyKey: "x",\n\t})\n\tif err != nil {\n\t\tpanic(err.Error())\n\t}\n\tfmt.Printf("%+v\\n", response.ID)\n}\n',
1483
+ },
1484
+ cli: {
1485
+ method: 'emails send',
1486
+ example: "segmentflow v1:emails send \\\n --api-key 'My API Key' \\\n --template-id 182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e \\\n --idempotency-key x",
1487
+ },
1488
+ php: {
1489
+ method: 'v1->emails->send',
1490
+ example: "<?php\n\nrequire_once dirname(__DIR__) . '/vendor/autoload.php';\n\n$client = new Client(apiKey: 'My API Key', environment: 'development');\n\n$response = $client->v1->emails->send(\n templateID: '182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e',\n idempotencyKey: 'x',\n bcc: 'x',\n cc: 'x',\n data: ['foo' => 'bar'],\n from: 'x',\n profileID: '182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e',\n replyTo: 'x',\n senderProfileID: '182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e',\n subject: 'x',\n subscriptionGroupID: '182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e',\n to: ['email' => 'dev@stainless.com', 'externalID' => 'x'],\n tracking: ['clicks' => true],\n);\n\nvar_dump($response);",
362
1491
  },
363
1492
  http: {
364
- example: 'curl https://api.segmentflow.ai/api/v1/public/assets/$ID/finalize \\\n -X POST \\\n -H "x-api-key: $SEGMENTFLOW_API_KEY"',
1493
+ example: 'curl https://api.segmentflow.ai/api/v1/emails \\\n -H \'Content-Type: application/json\' \\\n -H "x-api-key: $SEGMENTFLOW_API_KEY" \\\n -d \'{\n "templateId": "182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e"\n }\'',
1494
+ },
1495
+ },
1496
+ },
1497
+ {
1498
+ name: 'batch_send',
1499
+ endpoint: '/api/v1/emails/batch',
1500
+ httpMethod: 'post',
1501
+ summary: 'Batch send emails',
1502
+ description: 'Create or replay many independent EmailSend records. Each item has its own recipient identity, one-send data, idempotency key, and result; this is not a Broadcast, Bulk Operation, Carrier, or NewsletterIssue.',
1503
+ stainlessPath: '(resource) v1.emails > (method) batch_send',
1504
+ qualified: 'client.v1.emails.batchSend',
1505
+ params: [
1506
+ 'items: { idempotencyKey: string; bcc?: string | string[]; cc?: string | string[]; data?: object; from?: string; profileId?: string; replyTo?: string; senderProfileId?: string; subject?: string; subscriptionGroupId?: string; templateId?: string; to?: { email?: string; externalId?: string; }; tracking?: { clicks?: boolean; }; }[];',
1507
+ 'defaults?: { from?: string; replyTo?: string; senderProfileId?: string; subject?: string; subscriptionGroupId?: string; templateId?: string; tracking?: { clicks?: boolean; }; };',
1508
+ ],
1509
+ response: "{ accepted: number; items: { idempotencyKey: string; index: number; send: { id: string; cc: object[]; createdAt: string; failureMessage: string; failureReason: 'WorkerFailed' | 'ProviderRejected' | 'RenderFailed' | 'Unknown'; from: object; messageId: string; profileId: string; replyTo: object; senderProfileId: string; skippedReason: string; status: 'Queued' | 'Processing' | 'Sent' | 'Failed' | 'Skipped'; subject: string; subscriptionGroupId: string; templateId: string; templateSnapshotId: string; to: object; updatedAt: string; }; status: 'Accepted'; } | { error: { errorCode: string; message: string; statusCode: number; details?: object; }; idempotencyKey: string; index: number; status: 'Rejected'; }[]; rejected: number; total: number; }",
1510
+ markdown: "## batch_send\n\n`client.v1.emails.batchSend(items: { idempotencyKey: string; bcc?: string | string[]; cc?: string | string[]; data?: object; from?: string; profileId?: string; replyTo?: string; senderProfileId?: string; subject?: string; subscriptionGroupId?: string; templateId?: string; to?: { email?: string; externalId?: string; }; tracking?: { clicks?: boolean; }; }[], defaults?: { from?: string; replyTo?: string; senderProfileId?: string; subject?: string; subscriptionGroupId?: string; templateId?: string; tracking?: { clicks?: boolean; }; }): { accepted: number; items: object | object[]; rejected: number; total: number; }`\n\n**post** `/api/v1/emails/batch`\n\nCreate or replay many independent EmailSend records. Each item has its own recipient identity, one-send data, idempotency key, and result; this is not a Broadcast, Bulk Operation, Carrier, or NewsletterIssue.\n\n### Parameters\n\n- `items: { idempotencyKey: string; bcc?: string | string[]; cc?: string | string[]; data?: object; from?: string; profileId?: string; replyTo?: string; senderProfileId?: string; subject?: string; subscriptionGroupId?: string; templateId?: string; to?: { email?: string; externalId?: string; }; tracking?: { clicks?: boolean; }; }[]`\n Independent email sends. Items are processed in order and each item has its own idempotency key and result.\n\n- `defaults?: { from?: string; replyTo?: string; senderProfileId?: string; subject?: string; subscriptionGroupId?: string; templateId?: string; tracking?: { clicks?: boolean; }; }`\n Shared batch defaults applied to each item before item validation. Recipient, data, cc, and bcc fields are not allowed here.\n - `from?: string`\n Optional sender override. Accepts a bare email or \"Name <email@example.com>\" and must match a verified SenderProfile email.\n - `replyTo?: string`\n Optional reply-to override. Accepts a single bare email or \"Name <email@example.com>\" and must use a verified sender domain owned by the organization.\n - `senderProfileId?: string`\n Optional transactional SenderProfile override. Defaults to the template SenderProfile.\n - `subject?: string`\n Optional final subject override. When omitted, the Template subject is frozen onto the EmailSend.\n - `subscriptionGroupId?: string`\n Optional SubscriptionGroup gate. If supplied, the send is skipped when the recipient is not subscribed according to the group's OptIn/OptOut policy.\n - `templateId?: string`\n Exact saved Email Template id to snapshot and render.\n - `tracking?: { clicks?: boolean; }`\n Per-send tracking preferences.\n\n### Returns\n\n- `{ accepted: number; items: { idempotencyKey: string; index: number; send: { id: string; cc: object[]; createdAt: string; failureMessage: string; failureReason: 'WorkerFailed' | 'ProviderRejected' | 'RenderFailed' | 'Unknown'; from: object; messageId: string; profileId: string; replyTo: object; senderProfileId: string; skippedReason: string; status: 'Queued' | 'Processing' | 'Sent' | 'Failed' | 'Skipped'; subject: string; subscriptionGroupId: string; templateId: string; templateSnapshotId: string; to: object; updatedAt: string; }; status: 'Accepted'; } | { error: { errorCode: string; message: string; statusCode: number; details?: object; }; idempotencyKey: string; index: number; status: 'Rejected'; }[]; rejected: number; total: number; }`\n\n - `accepted: number`\n - `items: { idempotencyKey: string; index: number; send: { id: string; cc: { email: string; name: string; }[]; createdAt: string; failureMessage: string; failureReason: 'WorkerFailed' | 'ProviderRejected' | 'RenderFailed' | 'Unknown'; from: { email: string; name: string; }; messageId: string; profileId: string; replyTo: { email: string; name: string; }; senderProfileId: string; skippedReason: string; status: 'Queued' | 'Processing' | 'Sent' | 'Failed' | 'Skipped'; subject: string; subscriptionGroupId: string; templateId: string; templateSnapshotId: string; to: { email: string; }; updatedAt: string; }; status: 'Accepted'; } | { error: { errorCode: string; message: string; statusCode: number; details?: object; }; idempotencyKey: string; index: number; status: 'Rejected'; }[]`\n - `rejected: number`\n - `total: number`\n\n### Example\n\n```typescript\nimport SegmentflowAI from '@segmentflow/segmentflow-typescript';\n\nconst client = new SegmentflowAI();\n\nconst response = await client.v1.emails.batchSend({ items: [{ idempotencyKey: 'x' }] });\n\nconsole.log(response);\n```",
1511
+ perLanguage: {
1512
+ typescript: {
1513
+ method: 'client.v1.emails.batchSend',
1514
+ example: "import SegmentflowAI from '@segmentflow/segmentflow-typescript';\n\nconst client = new SegmentflowAI({\n apiKey: process.env['SEGMENTFLOW_API_KEY'], // This is the default and can be omitted\n});\n\nconst response = await client.v1.emails.batchSend({ items: [{ idempotencyKey: 'x' }] });\n\nconsole.log(response.accepted);",
1515
+ },
1516
+ python: {
1517
+ method: 'v1.emails.batch_send',
1518
+ example: 'import os\nfrom segmentflow import SegmentflowAI\n\nclient = SegmentflowAI(\n api_key=os.environ.get("SEGMENTFLOW_API_KEY"), # This is the default and can be omitted\n)\nresponse = client.v1.emails.batch_send(\n items=[{\n "idempotency_key": "x"\n }],\n)\nprint(response.accepted)',
1519
+ },
1520
+ java: {
1521
+ method: 'v1().emails().batchSend',
1522
+ example: 'package com.segmentflow.api.example;\n\nimport com.segmentflow.api.client.SegmentflowAiClient;\nimport com.segmentflow.api.client.okhttp.SegmentflowAiOkHttpClient;\nimport com.segmentflow.api.models.v1.emails.EmailBatchSendParams;\nimport com.segmentflow.api.models.v1.emails.EmailBatchSendResponse;\n\npublic final class Main {\n private Main() {}\n\n public static void main(String[] args) {\n SegmentflowAiClient client = SegmentflowAiOkHttpClient.fromEnv();\n\n EmailBatchSendParams params = EmailBatchSendParams.builder()\n .addItem(EmailBatchSendParams.Item.builder()\n .idempotencyKey("x")\n .build())\n .build();\n EmailBatchSendResponse response = client.v1().emails().batchSend(params);\n }\n}',
1523
+ },
1524
+ go: {
1525
+ method: 'client.V1.Emails.BatchSend',
1526
+ example: 'package main\n\nimport (\n\t"context"\n\t"fmt"\n\n\t"github.com/segmentflow/segmentflow-go"\n\t"github.com/segmentflow/segmentflow-go/option"\n)\n\nfunc main() {\n\tclient := segmentflow.NewClient(\n\t\toption.WithAPIKey("My API Key"),\n\t)\n\tresponse, err := client.V1.Emails.BatchSend(context.TODO(), segmentflow.V1EmailBatchSendParams{\n\t\tItems: []segmentflow.V1EmailBatchSendParamsItem{{\n\t\t\tIdempotencyKey: "x",\n\t\t}},\n\t})\n\tif err != nil {\n\t\tpanic(err.Error())\n\t}\n\tfmt.Printf("%+v\\n", response.Accepted)\n}\n',
1527
+ },
1528
+ cli: {
1529
+ method: 'emails batch_send',
1530
+ example: "segmentflow v1:emails batch-send \\\n --api-key 'My API Key' \\\n --item '{idempotencyKey: x}'",
1531
+ },
1532
+ php: {
1533
+ method: 'v1->emails->batchSend',
1534
+ example: "<?php\n\nrequire_once dirname(__DIR__) . '/vendor/autoload.php';\n\n$client = new Client(apiKey: 'My API Key', environment: 'development');\n\n$response = $client->v1->emails->batchSend(\n items: [\n [\n 'idempotencyKey' => 'x',\n 'bcc' => 'x',\n 'cc' => 'x',\n 'data' => ['foo' => 'bar'],\n 'from' => 'x',\n 'profileID' => '182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e',\n 'replyTo' => 'x',\n 'senderProfileID' => '182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e',\n 'subject' => 'x',\n 'subscriptionGroupID' => '182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e',\n 'templateID' => '182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e',\n 'to' => ['email' => 'dev@stainless.com', 'externalID' => 'x'],\n 'tracking' => ['clicks' => true],\n ],\n ],\n defaults: [\n 'from' => 'x',\n 'replyTo' => 'x',\n 'senderProfileID' => '182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e',\n 'subject' => 'x',\n 'subscriptionGroupID' => '182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e',\n 'templateID' => '182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e',\n 'tracking' => ['clicks' => true],\n ],\n);\n\nvar_dump($response);",
1535
+ },
1536
+ http: {
1537
+ example: 'curl https://api.segmentflow.ai/api/v1/emails/batch \\\n -H \'Content-Type: application/json\' \\\n -H "x-api-key: $SEGMENTFLOW_API_KEY" \\\n -d \'{\n "items": [\n {\n "idempotencyKey": "x"\n }\n ]\n }\'',
1538
+ },
1539
+ },
1540
+ },
1541
+ {
1542
+ name: 'retrieve',
1543
+ endpoint: '/api/v1/emails/{id}',
1544
+ httpMethod: 'get',
1545
+ summary: 'Retrieve email send',
1546
+ description: 'Get the current status handle for an EmailSend.',
1547
+ stainlessPath: '(resource) v1.emails > (method) retrieve',
1548
+ qualified: 'client.v1.emails.retrieve',
1549
+ params: ['id: string;'],
1550
+ response: "{ id: string; cc: { email: string; name: string; }[]; createdAt: string; failureMessage: string; failureReason: 'WorkerFailed' | 'ProviderRejected' | 'RenderFailed' | 'Unknown'; from: { email: string; name: string; }; messageId: string; profileId: string; replyTo: { email: string; name: string; }; senderProfileId: string; skippedReason: string; status: 'Queued' | 'Processing' | 'Sent' | 'Failed' | 'Skipped'; subject: string; subscriptionGroupId: string; templateId: string; templateSnapshotId: string; to: { email: string; }; updatedAt: string; }",
1551
+ markdown: "## retrieve\n\n`client.v1.emails.retrieve(id: string): { id: string; cc: object[]; createdAt: string; failureMessage: string; failureReason: 'WorkerFailed' | 'ProviderRejected' | 'RenderFailed' | 'Unknown'; from: object; messageId: string; profileId: string; replyTo: object; senderProfileId: string; skippedReason: string; status: 'Queued' | 'Processing' | 'Sent' | 'Failed' | 'Skipped'; subject: string; subscriptionGroupId: string; templateId: string; templateSnapshotId: string; to: object; updatedAt: string; }`\n\n**get** `/api/v1/emails/{id}`\n\nGet the current status handle for an EmailSend.\n\n### Parameters\n\n- `id: string`\n\n### Returns\n\n- `{ id: string; cc: { email: string; name: string; }[]; createdAt: string; failureMessage: string; failureReason: 'WorkerFailed' | 'ProviderRejected' | 'RenderFailed' | 'Unknown'; from: { email: string; name: string; }; messageId: string; profileId: string; replyTo: { email: string; name: string; }; senderProfileId: string; skippedReason: string; status: 'Queued' | 'Processing' | 'Sent' | 'Failed' | 'Skipped'; subject: string; subscriptionGroupId: string; templateId: string; templateSnapshotId: string; to: { email: string; }; updatedAt: string; }`\n\n - `id: string`\n - `cc: { email: string; name: string; }[]`\n - `createdAt: string`\n - `failureMessage: string`\n - `failureReason: 'WorkerFailed' | 'ProviderRejected' | 'RenderFailed' | 'Unknown'`\n - `from: { email: string; name: string; }`\n - `messageId: string`\n - `profileId: string`\n - `replyTo: { email: string; name: string; }`\n - `senderProfileId: string`\n - `skippedReason: string`\n - `status: 'Queued' | 'Processing' | 'Sent' | 'Failed' | 'Skipped'`\n - `subject: string`\n - `subscriptionGroupId: string`\n - `templateId: string`\n - `templateSnapshotId: string`\n - `to: { email: string; }`\n - `updatedAt: string`\n\n### Example\n\n```typescript\nimport SegmentflowAI from '@segmentflow/segmentflow-typescript';\n\nconst client = new SegmentflowAI();\n\nconst email = await client.v1.emails.retrieve('182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e');\n\nconsole.log(email);\n```",
1552
+ perLanguage: {
1553
+ typescript: {
1554
+ method: 'client.v1.emails.retrieve',
1555
+ example: "import SegmentflowAI from '@segmentflow/segmentflow-typescript';\n\nconst client = new SegmentflowAI({\n apiKey: process.env['SEGMENTFLOW_API_KEY'], // This is the default and can be omitted\n});\n\nconst email = await client.v1.emails.retrieve('182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e');\n\nconsole.log(email.id);",
1556
+ },
1557
+ python: {
1558
+ method: 'v1.emails.retrieve',
1559
+ example: 'import os\nfrom segmentflow import SegmentflowAI\n\nclient = SegmentflowAI(\n api_key=os.environ.get("SEGMENTFLOW_API_KEY"), # This is the default and can be omitted\n)\nemail = client.v1.emails.retrieve(\n "182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e",\n)\nprint(email.id)',
1560
+ },
1561
+ java: {
1562
+ method: 'v1().emails().retrieve',
1563
+ example: 'package com.segmentflow.api.example;\n\nimport com.segmentflow.api.client.SegmentflowAiClient;\nimport com.segmentflow.api.client.okhttp.SegmentflowAiOkHttpClient;\nimport com.segmentflow.api.models.v1.emails.EmailRetrieveParams;\nimport com.segmentflow.api.models.v1.emails.EmailRetrieveResponse;\n\npublic final class Main {\n private Main() {}\n\n public static void main(String[] args) {\n SegmentflowAiClient client = SegmentflowAiOkHttpClient.fromEnv();\n\n EmailRetrieveResponse email = client.v1().emails().retrieve("182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e");\n }\n}',
1564
+ },
1565
+ go: {
1566
+ method: 'client.V1.Emails.Get',
1567
+ example: 'package main\n\nimport (\n\t"context"\n\t"fmt"\n\n\t"github.com/segmentflow/segmentflow-go"\n\t"github.com/segmentflow/segmentflow-go/option"\n)\n\nfunc main() {\n\tclient := segmentflow.NewClient(\n\t\toption.WithAPIKey("My API Key"),\n\t)\n\temail, err := client.V1.Emails.Get(context.TODO(), "182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e")\n\tif err != nil {\n\t\tpanic(err.Error())\n\t}\n\tfmt.Printf("%+v\\n", email.ID)\n}\n',
1568
+ },
1569
+ cli: {
1570
+ method: 'emails retrieve',
1571
+ example: "segmentflow v1:emails retrieve \\\n --api-key 'My API Key' \\\n --id 182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e",
1572
+ },
1573
+ php: {
1574
+ method: 'v1->emails->retrieve',
1575
+ example: "<?php\n\nrequire_once dirname(__DIR__) . '/vendor/autoload.php';\n\n$client = new Client(apiKey: 'My API Key', environment: 'development');\n\n$email = $client->v1->emails->retrieve('182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e');\n\nvar_dump($email);",
1576
+ },
1577
+ http: {
1578
+ example: 'curl https://api.segmentflow.ai/api/v1/emails/$ID \\\n -H "x-api-key: $SEGMENTFLOW_API_KEY"',
1579
+ },
1580
+ },
1581
+ },
1582
+ {
1583
+ name: 'track',
1584
+ endpoint: '/api/v1/events',
1585
+ httpMethod: 'post',
1586
+ summary: 'Track event',
1587
+ description: 'Accept one server-side identified business event, persist a UserEvent, and trigger matching active Journeys.',
1588
+ stainlessPath: '(resource) v1.events > (method) track',
1589
+ qualified: 'client.v1.events.track',
1590
+ params: [
1591
+ 'event: string;',
1592
+ 'profile: { email?: string; externalId?: string; properties?: object; };',
1593
+ 'idempotency-key: string;',
1594
+ 'data?: object;',
1595
+ 'occurredAt?: string;',
1596
+ 'redactedDataPaths?: string[];',
1597
+ 'referenceId?: string;',
1598
+ ],
1599
+ response: '{ enrolledJourneys: number; eventId: string; matchedJourneys: number; profileId: string; skippedJourneys: number; }',
1600
+ markdown: "## track\n\n`client.v1.events.track(event: string, profile: { email?: string; externalId?: string; properties?: object; }, idempotency-key: string, data?: object, occurredAt?: string, redactedDataPaths?: string[], referenceId?: string): { enrolledJourneys: number; eventId: string; matchedJourneys: number; profileId: string; skippedJourneys: number; }`\n\n**post** `/api/v1/events`\n\nAccept one server-side identified business event, persist a UserEvent, and trigger matching active Journeys.\n\n### Parameters\n\n- `event: string`\n Free-form business event name, for example order.created.\n\n- `profile: { email?: string; externalId?: string; properties?: object; }`\n Profile identity and optional durable Profile Property input.\n - `email?: string`\n Profile email address used to resolve or create a Profile.\n - `externalId?: string`\n Caller-owned Profile identifier.\n - `properties?: object`\n Optional durable Profile Property updates keyed by existing Profile Property names.\n\n- `idempotency-key: string`\n\n- `data?: object`\n One-event payload for this event. This is not copied into Profile Properties.\n\n- `occurredAt?: string`\n Event time. If omitted, Segmentflow uses receipt time.\n\n- `redactedDataPaths?: string[]`\n Event state paths to redact before durable retention. Paths must live under /event/.\n\n- `referenceId?: string`\n Safe caller correlation id. It is not used for idempotency; use the Idempotency-Key header for that.\n\n### Returns\n\n- `{ enrolledJourneys: number; eventId: string; matchedJourneys: number; profileId: string; skippedJourneys: number; }`\n\n - `enrolledJourneys: number`\n - `eventId: string`\n - `matchedJourneys: number`\n - `profileId: string`\n - `skippedJourneys: number`\n\n### Example\n\n```typescript\nimport SegmentflowAI from '@segmentflow/segmentflow-typescript';\n\nconst client = new SegmentflowAI();\n\nconst response = await client.v1.events.track({\n event: 'x',\n profile: {},\n 'idempotency-key': 'x',\n});\n\nconsole.log(response);\n```",
1601
+ perLanguage: {
1602
+ typescript: {
1603
+ method: 'client.v1.events.track',
1604
+ example: "import SegmentflowAI from '@segmentflow/segmentflow-typescript';\n\nconst client = new SegmentflowAI({\n apiKey: process.env['SEGMENTFLOW_API_KEY'], // This is the default and can be omitted\n});\n\nconst response = await client.v1.events.track({\n event: 'x',\n profile: {},\n 'idempotency-key': 'x',\n});\n\nconsole.log(response.enrolledJourneys);",
1605
+ },
1606
+ python: {
1607
+ method: 'v1.events.track',
1608
+ example: 'import os\nfrom segmentflow import SegmentflowAI\n\nclient = SegmentflowAI(\n api_key=os.environ.get("SEGMENTFLOW_API_KEY"), # This is the default and can be omitted\n)\nresponse = client.v1.events.track(\n event="x",\n profile={},\n idempotency_key="x",\n)\nprint(response.enrolled_journeys)',
1609
+ },
1610
+ java: {
1611
+ method: 'v1().events().track',
1612
+ example: 'package com.segmentflow.api.example;\n\nimport com.segmentflow.api.client.SegmentflowAiClient;\nimport com.segmentflow.api.client.okhttp.SegmentflowAiOkHttpClient;\nimport com.segmentflow.api.models.v1.events.EventTrackParams;\nimport com.segmentflow.api.models.v1.events.EventTrackResponse;\n\npublic final class Main {\n private Main() {}\n\n public static void main(String[] args) {\n SegmentflowAiClient client = SegmentflowAiOkHttpClient.fromEnv();\n\n EventTrackParams params = EventTrackParams.builder()\n .idempotencyKey("x")\n .event("x")\n .profile(EventTrackParams.Profile.builder().build())\n .build();\n EventTrackResponse response = client.v1().events().track(params);\n }\n}',
1613
+ },
1614
+ go: {
1615
+ method: 'client.V1.Events.Track',
1616
+ example: 'package main\n\nimport (\n\t"context"\n\t"fmt"\n\n\t"github.com/segmentflow/segmentflow-go"\n\t"github.com/segmentflow/segmentflow-go/option"\n)\n\nfunc main() {\n\tclient := segmentflow.NewClient(\n\t\toption.WithAPIKey("My API Key"),\n\t)\n\tresponse, err := client.V1.Events.Track(context.TODO(), segmentflow.V1EventTrackParams{\n\t\tEvent: "x",\n\t\tProfile: segmentflow.V1EventTrackParamsProfile{},\n\t\tIdempotencyKey: "x",\n\t})\n\tif err != nil {\n\t\tpanic(err.Error())\n\t}\n\tfmt.Printf("%+v\\n", response.EnrolledJourneys)\n}\n',
1617
+ },
1618
+ cli: {
1619
+ method: 'events track',
1620
+ example: "segmentflow v1:events track \\\n --api-key 'My API Key' \\\n --event x \\\n --profile '{}' \\\n --idempotency-key x",
1621
+ },
1622
+ php: {
1623
+ method: 'v1->events->track',
1624
+ example: "<?php\n\nrequire_once dirname(__DIR__) . '/vendor/autoload.php';\n\n$client = new Client(apiKey: 'My API Key', environment: 'development');\n\n$response = $client->v1->events->track(\n event: 'x',\n profile: [\n 'email' => 'dev@stainless.com',\n 'externalID' => 'x',\n 'properties' => ['foo' => 'bar'],\n ],\n idempotencyKey: 'x',\n data: ['foo' => 'bar'],\n occurredAt: new \\DateTimeImmutable('2019-12-27T18:11:19.117Z'),\n redactedDataPaths: ['/event/'],\n referenceID: 'x',\n);\n\nvar_dump($response);",
1625
+ },
1626
+ http: {
1627
+ example: 'curl https://api.segmentflow.ai/api/v1/events \\\n -H \'Content-Type: application/json\' \\\n -H "x-api-key: $SEGMENTFLOW_API_KEY" \\\n -d \'{\n "event": "x",\n "profile": {}\n }\'',
365
1628
  },
366
1629
  },
367
1630
  },
368
1631
  ];
369
1632
  const EMBEDDED_READMES = [
1633
+ {
1634
+ language: 'cli',
1635
+ content: "# Segmentflow AI CLI\n\nThe official CLI for the [Segmentflow AI REST API](https://segmentflow.ai/docs).\n\nIt is generated with [Stainless](https://www.stainless.com/).\n\n<!-- x-release-please-start-version -->\n\n## Installation\n\n### Installing with Go\n\nTo test or install the CLI locally, you need [Go](https://go.dev/doc/install) version 1.22 or later installed.\n\n~~~sh\ngo install 'github.com/segmentflow/segmentflow-cli/cmd/segmentflow@latest'\n~~~\n\nOnce you have run `go install`, the binary is placed in your Go bin directory:\n\n- **Default location**: `$HOME/go/bin` (or `$GOPATH/bin` if GOPATH is set)\n- **Check your path**: Run `go env GOPATH` to see the base directory\n\nIf commands aren't found after installation, add the Go bin directory to your PATH:\n\n~~~sh\n# Add to your shell profile (.zshrc, .bashrc, etc.)\nexport PATH=\"$PATH:$(go env GOPATH)/bin\"\n~~~\n\n<!-- x-release-please-end -->\n\n### Running Locally\n\nAfter cloning the git repository for this project, you can use the\n`scripts/run` script to run the tool locally:\n\n~~~sh\n./scripts/run args...\n~~~\n\n## Usage\n\nThe CLI follows a resource-based command structure:\n\n~~~sh\nsegmentflow [resource] <command> [flags...]\n~~~\n\n~~~sh\nsegmentflow v1:profiles retrieve \\\n --api-key 'My API Key' \\\n --profile-id REPLACE_ME\n~~~\n\nFor details about specific commands, use the `--help` flag.\n\n### Environment variables\n\n| Environment variable | Description | Required |\n| --------------------- | ------------------------------- | -------- |\n| `SEGMENTFLOW_API_KEY` | API key for the Segmentflow API | yes |\n\n### Global flags\n\n- `--api-key` - API key for the Segmentflow API (can also be set with `SEGMENTFLOW_API_KEY` env var)\n- `--help` - Show command line usage\n- `--debug` - Enable debug logging (includes HTTP request/response details)\n- `--version`, `-v` - Show the CLI version\n- `--base-url` - Use a custom API backend URL\n- `--format` - Change the output format (`auto`, `explore`, `json`, `jsonl`, `pretty`, `raw`, `yaml`)\n- `--format-error` - Change the output format for errors (`auto`, `explore`, `json`, `jsonl`, `pretty`, `raw`, `yaml`)\n- `--transform` - Transform the data output using [GJSON syntax](https://github.com/tidwall/gjson/blob/master/SYNTAX.md)\n- `--transform-error` - Transform the error output using [GJSON syntax](https://github.com/tidwall/gjson/blob/master/SYNTAX.md)\n\n### Passing files as arguments\n\nTo pass files to your API, you can use the `@myfile.ext` syntax:\n\n~~~bash\nsegmentflow <command> --arg @abe.jpg\n~~~\n\nFiles can also be passed inside JSON or YAML blobs:\n\n~~~bash\nsegmentflow <command> --arg '{image: \"@abe.jpg\"}'\n# Equivalent:\nsegmentflow <command> <<YAML\narg:\n image: \"@abe.jpg\"\nYAML\n~~~\n\nIf you need to pass a string literal that begins with an `@` sign, you can\nescape the `@` sign to avoid accidentally passing a file.\n\n~~~bash\nsegmentflow <command> --username '\\@abe'\n~~~\n\n#### Explicit encoding\n\nFor JSON endpoints, the CLI tool does filetype sniffing to determine whether the\nfile contents should be sent as a string literal (for plain text files) or as a\nbase64-encoded string literal (for binary files). If you need to explicitly send\nthe file as either plain text or base64-encoded data, you can use\n`@file://myfile.txt` (for string encoding) or `@data://myfile.dat` (for\nbase64-encoding). Note that absolute paths will begin with `@file://` or\n`@data://`, followed by a third `/` (for example, `@file:///tmp/file.txt`).\n\n~~~bash\nsegmentflow <command> --arg @data://file.txt\n~~~\n\n## Linking different Go SDK versions\n\nYou can link the CLI against a different version of the Segmentflow AI Go SDK\nfor development purposes using the `./scripts/link` script.\n\nTo link to a specific version from a repository (version can be a branch,\ngit tag, or commit hash):\n\n~~~bash\n./scripts/link github.com/org/repo@version\n~~~\n\nTo link to a local copy of the SDK:\n\n~~~bash\n./scripts/link ../path/to/segmentflow-go\n~~~\n\nIf you run the link script without any arguments, it will default to `../segmentflow-go`.\n",
1636
+ },
1637
+ {
1638
+ language: 'go',
1639
+ content: '# Segmentflow AI Go API Library\n\n<a href="https://pkg.go.dev/github.com/segmentflow/segmentflow-go"><img src="https://pkg.go.dev/badge/github.com/segmentflow/segmentflow-go.svg" alt="Go Reference"></a>\n\nThe Segmentflow AI Go library provides convenient access to the [Segmentflow AI REST API](https://segmentflow.ai/docs)\nfrom applications written in Go.\n\nIt is generated with [Stainless](https://www.stainless.com/).\n\n## MCP Server\n\nUse the Segmentflow AI 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=%40segmentflow%2Fsegmentflow-mcp&config=eyJjb21tYW5kIjoibnB4IiwiYXJncyI6WyIteSIsIkBzZWdtZW50Zmxvdy9zZWdtZW50Zmxvdy1tY3AiXSwiZW52Ijp7IlNFR01FTlRGTE9XX0FQSV9LRVkiOiJNeSBBUEkgS2V5In19)\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%40segmentflow%2Fsegmentflow-mcp%22%2C%22command%22%3A%22npx%22%2C%22args%22%3A%5B%22-y%22%2C%22%40segmentflow%2Fsegmentflow-mcp%22%5D%2C%22env%22%3A%7B%22SEGMENTFLOW_API_KEY%22%3A%22My%20API%20Key%22%7D%7D)\n\n> Note: You may need to set environment variables in your MCP client.\n\n## Installation\n\n<!-- x-release-please-start-version -->\n\n```go\nimport (\n\t"github.com/segmentflow/segmentflow-go" // imported as SDK_PackageName\n)\n```\n\n<!-- x-release-please-end -->\n\nOr to pin the version:\n\n<!-- x-release-please-start-version -->\n\n```sh\ngo get -u \'github.com/segmentflow/segmentflow-go@v0.0.1\'\n```\n\n<!-- x-release-please-end -->\n\n## Requirements\n\nThis library requires Go 1.22+.\n\n## Usage\n\nThe full API of this library can be found in [api.md](api.md).\n\n```go\npackage main\n\nimport (\n\t"context"\n\t"fmt"\n\n\t"github.com/segmentflow/segmentflow-go"\n\t"github.com/segmentflow/segmentflow-go/option"\n)\n\nfunc main() {\n\tclient := segmentflow.NewClient(\n\t\toption.WithAPIKey("My API Key"), // defaults to os.LookupEnv("SEGMENTFLOW_API_KEY")\n\t\toption.WithEnvironmentDevelopment(), // defaults to option.WithEnvironmentProduction()\n\t)\n\tprofile, err := client.V1.Profiles.Get(context.TODO(), "REPLACE_ME")\n\tif err != nil {\n\t\tpanic(err.Error())\n\t}\n\tfmt.Printf("%+v\\n", profile.ID)\n}\n\n```\n\n### Request fields\n\nAll request parameters are wrapped in a generic `Field` type,\nwhich we use to distinguish zero values from null or omitted fields.\n\nThis prevents accidentally sending a zero value if you forget a required parameter,\nand enables explicitly sending `null`, `false`, `\'\'`, or `0` on optional parameters.\nAny field not specified is not sent.\n\nTo construct fields with values, use the helpers `String()`, `Int()`, `Float()`, or most commonly, the generic `F[T]()`.\nTo send a null, use `Null[T]()`, and to send a nonconforming value, use `Raw[T](any)`. For example:\n\n```go\nparams := FooParams{\n\tName: SDK_PackageName.F("hello"),\n\n\t// Explicitly send `"description": null`\n\tDescription: SDK_PackageName.Null[string](),\n\n\tPoint: SDK_PackageName.F(SDK_PackageName.Point{\n\t\tX: SDK_PackageName.Int(0),\n\t\tY: SDK_PackageName.Int(1),\n\n\t\t// In cases where the API specifies a given type,\n\t\t// but you want to send something else, use `Raw`:\n\t\tZ: SDK_PackageName.Raw[int64](0.01), // sends a float\n\t}),\n}\n```\n\n### Response objects\n\nAll fields in response structs are value types (not pointers or wrappers).\n\nIf a given field is `null`, not present, or invalid, the corresponding field\nwill simply be its zero value.\n\nAll response structs also include a special `JSON` field, containing more detailed\ninformation about each property, which you can use like so:\n\n```go\nif res.Name == "" {\n\t// true if `"name"` is either not present or explicitly null\n\tres.JSON.Name.IsNull()\n\n\t// true if the `"name"` key was not present in the response JSON at all\n\tres.JSON.Name.IsMissing()\n\n\t// When the API returns data that cannot be coerced to the expected type:\n\tif res.JSON.Name.IsInvalid() {\n\t\traw := res.JSON.Name.Raw()\n\n\t\tlegacyName := struct{\n\t\t\tFirst string `json:"first"`\n\t\t\tLast string `json:"last"`\n\t\t}{}\n\t\tjson.Unmarshal([]byte(raw), &legacyName)\n\t\tname = legacyName.First + " " + legacyName.Last\n\t}\n}\n```\n\nThese `.JSON` structs also include an `Extras` map containing\nany properties in the json response that were not specified\nin the struct. This can be useful for API features not yet\npresent in the SDK.\n\n```go\nbody := res.JSON.ExtraFields["my_unexpected_field"].Raw()\n```\n\n### RequestOptions\n\nThis library uses the functional options pattern. Functions defined in the\n`SDK_PackageOptionName` package return a `RequestOption`, which is a closure that mutates a\n`RequestConfig`. These options can be supplied to the client or at individual\nrequests. For example:\n\n```go\nclient := SDK_PackageName.SDK_ClientInitializerName(\n\t// Adds a header to every request made by the client\n\tSDK_PackageOptionName.WithHeader("X-Some-Header", "custom_header_info"),\n)\n\nclient.V1.Profiles.List(context.TODO(), ...,\n\t// Override the header\n\tSDK_PackageOptionName.WithHeader("X-Some-Header", "some_other_custom_header_info"),\n\t// Add an undocumented field to the request body, using sjson syntax\n\tSDK_PackageOptionName.WithJSONSet("some.json.path", map[string]string{"my": "object"}),\n)\n```\n\nSee the [full list of request options](https://pkg.go.dev/github.com/segmentflow/segmentflow-go/SDK_PackageOptionName).\n\n### Pagination\n\nThis library provides some conveniences for working with paginated list endpoints.\n\nYou can use `.ListAutoPaging()` methods to iterate through items across all pages:\n\n\n\nOr you can use simple `.List()` methods to fetch a single page and receive a standard response object\nwith additional helper methods like `.GetNextPage()`, e.g.:\n\n\n\n### Errors\n\nWhen the API returns a non-success status code, we return an error with type\n`*SDK_PackageName.Error`. This contains the `StatusCode`, `*http.Request`, and\n`*http.Response` values of the request, as well as the JSON of the error body\n(much like other response objects in the SDK).\n\nTo handle errors, we recommend that you use the `errors.As` pattern:\n\n```go\n_, err := client.V1.Profiles.List(context.TODO(), segmentflow.V1ProfileListParams{\n\tLimit: segmentflow.Int(10),\n\tSearch: segmentflow.String("user@example.com"),\n})\nif err != nil {\n\tvar apierr *segmentflow.Error\n\tif errors.As(err, &apierr) {\n\t\tprintln(string(apierr.DumpRequest(true))) // Prints the serialized HTTP request\n\t\tprintln(string(apierr.DumpResponse(true))) // Prints the serialized HTTP response\n\t}\n\tpanic(err.Error()) // GET "/api/v1/profiles": 400 Bad Request { ... }\n}\n```\n\nWhen other errors occur, they are returned unwrapped; for example,\nif HTTP transport fails, you might receive `*url.Error` wrapping `*net.OpError`.\n\n### Timeouts\n\nRequests do not time out by default; use context to configure a timeout for a request lifecycle.\n\nNote that if a request is [retried](#retries), the context timeout does not start over.\nTo set a per-retry timeout, use `SDK_PackageOptionName.WithRequestTimeout()`.\n\n```go\n// This sets the timeout for the request, including all the retries.\nctx, cancel := context.WithTimeout(context.Background(), 5*time.Minute)\ndefer cancel()\nclient.V1.Profiles.List(\n\tctx,\n\tsegmentflow.V1ProfileListParams{\n\t\tLimit: segmentflow.Int(10),\n\t\tSearch: segmentflow.String("user@example.com"),\n\t},\n\t// This sets the per-retry timeout\n\toption.WithRequestTimeout(20*time.Second),\n)\n```\n\n### File uploads\n\nRequest parameters that correspond to file uploads in multipart requests are typed as\n`param.Field[io.Reader]`. The contents of the `io.Reader` will by default be sent as a multipart form\npart with the file name of "anonymous_file" and content-type of "application/octet-stream".\n\nThe file name and content-type can be customized by implementing `Name() string` or `ContentType()\nstring` on the run-time type of `io.Reader`. Note that `os.File` implements `Name() string`, so a\nfile returned by `os.Open` will be sent with the file name on disk.\n\nWe also provide a helper `SDK_PackageName.FileParam(reader io.Reader, filename string, contentType string)`\nwhich can be used to wrap any `io.Reader` with the appropriate file name and content type.\n\n\n\n### Retries\n\nCertain errors will be automatically retried 2 times by default, with a short exponential backoff.\nWe retry by default all connection errors, 408 Request Timeout, 409 Conflict, 429 Rate Limit,\nand >=500 Internal errors.\n\nYou can use the `WithMaxRetries` option to configure or disable this:\n\n```go\n// Configure the default for all requests:\nclient := segmentflow.NewClient(\n\toption.WithMaxRetries(0), // default is 2\n)\n\n// Override per-request:\nclient.V1.Profiles.List(\n\tcontext.TODO(),\n\tsegmentflow.V1ProfileListParams{\n\t\tLimit: segmentflow.Int(10),\n\t\tSearch: segmentflow.String("user@example.com"),\n\t},\n\toption.WithMaxRetries(5),\n)\n```\n\n\n### Accessing raw response data (e.g. response headers)\n\nYou can access the raw HTTP response data by using the `option.WithResponseInto()` request option. This is useful when\nyou need to examine response headers, status codes, or other details.\n\n```go\n// Create a variable to store the HTTP response\nvar response *http.Response\nprofileList, err := client.V1.Profiles.List(\n\tcontext.TODO(),\n\tsegmentflow.V1ProfileListParams{\n\t\tLimit: segmentflow.Int(10),\n\t\tSearch: segmentflow.String("user@example.com"),\n\t},\n\toption.WithResponseInto(&response),\n)\nif err != nil {\n\t// handle error\n}\nfmt.Printf("%+v\\n", profileList)\n\nfmt.Printf("Status Code: %d\\n", response.StatusCode)\nfmt.Printf("Headers: %+#v\\n", response.Header)\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.\n`RequestOptions` on the client, such as retries, will be respected when making these requests.\n\n```go\nvar (\n // params can be an io.Reader, a []byte, an encoding/json serializable object,\n // or a "…Params" struct defined in this library.\n params map[string]interface{}\n\n // result can be an []byte, *http.Response, a encoding/json deserializable object,\n // or a model defined in this library.\n result *http.Response\n)\nerr := client.Post(context.Background(), "/unspecified", params, &result)\nif err != nil {\n …\n}\n```\n\n#### Undocumented request params\n\nTo make requests using undocumented parameters, you may use either the `SDK_PackageOptionName.WithQuerySet()`\nor the `SDK_PackageOptionName.WithJSONSet()` methods.\n\n```go\nparams := FooNewParams{\n ID: SDK_PackageName.F("id_xxxx"),\n Data: SDK_PackageName.F(FooNewParamsData{\n FirstName: SDK_PackageName.F("John"),\n }),\n}\nclient.Foo.New(context.Background(), params, SDK_PackageOptionName.WithJSONSet("data.last_name", "Doe"))\n```\n\n#### Undocumented response properties\n\nTo access undocumented response properties, you may either access the raw JSON of the response as a string\nwith `result.JSON.RawJSON()`, or get the raw JSON of a particular field on the result with\n`result.JSON.Foo.Raw()`.\n\nAny fields that are not present on the response struct will be saved and can be accessed by `result.JSON.ExtraFields()` which returns the extra fields as a `map[string]Field`.\n\n### Middleware\n\nWe provide `SDK_PackageOptionName.WithMiddleware` which applies the given\nmiddleware to requests.\n\n```go\nfunc Logger(req *http.Request, next SDK_PackageOptionName.MiddlewareNext) (res *http.Response, err error) {\n\t// Before the request\n\tstart := time.Now()\n\tLogReq(req)\n\n\t// Forward the request to the next handler\n\tres, err = next(req)\n\n\t// Handle stuff after the request\n\tend := time.Now()\n\tLogRes(res, err, start - end)\n\n return res, err\n}\n\nclient := SDK_PackageName.SDK_ClientInitializerName(\n\tSDK_PackageOptionName.WithMiddleware(Logger),\n)\n```\n\nWhen multiple middlewares are provided as variadic arguments, the middlewares\nare applied left to right. If `SDK_PackageOptionName.WithMiddleware` is given\nmultiple times, for example first in the client then the method, the\nmiddleware in the client will run first and the middleware given in the method\nwill run next.\n\nYou may also replace the default `http.Client` with\n`SDK_PackageOptionName.WithHTTPClient(client)`. Only one http client is\naccepted (this overwrites any previous client) and receives requests after any\nmiddleware has been applied.\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 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.)_\n2. 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/segmentflow/segmentflow-go/issues) with questions, bugs, or suggestions.\n\n## Contributing\n\nSee [the contributing documentation](./CONTRIBUTING.md).\n',
1640
+ },
1641
+ {
1642
+ language: 'java',
1643
+ content: '# Segmentflow AI Java API Library\n\n<!-- x-release-please-start-version -->\n[![Maven Central](https://img.shields.io/maven-central/v/com.segmentflow.api/segmentflow-ai-java)](https://central.sonatype.com/artifact/com.segmentflow.api/segmentflow-ai-java/0.0.1)\n[![javadoc](https://javadoc.io/badge2/com.segmentflow.api/segmentflow-ai-java/0.0.1/javadoc.svg)](https://javadoc.io/doc/com.segmentflow.api/segmentflow-ai-java/0.0.1)\n<!-- x-release-please-end -->\n\nThe Segmentflow AI Java SDK provides convenient access to the [Segmentflow AI REST API](https://segmentflow.ai/docs) from applications written in Java.\n\n\n\nIt is generated with [Stainless](https://www.stainless.com/).\n\n## MCP Server\n\nUse the Segmentflow AI 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=%40segmentflow%2Fsegmentflow-mcp&config=eyJjb21tYW5kIjoibnB4IiwiYXJncyI6WyIteSIsIkBzZWdtZW50Zmxvdy9zZWdtZW50Zmxvdy1tY3AiXSwiZW52Ijp7IlNFR01FTlRGTE9XX0FQSV9LRVkiOiJNeSBBUEkgS2V5In19)\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%40segmentflow%2Fsegmentflow-mcp%22%2C%22command%22%3A%22npx%22%2C%22args%22%3A%5B%22-y%22%2C%22%40segmentflow%2Fsegmentflow-mcp%22%5D%2C%22env%22%3A%7B%22SEGMENTFLOW_API_KEY%22%3A%22My%20API%20Key%22%7D%7D)\n\n> Note: You may need to set environment variables in your MCP client.\n\n<!-- x-release-please-start-version -->\n\nThe REST API documentation can be found on [segmentflow.ai](https://segmentflow.ai/docs). Javadocs are available on [javadoc.io](https://javadoc.io/doc/com.segmentflow.api/segmentflow-ai-java/0.0.1).\n\n<!-- x-release-please-end -->\n\n## Installation\n\n<!-- x-release-please-start-version -->\n\n### Gradle\n\n~~~kotlin\nimplementation("com.segmentflow.api:segmentflow-ai-java:0.0.1")\n~~~\n\n### Maven\n\n~~~xml\n<dependency>\n <groupId>com.segmentflow.api</groupId>\n <artifactId>segmentflow-ai-java</artifactId>\n <version>0.0.1</version>\n</dependency>\n~~~\n\n<!-- x-release-please-end -->\n\n## Requirements\n\nThis library requires Java 8 or later.\n\n## Usage\n\n```java\nimport com.segmentflow.api.client.SegmentflowAiClient;\nimport com.segmentflow.api.client.okhttp.SegmentflowAiOkHttpClient;\nimport com.segmentflow.api.models.v1.profiles.Profile;\nimport com.segmentflow.api.models.v1.profiles.ProfileRetrieveParams;\n\n// Configures using the `segmentflowai.segmentflowApiKey` and `segmentflowai.baseUrl` system properties\n// Or configures using the `SEGMENTFLOW_API_KEY` and `SEGMENTFLOW_AI_BASE_URL` environment variables\nSegmentflowAiClient client = SegmentflowAiOkHttpClient.fromEnv();\n\nProfile profile = client.v1().profiles().retrieve("REPLACE_ME");\n```\n\n## Client configuration\n\nConfigure the client using system properties or environment variables:\n\n```java\nimport com.segmentflow.api.client.SegmentflowAiClient;\nimport com.segmentflow.api.client.okhttp.SegmentflowAiOkHttpClient;\n\n// Configures using the `segmentflowai.segmentflowApiKey` and `segmentflowai.baseUrl` system properties\n// Or configures using the `SEGMENTFLOW_API_KEY` and `SEGMENTFLOW_AI_BASE_URL` environment variables\nSegmentflowAiClient client = SegmentflowAiOkHttpClient.fromEnv();\n```\n\nOr manually:\n\n```java\nimport com.segmentflow.api.client.SegmentflowAiClient;\nimport com.segmentflow.api.client.okhttp.SegmentflowAiOkHttpClient;\n\nSegmentflowAiClient client = SegmentflowAiOkHttpClient.builder()\n .apiKey("My API Key")\n .build();\n```\n\nOr using a combination of the two approaches:\n\n```java\nimport com.segmentflow.api.client.SegmentflowAiClient;\nimport com.segmentflow.api.client.okhttp.SegmentflowAiOkHttpClient;\n\nSegmentflowAiClient client = SegmentflowAiOkHttpClient.builder()\n // Configures using the `segmentflowai.segmentflowApiKey` and `segmentflowai.baseUrl` system properties\n // Or configures using the `SEGMENTFLOW_API_KEY` and `SEGMENTFLOW_AI_BASE_URL` environment variables\n .fromEnv()\n .apiKey("My API Key")\n .build();\n```\n\nSee this table for the available options:\n\n| Setter | System property | Environment variable | Required | Default value |\n| --------- | --------------------------------- | ------------------------- | -------- | ------------------------------ |\n| `apiKey` | `segmentflowai.segmentflowApiKey` | `SEGMENTFLOW_API_KEY` | true | - |\n| `baseUrl` | `segmentflowai.baseUrl` | `SEGMENTFLOW_AI_BASE_URL` | true | `"https://api.segmentflow.ai"` |\n\nSystem properties take precedence over environment variables.\n\n> [!TIP]\n> Don\'t create more than one client in the same application. Each client has a connection pool and\n> thread pools, which are more efficient to share between requests.\n\n### Modifying configuration\n\nTo temporarily use a modified client configuration, while reusing the same connection and thread pools, call `withOptions()` on any client or service:\n\n```java\nimport com.segmentflow.api.client.SegmentflowAiClient;\n\nSegmentflowAiClient clientWithOptions = client.withOptions(optionsBuilder -> {\n optionsBuilder.baseUrl("https://example.com");\n optionsBuilder.maxRetries(42);\n});\n```\n\nThe `withOptions()` method does not affect the original client or service.\n\n## Requests and responses\n\nTo send a request to the Segmentflow AI API, build an instance of some `Params` class and pass it to the corresponding client method. When the response is received, it will be deserialized into an instance of a Java class.\n\nFor example, `client.v1().profiles().retrieve(...)` should be called with an instance of `ProfileRetrieveParams`, and it will return an instance of `Profile`.\n\n## Immutability\n\nEach class in the SDK has an associated [builder](https://blogs.oracle.com/javamagazine/post/exploring-joshua-blochs-builder-design-pattern-in-java) or factory method for constructing it.\n\nEach class is [immutable](https://docs.oracle.com/javase/tutorial/essential/concurrency/immutable.html) once constructed. If the class has an associated builder, then it has a `toBuilder()` method, which can be used to convert it back to a builder for making a modified copy.\n\nBecause each class is immutable, builder modification will _never_ affect already built class instances.\n\n## Asynchronous execution\n\nThe default client is synchronous. To switch to asynchronous execution, call the `async()` method:\n\n```java\nimport com.segmentflow.api.client.SegmentflowAiClient;\nimport com.segmentflow.api.client.okhttp.SegmentflowAiOkHttpClient;\nimport com.segmentflow.api.models.v1.profiles.Profile;\nimport com.segmentflow.api.models.v1.profiles.ProfileRetrieveParams;\nimport java.util.concurrent.CompletableFuture;\n\n// Configures using the `segmentflowai.segmentflowApiKey` and `segmentflowai.baseUrl` system properties\n// Or configures using the `SEGMENTFLOW_API_KEY` and `SEGMENTFLOW_AI_BASE_URL` environment variables\nSegmentflowAiClient client = SegmentflowAiOkHttpClient.fromEnv();\n\nCompletableFuture<Profile> profile = client.async().v1().profiles().retrieve("REPLACE_ME");\n```\n\nOr create an asynchronous client from the beginning:\n\n```java\nimport com.segmentflow.api.client.SegmentflowAiClientAsync;\nimport com.segmentflow.api.client.okhttp.SegmentflowAiOkHttpClientAsync;\nimport com.segmentflow.api.models.v1.profiles.Profile;\nimport com.segmentflow.api.models.v1.profiles.ProfileRetrieveParams;\nimport java.util.concurrent.CompletableFuture;\n\n// Configures using the `segmentflowai.segmentflowApiKey` and `segmentflowai.baseUrl` system properties\n// Or configures using the `SEGMENTFLOW_API_KEY` and `SEGMENTFLOW_AI_BASE_URL` environment variables\nSegmentflowAiClientAsync client = SegmentflowAiOkHttpClientAsync.fromEnv();\n\nCompletableFuture<Profile> profile = client.v1().profiles().retrieve("REPLACE_ME");\n```\n\nThe asynchronous client supports the same options as the synchronous one, except most methods return `CompletableFuture`s.\n\n\n\n\n\n\n\n## Raw responses\n\nThe SDK defines methods that deserialize responses into instances of Java classes. However, these methods don\'t provide access to the response headers, status code, or the raw response body.\n\nTo access this data, prefix any HTTP method call on a client or service with `withRawResponse()`:\n\n```java\nimport com.segmentflow.api.core.http.Headers;\nimport com.segmentflow.api.core.http.HttpResponseFor;\nimport com.segmentflow.api.models.v1.profiles.ProfileList;\nimport com.segmentflow.api.models.v1.profiles.ProfileListParams;\n\nProfileListParams params = ProfileListParams.builder()\n .limit(10L)\n .search("user@example.com")\n .build();\nHttpResponseFor<ProfileList> profileList = client.v1().profiles().withRawResponse().list(params);\n\nint statusCode = profileList.statusCode();\nHeaders headers = profileList.headers();\n```\n\nYou can still deserialize the response into an instance of a Java class if needed:\n\n```java\nimport com.segmentflow.api.models.v1.profiles.ProfileList;\n\nProfileList parsedProfileList = profileList.parse();\n```\n\n## Error handling\n\nThe SDK throws custom unchecked exception types:\n\n- [`SegmentflowAiServiceException`](segmentflow-ai-java-core/src/main/kotlin/com/segmentflow/api/errors/SegmentflowAiServiceException.kt): Base class for HTTP errors. See this table for which exception subclass is thrown for each HTTP status code:\n\n | Status | Exception |\n | ------ | -------------------------------------------------- |\n | 400 | [`BadRequestException`](segmentflow-ai-java-core/src/main/kotlin/com/segmentflow/api/errors/BadRequestException.kt) |\n | 401 | [`UnauthorizedException`](segmentflow-ai-java-core/src/main/kotlin/com/segmentflow/api/errors/UnauthorizedException.kt) |\n | 403 | [`PermissionDeniedException`](segmentflow-ai-java-core/src/main/kotlin/com/segmentflow/api/errors/PermissionDeniedException.kt) |\n | 404 | [`NotFoundException`](segmentflow-ai-java-core/src/main/kotlin/com/segmentflow/api/errors/NotFoundException.kt) |\n | 422 | [`UnprocessableEntityException`](segmentflow-ai-java-core/src/main/kotlin/com/segmentflow/api/errors/UnprocessableEntityException.kt) |\n | 429 | [`RateLimitException`](segmentflow-ai-java-core/src/main/kotlin/com/segmentflow/api/errors/RateLimitException.kt) |\n | 5xx | [`InternalServerException`](segmentflow-ai-java-core/src/main/kotlin/com/segmentflow/api/errors/InternalServerException.kt) |\n | others | [`UnexpectedStatusCodeException`](segmentflow-ai-java-core/src/main/kotlin/com/segmentflow/api/errors/UnexpectedStatusCodeException.kt) |\n\n- [`SegmentflowAiIoException`](segmentflow-ai-java-core/src/main/kotlin/com/segmentflow/api/errors/SegmentflowAiIoException.kt): I/O networking errors.\n\n- [`SegmentflowAiRetryableException`](segmentflow-ai-java-core/src/main/kotlin/com/segmentflow/api/errors/SegmentflowAiRetryableException.kt): Generic error indicating a failure that could be retried by the client.\n\n- [`SegmentflowAiInvalidDataException`](segmentflow-ai-java-core/src/main/kotlin/com/segmentflow/api/errors/SegmentflowAiInvalidDataException.kt): Failure to interpret successfully parsed data. For example, when accessing a property that\'s supposed to be required, but the API unexpectedly omitted it from the response.\n\n- [`SegmentflowAiException`](segmentflow-ai-java-core/src/main/kotlin/com/segmentflow/api/errors/SegmentflowAiException.kt): Base class for all exceptions. Most errors will result in one of the previously mentioned ones, but completely generic errors may be thrown using the base class.\n\n\n\n## Logging\n\nEnable logging by setting the `SEGMENTFLOW_AI_LOG` environment variable to `info`:\n\n```sh\nexport SEGMENTFLOW_AI_LOG=info\n```\n\nOr to `debug` for more verbose logging:\n\n```sh\nexport SEGMENTFLOW_AI_LOG=debug\n```\n\nOr configure the client manually using the `logLevel` method:\n\n```java\nimport com.segmentflow.api.client.SegmentflowAiClient;\nimport com.segmentflow.api.client.okhttp.SegmentflowAiOkHttpClient;\nimport com.segmentflow.api.core.LogLevel;\n\nSegmentflowAiClient client = SegmentflowAiOkHttpClient.builder()\n .fromEnv()\n .logLevel(LogLevel.INFO)\n .build();\n```\n\n## ProGuard and R8\n\nAlthough the SDK uses reflection, it is still usable with [ProGuard](https://github.com/Guardsquare/proguard) and [R8](https://developer.android.com/topic/performance/app-optimization/enable-app-optimization) because `segmentflow-ai-java-core` is published with a [configuration file](segmentflow-ai-java-core/src/main/resources/META-INF/proguard/segmentflow-ai-java-core.pro) containing [keep rules](https://www.guardsquare.com/manual/configuration/usage).\n\nProGuard and R8 should automatically detect and use the published rules, but you can also manually copy the keep rules if necessary.\n\n\n\n\n\n## Jackson\n\nThe SDK depends on [Jackson](https://github.com/FasterXML/jackson) for JSON serialization/deserialization. It is compatible with version 2.13.4 or higher, but depends on version 2.18.2 by default.\n\nThe SDK throws an exception if it detects an incompatible Jackson version at runtime (e.g. if the default version was overridden in your Maven or Gradle config).\n\nIf the SDK threw an exception, but you\'re _certain_ the version is compatible, then disable the version check using the `checkJacksonVersionCompatibility` on [`SegmentflowAiOkHttpClient`](segmentflow-ai-java-client-okhttp/src/main/kotlin/com/segmentflow/api/client/okhttp/SegmentflowAiOkHttpClient.kt) or [`SegmentflowAiOkHttpClientAsync`](segmentflow-ai-java-client-okhttp/src/main/kotlin/com/segmentflow/api/client/okhttp/SegmentflowAiOkHttpClientAsync.kt).\n\n> [!CAUTION]\n> We make no guarantee that the SDK works correctly when the Jackson version check is disabled.\n\nAlso note that there are bugs in older Jackson versions that can affect the SDK. We don\'t work around all Jackson bugs ([example](https://github.com/FasterXML/jackson-databind/issues/3240)) and expect users to upgrade Jackson for those instead.\n\n## Network options\n\n### Retries\n\nThe SDK automatically retries 2 times by default, with a short exponential backoff between requests.\n\nOnly the following error types are retried:\n- Connection errors (for example, due to a network connectivity problem)\n- 408 Request Timeout\n- 409 Conflict\n- 429 Rate Limit\n- 5xx Internal\n\nThe API may also explicitly instruct the SDK to retry or not retry a request.\n\nTo set a custom number of retries, configure the client using the `maxRetries` method:\n\n```java\nimport com.segmentflow.api.client.SegmentflowAiClient;\nimport com.segmentflow.api.client.okhttp.SegmentflowAiOkHttpClient;\n\nSegmentflowAiClient client = SegmentflowAiOkHttpClient.builder()\n .fromEnv()\n .maxRetries(4)\n .build();\n```\n\n### Timeouts\n\nRequests time out after 1 minute by default.\n\nTo set a custom timeout, configure the method call using the `timeout` method:\n\n```java\nimport com.segmentflow.api.models.v1.profiles.ProfileList;\n\nProfileList profileList = client.v1().profiles().list(RequestOptions.builder().timeout(Duration.ofSeconds(30)).build());\n```\n\nOr configure the default for all method calls at the client level:\n\n```java\nimport com.segmentflow.api.client.SegmentflowAiClient;\nimport com.segmentflow.api.client.okhttp.SegmentflowAiOkHttpClient;\nimport java.time.Duration;\n\nSegmentflowAiClient client = SegmentflowAiOkHttpClient.builder()\n .fromEnv()\n .timeout(Duration.ofSeconds(30))\n .build();\n```\n\n### Proxies\n\nTo route requests through a proxy, configure the client using the `proxy` method:\n\n```java\nimport com.segmentflow.api.client.SegmentflowAiClient;\nimport com.segmentflow.api.client.okhttp.SegmentflowAiOkHttpClient;\nimport java.net.InetSocketAddress;\nimport java.net.Proxy;\n\nSegmentflowAiClient client = SegmentflowAiOkHttpClient.builder()\n .fromEnv()\n .proxy(new Proxy(\n Proxy.Type.HTTP, new InetSocketAddress(\n "https://example.com", 8080\n )\n ))\n .build();\n```\n\nIf the proxy responds with `407 Proxy Authentication Required`, supply credentials by also configuring `proxyAuthenticator`:\n\n```java\nimport com.segmentflow.api.client.SegmentflowAiClient;\nimport com.segmentflow.api.client.okhttp.SegmentflowAiOkHttpClient;\nimport com.segmentflow.api.core.http.ProxyAuthenticator;\n\nSegmentflowAiClient client = SegmentflowAiOkHttpClient.builder()\n .fromEnv()\n .proxy(...)\n // Or a custom implementation of `ProxyAuthenticator`.\n .proxyAuthenticator(ProxyAuthenticator.basic("username", "password"))\n .build();\n```\n\n### Connection pooling\n\nTo customize the underlying OkHttp connection pool, configure the client using the `maxIdleConnections` and `keepAliveDuration` methods:\n\n```java\nimport com.segmentflow.api.client.SegmentflowAiClient;\nimport com.segmentflow.api.client.okhttp.SegmentflowAiOkHttpClient;\nimport java.time.Duration;\n\nSegmentflowAiClient client = SegmentflowAiOkHttpClient.builder()\n .fromEnv()\n // If `maxIdleConnections` is set, then `keepAliveDuration` must be set, and vice versa.\n .maxIdleConnections(10)\n .keepAliveDuration(Duration.ofMinutes(2))\n .build();\n```\n\nIf both options are unset, OkHttp\'s default connection pool settings are used.\n\n### HTTPS\n\n> [!NOTE]\n> Most applications should not call these methods, and instead use the system defaults. The defaults include\n> special optimizations that can be lost if the implementations are modified.\n\nTo configure how HTTPS connections are secured, configure the client using the `sslSocketFactory`, `trustManager`, and `hostnameVerifier` methods:\n\n```java\nimport com.segmentflow.api.client.SegmentflowAiClient;\nimport com.segmentflow.api.client.okhttp.SegmentflowAiOkHttpClient;\n\nSegmentflowAiClient client = SegmentflowAiOkHttpClient.builder()\n .fromEnv()\n // If `sslSocketFactory` is set, then `trustManager` must be set, and vice versa.\n .sslSocketFactory(yourSSLSocketFactory)\n .trustManager(yourTrustManager)\n .hostnameVerifier(yourHostnameVerifier)\n .build();\n```\n\n### Environments\n\nThe SDK sends requests to the production by default. To send requests to a different environment, configure the client like so:\n\n```java\nimport com.segmentflow.api.client.SegmentflowAiClient;\nimport com.segmentflow.api.client.okhttp.SegmentflowAiOkHttpClient;\n\nSegmentflowAiClient client = SegmentflowAiOkHttpClient.builder()\n .fromEnv()\n .development()\n .build();\n```\n\n### Custom HTTP client\n\nThe SDK consists of three artifacts:\n- `segmentflow-ai-java-core`\n - Contains core SDK logic\n - Does not depend on [OkHttp](https://square.github.io/okhttp)\n - Exposes [`SegmentflowAiClient`](segmentflow-ai-java-core/src/main/kotlin/com/segmentflow/api/client/SegmentflowAiClient.kt), [`SegmentflowAiClientAsync`](segmentflow-ai-java-core/src/main/kotlin/com/segmentflow/api/client/SegmentflowAiClientAsync.kt), [`SegmentflowAiClientImpl`](segmentflow-ai-java-core/src/main/kotlin/com/segmentflow/api/client/SegmentflowAiClientImpl.kt), and [`SegmentflowAiClientAsyncImpl`](segmentflow-ai-java-core/src/main/kotlin/com/segmentflow/api/client/SegmentflowAiClientAsyncImpl.kt), all of which can work with any HTTP client\n- `segmentflow-ai-java-client-okhttp`\n - Depends on [OkHttp](https://square.github.io/okhttp)\n - Exposes [`SegmentflowAiOkHttpClient`](segmentflow-ai-java-client-okhttp/src/main/kotlin/com/segmentflow/api/client/okhttp/SegmentflowAiOkHttpClient.kt) and [`SegmentflowAiOkHttpClientAsync`](segmentflow-ai-java-client-okhttp/src/main/kotlin/com/segmentflow/api/client/okhttp/SegmentflowAiOkHttpClientAsync.kt), which provide a way to construct [`SegmentflowAiClientImpl`](segmentflow-ai-java-core/src/main/kotlin/com/segmentflow/api/client/SegmentflowAiClientImpl.kt) and [`SegmentflowAiClientAsyncImpl`](segmentflow-ai-java-core/src/main/kotlin/com/segmentflow/api/client/SegmentflowAiClientAsyncImpl.kt), respectively, using OkHttp\n- `segmentflow-ai-java`\n - Depends on and exposes the APIs of both `segmentflow-ai-java-core` and `segmentflow-ai-java-client-okhttp`\n - Does not have its own logic\n\nThis structure allows replacing the SDK\'s default HTTP client without pulling in unnecessary dependencies.\n\n#### Customized [`OkHttpClient`](https://square.github.io/okhttp/3.x/okhttp/okhttp3/OkHttpClient.html)\n\n> [!TIP]\n> Try the available [network options](#network-options) before replacing the default client.\n\nTo use a customized `OkHttpClient`:\n\n1. Replace your [`segmentflow-ai-java` dependency](#installation) with `segmentflow-ai-java-core`\n2. Copy `segmentflow-ai-java-client-okhttp`\'s [`OkHttpClient`](segmentflow-ai-java-client-okhttp/src/main/kotlin/com/segmentflow/api/client/okhttp/OkHttpClient.kt) class into your code and customize it\n3. Construct [`SegmentflowAiClientImpl`](segmentflow-ai-java-core/src/main/kotlin/com/segmentflow/api/client/SegmentflowAiClientImpl.kt) or [`SegmentflowAiClientAsyncImpl`](segmentflow-ai-java-core/src/main/kotlin/com/segmentflow/api/client/SegmentflowAiClientAsyncImpl.kt), similarly to [`SegmentflowAiOkHttpClient`](segmentflow-ai-java-client-okhttp/src/main/kotlin/com/segmentflow/api/client/okhttp/SegmentflowAiOkHttpClient.kt) or [`SegmentflowAiOkHttpClientAsync`](segmentflow-ai-java-client-okhttp/src/main/kotlin/com/segmentflow/api/client/okhttp/SegmentflowAiOkHttpClientAsync.kt), using your customized client\n\n### Completely custom HTTP client\n\nTo use a completely custom HTTP client:\n\n1. Replace your [`segmentflow-ai-java` dependency](#installation) with `segmentflow-ai-java-core`\n2. Write a class that implements the [`HttpClient`](segmentflow-ai-java-core/src/main/kotlin/com/segmentflow/api/core/http/HttpClient.kt) interface\n3. Construct [`SegmentflowAiClientImpl`](segmentflow-ai-java-core/src/main/kotlin/com/segmentflow/api/client/SegmentflowAiClientImpl.kt) or [`SegmentflowAiClientAsyncImpl`](segmentflow-ai-java-core/src/main/kotlin/com/segmentflow/api/client/SegmentflowAiClientAsyncImpl.kt), similarly to [`SegmentflowAiOkHttpClient`](segmentflow-ai-java-client-okhttp/src/main/kotlin/com/segmentflow/api/client/okhttp/SegmentflowAiOkHttpClient.kt) or [`SegmentflowAiOkHttpClientAsync`](segmentflow-ai-java-client-okhttp/src/main/kotlin/com/segmentflow/api/client/okhttp/SegmentflowAiOkHttpClientAsync.kt), using your new client class\n\n## Undocumented API functionality\n\nThe SDK is typed for convenient usage of the documented API. However, it also supports working with undocumented or not yet supported parts of the API.\n\n### Parameters\n\nTo set undocumented parameters, call the `putAdditionalHeader`, `putAdditionalQueryParam`, or `putAdditionalBodyProperty` methods on any `Params` class:\n\n```java\nimport com.segmentflow.api.core.JsonValue;\nimport com.segmentflow.api.models.v1.profiles.ProfileRetrieveParams;\n\nProfileRetrieveParams params = ProfileRetrieveParams.builder()\n .putAdditionalHeader("Secret-Header", "42")\n .putAdditionalQueryParam("secret_query_param", "42")\n .putAdditionalBodyProperty("secretProperty", JsonValue.from("42"))\n .build();\n```\n\nThese can be accessed on the built object later using the `_additionalHeaders()`, `_additionalQueryParams()`, and `_additionalBodyProperties()` methods.\n\nTo set undocumented parameters on _nested_ headers, query params, or body classes, call the `putAdditionalProperty` method on the nested class:\n\n```java\nimport com.segmentflow.api.core.JsonValue;\nimport com.segmentflow.api.models.v1.brandkit.BrandKitCreateParams;\n\nBrandKitCreateParams params = BrandKitCreateParams.builder()\n .brandKit(BrandKitCreateParams.BrandKit.builder()\n .putAdditionalProperty("secretProperty", JsonValue.from("42"))\n .build())\n .build();\n```\n\nThese properties can be accessed on the nested built object later using the `_additionalProperties()` method.\n\nTo set a documented parameter or property to an undocumented or not yet supported _value_, pass a [`JsonValue`](segmentflow-ai-java-core/src/main/kotlin/com/segmentflow/api/core/Values.kt) object to its setter:\n\n```java\nimport com.segmentflow.api.models.v1.profiles.ProfileRetrieveParams;\n\nProfileRetrieveParams params = ProfileRetrieveParams.builder().build();\n```\n\nThe most straightforward way to create a [`JsonValue`](segmentflow-ai-java-core/src/main/kotlin/com/segmentflow/api/core/Values.kt) is using its `from(...)` method:\n\n```java\nimport com.segmentflow.api.core.JsonValue;\nimport java.util.List;\nimport java.util.Map;\n\n// Create primitive JSON values\nJsonValue nullValue = JsonValue.from(null);\nJsonValue booleanValue = JsonValue.from(true);\nJsonValue numberValue = JsonValue.from(42);\nJsonValue stringValue = JsonValue.from("Hello World!");\n\n// Create a JSON array value equivalent to `["Hello", "World"]`\nJsonValue arrayValue = JsonValue.from(List.of(\n "Hello", "World"\n));\n\n// Create a JSON object value equivalent to `{ "a": 1, "b": 2 }`\nJsonValue objectValue = JsonValue.from(Map.of(\n "a", 1,\n "b", 2\n));\n\n// Create an arbitrarily nested JSON equivalent to:\n// {\n// "a": [1, 2],\n// "b": [3, 4]\n// }\nJsonValue complexValue = JsonValue.from(Map.of(\n "a", List.of(\n 1, 2\n ),\n "b", List.of(\n 3, 4\n )\n));\n```\n\nNormally a `Builder` class\'s `build` method will throw [`IllegalStateException`](https://docs.oracle.com/javase/8/docs/api/java/lang/IllegalStateException.html) if any required parameter or property is unset.\n\nTo forcibly omit a required parameter or property, pass [`JsonMissing`](segmentflow-ai-java-core/src/main/kotlin/com/segmentflow/api/core/Values.kt):\n\n```java\nimport com.segmentflow.api.core.JsonMissing;\nimport com.segmentflow.api.models.v1.profiles.ProfileRetrieveParams;\n\nProfileRetrieveParams params = ProfileRetrieveParams.builder()\n .profileId(JsonMissing.of())\n .build();\n```\n\n### Response properties\n\nTo access undocumented response properties, call the `_additionalProperties()` method:\n\n```java\nimport com.segmentflow.api.core.JsonValue;\nimport java.util.Map;\n\nMap<String, JsonValue> additionalProperties = client.v1().profiles().retrieve(params)._additionalProperties();\nJsonValue secretPropertyValue = additionalProperties.get("secretProperty");\n\nString result = secretPropertyValue.accept(new JsonValue.Visitor<>() {\n @Override\n public String visitNull() {\n return "It\'s null!";\n }\n\n @Override\n public String visitBoolean(boolean value) {\n return "It\'s a boolean!";\n }\n\n @Override\n public String visitNumber(Number value) {\n return "It\'s a number!";\n }\n\n // Other methods include `visitMissing`, `visitString`, `visitArray`, and `visitObject`\n // The default implementation of each unimplemented method delegates to `visitDefault`, which throws by default, but can also be overridden\n});\n```\n\nTo access a property\'s raw JSON value, which may be undocumented, call its `_` prefixed method:\n\n```java\nimport com.segmentflow.api.core.JsonField;\nimport java.util.Optional;\n\nJsonField<Object> field = client.v1().profiles().retrieve(params)._field();\n\nif (field.isMissing()) {\n // The property is absent from the JSON response\n} else if (field.isNull()) {\n // The property was set to literal null\n} else {\n // Check if value was provided as a string\n // Other methods include `asNumber()`, `asBoolean()`, etc.\n Optional<String> jsonString = field.asString();\n\n // Try to deserialize into a custom type\n MyClass myObject = field.asUnknown().orElseThrow().convert(MyClass.class);\n}\n```\n\n### Response validation\n\nIn rare cases, the API may return a response that doesn\'t match the expected type. For example, the SDK may expect a property to contain a `String`, but the API could return something else.\n\nBy default, the SDK will not throw an exception in this case. It will throw [`SegmentflowAiInvalidDataException`](segmentflow-ai-java-core/src/main/kotlin/com/segmentflow/api/errors/SegmentflowAiInvalidDataException.kt) only if you directly access the property.\n\nValidating the response is _not_ forwards compatible with new types from the API for existing fields.\n\nIf you would still prefer to check that the response is completely well-typed upfront, then either call `validate()`:\n\n```java\nimport com.segmentflow.api.models.v1.profiles.Profile;\n\nProfile profile = client.v1().profiles().retrieve(params).validate();\n```\n\nOr configure the method call to validate the response using the `responseValidation` method:\n\n```java\nimport com.segmentflow.api.models.v1.profiles.Profile;\n\nProfile profile = client.v1().profiles().retrieve(RequestOptions.builder().responseValidation(true).build());\n```\n\nOr configure the default for all method calls at the client level:\n\n```java\nimport com.segmentflow.api.client.SegmentflowAiClient;\nimport com.segmentflow.api.client.okhttp.SegmentflowAiOkHttpClient;\n\nSegmentflowAiClient client = SegmentflowAiOkHttpClient.builder()\n .fromEnv()\n .responseValidation(true)\n .build();\n```\n\n## FAQ\n\n### Why don\'t you use plain `enum` classes?\n\nJava `enum` classes are not trivially [forwards compatible](https://www.stainless.com/blog/making-java-enums-forwards-compatible). Using them in the SDK could cause runtime exceptions if the API is updated to respond with a new enum value.\n\n### Why do you represent fields using `JsonField<T>` instead of just plain `T`?\n\nUsing `JsonField<T>` enables a few features:\n\n- Allowing usage of [undocumented API functionality](#undocumented-api-functionality)\n- Lazily [validating the API response against the expected shape](#response-validation)\n- Representing absent vs explicitly null values\n\n### Why don\'t you use [`data` classes](https://kotlinlang.org/docs/data-classes.html)?\n\nIt is not [backwards compatible to add new fields to a data class](https://kotlinlang.org/docs/api-guidelines-backward-compatibility.html#avoid-using-data-classes-in-your-api) and we don\'t want to introduce a breaking change every time we add a field to a class.\n\n### Why don\'t you use checked exceptions?\n\nChecked exceptions are widely considered a mistake in the Java programming language. In fact, they were omitted from Kotlin for this reason.\n\nChecked exceptions:\n\n- Are verbose to handle\n- Encourage error handling at the wrong level of abstraction, where nothing can be done about the error\n- Are tedious to propagate due to the [function coloring problem](https://journal.stuffwithstuff.com/2015/02/01/what-color-is-your-function)\n- Don\'t play well with lambdas (also due to the function coloring problem)\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 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.)_\n2. 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/segmentflow/segmentflow-java/issues) with questions, bugs, or suggestions.\n',
1644
+ },
1645
+ {
1646
+ language: 'php',
1647
+ content: '# Segmentflow AI PHP API Library\n\nThe Segmentflow AI PHP library provides convenient access to the Segmentflow AI REST API from any PHP 8.1.0+ application.\n\n## Installation\n\nTo use this package, install via Composer by adding the following to your application\'s `composer.json`:\n\n<!-- x-release-please-start-version -->\n```json\n{\n "repositories": [\n {\n "type": "vcs",\n "url": "git@github.com:segmentflow/segmentflow-php.git"\n }\n ],\n "require": {\n "segmentflow/segmentflow": "dev-main"\n }\n}\n```\n<!-- x-release-please-end -->\n\n## Usage\n\n```php\n<?php\n\n$client = new Client(\n apiKey: getenv(\'SEGMENTFLOW_API_KEY\') ?: \'My API Key\',\n environment: \'development\',\n);\n\n$profile = $client->v1->profiles->retrieve(\'REPLACE_ME\');\n\nvar_dump($profile->id);\n```',
1648
+ },
1649
+ {
1650
+ language: 'python',
1651
+ content: '# Segmentflow AI Python API library\n\n<!-- prettier-ignore -->\n[![PyPI version](https://img.shields.io/pypi/v/segmentflow.svg?label=pypi%20(stable))](https://pypi.org/project/segmentflow/)\n\nThe Segmentflow AI Python library provides convenient access to the Segmentflow AI 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 Segmentflow AI 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=%40segmentflow%2Fsegmentflow-mcp&config=eyJjb21tYW5kIjoibnB4IiwiYXJncyI6WyIteSIsIkBzZWdtZW50Zmxvdy9zZWdtZW50Zmxvdy1tY3AiXSwiZW52Ijp7IlNFR01FTlRGTE9XX0FQSV9LRVkiOiJNeSBBUEkgS2V5In19)\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%40segmentflow%2Fsegmentflow-mcp%22%2C%22command%22%3A%22npx%22%2C%22args%22%3A%5B%22-y%22%2C%22%40segmentflow%2Fsegmentflow-mcp%22%5D%2C%22env%22%3A%7B%22SEGMENTFLOW_API_KEY%22%3A%22My%20API%20Key%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 [segmentflow.ai](https://segmentflow.ai/docs). The full API of this library can be found in [api.md](api.md).\n\n## Installation\n\n```sh\n# install from the production repo\npip install git+ssh://git@github.com/segmentflow/segmentflow-python.git\n```\n> [!NOTE]\n> Once this package is [published to PyPI](https://www.stainless.com/docs/guides/publish), this will become: `pip install segmentflow`\n\n## Usage\n\nThe full API of this library can be found in [api.md](api.md).\n\n```python\nimport os\nfrom segmentflow import SegmentflowAI\n\nclient = SegmentflowAI(\n api_key=os.environ.get("SEGMENTFLOW_API_KEY"), # This is the default and can be omitted\n # defaults to "production".\n environment="development",\n)\n\nprofile = client.v1.profiles.retrieve(\n "REPLACE_ME",\n)\nprint(profile.id)\n```\n\nWhile you can provide an `api_key` keyword argument,\nwe recommend using [python-dotenv](https://pypi.org/project/python-dotenv/)\nto add `SEGMENTFLOW_API_KEY="My API Key"` to your `.env` file\nso that your API Key is not stored in source control.\n\n## Async usage\n\nSimply import `AsyncSegmentflowAI` instead of `SegmentflowAI` and use `await` with each API call:\n\n```python\nimport os\nimport asyncio\nfrom segmentflow import AsyncSegmentflowAI\n\nclient = AsyncSegmentflowAI(\n api_key=os.environ.get("SEGMENTFLOW_API_KEY"), # This is the default and can be omitted\n # defaults to "production".\n environment="development",\n)\n\nasync def main() -> None:\n profile = await client.v1.profiles.retrieve(\n "REPLACE_ME",\n )\n print(profile.id)\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 the production repo\npip install \'segmentflow[aiohttp] @ git+ssh://git@github.com/segmentflow/segmentflow-python.git\'\n```\n\nThen you can enable it by instantiating the client with `http_client=DefaultAioHttpClient()`:\n\n```python\nimport os\nimport asyncio\nfrom segmentflow import DefaultAioHttpClient\nfrom segmentflow import AsyncSegmentflowAI\n\nasync def main() -> None:\n async with AsyncSegmentflowAI(\n api_key=os.environ.get("SEGMENTFLOW_API_KEY"), # This is the default and can be omitted\n http_client=DefaultAioHttpClient(),\n) as client:\n profile = await client.v1.profiles.retrieve(\n "REPLACE_ME",\n )\n print(profile.id)\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 segmentflow import SegmentflowAI\n\nclient = SegmentflowAI()\n\nbrand_kit = client.v1.brand_kit.create(\n name="name",\n brand_kit={},\n)\nprint(brand_kit.brand_kit)\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 `segmentflow.APIConnectionError` is raised.\n\nWhen the API returns a non-success status code (that is, 4xx or 5xx\nresponse), a subclass of `segmentflow.APIStatusError` is raised, containing `status_code` and `response` properties.\n\nAll errors inherit from `segmentflow.APIError`.\n\n```python\nimport segmentflow\nfrom segmentflow import SegmentflowAI\n\nclient = SegmentflowAI()\n\ntry:\n client.v1.profiles.list(\n limit=10,\n search="user@example.com",\n )\nexcept segmentflow.APIConnectionError as e:\n print("The server could not be reached")\n print(e.__cause__) # an underlying Exception, likely raised within httpx.\nexcept segmentflow.RateLimitError as e:\n print("A 429 status code was received; we should back off a bit.")\nexcept segmentflow.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 segmentflow import SegmentflowAI\n\n# Configure the default for all requests:\nclient = SegmentflowAI(\n # default is 2\n max_retries=0,\n)\n\n# Or, configure per-request:\nclient.with_options(max_retries = 5).v1.profiles.list(\n limit=10,\n search="user@example.com",\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 segmentflow import SegmentflowAI\n\n# Configure the default for all requests:\nclient = SegmentflowAI(\n # 20 seconds (default is 1 minute)\n timeout=20.0,\n)\n\n# More granular control:\nclient = SegmentflowAI(\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).v1.profiles.list(\n limit=10,\n search="user@example.com",\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 `SEGMENTFLOW_AI_LOG` to `info`.\n\n```shell\n$ export SEGMENTFLOW_AI_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 segmentflow import SegmentflowAI\n\nclient = SegmentflowAI()\nresponse = client.v1.profiles.with_raw_response.list(\n limit=10,\n search="user@example.com",\n)\nprint(response.headers.get(\'X-My-Header\'))\n\nprofile = response.parse() # get the object that `v1.profiles.list()` would have returned\nprint(profile.profile_count)\n```\n\nThese methods return an [`APIResponse`](https://github.com/segmentflow/segmentflow-python/tree/main/src/segmentflow/_response.py) object.\n\nThe async client returns an [`AsyncAPIResponse`](https://github.com/segmentflow/segmentflow-python/tree/main/src/segmentflow/_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.v1.profiles.with_streaming_response.list(\n limit=10,\n search="user@example.com",\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 segmentflow import SegmentflowAI, DefaultHttpxClient\n\nclient = SegmentflowAI(\n # Or use the `SEGMENTFLOW_AI_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 segmentflow import SegmentflowAI\n\nwith SegmentflowAI() 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/segmentflow/segmentflow-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 segmentflow\nprint(segmentflow.__version__)\n```\n\n## Requirements\n\nPython 3.9 or higher.\n\n## Contributing\n\nSee [the contributing documentation](./CONTRIBUTING.md).\n',
1652
+ },
370
1653
  {
371
1654
  language: 'typescript',
372
- content: "# Segmentflow AI TypeScript API Library\n\n[![NPM version](https://img.shields.io/npm/v/@segmentflow/segmentflow-typescript.svg?label=npm%20(stable))](https://npmjs.org/package/@segmentflow/segmentflow-typescript) ![npm bundle size](https://img.shields.io/bundlephobia/minzip/@segmentflow/segmentflow-typescript)\n\nThis library provides convenient access to the Segmentflow AI REST API from server-side TypeScript or JavaScript.\n\n\n\nThe REST API documentation can be found on [segmentflow.ai](https://segmentflow.ai/docs). 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 Segmentflow AI 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=%40segmentflow%2Fsegmentflow-mcp&config=eyJjb21tYW5kIjoibnB4IiwiYXJncyI6WyIteSIsIkBzZWdtZW50Zmxvdy9zZWdtZW50Zmxvdy1tY3AiXSwiZW52Ijp7IlNFR01FTlRGTE9XX0FQSV9LRVkiOiJNeSBBUEkgS2V5In19)\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%40segmentflow%2Fsegmentflow-mcp%22%2C%22command%22%3A%22npx%22%2C%22args%22%3A%5B%22-y%22%2C%22%40segmentflow%2Fsegmentflow-mcp%22%5D%2C%22env%22%3A%7B%22SEGMENTFLOW_API_KEY%22%3A%22My%20API%20Key%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 @segmentflow/segmentflow-typescript\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 SegmentflowAI from '@segmentflow/segmentflow-typescript';\n\nconst client = new SegmentflowAI({\n apiKey: process.env['SEGMENTFLOW_API_KEY'], // This is the default and can be omitted\n environment: 'development', // defaults to 'production'\n});\n\nconst response = await client.v1.public.journeys.trigger('REPLACE_ME', {\n profile: { email: 'user@example.com' },\n});\n\nconsole.log(response.runId);\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 SegmentflowAI from '@segmentflow/segmentflow-typescript';\n\nconst client = new SegmentflowAI({\n apiKey: process.env['SEGMENTFLOW_API_KEY'], // This is the default and can be omitted\n environment: 'development', // defaults to 'production'\n});\n\nconst params: SegmentflowAI.V1.Public.JourneyTriggerParams = {\n profile: { email: 'user@example.com' },\n};\nconst response: SegmentflowAI.V1.Public.JourneyTriggerResponse =\n await client.v1.public.journeys.trigger('REPLACE_ME', 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 response = await client.v1.public.journeys\n .trigger('REPLACE_ME', { profile: { email: 'user@example.com' } })\n .catch(async (err) => {\n if (err instanceof SegmentflowAI.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 SegmentflowAI({\n maxRetries: 0, // default is 2\n});\n\n// Or, configure per-request:\nawait client.v1.public.journeys.trigger('REPLACE_ME', { profile: { email: 'user@example.com' } }, {\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 SegmentflowAI({\n timeout: 20 * 1000, // 20 seconds (default is 1 minute)\n});\n\n// Override per-request:\nawait client.v1.public.journeys.trigger('REPLACE_ME', { profile: { email: 'user@example.com' } }, {\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 SegmentflowAI();\n\nconst response = await client.v1.public.journeys\n .trigger('REPLACE_ME', { profile: { email: 'user@example.com' } })\n .asResponse();\nconsole.log(response.headers.get('X-My-Header'));\nconsole.log(response.statusText); // access the underlying Response object\n\nconst { data: response, response: raw } = await client.v1.public.journeys\n .trigger('REPLACE_ME', { profile: { email: 'user@example.com' } })\n .withResponse();\nconsole.log(raw.headers.get('X-My-Header'));\nconsole.log(response.runId);\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 `SEGMENTFLOW_AI_LOG` environment variable\n2. Using the `logLevel` client option (overrides the environment variable if set)\n\n```ts\nimport SegmentflowAI from '@segmentflow/segmentflow-typescript';\n\nconst client = new SegmentflowAI({\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 SegmentflowAI from '@segmentflow/segmentflow-typescript';\nimport pino from 'pino';\n\nconst logger = pino();\n\nconst client = new SegmentflowAI({\n logger: logger.child({ name: 'SegmentflowAI' }),\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.v1.public.journeys.trigger({\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 SegmentflowAI from '@segmentflow/segmentflow-typescript';\nimport fetch from 'my-fetch';\n\nconst client = new SegmentflowAI({ 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 SegmentflowAI from '@segmentflow/segmentflow-typescript';\n\nconst client = new SegmentflowAI({\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 SegmentflowAI from '@segmentflow/segmentflow-typescript';\nimport * as undici from 'undici';\n\nconst proxyAgent = new undici.ProxyAgent('http://localhost:8888');\nconst client = new SegmentflowAI({\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 SegmentflowAI from '@segmentflow/segmentflow-typescript';\n\nconst client = new SegmentflowAI({\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 SegmentflowAI from 'npm:@segmentflow/segmentflow-typescript';\n\nconst httpClient = Deno.createHttpClient({ proxy: { url: 'http://localhost:8888' } });\nconst client = new SegmentflowAI({\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/segmentflow/segmentflow-typescript/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",
1655
+ content: "# Segmentflow AI TypeScript API Library\n\n[![NPM version](https://img.shields.io/npm/v/@segmentflow/segmentflow-typescript.svg?label=npm%20(stable))](https://npmjs.org/package/@segmentflow/segmentflow-typescript) ![npm bundle size](https://img.shields.io/bundlephobia/minzip/@segmentflow/segmentflow-typescript)\n\nThis library provides convenient access to the Segmentflow AI REST API from server-side TypeScript or JavaScript.\n\n\n\nThe REST API documentation can be found on [segmentflow.ai](https://segmentflow.ai/docs). 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 Segmentflow AI 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=%40segmentflow%2Fsegmentflow-mcp&config=eyJjb21tYW5kIjoibnB4IiwiYXJncyI6WyIteSIsIkBzZWdtZW50Zmxvdy9zZWdtZW50Zmxvdy1tY3AiXSwiZW52Ijp7IlNFR01FTlRGTE9XX0FQSV9LRVkiOiJNeSBBUEkgS2V5In19)\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%40segmentflow%2Fsegmentflow-mcp%22%2C%22command%22%3A%22npx%22%2C%22args%22%3A%5B%22-y%22%2C%22%40segmentflow%2Fsegmentflow-mcp%22%5D%2C%22env%22%3A%7B%22SEGMENTFLOW_API_KEY%22%3A%22My%20API%20Key%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 @segmentflow/segmentflow-typescript\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 SegmentflowAI from '@segmentflow/segmentflow-typescript';\n\nconst client = new SegmentflowAI({\n apiKey: process.env['SEGMENTFLOW_API_KEY'], // This is the default and can be omitted\n environment: 'development', // defaults to 'production'\n});\n\nconst profile = await client.v1.profiles.retrieve('REPLACE_ME');\n\nconsole.log(profile.id);\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 SegmentflowAI from '@segmentflow/segmentflow-typescript';\n\nconst client = new SegmentflowAI({\n apiKey: process.env['SEGMENTFLOW_API_KEY'], // This is the default and can be omitted\n environment: 'development', // defaults to 'production'\n});\n\nconst params: SegmentflowAI.V1.ProfileListParams = { limit: 10, search: 'user@example.com' };\nconst profileList: SegmentflowAI.V1.ProfileList = await client.v1.profiles.list(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 profileList = await client.v1.profiles\n .list({ limit: 10, search: 'user@example.com' })\n .catch(async (err) => {\n if (err instanceof SegmentflowAI.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 SegmentflowAI({\n maxRetries: 0, // default is 2\n});\n\n// Or, configure per-request:\nawait client.v1.profiles.list({ limit: 10, search: 'user@example.com' }, {\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 SegmentflowAI({\n timeout: 20 * 1000, // 20 seconds (default is 1 minute)\n});\n\n// Override per-request:\nawait client.v1.profiles.list({ limit: 10, search: 'user@example.com' }, {\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 SegmentflowAI();\n\nconst response = await client.v1.profiles\n .list({ limit: 10, search: 'user@example.com' })\n .asResponse();\nconsole.log(response.headers.get('X-My-Header'));\nconsole.log(response.statusText); // access the underlying Response object\n\nconst { data: profileList, response: raw } = await client.v1.profiles\n .list({ limit: 10, search: 'user@example.com' })\n .withResponse();\nconsole.log(raw.headers.get('X-My-Header'));\nconsole.log(profileList.profileCount);\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 `SEGMENTFLOW_AI_LOG` environment variable\n2. Using the `logLevel` client option (overrides the environment variable if set)\n\n```ts\nimport SegmentflowAI from '@segmentflow/segmentflow-typescript';\n\nconst client = new SegmentflowAI({\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 SegmentflowAI from '@segmentflow/segmentflow-typescript';\nimport pino from 'pino';\n\nconst logger = pino();\n\nconst client = new SegmentflowAI({\n logger: logger.child({ name: 'SegmentflowAI' }),\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.v1.profiles.retrieve({\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 SegmentflowAI from '@segmentflow/segmentflow-typescript';\nimport fetch from 'my-fetch';\n\nconst client = new SegmentflowAI({ 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 SegmentflowAI from '@segmentflow/segmentflow-typescript';\n\nconst client = new SegmentflowAI({\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 SegmentflowAI from '@segmentflow/segmentflow-typescript';\nimport * as undici from 'undici';\n\nconst proxyAgent = new undici.ProxyAgent('http://localhost:8888');\nconst client = new SegmentflowAI({\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 SegmentflowAI from '@segmentflow/segmentflow-typescript';\n\nconst client = new SegmentflowAI({\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 SegmentflowAI from 'npm:@segmentflow/segmentflow-typescript';\n\nconst httpClient = Deno.createHttpClient({ proxy: { url: 'http://localhost:8888' } });\nconst client = new SegmentflowAI({\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/segmentflow/segmentflow-typescript/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",
373
1656
  },
374
1657
  ];
375
1658
  const INDEX_OPTIONS = {