This repository has been archived by the owner on Jul 6, 2018. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 0
/
logzio-public-api.yaml
2924 lines (2792 loc) · 99.1 KB
/
logzio-public-api.yaml
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
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
954
955
956
957
958
959
960
961
962
963
964
965
966
967
968
969
970
971
972
973
974
975
976
977
978
979
980
981
982
983
984
985
986
987
988
989
990
991
992
993
994
995
996
997
998
999
1000
swagger: '2.0'
schemes: [ https ]
host: api.logz.io
basePath: /v1
produces: [ application/json ]
consumes: [ application/json ]
info:
description: >-
## Introduction
This API is documented using the **OpenAPI 2.0** specification. You can browse the API documentation on this page, or you can download the specification file.
#### Updates and improvements
We update this document regularly to reflect changes and improvements to the Logz.io API. If you'd like to suggest corrections or improvements to this document, please email us at [[email protected]](mailto:[email protected]) or submit a ticket in the GitHub repository.
# Authentication
The Logz.io API is available to Enterprise plan subscribers. You can create new tokens in your [account settings](https://app.logz.io/#/dashboard/settings/manage-accounts_). You can also set and revoke API permissions at any time.
If you don't have an Enterprise account, we encourage you to sign up for a [free trial](https://logz.io/signup/freetrial.php).
<!-- ReDoc-Inject: <security-definitions> -->
# Rate limiting
API call and response rates are limited per individual account. To find out your rate limits or to make changes to your account plan, please email [our Support team](mailto:[email protected]).
version: v1
title: Logz.io API
termsOfService: 'https://logz.io/about-us/terms-of-use/'
contact:
email: [email protected]
url: https://logz.io/
license:
name: Apache 2.0
url: 'http://www.apache.org/licenses/LICENSE-2.0.html'
securityDefinitions:
X-API-TOKEN:
description: You can manage your tokens in your Logz.io account settings. Tokens are tied to individual accounts, including sub accounts. Tokens carry privileges to make changes to users and accounts, so it's important to keep your tokens secure.
type: apiKey
in: header
name: X-API-TOKEN
X-USER-TOKEN:
description: The `/search` API endpoint uses the native Elasticsearch API and authenticates with the `X-USER-TOKEN`. `X-USER-TOKEN` is identical to `X-API-TOKEN` in usage. It can be any of the tokens that you manage in your Logz.io account.
type: apiKey
in: header
name: X-USER-TOKEN
security:
- X-API-TOKEN: []
tags:
- name: Manage sub accounts
description: Use these API requests to create, update, retrieve, or delete sub accounts.
- name: Search logs
description: >-
Use the Elasticsearch Search API DSL query language to search your Logz.io data.
To ensure system performance and data availability, we've introduced some limitations to the original Elasticsearch specification. These limitations are detailed in the applicable API calls below.
- name: Retrieve audit trail
- name: Manage CloudTrail links
- name: Manage notification endpoints
- name: Import or export Kibana objects
- name: Manage shared tokens
- name: Logz.io snapshots
- name: Manage users
x-tagGroups:
- name: Log monitoring
tags:
- Search logs
- Logz.io snapshots
- name: Account administration
tags:
- Manage users
- Manage sub accounts
- Manage shared tokens
- Manage notification endpoints
- Import or export Kibana objects
- name: Data security
tags:
- Retrieve audit trail
- Manage shared tokens
- Manage users
- name: AWS security and audit
tags:
- Manage CloudTrail links
paths:
# ::::: ACCOUNTS
/account-management/time-based-accounts:
get:
summary: Retrieve all sub accounts
description: Returns a list of sub accounts as an array of JSON objects.
tags:
- Manage sub accounts
operationId: getAll
responses:
200:
description: successful operation
schema:
type: array
items:
$ref: '#/definitions/TimeBasedAccount'
x-code-samples:
- lang: cURL
source: 'curl --request GET --url "https://api.logz.io/v1/account-management/time-based-accounts" --header "X-API-TOKEN: <token>"'
post:
summary: Create a sub account
description: Creates a new time-based sub account.
tags:
- Manage sub accounts
operationId: createTimeBasedAccount
parameters:
- in: body
name: body
required: false
schema:
$ref: '#/definitions/TimeBasedAccountUpsertRequest'
responses:
200:
description: successful operation
schema:
$ref: '#/definitions/TimeBasedAccountCreationResponse'
x-code-samples:
- lang: cURL
source: >-
curl -X POST \
"https://api.logz.io/v1/account-management/time-based-accounts" \
-H "accept: application/json" -H "content-type: application/json" \
-H "X-API-TOKEN: <token>" \
-d '{
"email": "[email protected]",
"accountName": "AWS Lambda svr 3",
"maxDailyGB": 5,
"retentionDays": 5,
"searchable": true,
"accessible": false,
"sharingObjectsAccounts": [
48672,
36259
],
"docSizeSetting": true,
"utilizationSettings": {
"frequencyMinutes": 5,
"utilizationEnabled": true
}
}'
/account-management/time-based-accounts/detailed:
get:
summary: Retrieve detailed information on all sub accounts
description: Retrieves all time-based sub accounts, returned as an array of objects. Each sub account is its own object.
tags:
- Manage sub accounts
operationId: getAllDetailedTimeBasedAccount
responses:
200:
description: successful operation
schema:
type: array
items:
$ref: '#/definitions/DetailedTimeBasedAccount'
x-code-samples:
- lang: cURL
source: 'curl -X GET "https://api.logz.io/v1/account-management/time-based-accounts/detailed" -H "accept: application/json" -H "content-type: application/json" -H "X-API-TOKEN: <token>"'
/account-management/time-based-accounts/detailed/{id}:
get:
summary: Retrieve detailed account information by ID
description: Using account ID, returns detailed account information.
tags:
- Manage sub accounts
operationId: getDetailedTimeBasedAccount
parameters:
- name: id
in: path
required: true
type: integer
format: int32
description: ID of the account to retrieve
x-example: 99999
responses:
200:
description: successful operation
schema:
$ref: '#/definitions/DetailedTimeBasedAccount'
x-code-samples:
- lang: cURL
source: 'curl -X GET "https://api.logz.io/v1/account-management/time-based-accounts/detailed/99999" -H "accept: application/json" -H "content-type: application/json" -H "X-API-TOKEN: <token>"'
/account-management/time-based-accounts/{id}:
get:
summary: Retrieve sub account by ID
description: Returns account information and configuration as a JSON object.
tags:
- Manage sub accounts
operationId: get
parameters:
- name: id
in: path
required: true
type: integer
format: int32
description: ID of the account to retrieve
x-example: 99999
responses:
200:
description: successful operation
schema:
$ref: '#/definitions/TimeBasedAccount'
x-code-samples:
- lang: cURL
source: 'curl -X GET "https://api.logz.io/v1/account-management/time-based-accounts/99999" -H "accept: application/json" -H "content-type: application/json" -H "X-API-TOKEN: <token>"'
put:
summary: Update a sub account
tags:
- Manage sub accounts
operationId: updateTimeBasedAccount
parameters:
- name: id
in: path
required: true
type: integer
format: int32
description: ID of the account to update
x-example: 99999
- in: body
name: body
required: false
schema:
$ref: '#/definitions/TimeBasedAccountUpsertRequest'
responses:
204:
description: successful operation
x-code-samples:
- lang: cURL
source: >-
curl -X PUT \
"https://api.logz.io/v1/account-management/time-based-accounts/88888" \
-H "accept: application/json" -H "content-type: application/json" \
-H "X-API-TOKEN: <token>" \
-d "{
\"email\": \"[email protected]\",
\"accountName\": \"AWS Lambda svr 3\",
\"maxDailyGB\": 5,
\"retentionDays\": 5,
\"searchable\": true,
\"accessible\": false,
\"sharingObjectsAccounts\": [
55555
],
\"docSizeSetting\": true,
\"utilizationSettings\": {
\"frequencyMinutes\": 5,
\"utilizationEnabled\": true
}
}"
delete:
summary: Delete a sub account
description: Using an account ID, deletes a sub account.
tags:
- Manage sub accounts
operationId: deleteTimeBasedAccount
parameters:
- name: id
in: path
required: true
type: integer
format: int32
description: ID of the account to delete
x-example: 99999
responses:
204:
description: successful operation
x-code-samples:
- lang: cURL
source: 'curl -X DELETE "https://api.logz.io/v1/account-management/time-based-accounts/88888" -H "accept: application/json" -H "content-type: application/json" -H "X-API-TOKEN: <token>"'
# ::::: SEARCH, SCROLL
/search:
post:
security:
- X-USER-TOKEN: []
operationId: search
summary: Search logs
description: >-
Searches your account data using the Elasticsearch [Search API DSL](https://www.elastic.co/guide/en/elasticsearch/reference/5.x/search.html) query language.
**Note:** To ensure speed and availability of your logs, we've restricted some options from the Elasticsearch defaults that could hamper system performance. Restrictions are described with their respective elements below.
tags:
- Search logs
parameters:
- in: body
name: body
required: true
schema:
type: object
required:
- query
properties:
query:
type: object
description: >-
#### Limitations
* Your query will run only on data sent today and yesterday. You can still specify a filter on `timestamp` to search a smaller time frame.
* When using `query_string`, `allow_leading_wildcard` must be set to `false`
* `wildcard` cannot start with `*` or `?`
* Cannot contain `fuzzy_max_expansions`, `max_expansions`, or `max_determinized_states`
from:
type: integer
minimum: 0
default: 0
description: Of the results found, the first result to return
example: 10
size:
type: integer
description: Number of results to return
default: 10
example: 50
sort:
type: array
description: >-
#### Limitations
* Cannot sort or aggregate on `message`
items:
type: object
_source:
type: array
description: >-
* _Option 1:_ A single item to say whether you want to return the `_source` field.
* _Option 2:_ An array of fields to return.
items:
- type: boolean
description: To return the `_source` field, `true`. Otherwise, `false`.
example: true
- type: string
description: Fields to return
post_filter:
type: object
aggs:
type: object
description: >-
#### Limitations
* When using the `size` element, the value must be ≤ `1000`
* Can't nest 2 or more bucket aggregations of these types: `date_histogram`, `geohash_grid`, `histogram`, `ip_ranges`, `significant_terms`, `terms`
* Can't sort or aggregate on the `message` field
* Aggregation type `significant_terms` can't be used
**Note:** You can use `aggs` or `aggregations` as the field name
example: '{ \"byType\": { \"terms\": { \"field\": \"type\", \"size\": 5 } } }'
x-code-samples:
- lang: cURL
source: >-
curl -X POST https://api.logz.io/v1/search \
-H 'Content-Type: application/json' \
-H 'X-USER-TOKEN: <token>' \
-d '{
"size": 10,
"query": {
"bool": {
"must": [{
"range": {
"@timestamp": {
"gte": "now-5m",
"lte": "now"
}
}
}]
}
},
"aggs": {
"byType": {
"terms": {
"field": "type",
"size": 5
}
}
}
}'
responses:
200:
description: successful query
schema:
type: object
example: '{ "hits": { "total": 339604, "max_score": 0, "hits": [] }, "aggregations": { "byType": { "doc_count_error_upper_bound": 0, "sum_other_doc_count": 44879, "buckets": [ { "key": "web-app", "doc_count": 163690 }, { "key": "core-service", "doc_count": 64893 } ] } } }'
400:
description: invalid query
403:
description: access forbidden
429:
description: rate limit exceeded
503:
description: service unavailable
/scroll:
post:
summary: Scroll logs
tags:
- Search logs
description: >-
Searches your account data using the [Elasticsearch Search API DSL](https://www.elastic.co/guide/en/elasticsearch/reference/5.x/search.html) query language.
**Note:** To ensure speed and availability of your logs, we've restricted some options from the Elasticsearch defaults that could hamper system performance. Restrictions are described with their respective elements below.
operationId: scroll
parameters:
- in: body
name: body
required: false
schema:
$ref: '#/definitions/ScrollRequest'
x-code-samples:
- lang: cURL
source: >-
curl -X POST https://api.logz.io/v1/scroll \
-H 'Content-Type: application/json' \
-H 'X-API-TOKEN: <token>' \
-d '{
"size": 10,
"query": {
"bool": {
"must": [{
"range": {
"@timestamp": {
"gte": "now-5m",
"lte": "now"
}
}
}]
}
},
"aggs": {
"byType": {
"terms": {
"field": "type",
"size": 5
}
}
}
}'
responses:
200:
description: successful operation
schema:
$ref: '#/definitions/ScrollResponse'
400:
description: invalid query
403:
description: access forbidden
429:
description: rate limit exceeded
503:
description: service unavailable
# ::::: AUDIT TRAIL
/audit-trail/event-types:
post:
operationId: listAccountAuditTrails
summary: Retrieve all event types in the audit trail
description: Returns an array of strings. Each string is an event type that appears in the account's audit trail. Each event type is shown once, no matter how many times it occurs in the acconut's audit trail.
tags:
- Retrieve audit trail
responses:
200:
description: successful operation
schema:
$ref: '#/definitions/AuditTrailEventTypesResponse'
x-code-samples:
- lang: cURL
source: 'curl -X POST "https://api.logz.io/v1/audit-trail/event-types" -H "accept: application/json" -H "content-type: application/json" -H "X-API-TOKEN: <token>"'
/audit-trail:
post:
operationId: listAccountAuditTrailsFiltered
summary: Retrieve a filtered list of audit trail events
tags:
- Retrieve audit trail
parameters:
- in: body
name: body
required: false
schema:
$ref: '#/definitions/AuditTrailFilterRequest'
x-code-samples:
- lang: cURL
source: 'curl -X POST "https://api.logz.io/v1/audit-trail" -H "accept: application/json" -H "X-API-TOKEN: <token>" -H "Content-Type: application/json" -d "{\"from\":20, \"size\":15, \"fromDate\":1520444072192, \"toDate\":1528216472192, \"sortDescending\":true, \"includeFiltersData\":true, \"auditEventType\":null, \"auditEventUser\":null}"'
responses:
200:
description: successful operation
schema:
$ref: '#/definitions/AuditTrailFilteredResponse'
# ::::: CLOUDTRAIL
/log-shipping/cloudtrails:
get:
operationId: getAccountCloudTrails
summary: Retrieve all CloudTrail links
description: >-
Returns a list of CloudTrail links attached to your Logz.io account
**Note:** This endpoint requires permissions that must be set by our Support team. Please email [[email protected]](mailto:[email protected]) for assistance.
tags:
- Manage CloudTrail links
responses:
200:
description: successful operation
schema:
type: array
items:
$ref: '#/definitions/CloudTrailResponse'
x-code-samples:
- lang: cURL
source: 'curl -X GET "https://api.logz.io/v1/log-shipping/cloudtrails" -H "accept: application/json" -H "content-type: application/json" -H "X-API-TOKEN: <token>"'
post:
operationId: createCloudTrail
summary: Create a CloudTrail link
description: >-
Creates a new link to your CloudTrail data in an AWS S3 bucket.
**Note:** This endpoint requires permissions that must be set by our Support team. Please email [[email protected]](mailto:[email protected]) for assistance.
tags:
- Manage CloudTrail links
parameters:
- in: body
name: body
required: false
schema:
$ref: '#/definitions/CloudTrailRequest'
responses:
200:
description: successful operation
schema:
$ref: '#/definitions/IdBean'
x-code-samples:
- lang: cURL
source: >-
'curl -X POST "https://api.logz.io/v1/log-shipping/cloudtrails" \
-d "{
\"accessKey\": \"ee07df5801500745419c6dff\",
\"secretKey\": \"506d891fe2163a511b450eddc3279539f6\",
\"bucket\": \"LogzioBucket\",
\"prefix\": \"AWSLogs/7364988021587/myprefix\",
\"active\": true
}"'
/log-shipping/cloudtrails/{id}:
get:
operationId: getCloudTrail
summary: Retrieve a CloudTrail link by ID
description: >-
Returns connection information on a single CloudTrail link.
**Note:** This endpoint requires permissions that must be set by our Support team. Please email [[email protected]](mailto:[email protected]) for assistance.
tags:
- Manage CloudTrail links
parameters:
- name: id
in: path
required: true
type: integer
format: int32
description: ID of the CloudTrail link
responses:
200:
description: successful operation
schema:
$ref: '#/definitions/CloudTrailResponse'
put:
operationId: updateCloudTrail
summary: Update a CloudTrail link
description: >-
Updates connection information for a CloudTrail link.
**Note:** This endpoint requires permissions that must be set by our Support team. Please email [[email protected]](mailto:[email protected]) for assistance.
tags:
- Manage CloudTrail links
parameters:
- in: body
name: body
required: false
schema:
$ref: '#/definitions/CloudTrailRequest'
- name: id
in: path
required: true
type: integer
format: int32
responses:
200:
description: successful operation
schema:
$ref: '#/definitions/MessageBean'
delete:
operationId: deleteCloudTrail
summary: Delete a CloudTrail link
description: >-
Deletes a Logz.io link to CloudTrail.
**Note:** This endpoint requires permissions that must be set by our Support team. Please email [[email protected]](mailto:[email protected]) for assistance.
tags:
- Manage CloudTrail links
parameters:
- name: id
in: path
required: true
type: integer
format: int32
responses:
200:
description: successful operation
schema:
$ref: '#/definitions/MessageBean'
# ::::: NOTIFICATION ENDPOINTS
/endpoints/slack:
post:
operationId: createSlack
summary: Create a Slack endpoint
tags:
- Manage notification endpoints
description: Creates a new Slack notification endpoint or sends a test message to Slack
parameters:
- name: test
in: query
required: false
type: boolean
default: false
description: >-
To send a test message to the endpoint, `true`. Otherwise, `false`.
**Note:** If set to `true`, the notification endpoint is not created. To create the endpoint, you need to send the API request where `test=false`.
- in: body
name: body
required: false
schema:
$ref: '#/definitions/SlackEndpointUpsertRequest'
x-code-samples:
- lang: cURL
source: 'curl -X POST "https://api.logz.io/v1/endpoints/slack?test=false" -H "accept: application/json" -H "content-type: application/json" -H "X-API-TOKEN: <token>" -d \"{ \"title\": \"New Slack endpoint\", \"description\": \"Sends notifications to #logzio-alerts channel\", \"url\": \"https://hooks.slack.com/services/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\"}"'
responses:
200:
description: successful operation
schema:
$ref: '#/definitions/EndpointUpsertResponse'
/endpoints/slack/{id}:
put:
tags:
- Manage notification endpoints
summary: Update Slack endpoint
description: Updates a Slack notification endpoint or sends a test message to Slack
operationId: updateSlack
parameters:
- name: id
in: path
required: true
type: integer
format: int32
description: ID of the notification endpoint
- name: test
in: query
required: false
type: boolean
default: false
description: >-
To send a test message to the endpoint, `true`. Otherwise, `false`.
**Note:** If set to `true`, the notification endpoint is not updated. To update the endpoint, you need to send the API request where `test=false`.
- in: body
name: body
required: false
schema:
$ref: '#/definitions/SlackEndpointUpsertRequest'
x-code-samples:
- lang: cURL
source: 'curl -X PUT "https://api.logz.io/v1/endpoints/slack/269?test=false" -H "accept: application/json" -H "content-type: application/json" -H "X-API-TOKEN: <token>" -d "{ \"title\": \"Updated Slack endpoint\", \"description\": \"Sends notifications to #logzio-alerts channel\", \"url\": \"https://hooks.slack.com/services/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\"}"'
responses:
200:
description: successful operation
schema:
$ref: '#/definitions/EndpointUpsertResponse'
/endpoints/custom:
post:
tags:
- Manage notification endpoints
summary: Create a custom notification endpoint
description: Creates a new notification endpoint for a custom integration or sends a test message to the custom endpoint.
operationId: createCustom
parameters:
- name: test
in: query
required: false
type: boolean
default: false
description: >-
To send a test message to the endpoint, `true`. Otherwise, `false`.
**Note:** If set to `true`, the notification endpoint is not created. To create the endpoint, you need to send the API request where `test=false`.
- in: body
name: body
required: false
schema:
$ref: '#/definitions/CustomEndpointUpsertRequest'
x-code-samples:
- lang: cURL
source: 'curl -X POST "https://api.logz.io/v1/endpoints/custom" -H "accept: application/json" -H "content-type: application/json" -H "X-API-TOKEN: <token>" -d "{\"title\": \"New custom endpoint\", \"description\": \"Sends notifications to my custom endpoint\", \"url\": \"https://my.custom-endpoint.com\", \"method\": \"POST\", \"headers\": \"authKey=6e30-60a9-3591\", \"bodyTemplate\": {\"subject\": \"Alert from Logz.io\", \"message\": {\"severity\": \"LOW\", \"body\": \"Check Logz.io for log activity\"} }}"'
responses:
200:
description: successful operation
schema:
$ref: '#/definitions/EndpointUpsertResponse'
/endpoints/custom/{id}:
put:
tags:
- Manage notification endpoints
summary: Update a custom notification endpoint
description: Updates a new notification endpoint for a custom integration or sends a test message to the custom endpoint.
operationId: updateCustom
parameters:
- name: id
in: path
required: true
type: integer
format: int32
- name: test
in: query
required: false
type: boolean
default: false
description: >-
To send a test message to the endpoint, `true`. Otherwise, `false`.
**Note:** If set to `true`, the notification endpoint is not updated. To update the endpoint, you need to send the API request where `test=false`.
- in: body
name: body
required: false
schema:
$ref: '#/definitions/CustomEndpointUpsertRequest'
x-code-samples:
- lang: cURL
source: 'curl -X PUT "https://api.logz.io/v1/endpoints/custom/275" -H "accept: application/json" -H "content-type: application/json" -H "X-API-TOKEN: <token>" -d "{\"title\": \"Updated custom endpoint\", \"description\": \"Sends notifications to my custom endpoint\", \"url\": \"https://my.custom-endpoint.com/\", \"method\": \"POST\", \"headers\": \"authKey=6e30-60a9-3591\", \"bodyTemplate\": {\"subject\": \"Alert from Logz.io\", \"message\": {\"severity\": \"LOW\", \"body\": \"Check Logz.io for log activity\"} }}"'
responses:
200:
description: successful operation
schema:
$ref: '#/definitions/EndpointUpsertResponse'
/endpoints/pager-duty:
post:
tags:
- Manage notification endpoints
summary: Create a PagerDuty endpoint
description: Creates a new PagerDuty notification endpoint or sends a test message to PagerDuty.
operationId: createPagerDuty
parameters:
- name: test
in: query
required: false
type: boolean
default: false
description: >-
To send a test message to the endpoint, `true`. Otherwise, `false`.
**Note:** If set to `true`, the notification endpoint is not created. To create the endpoint, you need to send the API request where `test=false`.
- in: body
name: body
required: false
schema:
$ref: '#/definitions/PagerDutyEndpointUpsertRequest'
x-code-samples:
- lang: cURL
source: 'curl -X POST "https://api.logz.io/v1/endpoints/pager-duty" -H "accept: application/json" -H "content-type: application/json" -H "X-API-TOKEN: <token>" -d "{ \"title\": \"New PagerDuty endpoint\", \"description\": \"Sends notifications to PagerDuty\", \"serviceKey\": \"78c3b6cf0a884a538410fe281227eb0b\"}"'
responses:
200:
description: successful operation
schema:
$ref: '#/definitions/EndpointUpsertResponse'
/endpoints/pager-duty/{id}:
put:
tags:
- Manage notification endpoints
summary: Update a PagerDuty endpoint
description: Updates a PagerDuty notification endpoint or sends a test message to PagerDuty
operationId: updatePagerDuty
parameters:
- name: id
in: path
required: true
type: integer
format: int32
description: ID of the notification endpoint
- name: test
in: query
required: false
type: boolean
default: false
description: >-
To send a test message to the endpoint, `true`. Otherwise, `false`.
**Note:** If set to `true`, the notification endpoint is not updated. To update the endpoint, you need to send the API request where `test=false`.
- in: body
name: body
required: false
schema:
$ref: '#/definitions/PagerDutyEndpointUpsertRequest'
x-code-samples:
- lang: cURL
source: 'curl -X PUT "https://api.logz.io/v1/endpoints/pager-duty/271" -H "accept: application/json" -H "content-type: application/json" -H "X-API-TOKEN: <token>" -d "{ \"title\": \"Updated PagerDuty endpoint\", \"description\": \"Sends notifications to PagerDuty\", \"serviceKey\": \"78c3b6cf0a884a538410fe281227eb0b\"}"'
responses:
200:
description: successful operation
schema:
$ref: '#/definitions/EndpointUpsertResponse'
/endpoints/big-panda:
post:
tags:
- Manage notification endpoints
summary: Create a BigPanda endpoint
description: Creates a new BigPanda notification endpoint or sends a test message to BigPanda.
operationId: createBigPanda
parameters:
- name: test
in: query
required: false
type: boolean
default: false
description: >-
To send a test message to the endpoint, `true`. Otherwise, `false`.
**Note:** If set to `true`, the notification endpoint is not created. To create the endpoint, you need to send the API request where `test=false`.
- in: body
name: body
required: false
schema:
$ref: '#/definitions/BigPandaEndpointUpsertRequest'
responses:
200:
description: successful operation
schema:
$ref: '#/definitions/EndpointUpsertResponse'
x-code-samples:
- lang: cURL
source: 'curl -X POST "https://api.logz.io/v1/endpoints/big-panda" -H "accept: application/json" -H "content-type: application/json" -H "X-API-TOKEN: <token>" -d "{ \"title\": \"New BigPanda endpoint\", \"description\": \"Sends notifications to BigPanda\", \"apiToken\": \"94ad63254a1397a51a1ae340c4f10890\", \"appKey\": \"c687f9231619d7d7b959f33e4cc821a5\"}"'
/endpoints/big-panda/{id}:
put:
tags:
- Manage notification endpoints
summary: Update a BigPanda endpoint
description: Updates a BigPanda notification endpoint or sends a test message to BigPanda
operationId: updateBigPanda
parameters:
- name: id
in: path
required: true
type: integer
format: int32
description: ID of the notification endpoint
- name: test
in: query
required: false
type: boolean
default: false
description: >-
To send a test message to the endpoint, `true`. Otherwise, `false`.
**Note:** If set to `true`, the notification endpoint is not updated. To update the endpoint, you need to send the API request where `test=false`.
- in: body
name: body
required: false
schema:
$ref: '#/definitions/BigPandaEndpointUpsertRequest'
x-code-samples:
- lang: cURL
source: 'curl -X PUT "https://api.logz.io/v1/endpoints/big-panda/272" -H "accept: application/json" -H "content-type: application/json" -H "X-API-TOKEN: <token>" -d "{\"title\": \"Updated BigPanda endpoint\", \"description\": \"Sends notifications to BigPanda\", \"apiToken\": \"94ad63254a1397a51a1ae340c4f10890\", \"appKey\": \"c687f9231619d7d7b959f33e4cc821a5\"}"'
responses:
200:
description: successful operation
schema:
$ref: '#/definitions/EndpointUpsertResponse'
/endpoints/data-dog:
post:
tags:
- Manage notification endpoints
summary: Create a Datadog endpoint
description: Creates a new Datadog notification endpoint or sends a test message to Datadog.
operationId: createDataDog
parameters:
- name: test
in: query
required: false
type: boolean
default: false
description: >-
To send a test message to the endpoint, `true`. Otherwise, `false`.
**Note:** If set to `true`, the notification endpoint is not created. To create the endpoint, you need to send the API request where `test=false`.
- in: body
name: body
required: false
schema:
$ref: '#/definitions/DatadogEndpointUpsertRequest'
x-code-samples:
- lang: cURL
source: 'curl -X POST "https://api.logz.io/v1/endpoints/data-dog" -H "accept: application/json" -H "content-type: application/json" -H "X-API-TOKEN: <token>" -d "{ \"title\": \"New Datadog endpoint\", \"description\": \"Sends notifications to Datadog\", \"apiKey\": \"c687f9231619d7d7b959f33e4cc821a5\"}"'
responses:
200:
description: successful operation
schema:
$ref: '#/definitions/EndpointUpsertResponse'
/endpoints/data-dog/{id}:
put:
tags:
- Manage notification endpoints
summary: Update a Datadog endpoint
description: Updates a Datadog notification endpoint or sends a test message to Datadog
operationId: updateDataDog
parameters:
- name: id
in: path
required: true
type: integer
format: int32
description: ID of the notification endpoint
- name: test
in: query
required: false
type: boolean
default: false
description: >-
To send a test message to the endpoint, `true`. Otherwise, `false`.
**Note:** If set to `true`, the notification endpoint is not updated. To update the endpoint, you need to send the API request where `test=false`.
- in: body
name: body
required: false
schema:
$ref: '#/definitions/DatadogEndpointUpsertRequest'
x-code-samples:
- lang: cURL
source: 'curl -X PUT "http://endpoints/data-dog/273" -H "accept: application/json" -H "content-type: application/json" -H "X-API-TOKEN: <token>" -d "{\"title\": \"Updated Datadog endpoint\", \"description\": \"Sends notifications to Datadog\", \"apiKey\": \"c687f9231619d7d7b959f33e4cc821a5\"}"'
responses:
200:
description: successful operation
schema:
$ref: '#/definitions/EndpointUpsertResponse'
/endpoints/victorops:
post:
tags:
- Manage notification endpoints
summary: Create a VictorOps endpoint
description: Creates a new VictorOps notification endpoint or sends a test message to VictorOps.
operationId: createVictorops
parameters:
- name: test
in: query
required: false
type: boolean
default: false
description: >-
To send a test message to the endpoint, `true`. Otherwise, `false`.
**Note:** If set to `true`, the notification endpoint is not created. To create the endpoint, you need to send the API request where `test=false`.
- in: body
name: body
required: false
schema:
$ref: '#/definitions/VictoropsEndpointUpsertRequest'
x-code-samples:
- lang: cURL
source: 'curl -X POST "https://api.logz.io/v1/endpoints/victorops" -H "accept: application/json" -H "content-type: application/json" -H "X-API-TOKEN: <token>" -d "{ \"title\": \"New VictorOps endpoint\", \"description\": \"Sends notifications to VictorOps\", \"routingKey\": \"devops\", \"messageType\": \"WARNING\", \"serviceApiKey\": \"c687f9231619d7d7b959f33e4cc821a5\"}"'
responses:
200:
description: successful operation
schema:
$ref: '#/definitions/EndpointUpsertResponse'
/endpoints/victorops/{id}: