@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
@@ -51,395 +51,1926 @@ type SearchResult = {
51
51
 
52
52
  const EMBEDDED_METHODS: MethodEntry[] = [
53
53
  {
54
- name: 'get_brand_kit',
55
- endpoint: '/api/v1/public/brand-kit',
54
+ name: 'list',
55
+ endpoint: '/api/v1/profiles',
56
+ httpMethod: 'post',
57
+ summary: 'List profiles',
58
+ description: 'Get paginated list of Profiles with optional filtering',
59
+ stainlessPath: '(resource) v1.profiles > (method) list',
60
+ qualified: 'client.v1.profiles.list',
61
+ params: [
62
+ 'cursor?: string;',
63
+ "deliverySuppressionReasonFilter?: 'HardBounced' | 'Complained' | 'SoftBounceSuppressed'[];",
64
+ "deliverySuppressionStatus?: 'eligible' | 'suppressed';",
65
+ "direction?: 'before' | 'after';",
66
+ 'limit?: number;',
67
+ 'profileIds?: string[];',
68
+ 'profilePropertyFilter?: { id: string; values: string[]; }[];',
69
+ 'search?: string;',
70
+ 'segmentFilter?: string[];',
71
+ "sourceFilter?: 'form_submission' | 'csv_import' | 'api_sync' | 'sdk' | 'manual_edit' | 'computed'[];",
72
+ ],
73
+ response:
74
+ '{ 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; }',
75
+ markdown:
76
+ "## 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```",
77
+ perLanguage: {
78
+ typescript: {
79
+ method: 'client.v1.profiles.list',
80
+ example:
81
+ "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);",
82
+ },
83
+ python: {
84
+ method: 'v1.profiles.list',
85
+ example:
86
+ '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)',
87
+ },
88
+ java: {
89
+ method: 'v1().profiles().list',
90
+ example:
91
+ '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}',
92
+ },
93
+ go: {
94
+ method: 'client.V1.Profiles.List',
95
+ example:
96
+ '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',
97
+ },
98
+ cli: {
99
+ method: 'profiles list',
100
+ example: "segmentflow v1:profiles list \\\n --api-key 'My API Key'",
101
+ },
102
+ php: {
103
+ method: 'v1->profiles->list',
104
+ example:
105
+ "<?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);",
106
+ },
107
+ http: {
108
+ example:
109
+ 'curl https://api.segmentflow.ai/api/v1/profiles \\\n -X POST \\\n -H "x-api-key: $SEGMENTFLOW_API_KEY"',
110
+ },
111
+ },
112
+ },
113
+ {
114
+ name: 'retrieve',
115
+ endpoint: '/api/v1/profiles/{profileId}',
116
+ httpMethod: 'get',
117
+ summary: 'Get profile',
118
+ description: 'Get a single Profile by ID',
119
+ stainlessPath: '(resource) v1.profiles > (method) retrieve',
120
+ qualified: 'client.v1.profiles.retrieve',
121
+ params: ['profileId: string;'],
122
+ response:
123
+ "{ 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; }",
124
+ markdown:
125
+ "## 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```",
126
+ perLanguage: {
127
+ typescript: {
128
+ method: 'client.v1.profiles.retrieve',
129
+ example:
130
+ "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);",
131
+ },
132
+ python: {
133
+ method: 'v1.profiles.retrieve',
134
+ example:
135
+ '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)',
136
+ },
137
+ java: {
138
+ method: 'v1().profiles().retrieve',
139
+ example:
140
+ '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}',
141
+ },
142
+ go: {
143
+ method: 'client.V1.Profiles.Get',
144
+ example:
145
+ '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',
146
+ },
147
+ cli: {
148
+ method: 'profiles retrieve',
149
+ example: "segmentflow v1:profiles retrieve \\\n --api-key 'My API Key' \\\n --profile-id x",
150
+ },
151
+ php: {
152
+ method: 'v1->profiles->retrieve',
153
+ example:
154
+ "<?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);",
155
+ },
156
+ http: {
157
+ example:
158
+ 'curl https://api.segmentflow.ai/api/v1/profiles/$PROFILE_ID \\\n -H "x-api-key: $SEGMENTFLOW_API_KEY"',
159
+ },
160
+ },
161
+ },
162
+ {
163
+ name: 'delete',
164
+ endpoint: '/api/v1/profiles/{profileId}',
165
+ httpMethod: 'delete',
166
+ summary: 'Delete profile',
167
+ description: 'Delete a single Profile. Nullifies IdentityBridge rows and cascades to related tables.',
168
+ stainlessPath: '(resource) v1.profiles > (method) delete',
169
+ qualified: 'client.v1.profiles.delete',
170
+ params: ['profileId: string;'],
171
+ response: 'null',
172
+ markdown:
173
+ "## 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```",
174
+ perLanguage: {
175
+ typescript: {
176
+ method: 'client.v1.profiles.delete',
177
+ example:
178
+ "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);",
179
+ },
180
+ python: {
181
+ method: 'v1.profiles.delete',
182
+ example:
183
+ '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)',
184
+ },
185
+ java: {
186
+ method: 'v1().profiles().delete',
187
+ example:
188
+ '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}',
189
+ },
190
+ go: {
191
+ method: 'client.V1.Profiles.Delete',
192
+ example:
193
+ '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',
194
+ },
195
+ cli: {
196
+ method: 'profiles delete',
197
+ example: "segmentflow v1:profiles delete \\\n --api-key 'My API Key' \\\n --profile-id x",
198
+ },
199
+ php: {
200
+ method: 'v1->profiles->delete',
201
+ example:
202
+ "<?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);",
203
+ },
204
+ http: {
205
+ example:
206
+ 'curl https://api.segmentflow.ai/api/v1/profiles/$PROFILE_ID \\\n -X DELETE \\\n -H "x-api-key: $SEGMENTFLOW_API_KEY"',
207
+ },
208
+ },
209
+ },
210
+ {
211
+ name: 'bulk_delete',
212
+ endpoint: '/api/v1/profiles',
213
+ httpMethod: 'delete',
214
+ summary: 'Bulk delete profiles',
215
+ description: 'Delete multiple Profiles. Nullifies IdentityBridge rows and cascades to related tables.',
216
+ stainlessPath: '(resource) v1.profiles > (method) bulk_delete',
217
+ qualified: 'client.v1.profiles.bulkDelete',
218
+ params: ['ids: string[];'],
219
+ response: '{ deletedCount: number; }',
220
+ markdown:
221
+ "## 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```",
222
+ perLanguage: {
223
+ typescript: {
224
+ method: 'client.v1.profiles.bulkDelete',
225
+ example:
226
+ "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);",
227
+ },
228
+ python: {
229
+ method: 'v1.profiles.bulk_delete',
230
+ example:
231
+ '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)',
232
+ },
233
+ java: {
234
+ method: 'v1().profiles().bulkDelete',
235
+ example:
236
+ '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}',
237
+ },
238
+ go: {
239
+ method: 'client.V1.Profiles.BulkDelete',
240
+ example:
241
+ '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',
242
+ },
243
+ cli: {
244
+ method: 'profiles bulk_delete',
245
+ example: "segmentflow v1:profiles bulk-delete \\\n --api-key 'My API Key' \\\n --id x",
246
+ },
247
+ php: {
248
+ method: 'v1->profiles->bulkDelete',
249
+ example:
250
+ "<?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);",
251
+ },
252
+ http: {
253
+ example:
254
+ 'curl https://api.segmentflow.ai/api/v1/profiles \\\n -X DELETE \\\n -H "x-api-key: $SEGMENTFLOW_API_KEY"',
255
+ },
256
+ },
257
+ },
258
+ {
259
+ name: 'get_subscriptions',
260
+ endpoint: '/api/v1/profiles/{profileId}/subscriptions',
261
+ httpMethod: 'get',
262
+ summary: 'Get profile subscriptions',
263
+ description: 'Get subscription group statuses for a Profile',
264
+ stainlessPath: '(resource) v1.profiles > (method) get_subscriptions',
265
+ qualified: 'client.v1.profiles.getSubscriptions',
266
+ params: ['profileId: string;'],
267
+ response:
268
+ '{ profileId: string; subscriptionGroups: { id: string; isSubscribed: boolean; name: string; }[]; }',
269
+ markdown:
270
+ "## 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```",
271
+ perLanguage: {
272
+ typescript: {
273
+ method: 'client.v1.profiles.getSubscriptions',
274
+ example:
275
+ "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);",
276
+ },
277
+ python: {
278
+ method: 'v1.profiles.get_subscriptions',
279
+ example:
280
+ '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)',
281
+ },
282
+ java: {
283
+ method: 'v1().profiles().getSubscriptions',
284
+ example:
285
+ '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}',
286
+ },
287
+ go: {
288
+ method: 'client.V1.Profiles.GetSubscriptions',
289
+ example:
290
+ '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',
291
+ },
292
+ cli: {
293
+ method: 'profiles get_subscriptions',
294
+ example:
295
+ "segmentflow v1:profiles get-subscriptions \\\n --api-key 'My API Key' \\\n --profile-id x",
296
+ },
297
+ php: {
298
+ method: 'v1->profiles->getSubscriptions',
299
+ example:
300
+ "<?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);",
301
+ },
302
+ http: {
303
+ example:
304
+ 'curl https://api.segmentflow.ai/api/v1/profiles/$PROFILE_ID/subscriptions \\\n -H "x-api-key: $SEGMENTFLOW_API_KEY"',
305
+ },
306
+ },
307
+ },
308
+ {
309
+ name: 'list',
310
+ endpoint: '/api/v1/assets',
311
+ httpMethod: 'get',
312
+ summary: '',
313
+ description: '',
314
+ stainlessPath: '(resource) v1.assets > (method) list',
315
+ qualified: 'client.v1.assets.list',
316
+ response:
317
+ "{ 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; }",
318
+ markdown:
319
+ "## 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```",
320
+ perLanguage: {
321
+ typescript: {
322
+ method: 'client.v1.assets.list',
323
+ example:
324
+ "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);",
325
+ },
326
+ python: {
327
+ method: 'v1.assets.list',
328
+ example:
329
+ '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)',
330
+ },
331
+ java: {
332
+ method: 'v1().assets().list',
333
+ example:
334
+ '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}',
335
+ },
336
+ go: {
337
+ method: 'client.V1.Assets.List',
338
+ example:
339
+ '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',
340
+ },
341
+ cli: {
342
+ method: 'assets list',
343
+ example: "segmentflow v1:assets list \\\n --api-key 'My API Key'",
344
+ },
345
+ php: {
346
+ method: 'v1->assets->list',
347
+ example:
348
+ "<?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);",
349
+ },
350
+ http: {
351
+ example: 'curl https://api.segmentflow.ai/api/v1/assets \\\n -H "x-api-key: $SEGMENTFLOW_API_KEY"',
352
+ },
353
+ },
354
+ },
355
+ {
356
+ name: 'create',
357
+ endpoint: '/api/v1/assets',
358
+ httpMethod: 'post',
359
+ summary: '',
360
+ description: '',
361
+ stainlessPath: '(resource) v1.assets > (method) create',
362
+ qualified: 'client.v1.assets.create',
363
+ params: [
364
+ 'contentType: string;',
365
+ 'filename: string;',
366
+ 's3Key: string;',
367
+ 'size: number;',
368
+ "assetType?: 'content-image' | 'content-document' | 'lead-magnet';",
369
+ "imageType?: 'logo' | 'hero' | 'header' | 'product' | 'background' | 'icon' | 'other';",
370
+ 'websiteId?: string;',
371
+ ],
372
+ response:
373
+ "{ 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; }",
374
+ markdown:
375
+ "## 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```",
376
+ perLanguage: {
377
+ typescript: {
378
+ method: 'client.v1.assets.create',
379
+ example:
380
+ "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);",
381
+ },
382
+ python: {
383
+ method: 'v1.assets.create',
384
+ example:
385
+ '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)',
386
+ },
387
+ java: {
388
+ method: 'v1().assets().create',
389
+ example:
390
+ '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}',
391
+ },
392
+ go: {
393
+ method: 'client.V1.Assets.New',
394
+ example:
395
+ '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',
396
+ },
397
+ cli: {
398
+ method: 'assets create',
399
+ example:
400
+ "segmentflow v1:assets create \\\n --api-key 'My API Key' \\\n --content-type x \\\n --filename x \\\n --s3-key x \\\n --size 0",
401
+ },
402
+ php: {
403
+ method: 'v1->assets->create',
404
+ example:
405
+ "<?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);",
406
+ },
407
+ http: {
408
+ example:
409
+ '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 }\'',
410
+ },
411
+ },
412
+ },
413
+ {
414
+ name: 'request_upload',
415
+ endpoint: '/api/v1/assets/upload-request',
416
+ httpMethod: 'post',
417
+ summary: '',
418
+ description: '',
419
+ stainlessPath: '(resource) v1.assets > (method) request_upload',
420
+ qualified: 'client.v1.assets.requestUpload',
421
+ params: [
422
+ 'contentType: string;',
423
+ 'filename: string;',
424
+ 'size: number;',
425
+ "assetType?: 'content-image' | 'content-document' | 'lead-magnet';",
426
+ ],
427
+ response: '{ assetId: string; expiresAt: string; headers: object; uploadUrl: string; }',
428
+ markdown:
429
+ "## 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```",
430
+ perLanguage: {
431
+ typescript: {
432
+ method: 'client.v1.assets.requestUpload',
433
+ example:
434
+ "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);",
435
+ },
436
+ python: {
437
+ method: 'v1.assets.request_upload',
438
+ example:
439
+ '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)',
440
+ },
441
+ java: {
442
+ method: 'v1().assets().requestUpload',
443
+ example:
444
+ '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}',
445
+ },
446
+ go: {
447
+ method: 'client.V1.Assets.RequestUpload',
448
+ example:
449
+ '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',
450
+ },
451
+ cli: {
452
+ method: 'assets request_upload',
453
+ example:
454
+ "segmentflow v1:assets request-upload \\\n --api-key 'My API Key' \\\n --content-type x \\\n --filename x \\\n --size 9007199254740991",
455
+ },
456
+ php: {
457
+ method: 'v1->assets->requestUpload',
458
+ example:
459
+ "<?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);",
460
+ },
461
+ http: {
462
+ example:
463
+ '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 }\'',
464
+ },
465
+ },
466
+ },
467
+ {
468
+ name: 'get_upload_url',
469
+ endpoint: '/api/v1/assets/upload-url',
470
+ httpMethod: 'post',
471
+ summary: '',
472
+ description: '',
473
+ stainlessPath: '(resource) v1.assets > (method) get_upload_url',
474
+ qualified: 'client.v1.assets.getUploadURL',
475
+ params: [
476
+ "contentType: 'image/jpeg' | 'image/png' | 'text/csv' | 'application/vnd.ms-excel' | 'application/pdf';",
477
+ 'filename: string;',
478
+ 'size: number;',
479
+ "assetType?: 'content-image' | 'content-document' | 'lead-magnet';",
480
+ 'websiteId?: string;',
481
+ ],
482
+ response: '{ expiresIn: number; key: string; success: boolean; uploadUrl: string; }',
483
+ markdown:
484
+ "## 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```",
485
+ perLanguage: {
486
+ typescript: {
487
+ method: 'client.v1.assets.getUploadURL',
488
+ example:
489
+ "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);",
490
+ },
491
+ python: {
492
+ method: 'v1.assets.get_upload_url',
493
+ example:
494
+ '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)',
495
+ },
496
+ java: {
497
+ method: 'v1().assets().getUploadUrl',
498
+ example:
499
+ '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}',
500
+ },
501
+ go: {
502
+ method: 'client.V1.Assets.GetUploadURL',
503
+ example:
504
+ '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',
505
+ },
506
+ cli: {
507
+ method: 'assets get_upload_url',
508
+ example:
509
+ "segmentflow v1:assets get-upload-url \\\n --api-key 'My API Key' \\\n --content-type image/jpeg \\\n --filename x \\\n --size 20971520",
510
+ },
511
+ php: {
512
+ method: 'v1->assets->getUploadURL',
513
+ example:
514
+ "<?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);",
515
+ },
516
+ http: {
517
+ example:
518
+ '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 }\'',
519
+ },
520
+ },
521
+ },
522
+ {
523
+ name: 'finalize',
524
+ endpoint: '/api/v1/assets/{assetId}/finalize',
525
+ httpMethod: 'post',
526
+ summary: '',
527
+ description: '',
528
+ stainlessPath: '(resource) v1.assets > (method) finalize',
529
+ qualified: 'client.v1.assets.finalize',
530
+ params: [
531
+ 'assetId: string;',
532
+ 'altText?: string;',
533
+ 'description?: string;',
534
+ "imageType?: 'logo' | 'hero' | 'header' | 'product' | 'background' | 'icon' | 'other';",
535
+ ],
536
+ response:
537
+ '{ asset: { id: string; contentType: string; createdAt: string; filename: string; height: number; size: number; url: string; width: number; }; }',
538
+ markdown:
539
+ "## 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```",
540
+ perLanguage: {
541
+ typescript: {
542
+ method: 'client.v1.assets.finalize',
543
+ example:
544
+ "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);",
545
+ },
546
+ python: {
547
+ method: 'v1.assets.finalize',
548
+ example:
549
+ '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)',
550
+ },
551
+ java: {
552
+ method: 'v1().assets().finalize',
553
+ example:
554
+ '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}',
555
+ },
556
+ go: {
557
+ method: 'client.V1.Assets.Finalize',
558
+ example:
559
+ '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',
560
+ },
561
+ cli: {
562
+ method: 'assets finalize',
563
+ example:
564
+ "segmentflow v1:assets finalize \\\n --api-key 'My API Key' \\\n --asset-id 182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e",
565
+ },
566
+ php: {
567
+ method: 'v1->assets->finalize',
568
+ example:
569
+ "<?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);",
570
+ },
571
+ http: {
572
+ example:
573
+ 'curl https://api.segmentflow.ai/api/v1/assets/$ASSET_ID/finalize \\\n -X POST \\\n -H "x-api-key: $SEGMENTFLOW_API_KEY"',
574
+ },
575
+ },
576
+ },
577
+ {
578
+ name: 'update_metadata',
579
+ endpoint: '/api/v1/assets/{id}',
580
+ httpMethod: 'patch',
581
+ summary: '',
582
+ description: '',
583
+ stainlessPath: '(resource) v1.assets > (method) update_metadata',
584
+ qualified: 'client.v1.assets.updateMetadata',
585
+ params: [
586
+ 'id: string;',
587
+ 'altText?: string;',
588
+ 'description?: string;',
589
+ "imageType?: 'logo' | 'hero' | 'header' | 'product' | 'background' | 'icon' | 'other';",
590
+ 'tags?: string[];',
591
+ ],
592
+ response:
593
+ "{ 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; }",
594
+ markdown:
595
+ "## 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```",
596
+ perLanguage: {
597
+ typescript: {
598
+ method: 'client.v1.assets.updateMetadata',
599
+ example:
600
+ "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);",
601
+ },
602
+ python: {
603
+ method: 'v1.assets.update_metadata',
604
+ example:
605
+ '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)',
606
+ },
607
+ java: {
608
+ method: 'v1().assets().updateMetadata',
609
+ example:
610
+ '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}',
611
+ },
612
+ go: {
613
+ method: 'client.V1.Assets.UpdateMetadata',
614
+ example:
615
+ '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',
616
+ },
617
+ cli: {
618
+ method: 'assets update_metadata',
619
+ example:
620
+ "segmentflow v1:assets update-metadata \\\n --api-key 'My API Key' \\\n --id 182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e",
621
+ },
622
+ php: {
623
+ method: 'v1->assets->updateMetadata',
624
+ example:
625
+ "<?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);",
626
+ },
627
+ http: {
628
+ example:
629
+ 'curl https://api.segmentflow.ai/api/v1/assets/$ID \\\n -X PATCH \\\n -H "x-api-key: $SEGMENTFLOW_API_KEY"',
630
+ },
631
+ },
632
+ },
633
+ {
634
+ name: 'delete',
635
+ endpoint: '/api/v1/assets/{id}',
636
+ httpMethod: 'delete',
637
+ summary: '',
638
+ description: '',
639
+ stainlessPath: '(resource) v1.assets > (method) delete',
640
+ qualified: 'client.v1.assets.delete',
641
+ params: ['id: string;'],
642
+ response: '{ message: string; success: boolean; }',
643
+ markdown:
644
+ "## 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```",
645
+ perLanguage: {
646
+ typescript: {
647
+ method: 'client.v1.assets.delete',
648
+ example:
649
+ "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);",
650
+ },
651
+ python: {
652
+ method: 'v1.assets.delete',
653
+ example:
654
+ '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)',
655
+ },
656
+ java: {
657
+ method: 'v1().assets().delete',
658
+ example:
659
+ '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}',
660
+ },
661
+ go: {
662
+ method: 'client.V1.Assets.Delete',
663
+ example:
664
+ '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',
665
+ },
666
+ cli: {
667
+ method: 'assets delete',
668
+ example:
669
+ "segmentflow v1:assets delete \\\n --api-key 'My API Key' \\\n --id 182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e",
670
+ },
671
+ php: {
672
+ method: 'v1->assets->delete',
673
+ example:
674
+ "<?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);",
675
+ },
676
+ http: {
677
+ example:
678
+ 'curl https://api.segmentflow.ai/api/v1/assets/$ID \\\n -X DELETE \\\n -H "x-api-key: $SEGMENTFLOW_API_KEY"',
679
+ },
680
+ },
681
+ },
682
+ {
683
+ name: 'list',
684
+ endpoint: '/api/v1/brand-kit',
56
685
  httpMethod: 'get',
57
- summary: 'List brand kits',
58
- description: 'List brand kits',
59
- stainlessPath: '(resource) v1.public > (method) get_brand_kit',
60
- qualified: 'client.v1.public.getBrandKit',
686
+ summary: '',
687
+ description: '',
688
+ stainlessPath: '(resource) v1.brand_kit > (method) list',
689
+ qualified: 'client.v1.brandKit.list',
690
+ response:
691
+ "{ 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; }",
692
+ markdown:
693
+ "## 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```",
694
+ perLanguage: {
695
+ typescript: {
696
+ method: 'client.v1.brandKit.list',
697
+ example:
698
+ "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);",
699
+ },
700
+ python: {
701
+ method: 'v1.brand_kit.list',
702
+ example:
703
+ '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)',
704
+ },
705
+ java: {
706
+ method: 'v1().brandKit().list',
707
+ example:
708
+ '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}',
709
+ },
710
+ go: {
711
+ method: 'client.V1.BrandKit.List',
712
+ example:
713
+ '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',
714
+ },
715
+ cli: {
716
+ method: 'brand_kit list',
717
+ example: "segmentflow v1:brand-kit list \\\n --api-key 'My API Key'",
718
+ },
719
+ php: {
720
+ method: 'v1->brandKit->list',
721
+ example:
722
+ "<?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);",
723
+ },
724
+ http: {
725
+ example:
726
+ 'curl https://api.segmentflow.ai/api/v1/brand-kit \\\n -H "x-api-key: $SEGMENTFLOW_API_KEY"',
727
+ },
728
+ },
729
+ },
730
+ {
731
+ name: 'create',
732
+ endpoint: '/api/v1/brand-kit',
733
+ httpMethod: 'post',
734
+ summary: '',
735
+ description: '',
736
+ stainlessPath: '(resource) v1.brand_kit > (method) create',
737
+ qualified: 'client.v1.brandKit.create',
738
+ params: [
739
+ 'name: string;',
740
+ "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; };",
741
+ 'slug?: string;',
742
+ 'website?: string;',
743
+ ],
744
+ response: '{ brandId: string; message: string; slug: string; success: boolean; }',
745
+ markdown:
746
+ "## 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```",
747
+ perLanguage: {
748
+ typescript: {
749
+ method: 'client.v1.brandKit.create',
750
+ example:
751
+ "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);",
752
+ },
753
+ python: {
754
+ method: 'v1.brand_kit.create',
755
+ example:
756
+ '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)',
757
+ },
758
+ java: {
759
+ method: 'v1().brandKit().create',
760
+ example:
761
+ '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}',
762
+ },
763
+ go: {
764
+ method: 'client.V1.BrandKit.New',
765
+ example:
766
+ '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',
767
+ },
768
+ cli: {
769
+ method: 'brand_kit create',
770
+ example: "segmentflow v1:brand-kit create \\\n --api-key 'My API Key' \\\n --name name",
771
+ },
772
+ php: {
773
+ method: 'v1->brandKit->create',
774
+ example:
775
+ "<?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);",
776
+ },
777
+ http: {
778
+ example:
779
+ '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 }\'',
780
+ },
781
+ },
782
+ },
783
+ {
784
+ name: 'retrieve',
785
+ endpoint: '/api/v1/brand-kit/{brandId}',
786
+ httpMethod: 'get',
787
+ summary: '',
788
+ description: '',
789
+ stainlessPath: '(resource) v1.brand_kit > (method) retrieve',
790
+ qualified: 'client.v1.brandKit.retrieve',
791
+ params: ['brandId: string;'],
792
+ response:
793
+ "{ 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; }",
794
+ markdown:
795
+ "## 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```",
796
+ perLanguage: {
797
+ typescript: {
798
+ method: 'client.v1.brandKit.retrieve',
799
+ example:
800
+ "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);",
801
+ },
802
+ python: {
803
+ method: 'v1.brand_kit.retrieve',
804
+ example:
805
+ '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)',
806
+ },
807
+ java: {
808
+ method: 'v1().brandKit().retrieve',
809
+ example:
810
+ '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}',
811
+ },
812
+ go: {
813
+ method: 'client.V1.BrandKit.Get',
814
+ example:
815
+ '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',
816
+ },
817
+ cli: {
818
+ method: 'brand_kit retrieve',
819
+ example:
820
+ "segmentflow v1:brand-kit retrieve \\\n --api-key 'My API Key' \\\n --brand-id 182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e",
821
+ },
822
+ php: {
823
+ method: 'v1->brandKit->retrieve',
824
+ example:
825
+ "<?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);",
826
+ },
827
+ http: {
828
+ example:
829
+ 'curl https://api.segmentflow.ai/api/v1/brand-kit/$BRAND_ID \\\n -H "x-api-key: $SEGMENTFLOW_API_KEY"',
830
+ },
831
+ },
832
+ },
833
+ {
834
+ name: 'update',
835
+ endpoint: '/api/v1/brand-kit/{brandId}',
836
+ httpMethod: 'put',
837
+ summary: '',
838
+ description: '',
839
+ stainlessPath: '(resource) v1.brand_kit > (method) update',
840
+ qualified: 'client.v1.brandKit.update',
841
+ params: [
842
+ 'brandId: string;',
843
+ "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; };",
844
+ ],
61
845
  response:
62
- '{ 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; }',
846
+ "{ message: string; success: boolean; warnings?: { tokenIds: string[]; type: 'missing_legal_required'; }[]; }",
847
+ markdown:
848
+ "## 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```",
849
+ perLanguage: {
850
+ typescript: {
851
+ method: 'client.v1.brandKit.update',
852
+ example:
853
+ "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);",
854
+ },
855
+ python: {
856
+ method: 'v1.brand_kit.update',
857
+ example:
858
+ '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)',
859
+ },
860
+ java: {
861
+ method: 'v1().brandKit().update',
862
+ example:
863
+ '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}',
864
+ },
865
+ go: {
866
+ method: 'client.V1.BrandKit.Update',
867
+ example:
868
+ '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',
869
+ },
870
+ cli: {
871
+ method: 'brand_kit update',
872
+ example:
873
+ "segmentflow v1:brand-kit update \\\n --api-key 'My API Key' \\\n --brand-id 182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e \\\n --brand-kit '{}'",
874
+ },
875
+ php: {
876
+ method: 'v1->brandKit->update',
877
+ example:
878
+ "<?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);",
879
+ },
880
+ http: {
881
+ example:
882
+ '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 }\'',
883
+ },
884
+ },
885
+ },
886
+ {
887
+ name: 'rename',
888
+ endpoint: '/api/v1/brand-kit/{brandId}',
889
+ httpMethod: 'patch',
890
+ summary: '',
891
+ description: '',
892
+ stainlessPath: '(resource) v1.brand_kit > (method) rename',
893
+ qualified: 'client.v1.brandKit.rename',
894
+ params: ['brandId: string;', 'name: string;'],
895
+ response: '{ message: string; name: string; slug: string; success: boolean; }',
896
+ markdown:
897
+ "## 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```",
898
+ perLanguage: {
899
+ typescript: {
900
+ method: 'client.v1.brandKit.rename',
901
+ example:
902
+ "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);",
903
+ },
904
+ python: {
905
+ method: 'v1.brand_kit.rename',
906
+ example:
907
+ '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)',
908
+ },
909
+ java: {
910
+ method: 'v1().brandKit().rename',
911
+ example:
912
+ '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}',
913
+ },
914
+ go: {
915
+ method: 'client.V1.BrandKit.Rename',
916
+ example:
917
+ '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',
918
+ },
919
+ cli: {
920
+ method: 'brand_kit rename',
921
+ example:
922
+ "segmentflow v1:brand-kit rename \\\n --api-key 'My API Key' \\\n --brand-id 182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e \\\n --name name",
923
+ },
924
+ php: {
925
+ method: 'v1->brandKit->rename',
926
+ example:
927
+ "<?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);",
928
+ },
929
+ http: {
930
+ example:
931
+ '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 }\'',
932
+ },
933
+ },
934
+ },
935
+ {
936
+ name: 'delete',
937
+ endpoint: '/api/v1/brand-kit/{brandId}',
938
+ httpMethod: 'delete',
939
+ summary: '',
940
+ description: '',
941
+ stainlessPath: '(resource) v1.brand_kit > (method) delete',
942
+ qualified: 'client.v1.brandKit.delete',
943
+ params: ['brandId: string;'],
944
+ response: '{ message: string; success: boolean; templatesReassigned?: number; }',
945
+ markdown:
946
+ "## 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```",
947
+ perLanguage: {
948
+ typescript: {
949
+ method: 'client.v1.brandKit.delete',
950
+ example:
951
+ "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);",
952
+ },
953
+ python: {
954
+ method: 'v1.brand_kit.delete',
955
+ example:
956
+ '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)',
957
+ },
958
+ java: {
959
+ method: 'v1().brandKit().delete',
960
+ example:
961
+ '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}',
962
+ },
963
+ go: {
964
+ method: 'client.V1.BrandKit.Delete',
965
+ example:
966
+ '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',
967
+ },
968
+ cli: {
969
+ method: 'brand_kit delete',
970
+ example:
971
+ "segmentflow v1:brand-kit delete \\\n --api-key 'My API Key' \\\n --brand-id 182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e",
972
+ },
973
+ php: {
974
+ method: 'v1->brandKit->delete',
975
+ example:
976
+ "<?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);",
977
+ },
978
+ http: {
979
+ example:
980
+ 'curl https://api.segmentflow.ai/api/v1/brand-kit/$BRAND_ID \\\n -X DELETE \\\n -H "x-api-key: $SEGMENTFLOW_API_KEY"',
981
+ },
982
+ },
983
+ },
984
+ {
985
+ name: 'extract',
986
+ endpoint: '/api/v1/brand-kit/extract',
987
+ httpMethod: 'post',
988
+ summary: '',
989
+ description: '',
990
+ stainlessPath: '(resource) v1.brand_kit > (method) extract',
991
+ qualified: 'client.v1.brandKit.extract',
992
+ params: ['websiteUrl: string;'],
993
+ response: '{ message: string; success: boolean; workflowId: string; brandId?: string; }',
994
+ markdown:
995
+ "## 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```",
996
+ perLanguage: {
997
+ typescript: {
998
+ method: 'client.v1.brandKit.extract',
999
+ example:
1000
+ "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);",
1001
+ },
1002
+ python: {
1003
+ method: 'v1.brand_kit.extract',
1004
+ example:
1005
+ '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)',
1006
+ },
1007
+ java: {
1008
+ method: 'v1().brandKit().extract',
1009
+ example:
1010
+ '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}',
1011
+ },
1012
+ go: {
1013
+ method: 'client.V1.BrandKit.Extract',
1014
+ example:
1015
+ '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',
1016
+ },
1017
+ cli: {
1018
+ method: 'brand_kit extract',
1019
+ example:
1020
+ "segmentflow v1:brand-kit extract \\\n --api-key 'My API Key' \\\n --website-url https://example.com",
1021
+ },
1022
+ php: {
1023
+ method: 'v1->brandKit->extract',
1024
+ example:
1025
+ "<?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);",
1026
+ },
1027
+ http: {
1028
+ example:
1029
+ '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 }\'',
1030
+ },
1031
+ },
1032
+ },
1033
+ {
1034
+ name: 'extract_into',
1035
+ endpoint: '/api/v1/brand-kit/{brandId}/extract',
1036
+ httpMethod: 'post',
1037
+ summary: '',
1038
+ description: '',
1039
+ stainlessPath: '(resource) v1.brand_kit > (method) extract_into',
1040
+ qualified: 'client.v1.brandKit.extractInto',
1041
+ params: ['brandId: string;', 'websiteUrl: string;'],
1042
+ response: '{ message: string; success: boolean; workflowId: string; brandId?: string; }',
1043
+ markdown:
1044
+ "## 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```",
1045
+ perLanguage: {
1046
+ typescript: {
1047
+ method: 'client.v1.brandKit.extractInto',
1048
+ example:
1049
+ "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);",
1050
+ },
1051
+ python: {
1052
+ method: 'v1.brand_kit.extract_into',
1053
+ example:
1054
+ '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)',
1055
+ },
1056
+ java: {
1057
+ method: 'v1().brandKit().extractInto',
1058
+ example:
1059
+ '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}',
1060
+ },
1061
+ go: {
1062
+ method: 'client.V1.BrandKit.ExtractInto',
1063
+ example:
1064
+ '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',
1065
+ },
1066
+ cli: {
1067
+ method: 'brand_kit extract_into',
1068
+ example:
1069
+ "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",
1070
+ },
1071
+ php: {
1072
+ method: 'v1->brandKit->extractInto',
1073
+ example:
1074
+ "<?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);",
1075
+ },
1076
+ http: {
1077
+ example:
1078
+ '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 }\'',
1079
+ },
1080
+ },
1081
+ },
1082
+ {
1083
+ name: 'clear',
1084
+ endpoint: '/api/v1/brand-kit/{brandId}/clear',
1085
+ httpMethod: 'post',
1086
+ summary: '',
1087
+ description: '',
1088
+ stainlessPath: '(resource) v1.brand_kit > (method) clear',
1089
+ qualified: 'client.v1.brandKit.clear',
1090
+ params: ['brandId: string;'],
1091
+ response: '{ message: string; success: boolean; }',
1092
+ markdown:
1093
+ "## 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```",
1094
+ perLanguage: {
1095
+ typescript: {
1096
+ method: 'client.v1.brandKit.clear',
1097
+ example:
1098
+ "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);",
1099
+ },
1100
+ python: {
1101
+ method: 'v1.brand_kit.clear',
1102
+ example:
1103
+ '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)',
1104
+ },
1105
+ java: {
1106
+ method: 'v1().brandKit().clear',
1107
+ example:
1108
+ '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}',
1109
+ },
1110
+ go: {
1111
+ method: 'client.V1.BrandKit.Clear',
1112
+ example:
1113
+ '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',
1114
+ },
1115
+ cli: {
1116
+ method: 'brand_kit clear',
1117
+ example:
1118
+ "segmentflow v1:brand-kit clear \\\n --api-key 'My API Key' \\\n --brand-id 182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e",
1119
+ },
1120
+ php: {
1121
+ method: 'v1->brandKit->clear',
1122
+ example:
1123
+ "<?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);",
1124
+ },
1125
+ http: {
1126
+ example:
1127
+ 'curl https://api.segmentflow.ai/api/v1/brand-kit/$BRAND_ID/clear \\\n -X POST \\\n -H "x-api-key: $SEGMENTFLOW_API_KEY"',
1128
+ },
1129
+ },
1130
+ },
1131
+ {
1132
+ name: 'set_default',
1133
+ endpoint: '/api/v1/brand-kit/{brandId}/set-default',
1134
+ httpMethod: 'post',
1135
+ summary: '',
1136
+ description: '',
1137
+ stainlessPath: '(resource) v1.brand_kit > (method) set_default',
1138
+ qualified: 'client.v1.brandKit.setDefault',
1139
+ params: ['brandId: string;'],
1140
+ response: '{ message: string; success: boolean; }',
63
1141
  markdown:
64
- "## 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```",
1142
+ "## 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```",
65
1143
  perLanguage: {
66
1144
  typescript: {
67
- method: 'client.v1.public.getBrandKit',
1145
+ method: 'client.v1.brandKit.setDefault',
1146
+ example:
1147
+ "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);",
1148
+ },
1149
+ python: {
1150
+ method: 'v1.brand_kit.set_default',
1151
+ example:
1152
+ '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)',
1153
+ },
1154
+ java: {
1155
+ method: 'v1().brandKit().setDefault',
1156
+ example:
1157
+ '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}',
1158
+ },
1159
+ go: {
1160
+ method: 'client.V1.BrandKit.SetDefault',
1161
+ example:
1162
+ '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',
1163
+ },
1164
+ cli: {
1165
+ method: 'brand_kit set_default',
1166
+ example:
1167
+ "segmentflow v1:brand-kit set-default \\\n --api-key 'My API Key' \\\n --brand-id 182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e",
1168
+ },
1169
+ php: {
1170
+ method: 'v1->brandKit->setDefault',
68
1171
  example:
69
- "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);",
1172
+ "<?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);",
70
1173
  },
71
1174
  http: {
72
1175
  example:
73
- 'curl https://api.segmentflow.ai/api/v1/public/brand-kit \\\n -H "x-api-key: $SEGMENTFLOW_API_KEY"',
1176
+ 'curl https://api.segmentflow.ai/api/v1/brand-kit/$BRAND_ID/set-default \\\n -X POST \\\n -H "x-api-key: $SEGMENTFLOW_API_KEY"',
74
1177
  },
75
1178
  },
76
1179
  },
77
1180
  {
78
- name: 'trigger',
79
- endpoint: '/api/v1/public/journeys/{id}/trigger',
80
- httpMethod: 'post',
81
- summary: 'Trigger a journey for a profile',
1181
+ name: 'get_extraction_progress',
1182
+ endpoint: '/api/v1/brand-kit/{brandId}/extraction-progress',
1183
+ httpMethod: 'get',
1184
+ summary: 'Get brand kit extraction progress',
82
1185
  description:
83
- 'Start an API-triggerable journey for a single profile. Returns immediately; poll GET /journeys/runs/{runId} for status. Supports Idempotency-Key header.',
84
- stainlessPath: '(resource) v1.public.journeys > (method) trigger',
85
- qualified: 'client.v1.public.journeys.trigger',
86
- params: [
87
- 'id: string;',
88
- 'profile: { anonymousId?: string; email?: string; userId?: string; };',
89
- 'variables?: object;',
90
- ],
91
- response: "{ runId: string; status: 'queued' | 'running' | 'completed' | 'failed' | 'exited'; }",
1186
+ '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.',
1187
+ stainlessPath: '(resource) v1.brand_kit > (method) get_extraction_progress',
1188
+ qualified: 'client.v1.brandKit.getExtractionProgress',
1189
+ params: ['brandId: string;'],
1190
+ response:
1191
+ '{ completedSteps: number; currentStep: string; isComplete: boolean; isFailed: boolean; totalSteps: number; error?: string; }',
92
1192
  markdown:
93
- "## 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```",
1193
+ "## 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```",
94
1194
  perLanguage: {
95
1195
  typescript: {
96
- method: 'client.v1.public.journeys.trigger',
1196
+ method: 'client.v1.brandKit.getExtractionProgress',
1197
+ example:
1198
+ "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);",
1199
+ },
1200
+ python: {
1201
+ method: 'v1.brand_kit.get_extraction_progress',
1202
+ example:
1203
+ '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)',
1204
+ },
1205
+ java: {
1206
+ method: 'v1().brandKit().getExtractionProgress',
1207
+ example:
1208
+ '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}',
1209
+ },
1210
+ go: {
1211
+ method: 'client.V1.BrandKit.GetExtractionProgress',
1212
+ example:
1213
+ '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',
1214
+ },
1215
+ cli: {
1216
+ method: 'brand_kit get_extraction_progress',
1217
+ example:
1218
+ "segmentflow v1:brand-kit get-extraction-progress \\\n --api-key 'My API Key' \\\n --brand-id 182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e",
1219
+ },
1220
+ php: {
1221
+ method: 'v1->brandKit->getExtractionProgress',
97
1222
  example:
98
- "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);",
1223
+ "<?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);",
99
1224
  },
100
1225
  http: {
101
1226
  example:
102
- '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 }\'',
1227
+ 'curl https://api.segmentflow.ai/api/v1/brand-kit/$BRAND_ID/extraction-progress \\\n -H "x-api-key: $SEGMENTFLOW_API_KEY"',
103
1228
  },
104
1229
  },
105
1230
  },
106
1231
  {
107
- name: 'get_run_status',
108
- endpoint: '/api/v1/public/journeys/runs/{runId}',
1232
+ name: 'list',
1233
+ endpoint: '/api/v1/templates',
109
1234
  httpMethod: 'get',
110
- summary: 'Get journey run status',
111
- description: 'Fetch the status of a journey run previously created via POST /journeys/{id}/trigger.',
112
- stainlessPath: '(resource) v1.public.journeys > (method) get_run_status',
113
- qualified: 'client.v1.public.journeys.getRunStatus',
114
- params: ['runId: string;'],
1235
+ summary: 'List templates',
1236
+ description: 'Get all templates for the organization',
1237
+ stainlessPath: '(resource) v1.templates > (method) list',
1238
+ qualified: 'client.v1.templates.list',
1239
+ params: [
1240
+ "purpose?: 'General' | 'Newsletter' | 'Promotional' | 'Transactional' | 'LeadMagnetDelivery';",
1241
+ "status?: 'Active' | 'Archived'[];",
1242
+ ],
115
1243
  response:
116
- "{ completedAt: string; error: string; journeyId: string; profileId: string; runId: string; status: 'queued' | 'running' | 'completed' | 'failed' | 'exited'; triggeredAt: string; }",
1244
+ "{ 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; }[]",
117
1245
  markdown:
118
- "## 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```",
1246
+ "## 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```",
119
1247
  perLanguage: {
120
1248
  typescript: {
121
- method: 'client.v1.public.journeys.getRunStatus',
1249
+ method: 'client.v1.templates.list',
1250
+ example:
1251
+ "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);",
1252
+ },
1253
+ python: {
1254
+ method: 'v1.templates.list',
1255
+ example:
1256
+ '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)',
1257
+ },
1258
+ java: {
1259
+ method: 'v1().templates().list',
1260
+ example:
1261
+ '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}',
1262
+ },
1263
+ go: {
1264
+ method: 'client.V1.Templates.List',
1265
+ example:
1266
+ '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',
1267
+ },
1268
+ cli: {
1269
+ method: 'templates list',
1270
+ example: "segmentflow v1:templates list \\\n --api-key 'My API Key'",
1271
+ },
1272
+ php: {
1273
+ method: 'v1->templates->list',
122
1274
  example:
123
- "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);",
1275
+ "<?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);",
124
1276
  },
125
1277
  http: {
126
1278
  example:
127
- 'curl https://api.segmentflow.ai/api/v1/public/journeys/runs/$RUN_ID \\\n -H "x-api-key: $SEGMENTFLOW_API_KEY"',
1279
+ 'curl https://api.segmentflow.ai/api/v1/templates \\\n -H "x-api-key: $SEGMENTFLOW_API_KEY"',
128
1280
  },
129
1281
  },
130
1282
  },
131
1283
  {
132
1284
  name: 'create',
133
- endpoint: '/api/v1/public/broadcasts',
1285
+ endpoint: '/api/v1/templates',
134
1286
  httpMethod: 'post',
135
- summary: 'Create and send a broadcast',
136
- description:
137
- 'Create a broadcast and send immediately. v1 does not support scheduledAt; providing it returns 501. Supports Idempotency-Key header.',
138
- stainlessPath: '(resource) v1.public.broadcasts > (method) create',
139
- qualified: 'client.v1.public.broadcasts.create',
1287
+ summary: 'Create template',
1288
+ description: 'Create template',
1289
+ stainlessPath: '(resource) v1.templates > (method) create',
1290
+ qualified: 'client.v1.templates.create',
140
1291
  params: [
141
1292
  'name: string;',
142
- 'segmentId: string;',
143
- 'templateId: string;',
144
- 'scheduledAt?: string;',
145
- 'subject?: string;',
1293
+ 'type: string;',
1294
+ 'id?: string;',
1295
+ 'brandKitId?: string;',
1296
+ 'defaultSegmentId?: string;',
1297
+ "definition?: { body: { elements: object; root: string; }; codeFormat: 'json'; emailContentsType: 'Code'; type: 'Email'; from?: string; preheader?: string; renderVariables?: object; replyTo?: string; sensitiveTransactionalVariablePaths?: string[]; subject?: string; };",
1298
+ 'language?: string;',
1299
+ "purpose?: 'General' | 'Newsletter' | 'Promotional' | 'Transactional' | 'LeadMagnetDelivery';",
1300
+ 'senderProfileId?: string;',
1301
+ 'subType?: string;',
146
1302
  ],
147
1303
  response:
148
- "{ broadcastId: string; status: 'NotStarted' | 'InProgress' | 'Triggered' | 'Sent' | 'Failed' | 'Archived' | 'Warming' | 'Paused'; }",
1304
+ "{ 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[]; }; }",
149
1305
  markdown:
150
- "## 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```",
1306
+ "## 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```",
151
1307
  perLanguage: {
152
1308
  typescript: {
153
- method: 'client.v1.public.broadcasts.create',
1309
+ method: 'client.v1.templates.create',
1310
+ example:
1311
+ "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);",
1312
+ },
1313
+ python: {
1314
+ method: 'v1.templates.create',
1315
+ example:
1316
+ '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)',
1317
+ },
1318
+ java: {
1319
+ method: 'v1().templates().create',
1320
+ example:
1321
+ '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}',
1322
+ },
1323
+ go: {
1324
+ method: 'client.V1.Templates.New',
1325
+ example:
1326
+ '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',
1327
+ },
1328
+ cli: {
1329
+ method: 'templates create',
1330
+ example:
1331
+ "segmentflow v1:templates create \\\n --api-key 'My API Key' \\\n --name name \\\n --type type",
1332
+ },
1333
+ php: {
1334
+ method: 'v1->templates->create',
154
1335
  example:
155
- "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);",
1336
+ "<?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);",
156
1337
  },
157
1338
  http: {
158
1339
  example:
159
- '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 }\'',
1340
+ '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 }\'',
160
1341
  },
161
1342
  },
162
1343
  },
163
1344
  {
164
- name: 'cancel',
165
- endpoint: '/api/v1/public/broadcasts/{id}/cancel',
166
- httpMethod: 'post',
167
- summary: 'Cancel an in-flight broadcast',
168
- description:
169
- 'Cancel all in-flight workflows for a broadcast and mark it Failed. Idempotent — noop (still 200) on broadcasts in terminal states.',
170
- stainlessPath: '(resource) v1.public.broadcasts > (method) cancel',
171
- qualified: 'client.v1.public.broadcasts.cancel',
1345
+ name: 'retrieve',
1346
+ endpoint: '/api/v1/templates/{id}',
1347
+ httpMethod: 'get',
1348
+ summary: 'Get template',
1349
+ description: 'Get template',
1350
+ stainlessPath: '(resource) v1.templates > (method) retrieve',
1351
+ qualified: 'client.v1.templates.retrieve',
172
1352
  params: ['id: string;'],
173
1353
  response:
174
- "{ broadcastId: string; status: 'NotStarted' | 'InProgress' | 'Triggered' | 'Sent' | 'Failed' | 'Archived' | 'Warming' | 'Paused'; }",
1354
+ "{ 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[]; }; }",
175
1355
  markdown:
176
- "## 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```",
1356
+ "## 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```",
177
1357
  perLanguage: {
178
1358
  typescript: {
179
- method: 'client.v1.public.broadcasts.cancel',
1359
+ method: 'client.v1.templates.retrieve',
1360
+ example:
1361
+ "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);",
1362
+ },
1363
+ python: {
1364
+ method: 'v1.templates.retrieve',
1365
+ example:
1366
+ '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)',
1367
+ },
1368
+ java: {
1369
+ method: 'v1().templates().retrieve',
180
1370
  example:
181
- "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);",
1371
+ '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}',
1372
+ },
1373
+ go: {
1374
+ method: 'client.V1.Templates.Get',
1375
+ example:
1376
+ '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',
1377
+ },
1378
+ cli: {
1379
+ method: 'templates retrieve',
1380
+ example:
1381
+ "segmentflow v1:templates retrieve \\\n --api-key 'My API Key' \\\n --id 182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e",
1382
+ },
1383
+ php: {
1384
+ method: 'v1->templates->retrieve',
1385
+ example:
1386
+ "<?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);",
182
1387
  },
183
1388
  http: {
184
1389
  example:
185
- 'curl https://api.segmentflow.ai/api/v1/public/broadcasts/$ID/cancel \\\n -X POST \\\n -H "x-api-key: $SEGMENTFLOW_API_KEY"',
1390
+ 'curl https://api.segmentflow.ai/api/v1/templates/$ID \\\n -H "x-api-key: $SEGMENTFLOW_API_KEY"',
186
1391
  },
187
1392
  },
188
1393
  },
189
1394
  {
190
- name: 'prepare',
191
- endpoint: '/api/v1/public/broadcasts/prepare',
192
- httpMethod: 'post',
193
- summary: 'Prepare a broadcast (dry-run, returns preparedSendId)',
194
- description:
195
- '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.',
196
- stainlessPath: '(resource) v1.public.broadcasts > (method) prepare',
197
- qualified: 'client.v1.public.broadcasts.prepare',
198
- params: ['name: string;', 'segmentId: string;', 'templateId: string;', 'subject?: string;'],
1395
+ name: 'update',
1396
+ endpoint: '/api/v1/templates/{id}',
1397
+ httpMethod: 'put',
1398
+ summary: 'Update template',
1399
+ description: 'Update template',
1400
+ stainlessPath: '(resource) v1.templates > (method) update',
1401
+ qualified: 'client.v1.templates.update',
1402
+ params: [
1403
+ 'id: string;',
1404
+ 'brandKitId?: string;',
1405
+ 'defaultSegmentId?: string;',
1406
+ "definition?: { body: { elements: object; root: string; }; codeFormat: 'json'; emailContentsType: 'Code'; type: 'Email'; from?: string; preheader?: string; renderVariables?: object; replyTo?: string; sensitiveTransactionalVariablePaths?: string[]; subject?: string; };",
1407
+ 'language?: string;',
1408
+ 'name?: string;',
1409
+ "purpose?: 'General' | 'Newsletter' | 'Promotional' | 'Transactional' | 'LeadMagnetDelivery';",
1410
+ 'senderProfileId?: string;',
1411
+ 'subType?: string;',
1412
+ ],
199
1413
  response:
200
- '{ audienceCount: number; expiresAt: string; preparedSendId: string; senderProfile: { id: string; fromEmail: string; name: string; }; subjectPreview: string; }',
1414
+ "{ 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[]; }; }",
201
1415
  markdown:
202
- "## 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```",
1416
+ "## 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```",
203
1417
  perLanguage: {
204
1418
  typescript: {
205
- method: 'client.v1.public.broadcasts.prepare',
1419
+ method: 'client.v1.templates.update',
1420
+ example:
1421
+ "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);",
1422
+ },
1423
+ python: {
1424
+ method: 'v1.templates.update',
1425
+ example:
1426
+ '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)',
1427
+ },
1428
+ java: {
1429
+ method: 'v1().templates().update',
206
1430
  example:
207
- "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);",
1431
+ '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}',
1432
+ },
1433
+ go: {
1434
+ method: 'client.V1.Templates.Update',
1435
+ example:
1436
+ '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',
1437
+ },
1438
+ cli: {
1439
+ method: 'templates update',
1440
+ example:
1441
+ "segmentflow v1:templates update \\\n --api-key 'My API Key' \\\n --id 182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e",
1442
+ },
1443
+ php: {
1444
+ method: 'v1->templates->update',
1445
+ example:
1446
+ "<?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);",
208
1447
  },
209
1448
  http: {
210
1449
  example:
211
- '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 }\'',
1450
+ 'curl https://api.segmentflow.ai/api/v1/templates/$ID \\\n -X PUT \\\n -H "x-api-key: $SEGMENTFLOW_API_KEY"',
212
1451
  },
213
1452
  },
214
1453
  },
215
1454
  {
216
- name: 'send_prepared',
217
- endpoint: '/api/v1/public/broadcasts/send-prepared',
218
- httpMethod: 'post',
219
- summary: 'Redeem a preparedSendId and trigger the broadcast',
220
- description:
221
- "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.",
222
- stainlessPath: '(resource) v1.public.broadcasts > (method) send_prepared',
223
- qualified: 'client.v1.public.broadcasts.sendPrepared',
224
- params: ['preparedSendId: string;'],
225
- response:
226
- "{ broadcastId: string; firstRedeem: boolean; status: 'NotStarted' | 'InProgress' | 'Triggered' | 'Sent' | 'Failed' | 'Archived' | 'Warming' | 'Paused'; }",
1455
+ name: 'delete',
1456
+ endpoint: '/api/v1/templates/{id}',
1457
+ httpMethod: 'delete',
1458
+ summary: 'Delete template',
1459
+ description: 'Delete template',
1460
+ stainlessPath: '(resource) v1.templates > (method) delete',
1461
+ qualified: 'client.v1.templates.delete',
1462
+ params: ['id: string;'],
1463
+ response: 'null',
227
1464
  markdown:
228
- "## 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```",
1465
+ "## 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```",
229
1466
  perLanguage: {
230
1467
  typescript: {
231
- method: 'client.v1.public.broadcasts.sendPrepared',
1468
+ method: 'client.v1.templates.delete',
1469
+ example:
1470
+ "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);",
1471
+ },
1472
+ python: {
1473
+ method: 'v1.templates.delete',
1474
+ example:
1475
+ '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)',
1476
+ },
1477
+ java: {
1478
+ method: 'v1().templates().delete',
1479
+ example:
1480
+ '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}',
1481
+ },
1482
+ go: {
1483
+ method: 'client.V1.Templates.Delete',
232
1484
  example:
233
- "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);",
1485
+ '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',
1486
+ },
1487
+ cli: {
1488
+ method: 'templates delete',
1489
+ example:
1490
+ "segmentflow v1:templates delete \\\n --api-key 'My API Key' \\\n --id 182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e",
1491
+ },
1492
+ php: {
1493
+ method: 'v1->templates->delete',
1494
+ example:
1495
+ "<?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);",
234
1496
  },
235
1497
  http: {
236
1498
  example:
237
- '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 }\'',
1499
+ 'curl https://api.segmentflow.ai/api/v1/templates/$ID \\\n -X DELETE \\\n -H "x-api-key: $SEGMENTFLOW_API_KEY"',
238
1500
  },
239
1501
  },
240
1502
  },
241
1503
  {
242
- name: 'get_status',
243
- endpoint: '/api/v1/public/broadcasts/{id}',
244
- httpMethod: 'get',
245
- summary: 'Get broadcast status + stats',
246
- description: 'Get broadcast status + stats',
247
- stainlessPath: '(resource) v1.public.broadcasts > (method) get_status',
248
- qualified: 'client.v1.public.broadcasts.getStatus',
1504
+ name: 'duplicate',
1505
+ endpoint: '/api/v1/templates/{id}/duplicate',
1506
+ httpMethod: 'post',
1507
+ summary: 'Duplicate template',
1508
+ description: 'Create an editable copy of an existing template in the current organization',
1509
+ stainlessPath: '(resource) v1.templates > (method) duplicate',
1510
+ qualified: 'client.v1.templates.duplicate',
249
1511
  params: ['id: string;'],
250
1512
  response:
251
- "{ 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'; }",
1513
+ "{ 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[]; }; }",
252
1514
  markdown:
253
- "## 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```",
1515
+ "## 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```",
254
1516
  perLanguage: {
255
1517
  typescript: {
256
- method: 'client.v1.public.broadcasts.getStatus',
1518
+ method: 'client.v1.templates.duplicate',
1519
+ example:
1520
+ "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);",
1521
+ },
1522
+ python: {
1523
+ method: 'v1.templates.duplicate',
257
1524
  example:
258
- "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);",
1525
+ '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)',
1526
+ },
1527
+ java: {
1528
+ method: 'v1().templates().duplicate',
1529
+ example:
1530
+ '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}',
1531
+ },
1532
+ go: {
1533
+ method: 'client.V1.Templates.Duplicate',
1534
+ example:
1535
+ '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',
1536
+ },
1537
+ cli: {
1538
+ method: 'templates duplicate',
1539
+ example:
1540
+ "segmentflow v1:templates duplicate \\\n --api-key 'My API Key' \\\n --id 182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e",
1541
+ },
1542
+ php: {
1543
+ method: 'v1->templates->duplicate',
1544
+ example:
1545
+ "<?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);",
259
1546
  },
260
1547
  http: {
261
1548
  example:
262
- 'curl https://api.segmentflow.ai/api/v1/public/broadcasts/$ID \\\n -H "x-api-key: $SEGMENTFLOW_API_KEY"',
1549
+ 'curl https://api.segmentflow.ai/api/v1/templates/$ID/duplicate \\\n -X POST \\\n -H "x-api-key: $SEGMENTFLOW_API_KEY"',
263
1550
  },
264
1551
  },
265
1552
  },
266
1553
  {
267
- name: 'list',
268
- endpoint: '/api/v1/public/templates',
269
- httpMethod: 'get',
270
- summary: 'List email templates',
271
- description: 'List email templates',
272
- stainlessPath: '(resource) v1.public.templates > (method) list',
273
- qualified: 'client.v1.public.templates.list',
274
- params: [
275
- 'cursor?: string;',
276
- 'limit?: number;',
277
- 'pageSize?: number;',
278
- "purpose?: 'General' | 'Newsletter' | 'Promotional' | 'Transactional' | 'LeadMagnetDelivery';",
279
- "status?: 'Active' | 'Archived';",
280
- ],
1554
+ name: 'archive',
1555
+ endpoint: '/api/v1/templates/{id}/archive',
1556
+ httpMethod: 'post',
1557
+ summary: 'Archive template',
1558
+ description: 'Archive template',
1559
+ stainlessPath: '(resource) v1.templates > (method) archive',
1560
+ qualified: 'client.v1.templates.archive',
1561
+ params: ['id: string;'],
281
1562
  response:
282
- "{ id: string; createdAt: string; isComplete: boolean; language: string; name: string; purpose: 'General' | 'Newsletter' | 'Promotional' | 'Transactional' | 'LeadMagnetDelivery'; status: 'Active' | 'Archived'; type: string; updatedAt: string; }[]",
1563
+ "{ id: string; createdAt: string; name: string; organizationId: string; status: 'Active' | 'Archived'; type: string; updatedAt: string; statusBeforeArchive?: 'Active' | 'Archived'; }",
283
1564
  markdown:
284
- "## 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```",
1565
+ "## 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```",
285
1566
  perLanguage: {
286
1567
  typescript: {
287
- method: 'client.v1.public.templates.list',
1568
+ method: 'client.v1.templates.archive',
1569
+ example:
1570
+ "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);",
1571
+ },
1572
+ python: {
1573
+ method: 'v1.templates.archive',
1574
+ example:
1575
+ '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)',
1576
+ },
1577
+ java: {
1578
+ method: 'v1().templates().archive',
1579
+ example:
1580
+ '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}',
1581
+ },
1582
+ go: {
1583
+ method: 'client.V1.Templates.Archive',
1584
+ example:
1585
+ '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',
1586
+ },
1587
+ cli: {
1588
+ method: 'templates archive',
1589
+ example:
1590
+ "segmentflow v1:templates archive \\\n --api-key 'My API Key' \\\n --id 182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e",
1591
+ },
1592
+ php: {
1593
+ method: 'v1->templates->archive',
288
1594
  example:
289
- "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);",
1595
+ "<?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);",
290
1596
  },
291
1597
  http: {
292
1598
  example:
293
- 'curl https://api.segmentflow.ai/api/v1/public/templates \\\n -H "x-api-key: $SEGMENTFLOW_API_KEY"',
1599
+ 'curl https://api.segmentflow.ai/api/v1/templates/$ID/archive \\\n -X POST \\\n -H "x-api-key: $SEGMENTFLOW_API_KEY"',
294
1600
  },
295
1601
  },
296
1602
  },
297
1603
  {
298
- name: 'get',
299
- endpoint: '/api/v1/public/templates/{id}',
300
- httpMethod: 'get',
301
- summary: 'Get an email template by id',
302
- description: 'Get an email template by id',
303
- stainlessPath: '(resource) v1.public.templates > (method) get',
304
- qualified: 'client.v1.public.templates.get',
1604
+ name: 'unarchive',
1605
+ endpoint: '/api/v1/templates/{id}/unarchive',
1606
+ httpMethod: 'post',
1607
+ summary: 'Unarchive template',
1608
+ description: 'Unarchive template',
1609
+ stainlessPath: '(resource) v1.templates > (method) unarchive',
1610
+ qualified: 'client.v1.templates.unarchive',
305
1611
  params: ['id: string;'],
306
1612
  response:
307
- "{ id: string; createdAt: string; isComplete: boolean; language: string; name: string; purpose: 'General' | 'Newsletter' | 'Promotional' | 'Transactional' | 'LeadMagnetDelivery'; status: 'Active' | 'Archived'; type: string; updatedAt: string; }",
1613
+ "{ id: string; createdAt: string; name: string; organizationId: string; status: 'Active' | 'Archived'; type: string; updatedAt: string; statusBeforeArchive?: 'Active' | 'Archived'; }",
308
1614
  markdown:
309
- "## 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```",
1615
+ "## 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```",
310
1616
  perLanguage: {
311
1617
  typescript: {
312
- method: 'client.v1.public.templates.get',
1618
+ method: 'client.v1.templates.unarchive',
1619
+ example:
1620
+ "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);",
1621
+ },
1622
+ python: {
1623
+ method: 'v1.templates.unarchive',
1624
+ example:
1625
+ '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)',
1626
+ },
1627
+ java: {
1628
+ method: 'v1().templates().unarchive',
1629
+ example:
1630
+ '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}',
1631
+ },
1632
+ go: {
1633
+ method: 'client.V1.Templates.Unarchive',
1634
+ example:
1635
+ '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',
1636
+ },
1637
+ cli: {
1638
+ method: 'templates unarchive',
1639
+ example:
1640
+ "segmentflow v1:templates unarchive \\\n --api-key 'My API Key' \\\n --id 182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e",
1641
+ },
1642
+ php: {
1643
+ method: 'v1->templates->unarchive',
313
1644
  example:
314
- "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);",
1645
+ "<?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);",
315
1646
  },
316
1647
  http: {
317
1648
  example:
318
- 'curl https://api.segmentflow.ai/api/v1/public/templates/$ID \\\n -H "x-api-key: $SEGMENTFLOW_API_KEY"',
1649
+ 'curl https://api.segmentflow.ai/api/v1/templates/$ID/unarchive \\\n -X POST \\\n -H "x-api-key: $SEGMENTFLOW_API_KEY"',
319
1650
  },
320
1651
  },
321
1652
  },
322
1653
  {
323
- name: 'list',
324
- endpoint: '/api/v1/public/segments',
325
- httpMethod: 'get',
326
- summary: 'List segments',
327
- description: 'List segments',
328
- stainlessPath: '(resource) v1.public.segments > (method) list',
329
- qualified: 'client.v1.public.segments.list',
1654
+ name: 'create',
1655
+ endpoint: '/api/v1/broadcasts',
1656
+ httpMethod: 'post',
1657
+ summary: 'Create broadcast',
1658
+ description:
1659
+ '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.',
1660
+ stainlessPath: '(resource) v1.broadcasts > (method) create',
1661
+ qualified: 'client.v1.broadcasts.create',
330
1662
  params: [
331
- "membershipType?: 'computed' | 'static';",
332
- "status?: 'NotStarted' | 'Running' | 'Paused' | 'Archived';",
1663
+ 'from?: string;',
1664
+ 'html?: string;',
1665
+ 'name?: string;',
1666
+ 'replyTo?: string | string[];',
1667
+ 'scheduledAt?: string;',
1668
+ 'segmentId?: string;',
1669
+ 'send?: boolean;',
1670
+ 'subject?: string;',
1671
+ 'subscriptionGroupId?: string;',
1672
+ 'templateId?: string;',
1673
+ 'text?: string;',
1674
+ 'topicId?: string;',
333
1675
  ],
334
- response:
335
- "{ id: string; createdAt: string; lastComputedAt: string; membershipType: 'computed' | 'static'; name: string; status: 'NotStarted' | 'Running' | 'Paused' | 'Archived'; updatedAt: string; userCount: number; }[]",
1676
+ response: '{ id: string; }',
336
1677
  markdown:
337
- "## 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```",
1678
+ '## 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```',
338
1679
  perLanguage: {
339
1680
  typescript: {
340
- method: 'client.v1.public.segments.list',
1681
+ method: 'client.v1.broadcasts.create',
1682
+ example:
1683
+ "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);",
1684
+ },
1685
+ python: {
1686
+ method: 'v1.broadcasts.create',
1687
+ example:
1688
+ '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)',
1689
+ },
1690
+ java: {
1691
+ method: 'v1().broadcasts().create',
1692
+ example:
1693
+ '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}',
1694
+ },
1695
+ go: {
1696
+ method: 'client.V1.Broadcasts.New',
1697
+ example:
1698
+ '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',
1699
+ },
1700
+ cli: {
1701
+ method: 'broadcasts create',
1702
+ example: "segmentflow v1:broadcasts create \\\n --api-key 'My API Key'",
1703
+ },
1704
+ php: {
1705
+ method: 'v1->broadcasts->create',
341
1706
  example:
342
- "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);",
1707
+ "<?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);",
343
1708
  },
344
1709
  http: {
345
1710
  example:
346
- 'curl https://api.segmentflow.ai/api/v1/public/segments \\\n -H "x-api-key: $SEGMENTFLOW_API_KEY"',
1711
+ 'curl https://api.segmentflow.ai/api/v1/broadcasts \\\n -X POST \\\n -H "x-api-key: $SEGMENTFLOW_API_KEY"',
347
1712
  },
348
1713
  },
349
1714
  },
350
1715
  {
351
- name: 'preview',
352
- endpoint: '/api/v1/public/segments/{id}/preview',
1716
+ name: 'send',
1717
+ endpoint: '/api/v1/emails',
353
1718
  httpMethod: 'post',
354
- summary: 'Preview segment audience count',
355
- description:
356
- "Recompile the segment's live definition and count matching users from api.user_event. Bypasses the cached segment_membership table.",
357
- stainlessPath: '(resource) v1.public.segments > (method) preview',
358
- qualified: 'client.v1.public.segments.preview',
359
- params: ['id: string;'],
360
- response: '{ matchedUserCount: number; previewedAt: string; }',
1719
+ summary: 'Send email',
1720
+ description: 'Create one EmailSend from a saved email template and enqueue delivery.',
1721
+ stainlessPath: '(resource) v1.emails > (method) send',
1722
+ qualified: 'client.v1.emails.send',
1723
+ params: [
1724
+ 'templateId: string;',
1725
+ 'idempotency-key: string;',
1726
+ 'bcc?: string | string[];',
1727
+ 'cc?: string | string[];',
1728
+ 'data?: object;',
1729
+ 'from?: string;',
1730
+ 'profileId?: string;',
1731
+ 'replyTo?: string;',
1732
+ 'senderProfileId?: string;',
1733
+ 'subject?: string;',
1734
+ 'subscriptionGroupId?: string;',
1735
+ 'to?: { email?: string; externalId?: string; };',
1736
+ 'tracking?: { clicks?: boolean; };',
1737
+ ],
1738
+ response:
1739
+ "{ 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; }",
361
1740
  markdown:
362
- "## 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```",
1741
+ "## 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```",
363
1742
  perLanguage: {
364
1743
  typescript: {
365
- method: 'client.v1.public.segments.preview',
1744
+ method: 'client.v1.emails.send',
1745
+ example:
1746
+ "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);",
1747
+ },
1748
+ python: {
1749
+ method: 'v1.emails.send',
1750
+ example:
1751
+ '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)',
1752
+ },
1753
+ java: {
1754
+ method: 'v1().emails().send',
1755
+ example:
1756
+ '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}',
1757
+ },
1758
+ go: {
1759
+ method: 'client.V1.Emails.Send',
1760
+ example:
1761
+ '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',
1762
+ },
1763
+ cli: {
1764
+ method: 'emails send',
1765
+ example:
1766
+ "segmentflow v1:emails send \\\n --api-key 'My API Key' \\\n --template-id 182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e \\\n --idempotency-key x",
1767
+ },
1768
+ php: {
1769
+ method: 'v1->emails->send',
366
1770
  example:
367
- "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);",
1771
+ "<?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);",
368
1772
  },
369
1773
  http: {
370
1774
  example:
371
- 'curl https://api.segmentflow.ai/api/v1/public/segments/$ID/preview \\\n -X POST \\\n -H "x-api-key: $SEGMENTFLOW_API_KEY"',
1775
+ '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 }\'',
372
1776
  },
373
1777
  },
374
1778
  },
375
1779
  {
376
- name: 'request_upload',
377
- endpoint: '/api/v1/public/assets/upload-request',
1780
+ name: 'batch_send',
1781
+ endpoint: '/api/v1/emails/batch',
378
1782
  httpMethod: 'post',
379
- summary: 'Request a presigned asset upload',
1783
+ summary: 'Batch send emails',
380
1784
  description:
381
- 'Pre-mints an asset id and returns a presigned S3 PUT URL. Upload the bytes with the returned headers, then call /assets/{assetId}/finalize.',
382
- stainlessPath: '(resource) v1.public.assets > (method) request_upload',
383
- qualified: 'client.v1.public.assets.requestUpload',
1785
+ '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.',
1786
+ stainlessPath: '(resource) v1.emails > (method) batch_send',
1787
+ qualified: 'client.v1.emails.batchSend',
384
1788
  params: [
385
- 'contentType: string;',
386
- 'filename: string;',
387
- 'size: number;',
388
- "assetType?: 'content-image' | 'content-document' | 'lead-magnet';",
1789
+ '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; }; }[];',
1790
+ 'defaults?: { from?: string; replyTo?: string; senderProfileId?: string; subject?: string; subscriptionGroupId?: string; templateId?: string; tracking?: { clicks?: boolean; }; };',
389
1791
  ],
390
- response: '{ assetId: string; expiresAt: string; headers: object; uploadUrl: string; }',
1792
+ response:
1793
+ "{ 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; }",
391
1794
  markdown:
392
- "## 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```",
1795
+ "## 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```",
393
1796
  perLanguage: {
394
1797
  typescript: {
395
- method: 'client.v1.public.assets.requestUpload',
1798
+ method: 'client.v1.emails.batchSend',
396
1799
  example:
397
- "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);",
1800
+ "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);",
1801
+ },
1802
+ python: {
1803
+ method: 'v1.emails.batch_send',
1804
+ example:
1805
+ '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)',
1806
+ },
1807
+ java: {
1808
+ method: 'v1().emails().batchSend',
1809
+ example:
1810
+ '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}',
1811
+ },
1812
+ go: {
1813
+ method: 'client.V1.Emails.BatchSend',
1814
+ example:
1815
+ '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',
1816
+ },
1817
+ cli: {
1818
+ method: 'emails batch_send',
1819
+ example:
1820
+ "segmentflow v1:emails batch-send \\\n --api-key 'My API Key' \\\n --item '{idempotencyKey: x}'",
1821
+ },
1822
+ php: {
1823
+ method: 'v1->emails->batchSend',
1824
+ example:
1825
+ "<?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);",
1826
+ },
1827
+ http: {
1828
+ example:
1829
+ '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 }\'',
1830
+ },
1831
+ },
1832
+ },
1833
+ {
1834
+ name: 'retrieve',
1835
+ endpoint: '/api/v1/emails/{id}',
1836
+ httpMethod: 'get',
1837
+ summary: 'Retrieve email send',
1838
+ description: 'Get the current status handle for an EmailSend.',
1839
+ stainlessPath: '(resource) v1.emails > (method) retrieve',
1840
+ qualified: 'client.v1.emails.retrieve',
1841
+ params: ['id: string;'],
1842
+ response:
1843
+ "{ 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; }",
1844
+ markdown:
1845
+ "## 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```",
1846
+ perLanguage: {
1847
+ typescript: {
1848
+ method: 'client.v1.emails.retrieve',
1849
+ example:
1850
+ "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);",
1851
+ },
1852
+ python: {
1853
+ method: 'v1.emails.retrieve',
1854
+ example:
1855
+ '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)',
1856
+ },
1857
+ java: {
1858
+ method: 'v1().emails().retrieve',
1859
+ example:
1860
+ '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}',
1861
+ },
1862
+ go: {
1863
+ method: 'client.V1.Emails.Get',
1864
+ example:
1865
+ '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',
1866
+ },
1867
+ cli: {
1868
+ method: 'emails retrieve',
1869
+ example:
1870
+ "segmentflow v1:emails retrieve \\\n --api-key 'My API Key' \\\n --id 182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e",
1871
+ },
1872
+ php: {
1873
+ method: 'v1->emails->retrieve',
1874
+ example:
1875
+ "<?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);",
398
1876
  },
399
1877
  http: {
400
1878
  example:
401
- '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 }\'',
1879
+ 'curl https://api.segmentflow.ai/api/v1/emails/$ID \\\n -H "x-api-key: $SEGMENTFLOW_API_KEY"',
402
1880
  },
403
1881
  },
404
1882
  },
405
1883
  {
406
- name: 'finalize_upload',
407
- endpoint: '/api/v1/public/assets/{id}/finalize',
1884
+ name: 'track',
1885
+ endpoint: '/api/v1/events',
408
1886
  httpMethod: 'post',
409
- summary: 'Finalize a presigned upload',
1887
+ summary: 'Track event',
410
1888
  description:
411
- 'Verifies the bytes landed in S3, strips EXIF/GPS metadata, extracts dimensions, and commits the asset row.',
412
- stainlessPath: '(resource) v1.public.assets > (method) finalize_upload',
413
- qualified: 'client.v1.public.assets.finalizeUpload',
1889
+ 'Accept one server-side identified business event, persist a UserEvent, and trigger matching active Journeys.',
1890
+ stainlessPath: '(resource) v1.events > (method) track',
1891
+ qualified: 'client.v1.events.track',
414
1892
  params: [
415
- 'id: string;',
416
- 'altText?: string;',
417
- 'description?: string;',
418
- "imageType?: 'logo' | 'hero' | 'header' | 'product' | 'background' | 'icon' | 'other';",
1893
+ 'event: string;',
1894
+ 'profile: { email?: string; externalId?: string; properties?: object; };',
1895
+ 'idempotency-key: string;',
1896
+ 'data?: object;',
1897
+ 'occurredAt?: string;',
1898
+ 'redactedDataPaths?: string[];',
1899
+ 'referenceId?: string;',
419
1900
  ],
420
1901
  response:
421
- '{ asset: { id: string; contentType: string; createdAt: string; filename: string; height: number; size: number; url: string; width: number; }; }',
1902
+ '{ enrolledJourneys: number; eventId: string; matchedJourneys: number; profileId: string; skippedJourneys: number; }',
422
1903
  markdown:
423
- "## 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```",
1904
+ "## 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```",
424
1905
  perLanguage: {
425
1906
  typescript: {
426
- method: 'client.v1.public.assets.finalizeUpload',
1907
+ method: 'client.v1.events.track',
1908
+ example:
1909
+ "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);",
1910
+ },
1911
+ python: {
1912
+ method: 'v1.events.track',
1913
+ example:
1914
+ '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)',
1915
+ },
1916
+ java: {
1917
+ method: 'v1().events().track',
1918
+ example:
1919
+ '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}',
1920
+ },
1921
+ go: {
1922
+ method: 'client.V1.Events.Track',
1923
+ example:
1924
+ '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',
1925
+ },
1926
+ cli: {
1927
+ method: 'events track',
1928
+ example:
1929
+ "segmentflow v1:events track \\\n --api-key 'My API Key' \\\n --event x \\\n --profile '{}' \\\n --idempotency-key x",
1930
+ },
1931
+ php: {
1932
+ method: 'v1->events->track',
427
1933
  example:
428
- "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);",
1934
+ "<?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);",
429
1935
  },
430
1936
  http: {
431
1937
  example:
432
- 'curl https://api.segmentflow.ai/api/v1/public/assets/$ID/finalize \\\n -X POST \\\n -H "x-api-key: $SEGMENTFLOW_API_KEY"',
1938
+ '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 }\'',
433
1939
  },
434
1940
  },
435
1941
  },
436
1942
  ];
437
1943
 
438
1944
  const EMBEDDED_READMES: { language: string; content: string }[] = [
1945
+ {
1946
+ language: 'cli',
1947
+ content:
1948
+ "# 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",
1949
+ },
1950
+ {
1951
+ language: 'go',
1952
+ content:
1953
+ '# 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',
1954
+ },
1955
+ {
1956
+ language: 'java',
1957
+ content:
1958
+ '# 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',
1959
+ },
1960
+ {
1961
+ language: 'php',
1962
+ content:
1963
+ '# 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```',
1964
+ },
1965
+ {
1966
+ language: 'python',
1967
+ content:
1968
+ '# 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',
1969
+ },
439
1970
  {
440
1971
  language: 'typescript',
441
1972
  content:
442
- "# 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",
1973
+ "# 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",
443
1974
  },
444
1975
  ];
445
1976