-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathingestion.openapi.yml
More file actions
522 lines (500 loc) · 18.3 KB
/
Copy pathingestion.openapi.yml
File metadata and controls
522 lines (500 loc) · 18.3 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
openapi: "3.0.2"
info:
title: Mixpanel Ingestion API
version: "1.0"
externalDocs:
url: https://developer.mixpanel.com/reference/ingestion-api
description: Check Events section to explore Mixpanel Ingestion API endpoints.
servers:
- url: https://api-eu.mixpanel.com
description: EU Residency Server
- url: https://api.mixpanel.com
description: Standard Server
tags:
- name: Track
description: |
Track an event by providing an event name and event properties.
The track endpoint will not accept requests with a time property older than 5 days.
externalDocs:
url: https://developer.mixpanel.com/reference/events#track-event
- name: Track and Deduplicate
description: |
Event deduplication allows a project to send the same exact event while only recording that event once.
Deduplication only occurs when a subset of the event data is exactly identical.
externalDocs:
url: https://developer.mixpanel.com/reference/events#track-and-deduplicate-event
- name: Track multiple
description: |
Import a batch of events into Mixpanel for all users.
Instead of sending a single JSON object as the data query parameter,
send a JSON list of up to 50 objects as the data parameter of
an `application/x-www-form-urlencoded` POST or GET request body.
When sending a batch request to Mixpanel, we will accept the request and return a `1` status
if at least one of the events is valid. In this case, invalid events are dropped.
If no events are valid, then a `0` status will be returned.
externalDocs:
url: https://developer.mixpanel.com/reference/events#track-events-in-batch
- name: Set Property
description: |
Takes a JSON object containing names and values of profile properties.
If the profile does not exist, it creates it with these properties.
If it does exist, it sets the properties to these values, overwriting existing values.
externalDocs:
url: https://developer.mixpanel.com/reference/user-profiles#profile-set
- name: Set Property Once
description: |
Works just like "Set Property", except it will not overwrite existing property values.
This is useful for properties like "First login date".
externalDocs:
url: https://developer.mixpanel.com/reference/user-profiles#profile-set-property-once
- name: Increment Numerical Property
description: |
Takes a JSON object containing keys and numerical values.
Method will increment the value of a user profile property.
When processed, the property values are added to the existing values of the properties on the profile.
If the property is not present on the profile, the value will be added to 0.
It is possible to decrement by calling "$add" with negative values.
This is useful for maintaining the values of properties like "Number of Logins" or "Files Uploaded".
externalDocs:
url: https://developer.mixpanel.com/reference/user-profiles#profile-numerical-add
- name: Append to List Property
description: |
Takes a JSON object containing keys and values,
and appends each to a list associated with the corresponding property name.
Appending to a property that doesn't exist will result in assigning a list with one element to that property.
externalDocs:
url: https://developer.mixpanel.com/reference/user-profiles#profile-append-to-list-property
- name: Remove from List Property
description: |
Takes a JSON object containing keys and values.
The value in the request is removed from the existing list on the user profile.
If it does not exist, no updates are made.
externalDocs:
url: https://developer.mixpanel.com/reference/user-profiles#profile-remove-from-list-property
- name: Delete Property
description: |
Takes a JSON list of string property names, and permanently removes the properties and their values from a profile.
externalDocs:
url: https://developer.mixpanel.com/reference/user-profiles#profile-delete-property
- name: Update Multiple Profiles
description: |
Send a batch of profile updates. Instead of sending a single JSON object as the data query parameter,
send a JSON list of objects as the data parameter of an application/x-www-form-urlencoded POST or GET request body.
externalDocs:
url: https://developer.mixpanel.com/reference/user-profiles#profile-batch-update
- name: Delete Profile
description: |
Permanently delete the profile from Mixpanel, along with all of its properties.
The value is ignored - the profile is determined by the $distinct_id from the request itself.
If you have duplicate profiles, use property $ignore_alias set to true
so that you don't delete the original profile when trying to delete the duplicate
(as they pass in the alias as the distinct_id).
externalDocs:
url: https://developer.mixpanel.com/reference/user-profiles#delete-profile
components:
schemas:
event-object:
contentType: application/json
$ref: "./event.schema.json"
description: |
A JSON object as a string representing the event being tracked.
Event is the name of the event being tracked and is a required property.
Check Mixpanel Event Schema.
engage-object:
contentType: application/json
$ref: "./engage.schema.json"
description: A JSON object representing an action available for the user profile.
event-form:
title: Track Event form data
type: object
required:
- data
properties:
data:
$ref: "#/components/schemas/event-object"
ip:
type: integer
format: int32
minimum: 0
maximum: 1
description: |
If present and equal to 1, Mixpanel will use the ip address of the incoming request
as a distinct_id if none is provided.
This is different from providing a `properties.ip` value in the Event Object.
verbose:
type: integer
format: int32
minimum: 0
maximum: 1
description: |
If present and equal to 1, Mixpanel will respond with a JSON Object describing the success
or failure of the tracking call. The returned object will have two keys: `status`,
with the value 1 on success and 0 on failure, and `error`,
with a string-valued error message if the request wasn't successful.
redirect:
type: string
description: |
If present, Mixpanel will serve a redirect to the given url as a response to the request.
This is useful to add link tracking in notifications.
img:
type: integer
format: int32
minimum: 0
maximum: 1
description: |
If present and equal to 1, Mixpanel will serve a 1x1 transparent pixel image as a response to the request.
This is useful for adding [Pixel Tracking](https://en.wikipedia.org/wiki/Web_beacon)
in places that javascript is not supported.
callback:
type: string
description: |
If present, Mixpanel will return a `content-type: text/javascript` with a body that calls a function
by value provided. This is useful for creating local callbacks to a successful track call in JavaScript.
engage-form:
title: User profile action
type: object
required:
- "data"
properties:
data:
$ref: "#/components/schemas/engage-object"
verbose:
type: integer
format: int32
minimum: 0
maximum: 1
description: |
If present and equal to 1, Mixpanel will respond with a JSON Object describing the success
or failure of the tracking call.
The returned object will have two keys: `status`, with the value 1 on success and 0 on failure,
and `error`, with a string-valued error message if the request wasn't successful.
redirect:
type: string
description: |
If present, Mixpanel will serve a redirect to the given url as a response to the request.
This is useful to add link tracking in notifications.
callback:
type: string
description: |
If present, Mixpanel will return a `content-type: text/javascript` with a body that calls a function
by value provided. This is useful for creating local callbacks to a successful track call in JavaScript.
response-status-flag:
title: Response status value
type: integer
minimum: 0
maximum: 1
description: |
The value `1` indicates all data objects provided are valid.
This does not signify a valid project token or secret.
The value `0` indicates one or more data objects in the body are invalid.
verbose-response:
type: object
title: Verbose response
description: Verbose response on demand.
properties:
status:
$ref: "#/components/schemas/response-status-flag"
error:
type: string
description: Error description if the request wasn't successful.
error-response:
type: object
title: Error response object
properties:
status:
type: string
description: Response status value.
error:
type: string
description: Response error description.
responses:
"200":
description: OK
content:
text/plain:
schema:
$ref: "#/components/schemas/response-status-flag"
application/json:
schema:
$ref: "#/components/schemas/verbose-response"
"401":
description: Unauthorized
content:
application/json:
schema:
$ref: "#/components/schemas/error-response"
"403":
description: Forbidden
content:
application/json:
schema:
$ref: "#/components/schemas/error-response"
paths:
/track#live-event:
post:
summary: Track recent event.
tags:
- Track
operationId: TrackEvent
requestBody:
required: true
content:
application/x-www-form-urlencoded:
schema:
$ref: "#/components/schemas/event-form"
responses:
"200":
$ref: "#/components/responses/200"
"401":
$ref: "#/components/responses/401"
"403":
$ref: "#/components/responses/403"
/track#live-event-deduplicate:
post:
summary: Track recent event with deduplication.
tags:
- Track and Deduplicate
operationId: TrackDeduplicateEvent
requestBody:
required: true
content:
application/x-www-form-urlencoded:
schema:
$ref: "#/components/schemas/event-form"
responses:
"200":
$ref: "#/components/responses/200"
"401":
$ref: "#/components/responses/401"
"403":
$ref: "#/components/responses/403"
/track#past-events-batch:
post:
summary: Track multiple events at once.
tags:
- Track multiple
operationId: TrackMultipleEvents
requestBody:
required: true
content:
application/x-www-form-urlencoded:
schema:
title: Track multiple events form data
type: object
required:
- data
properties:
data:
type: array
items:
$ref: "#/components/schemas/event-object"
maxItems: 50
verbose:
type: integer
format: int32
minimum: 0
maximum: 1
description: |
If present and equal to 1, Mixpanel will respond with a JSON Object describing the success
or failure of the tracking call. The returned object will have two keys: `status`,
with the value 1 on success and 0 on failure, and `error`,
with a string-valued error message if the request wasn't successful.
responses:
"200":
$ref: "#/components/responses/200"
"401":
$ref: "#/components/responses/401"
"403":
$ref: "#/components/responses/403"
/engage#profile-set:
post:
summary: Set profile property
tags:
- Set Property
operationId: EngageProfileSet
requestBody:
required: true
content:
application/x-www-form-urlencoded:
schema:
$ref: "#/components/schemas/engage-form"
type: "object"
required:
- "$token"
- "$distinct_id"
- "$set"
responses:
"200":
$ref: "#/components/responses/200"
"401":
$ref: "#/components/responses/401"
"403":
$ref: "#/components/responses/403"
/engage#profile-set-once:
post:
summary: Set profile property only once
tags:
- Set Property Once
operationId: EngageProfileSetOnce
requestBody:
required: true
content:
application/x-www-form-urlencoded:
schema:
$ref: "#/components/schemas/engage-form"
type: "object"
required:
- "$token"
- "$distinct_id"
- "$set_once"
responses:
"200":
$ref: "#/components/responses/200"
"401":
$ref: "#/components/responses/401"
"403":
$ref: "#/components/responses/403"
/engage#profile-numerical-add:
post:
summary: Add value to profile numerical property
tags:
- Increment Numerical Property
operationId: EngageProfileAdd
requestBody:
required: true
content:
application/x-www-form-urlencoded:
schema:
$ref: "#/components/schemas/engage-form"
type: "object"
required:
- "$token"
- "$distinct_id"
- "$add"
responses:
"200":
$ref: "#/components/responses/200"
"401":
$ref: "#/components/responses/401"
"403":
$ref: "#/components/responses/403"
/engage#profile-list-append:
post:
summary: Add value to profile list property
tags:
- Append to List Property
operationId: EngageProfileAppendToList
requestBody:
required: true
content:
application/x-www-form-urlencoded:
schema:
$ref: "#/components/schemas/engage-form"
type: "object"
required:
- "$token"
- "$distinct_id"
- "$append"
responses:
"200":
$ref: "#/components/responses/200"
"401":
$ref: "#/components/responses/401"
"403":
$ref: "#/components/responses/403"
/engage#profile-list-remove:
post:
summary: Remove item from profile list property
tags:
- Remove from List Property
operationId: EngageProfileRemoveFromList
requestBody:
required: true
content:
application/x-www-form-urlencoded:
schema:
$ref: "#/components/schemas/engage-form"
type: "object"
required:
- "$token"
- "$distinct_id"
- "$remove"
responses:
"200":
$ref: "#/components/responses/200"
"401":
$ref: "#/components/responses/401"
"403":
$ref: "#/components/responses/403"
/engage#profile-unset:
post:
summary: Delete profile property
tags:
- Delete Property
operationId: EngageProfileUnset
requestBody:
required: true
content:
application/x-www-form-urlencoded:
schema:
$ref: "#/components/schemas/engage-form"
type: "object"
required:
- "$token"
- "$distinct_id"
- "$unset"
responses:
"200":
$ref: "#/components/responses/200"
"401":
$ref: "#/components/responses/401"
"403":
$ref: "#/components/responses/403"
/engage#profile-batch-update:
post:
summary: Send a batch of profile updates.
tags:
- Update Multiple Profiles
operationId: EngageMultipleProfiles
requestBody:
required: true
content:
application/x-www-form-urlencoded:
schema:
title: Engage multiple profiles update
type: object
required:
- data
properties:
data:
type: array
items:
$ref: "#/components/schemas/engage-object"
maxItems: 50
verbose:
type: integer
format: int32
minimum: 0
maximum: 1
description: |
If present and equal to 1, Mixpanel will respond with a JSON Object describing the success
or failure of the tracking call.
The returned object will have two keys: `status`, with the value 1 on success and 0 on failure,
and `error`, with a string-valued error message if the request wasn't successful.
redirect:
type: string
description: |
If present, Mixpanel will serve a redirect to the given url as a response to the request.
This is useful to add link tracking in notifications.
callback:
type: string
description: |
If present, Mixpanel will return a `content-type: text/javascript` with a body that calls a function
by value provided. This is useful for creating local callbacks to a successful track call in JavaScript.
responses:
"200":
$ref: "#/components/responses/200"
"401":
$ref: "#/components/responses/401"
"403":
$ref: "#/components/responses/403"