-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathsplit-evaluator-api-openapi.yml
More file actions
523 lines (523 loc) · 17 KB
/
Copy pathsplit-evaluator-api-openapi.yml
File metadata and controls
523 lines (523 loc) · 17 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
openapi: 3.1.0
info:
title: Split Evaluator API
description: >-
The Split Evaluator is an HTTP service that wraps Split SDKs to provide
feature flag evaluation via a REST API. It enables applications that cannot
directly embed an SDK to request treatment evaluations over HTTP, making it
suitable for architectures where a centralized evaluation service is
preferred. The Evaluator can be deployed as a standalone microservice that
processes getTreatment calls and returns the appropriate treatments for
given users and feature flags. Swagger documentation is available by default
at the /api-docs endpoint.
version: '1.0'
contact:
name: Split Support
url: https://help.split.io
termsOfService: https://www.split.io/terms-of-service/
externalDocs:
description: Split Evaluator Documentation
url: https://help.split.io/hc/en-us/articles/360020037072-Split-Evaluator
servers:
- url: http://localhost:7548
description: Default local Evaluator instance
tags:
- name: Evaluation
description: >-
Endpoints for evaluating feature flags and retrieving treatment values
for given keys and feature flag names.
- name: Events
description: >-
Endpoints for tracking custom events used in experimentation and
metrics measurement.
paths:
/admin/ping:
get:
operationId: ping
summary: Ping service
description: >-
Checks whether the Split Evaluator service is running. If the service
is running, it responds with the text pong and HTTP status code 200.
tags: []
responses:
'200':
description: Service is running
content:
text/plain:
schema:
type: string
example: pong
/admin/version:
get:
operationId: getVersion
summary: Get service version
description: >-
Returns the current version of the Split Evaluator service.
tags: []
responses:
'200':
description: Service version information
content:
application/json:
schema:
type: object
properties:
version:
type: string
description: Version string of the running Evaluator
/admin/healthcheck:
get:
operationId: healthCheck
summary: Health check
description: >-
Checks that the Split Evaluator is connected to Split servers and
ready to process evaluation requests. Returns 200 if everything is
working as expected or 500 if there is an issue, along with a message
explaining the status.
tags: []
responses:
'200':
description: Service is healthy and ready for evaluations
content:
application/json:
schema:
$ref: '#/components/schemas/HealthCheckResponse'
'500':
description: Service is unhealthy
content:
application/json:
schema:
$ref: '#/components/schemas/HealthCheckResponse'
/client/get-treatment:
get:
operationId: getTreatment
summary: Get treatment for a feature flag
description: >-
Evaluates a single feature flag for the given key and returns the
treatment value. Optionally includes dynamic configuration associated
with the treatment. This is the primary endpoint for feature flag
evaluation.
tags:
- Evaluation
parameters:
- name: key
in: query
required: true
description: >-
The customer key to evaluate the feature flag against
schema:
type: string
- name: split-name
in: query
required: true
description: >-
The name of the feature flag to evaluate
schema:
type: string
- name: bucketing-key
in: query
description: >-
Optional bucketing key used for consistent percentage-based
treatment assignments
schema:
type: string
- name: attributes
in: query
description: >-
JSON string of attributes used in targeting rule evaluation
schema:
type: string
- name: impressions-disabled
in: query
description: >-
When set to true, disables impression logging for this evaluation
schema:
type: boolean
responses:
'200':
description: Successful evaluation response
content:
application/json:
schema:
$ref: '#/components/schemas/TreatmentResult'
'400':
description: Missing or invalid parameters
'500':
description: Internal server error during evaluation
post:
operationId: getTreatmentWithAttributes
summary: Get treatment with attributes
description: >-
Evaluates a single feature flag for the given key with attributes
passed in the request body. This is preferred over the GET method
when attributes contain complex or large data structures.
tags:
- Evaluation
parameters:
- name: key
in: query
required: true
description: The customer key to evaluate the feature flag against
schema:
type: string
- name: split-name
in: query
required: true
description: The name of the feature flag to evaluate
schema:
type: string
- name: bucketing-key
in: query
description: Optional bucketing key for consistent assignments
schema:
type: string
requestBody:
content:
application/json:
schema:
$ref: '#/components/schemas/EvaluationAttributes'
responses:
'200':
description: Successful evaluation response
content:
application/json:
schema:
$ref: '#/components/schemas/TreatmentResult'
'400':
description: Missing or invalid parameters
'500':
description: Internal server error during evaluation
/client/get-treatments:
get:
operationId: getTreatments
summary: Get treatments for multiple feature flags
description: >-
Evaluates multiple feature flags for the given key in a single request
and returns the treatment values for each. More efficient than making
individual get-treatment calls.
tags:
- Evaluation
parameters:
- name: key
in: query
required: true
description: The customer key to evaluate feature flags against
schema:
type: string
- name: split-names
in: query
required: true
description: >-
Comma-separated list of feature flag names to evaluate
schema:
type: string
- name: bucketing-key
in: query
description: Optional bucketing key for consistent assignments
schema:
type: string
- name: attributes
in: query
description: JSON string of attributes for targeting rule evaluation
schema:
type: string
- name: impressions-disabled
in: query
description: >-
When set to true, disables impression logging for these evaluations
schema:
type: boolean
responses:
'200':
description: Successful evaluation response with multiple treatments
content:
application/json:
schema:
$ref: '#/components/schemas/TreatmentsResult'
'400':
description: Missing or invalid parameters
'500':
description: Internal server error during evaluation
post:
operationId: getTreatmentsWithAttributes
summary: Get treatments with attributes
description: >-
Evaluates multiple feature flags for the given key with attributes
passed in the request body.
tags:
- Evaluation
parameters:
- name: key
in: query
required: true
description: The customer key to evaluate feature flags against
schema:
type: string
- name: split-names
in: query
required: true
description: Comma-separated list of feature flag names to evaluate
schema:
type: string
- name: bucketing-key
in: query
description: Optional bucketing key for consistent assignments
schema:
type: string
requestBody:
content:
application/json:
schema:
$ref: '#/components/schemas/EvaluationAttributes'
responses:
'200':
description: Successful evaluation response with multiple treatments
content:
application/json:
schema:
$ref: '#/components/schemas/TreatmentsResult'
'400':
description: Missing or invalid parameters
'500':
description: Internal server error during evaluation
/client/get-all-treatments:
get:
operationId: getAllTreatments
summary: Get all treatments for a key
description: >-
Evaluates all available feature flags for the given keys and traffic
types and returns the treatment values. Useful for retrieving a
complete set of flag evaluations for a user session.
tags:
- Evaluation
parameters:
- name: keys
in: query
required: true
description: >-
JSON string containing an array of key objects with matchingKey
and trafficType properties, and optionally a bucketingKey
schema:
type: string
- name: attributes
in: query
description: JSON string of attributes for targeting rule evaluation
schema:
type: string
- name: impressions-disabled
in: query
description: >-
When set to true, disables impression logging for these evaluations
schema:
type: boolean
responses:
'200':
description: >-
Successful response with treatments for all feature flags
content:
application/json:
schema:
$ref: '#/components/schemas/AllTreatmentsResult'
'400':
description: Missing or invalid parameters
'500':
description: Internal server error during evaluation
post:
operationId: getAllTreatmentsWithAttributes
summary: Get all treatments with attributes
description: >-
Evaluates all available feature flags for the given keys with
attributes passed in the request body.
tags:
- Evaluation
parameters:
- name: keys
in: query
required: true
description: >-
JSON string containing an array of key objects
schema:
type: string
requestBody:
content:
application/json:
schema:
$ref: '#/components/schemas/EvaluationAttributes'
responses:
'200':
description: >-
Successful response with treatments for all feature flags
content:
application/json:
schema:
$ref: '#/components/schemas/AllTreatmentsResult'
'400':
description: Missing or invalid parameters
'500':
description: Internal server error during evaluation
/client/track:
get:
operationId: trackEvent
summary: Track an event
description: >-
Records a custom event for the given key and event type. Events are
used to measure the impact of feature flags on user actions and
experimentation metrics.
tags:
- Events
parameters:
- name: key
in: query
required: true
description: The customer key associated with the event
schema:
type: string
- name: traffic-type
in: query
required: true
description: The traffic type for the event
schema:
type: string
- name: event-type
in: query
required: true
description: >-
The type of event being tracked (e.g., purchase, click, signup)
schema:
type: string
- name: value
in: query
description: Optional numeric value associated with the event
schema:
type: number
- name: properties
in: query
description: >-
JSON string with up to 15 key-value pairs of event properties.
Values must be boolean, string, number, or null.
schema:
type: string
responses:
'200':
description: Event tracked successfully
'400':
description: Missing or invalid parameters
'500':
description: Internal server error during tracking
post:
operationId: trackEventWithProperties
summary: Track an event with properties
description: >-
Records a custom event with properties passed in the request body.
Preferred for events with complex property structures.
tags:
- Events
parameters:
- name: key
in: query
required: true
description: The customer key associated with the event
schema:
type: string
- name: traffic-type
in: query
required: true
description: The traffic type for the event
schema:
type: string
- name: event-type
in: query
required: true
description: The type of event being tracked
schema:
type: string
- name: value
in: query
description: Optional numeric value associated with the event
schema:
type: number
requestBody:
content:
application/json:
schema:
$ref: '#/components/schemas/EventProperties'
responses:
'200':
description: Event tracked successfully
'400':
description: Missing or invalid parameters
'500':
description: Internal server error during tracking
components:
schemas:
HealthCheckResponse:
type: object
description: Health check response from the Split Evaluator
properties:
status:
type: string
description: Health status of the service
enum:
- ok
- error
message:
type: string
description: Detailed message about the health status
TreatmentResult:
type: object
description: >-
The result of evaluating a single feature flag for a given key.
properties:
splitName:
type: string
description: Name of the evaluated feature flag
treatment:
type: string
description: >-
The treatment value returned by the evaluation (e.g., on, off)
config:
type: string
nullable: true
description: >-
JSON string of dynamic configuration associated with the
treatment, or null if no configuration is defined
TreatmentsResult:
type: object
description: >-
The result of evaluating multiple feature flags for a given key.
Keys are feature flag names and values are treatment results.
additionalProperties:
$ref: '#/components/schemas/TreatmentResult'
AllTreatmentsResult:
type: object
description: >-
The result of evaluating all feature flags for the given keys. Keyed
by feature flag name with treatment result values.
additionalProperties:
$ref: '#/components/schemas/TreatmentResult'
EvaluationAttributes:
type: object
description: >-
Attributes passed in the request body for use in targeting rule
evaluation. Attributes can be strings, numbers, booleans, or sets.
properties:
attributes:
type: object
description: Key-value pairs of attribute names and their values
additionalProperties: true
impressionsDisabled:
type: boolean
description: >-
When set to true, disables impression logging for the evaluation
EventProperties:
type: object
description: >-
Properties associated with a tracked event.
properties:
properties:
type: object
description: >-
Key-value pairs of event properties. Maximum 15 keys. Values
must be boolean, string, number, or null.
additionalProperties: true
maxProperties: 15