-
Notifications
You must be signed in to change notification settings - Fork 0
/
openapi.yml
1488 lines (1434 loc) · 50.5 KB
/
openapi.yml
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
openapi: 3.0.3
servers:
- url: https://api.sensible.so/v0
description: Production server (uses live data)
info:
title: Configuration
version: 0.0.1
description: Sensible API for configuring document types, SenseML configurations, and reference documents.
license: # TODO: fill in
name: Sensible API
url: https://www.TBD.org/licenses/LICENSE-2.0.html
paths:
/document_types:
get:
operationId: list-document-types
summary: List document types for this account
description: List all document types for this account.
tags:
- Document type
responses:
200:
content:
application/json:
schema:
$ref: '#/components/schemas/GetAllDocumentTypes'
description: List of document types for the current account
400:
$ref: '#/components/responses/400'
401:
$ref: '#/components/responses/401'
415:
$ref: '#/components/responses/415'
500:
$ref: '#/components/responses/500'
post:
operationId: create-document-type
summary: Create document type
description: Create a document type.
tags:
- Document type
requestBody:
required: true
content:
application/json:
schema:
$ref: '#/components/schemas/PostDocumentType'
responses:
200:
content:
application/json:
schema:
$ref: '#/components/schemas/DocumentType'
description: List of document types for the current account
400:
$ref: '#/components/responses/400'
401:
$ref: '#/components/responses/401'
415:
$ref: '#/components/responses/415'
500:
$ref: '#/components/responses/500'
/document_types/{type-id}:
parameters:
- $ref: '#/components/parameters/documentTypeId'
get:
operationId: get-document-type
summary: Get document type
description: Find the document type id using the `/document_types` endpoint.
tags:
- Document type
responses:
200:
content:
application/json:
schema:
$ref: '#/components/schemas/DocumentType'
description: Identified document type
400:
$ref: '#/components/responses/400'
401:
$ref: '#/components/responses/401'
404:
$ref: '#/components/responses/404'
415:
$ref: '#/components/responses/415'
500:
$ref: '#/components/responses/500'
put:
operationId: update-document-type
summary: Update document type
description: |
Update an existing document type with new information. For example, use this endpoint to add validations:
```curl
curl --location --request PUT 'https://api.sensible.so/v0/document_types/<TYPE_ID>' \
--header 'Authorization: Bearer YOUR_API_KEY' \
--header 'Content-Type: application/json' \
--data-raw '{"schema":{"validations":[{"description":"example validation to test broker email format","condition":{"match":[{"var":"broker\\.email.value"},"^\\S+\\@\\S+$"]},"severity":"warning","fields":["test"]}]}} '
```
tags:
- Document type
requestBody:
required: true
content:
application/json:
schema:
$ref: '#/components/schemas/PutDocumentType'
example:
name: pay_stubs
schema:
validations:
- description: total pay is listed in paystub
condition: {"exists":[{"var":"total_pay.value"}]}
severity: warning
responses:
200:
content:
application/json:
schema:
$ref: '#/components/schemas/DocumentType'
description: Identified document type
400:
$ref: '#/components/responses/400'
401:
$ref: '#/components/responses/401'
404:
$ref: '#/components/responses/404'
415:
$ref: '#/components/responses/415'
500:
$ref: '#/components/responses/500'
delete:
operationId: delete-document-type
summary: Delete document type
description: |
Delete a document type and everything it contains, for example configurations and reference PDfs,
but not its extraction history displayed in the Sensible app.
tags:
- Document type
responses:
204:
$ref: '#/components/responses/204'
400:
$ref: '#/components/responses/400'
401:
$ref: '#/components/responses/401'
404:
$ref: '#/components/responses/404'
415:
$ref: '#/components/responses/415'
500:
$ref: '#/components/responses/500'
/document_types/{type-id}/configurations:
parameters:
- $ref: '#/components/parameters/documentTypeId'
get:
operationId: list-configurations
summary: List configurations in a document type
description: List configurations in a document type.
tags:
- Configuration
responses:
200:
content:
application/json:
schema:
$ref: '#/components/schemas/GetAllConfigurations'
description: List of document types for the current account
400:
$ref: '#/components/responses/400'
401:
$ref: '#/components/responses/401'
404:
$ref: '#/components/responses/404'
415:
$ref: '#/components/responses/415'
500:
$ref: '#/components/responses/500'
post:
operationId: create-configuration
summary: Create configuration in a document type
description: Pass the configuration as stringified JSON.
tags:
- Configuration
requestBody:
required: true
content:
application/json:
schema:
$ref: '#/components/schemas/PostConfiguration'
responses:
200:
content:
application/json:
schema:
$ref: '#/components/schemas/ConfigurationResponse'
description: The created configuration
400:
$ref: '#/components/responses/400'
401:
$ref: '#/components/responses/401'
404:
$ref: '#/components/responses/404'
415:
$ref: '#/components/responses/415'
500:
$ref: '#/components/responses/500'
/document_types/{type-id}/configurations/{config-name}:
parameters:
- $ref: '#/components/parameters/documentTypeId'
- $ref: '#/components/parameters/configurationName'
get:
operationId: get-configuration
summary: Get configuration
description: Get a configuration as stringified JSON.
tags:
- Configuration
responses:
200:
content:
application/json:
schema:
$ref: '#/components/schemas/ConfigurationResponse'
description: The identified configuration
400:
$ref: '#/components/responses/400'
401:
$ref: '#/components/responses/401'
404:
$ref: '#/components/responses/404'
415:
$ref: '#/components/responses/415'
500:
$ref: '#/components/responses/500'
put:
operationId: update-configuration
summary: Update configuration
description: Replace a published or draft version of the configuration.
tags:
- Configuration
requestBody:
required: true
content:
application/json:
schema:
$ref: '#/components/schemas/PutConfiguration'
responses:
200:
content:
application/json:
schema:
$ref: '#/components/schemas/ConfigurationResponse'
description: The created configuration
400:
$ref: '#/components/responses/400'
401:
$ref: '#/components/responses/401'
404:
$ref: '#/components/responses/404'
415:
$ref: '#/components/responses/415'
500:
$ref: '#/components/responses/500'
delete:
operationId: delete-configuration
summary: Delete configuration
description: Delete a configuration and its versions.
tags:
- Configuration
responses:
204:
$ref: '#/components/responses/204'
400:
$ref: '#/components/responses/400'
401:
$ref: '#/components/responses/401'
404:
$ref: '#/components/responses/404'
415:
$ref: '#/components/responses/415'
500:
$ref: '#/components/responses/500'
/document_types/{type-id}/configurations/{config-name}/versions:
parameters:
- $ref: '#/components/parameters/documentTypeId'
- $ref: '#/components/parameters/configurationName'
get:
operationId: get-configuration-versions
summary: List versions for a configuration
description: Get the version ids for a configuration.
tags:
- Configuration
responses:
200:
description: Version information for the identified configuration
content:
application/json:
schema:
$ref: '#/components/schemas/ConfigurationVersionsResponse'
400:
$ref: '#/components/responses/400'
401:
$ref: '#/components/responses/401'
404:
$ref: '#/components/responses/404'
415:
$ref: '#/components/responses/415'
500:
$ref: '#/components/responses/500'
/document_types/{type-id}/configurations/{config-name}/{version}:
parameters:
- $ref: '#/components/parameters/documentTypeId'
- $ref: '#/components/parameters/configurationName'
- $ref: '#/components/parameters/versionIdentifier'
get:
operationId: get-configuration-by-version
summary: Get configuration by version
description: Get a configuration as stringified JSON by version id.
tags:
- Configuration
responses:
200:
content:
application/json:
schema:
$ref: '#/components/schemas/ConfigurationResponse'
description: The identified configuration
400:
$ref: '#/components/responses/400'
401:
$ref: '#/components/responses/401'
404:
$ref: '#/components/responses/404'
415:
$ref: '#/components/responses/415'
500:
$ref: '#/components/responses/500'
put:
operationId: publish-configuration-by-version
summary: Publish configuration to an environment
description: To publish to an environment instead of as the current draft, the configuration must be valid according to this [schema](https://schema.sensible.so/configuration.schema.json).
tags:
- Configuration
requestBody:
required: true
content:
application/json:
schema:
$ref: '#/components/schemas/PublishConfigurationVersion'
responses:
200:
content:
application/json:
schema:
$ref: '#/components/schemas/ConfigurationResponse'
description: The identified configuration
400:
$ref: '#/components/responses/400'
401:
$ref: '#/components/responses/401'
404:
$ref: '#/components/responses/404'
415:
$ref: '#/components/responses/415'
500:
$ref: '#/components/responses/500'
delete:
operationId: delete-configuration-by-version
summary: Delete draft or unpublish configuration
description: >-
To delete a draft, specify a version name in the `version` parameter.
To unpublish a configuration, enter the publication environment name in the `version` parameter, for example,
`development`.
tags:
- Configuration
parameters:
- $ref: '#/components/parameters/documentTypeId'
- $ref: '#/components/parameters/configurationName'
- in: path
name: version
required: true
description: >-
if unpublishing a configuration from an environment, the name of the environment (`development`, `production`.)
If deleting the current draft, the version number of the current draft.
schema:
type: string
responses:
204:
$ref: '#/components/responses/204'
400:
$ref: '#/components/responses/400'
401:
$ref: '#/components/responses/401'
404:
$ref: '#/components/responses/404'
415:
$ref: '#/components/responses/415'
500:
$ref: '#/components/responses/500'
/document_types/{type-id}/goldens:
parameters:
- $ref: '#/components/parameters/documentTypeId'
get:
operationId: list-reference-documents
summary: List all reference documents in a document type
description: List all reference documents in a document type
tags:
- Reference document
responses:
200:
content:
application/json:
schema:
$ref: '#/components/schemas/GetAllGoldens'
description: List of reference documents for the current account
400:
$ref: '#/components/responses/400'
401:
$ref: '#/components/responses/401'
404:
$ref: '#/components/responses/404'
415:
$ref: '#/components/responses/415'
500:
$ref: '#/components/responses/500'
post:
operationId: create-reference-document
summary: Create reference document
description: >-
Specify document metadata in the request, and get back an `upload_url` at which to put the PDF,
for example with `curl -T ./sample.pdf`.
tags:
- Reference document
requestBody:
required: true
content:
application/json:
schema:
$ref: '#/components/schemas/PostGolden'
responses:
200:
content:
application/json:
schema:
$ref: '#/components/schemas/GoldenResponse'
description: The created reference document
400:
$ref: '#/components/responses/400'
401:
$ref: '#/components/responses/401'
404:
$ref: '#/components/responses/404'
415:
$ref: '#/components/responses/415'
500:
$ref: '#/components/responses/500'
/document_types/{type-id}/goldens/{document-name}:
parameters:
- $ref: '#/components/parameters/documentTypeId'
- $ref: '#/components/parameters/documentName'
get:
operationId: get-reference-document
summary: Get reference document metadata
description: Get download URL and other metadata for a reference document.
tags:
- Reference document
responses:
200:
content:
application/json:
schema:
$ref: '#/components/schemas/GoldenResponse'
description: The identified reference document
400:
$ref: '#/components/responses/400'
401:
$ref: '#/components/responses/401'
404:
$ref: '#/components/responses/404'
415:
$ref: '#/components/responses/415'
500:
$ref: '#/components/responses/500'
put:
operationId: update-reference-document
summary: Update metadata for a reference document
description: Update metadata for a reference document
tags:
- Reference document
requestBody:
required: true
content:
application/json:
schema:
$ref: '#/components/schemas/PutGolden'
responses:
200:
content:
application/json:
schema:
$ref: '#/components/schemas/GoldenResponse'
description: The updated reference document
400:
$ref: '#/components/responses/400'
401:
$ref: '#/components/responses/401'
404:
$ref: '#/components/responses/404'
415:
$ref: '#/components/responses/415'
500:
$ref: '#/components/responses/500'
delete:
operationId: delete-reference-document
summary: Delete reference document
description: Delete a reference document and break associations to any configs.
tags:
- Reference document
responses:
204:
$ref: '#/components/responses/204'
400:
$ref: '#/components/responses/400'
401:
$ref: '#/components/responses/401'
404:
$ref: '#/components/responses/404'
415:
$ref: '#/components/responses/415'
500:
$ref: '#/components/responses/500'
/document_types/{type-id}/goldens/{document-name}/configuration:
parameters:
- $ref: '#/components/parameters/documentTypeId'
- $ref: '#/components/parameters/documentName'
delete:
operationId: delete-reference-document-association
summary: Unassociate reference document from configuration
description: Break the association between a reference document and its configuration.
tags:
- Reference document
responses:
204:
$ref: '#/components/responses/204'
400:
$ref: '#/components/responses/400'
401:
$ref: '#/components/responses/401'
404:
$ref: '#/components/responses/404'
415:
$ref: '#/components/responses/415'
500:
$ref: '#/components/responses/500'
# Comment: decision to remove from public API reference as of march 2023; not being used. if make public, check accuracy of response model
# /extract_from_golden/{type-name}:
# parameters:
# - $ref: '#/components/parameters/documentTypeName'
# - $ref: '#/components/parameters/environment'
# post:
# operationId: extract-from-reference-document
# summary: Extract from reference document
# description: >-
# Extract from a specified reference document in a document type.
# Return the best-scoring extraction from the configurations in the document type, or from the
# specified configuration.
# tags:
# - Reference document extraction
# requestBody:
# required: true
# content:
# application/json:
# schema:
# $ref: '#/components/schemas/PostGoldenExtraction'
# responses:
# '200':
# content:
# application/json:
# schema:
# $ref: '#/components/schemas/ResponseGoldenExtraction'
# description: The structured data extracted from the reference document
# 400: # todo I didn't verify 40x responses for any extract_from_goldens, just assumed
# $ref: '#/components/responses/400'
# 401:
# $ref: '#/components/responses/401'
# 404:
# $ref: '#/components/responses/404'
# 415:
# $ref: '#/components/responses/415'
# 500:
# $ref: '#/components/responses/500'
# /extract_from_golden/{type-name}/{config-name}:
# parameters:
# - $ref: '#/components/parameters/documentTypeName'
# - $ref: '#/components/parameters/configurationName'
# - $ref: '#/components/parameters/environment'
# post:
# operationId: extract-from-reference-document-and-config
# summary: Extract from reference document using configuration
# description: Extract from a reference document using the specified published configuration
# tags:
# - Reference document extraction
# requestBody:
# required: true
# content:
# application/json:
# schema:
# $ref: '#/components/schemas/PostGoldenExtraction'
# responses:
# '200':
# content:
# application/json:
# schema:
# $ref: '#/components/schemas/ResponseGoldenExtraction'
# description: The structured data extracted from the reference document
# 400:
# $ref: '#/components/responses/400'
# 401:
# $ref: '#/components/responses/401'
# 404:
# $ref: '#/components/responses/404'
# 415:
# $ref: '#/components/responses/415'
# 500:
# $ref: '#/components/responses/500'
# /extract_from_golden/{type-name}/{config-name}/{version}/{document-name}:
# parameters:
# - $ref: '#/components/parameters/documentTypeName'
# - $ref: '#/components/parameters/configurationName'
# - $ref: '#/components/parameters/versionIdentifier'
# - $ref: '#/components/parameters/documentName'
# - $ref: '#/components/parameters/environment'
# get:
# operationId: extract-from-reference-document-and-config-version
# summary: Extract from reference document using configuration version
# description: Extract from a reference document using the specified version of a configuration.
# tags:
# - Reference document extraction
# responses:
# '200':
# content:
# application/json:
# schema:
# $ref: '#/components/schemas/ResponseGoldenExtraction'
# description: The structured data extracted from the reference document
# 400:
# $ref: '#/components/responses/400'
# 401:
# $ref: '#/components/responses/401'
# 404:
# $ref: '#/components/responses/404'
# 415:
# $ref: '#/components/responses/415'
# 500:
# $ref: '#/components/responses/500'
/extract_text_from_golden/{type-name}:
parameters:
- $ref: '#/components/parameters/documentTypeName'
# - $ref: '#/components/parameters/environment' # note: not documenting the env parameter that, while in the handler, is ignored for this endpoint
post:
operationId: extract-all-text-from-reference-document
summary: Extract all text from reference document
description: >-
Get all the text (lines) for a reference document as standardized output. The output is an array of pages with metadata such as text positioning.
If you specify a configuration, Sensible uses preprocessors defined in the configuration to process the text.
tags:
- Reference document
requestBody:
required: true
content:
application/json:
schema:
$ref: '#/components/schemas/PostGoldenExtraction'
responses:
200:
content:
application/json:
schema:
$ref: '#/components/schemas/ResponseStandardText'
description: All the text in the document
400:
$ref: '#/components/responses/400'
401:
$ref: '#/components/responses/401'
404:
$ref: '#/components/responses/404'
415:
$ref: '#/components/responses/415'
500:
$ref: '#/components/responses/500'
components:
parameters:
documentTypeId:
name: type-id
required: true
in: path
description: The unique document type identifier in v4 UUID format. Find IDs using the `/document_types` endpoint.
schema:
$ref: '#/components/schemas/UniqueId'
documentTypeName:
name: type-name
required: true
in: path
description: User-friendly name for a document type
schema:
$ref: '#/components/schemas/DocumentTypeName'
configurationName:
name: config-name
required: true
in: path
description: Unique name for a configuration. Find it in the Sensible app or from the `/document_types/{type-id}/configurations` endpoint.
example: anyco_auto_insurance_quote
schema:
$ref: '#/components/schemas/Name'
documentName:
name: document-name
required: true
in: path
description: Unique name for a document. Find it in the Sensible app or from the `/document_types/{type-id}}/goldens` endpoint.
example: best_scan_form_no_1234
schema:
$ref: '#/components/schemas/Name'
versionIdentifier:
name: version
required: true
in: path
description: Unique identifier for a configuration version.
schema:
type: string
environment:
name: environment
in: query
description: >-
If you specify `development`, extracts preferentially using config versions
published to the development environment in the Sensible app. The extraction runs all configs in the doc type before
picking the best fit. For each config, falls back to production version if no development version of the config exists.
schema:
type: string
enum: [production, development]
default: production
schemas:
UniqueId:
type: string
format: uuid
description: Unique identifier
example: 3fa85f64-5717-4562-b3fc-2c963f66afa6
Name: #used for params
type: string
pattern: ^[a-z0-9_]*$
minLength: 3
maxLength: 128
description: User-friendly name
DocumentTypeName:
description: Unique user-friendly name for a document type
example: auto_insurance_quotes_all_carriers
type: string
ConfigurationName:
description: Unique user-friendly name for a configuration
example: anyco_auto_insurance_quote
type: string
DocumentName:
description: Unique user-friendly name for a document
example: best_scan_form_num_1234
type: string
Date:
type: string
format: date-time
description: ISO 8601 date-time.
DocumentType:
type: object
properties:
name:
$ref: '#/components/schemas/DocumentTypeName'
id:
$ref: '#/components/schemas/UniqueId'
created:
$ref: '#/components/schemas/Date'
schema:
$ref: '#/components/schemas/DocumentTypeOutput'
required:
- name
- id
- created
- schema
additionalProperties: false
GetAllDocumentTypes:
type: array
items:
type: object
properties:
name:
$ref: '#/components/schemas/DocumentTypeName'
id:
$ref: '#/components/schemas/UniqueId'
created:
$ref: '#/components/schemas/Date'
schema:
$ref: '#/components/schemas/DocumentTypeOutput'
required:
- name
- id
#- created
additionalProperties: false
PostDocumentType:
type: object
properties:
name:
$ref: '#/components/schemas/DocumentTypeName'
schema:
$ref: '#/components/schemas/DocumentTypeOutput'
required:
- name
- schema
additionalProperties: false
DocumentTypeOutput:
type: object
additionalProperties: false
properties:
fingerprint_mode:
enum:
- fallback_to_all
- strict
type: string
description: The Sensible app defaults to `fallback_to_all`.
ocr_engine:
enum:
- microsoft
- amazon
- google
- lazarus
type: string
description: |
For information about each OCR engine, see [OCR engine](/senseml-reference/document-type-settings/ocr-engine).
prevent_default_merge_lines:
type: boolean
description: |
Prevents the built-in line merging that occurs before the
[Merge Lines](/senseml-reference/preprocessors/merge-lines) preprocessor.
ocr_level:
enum:
- 0
- 2
- 4
- 5
type: number
description: |
See [OCR level](/senseml-reference/document-type-settings/ocr-level).
validations:
description: Array of validations. See https://docs.sensible.so/docs/validate-extractions
items:
$ref: "#/components/schemas/ValidationRequest"
type: array
PutDocumentType:
type: object
properties:
name:
$ref: '#/components/schemas/Name'
schema:
$ref: '#/components/schemas/DocumentTypeOutput'
additionalProperties: false
GetAllGoldens:
type: array
items:
$ref: '#/components/schemas/GoldenResponse'
GoldenResponse:
type: object
properties:
name:
$ref: '#/components/schemas/DocumentName'
created:
$ref: '#/components/schemas/Date'
configuration:
$ref: '#/components/schemas/AssociatedConfigurationName'
error:
type: string
description: Any errors that occurred processing the reference document
upload_url:
type: string
description: If present, the URL to which a reference document can be PUT
download_url:
type: string
description: If present, the URL to GET to retrieve the reference document
thumbnail_url:
type: string
description: If present, the URL to GET to retrieve a thumbnail image of the first page of the reference document
required:
- name
- created
additionalProperties: false
PostGolden:
type: object
description: Upload url for putting the document
properties:
name:
$ref: '#/components/schemas/DocumentName'
configuration:
$ref: '#/components/schemas/AssociatedConfigurationName'
required:
- name
additionalProperties: false
PutGolden:
type: object
properties:
name:
$ref: '#/components/schemas/DocumentName'
configuration:
$ref: '#/components/schemas/AssociatedConfigurationName'
additionalProperties: false
AssociatedConfigurationName:
type: string
pattern: ^[a-z0-9_]*$
minLength: 3
maxLength: 128
description: User-friendly name of the configuration to associate to the reference document
example: anyco_auto_insurance_quote
GetAllConfigurations:
type: array
items:
type: object
properties:
name:
$ref: '#/components/schemas/ConfigurationName'
created:
$ref: '#/components/schemas/Date'
versions:
type: array
items:
$ref: '#/components/schemas/ConfigurationVersion'
required:
- name
- created
- versions
additionalProperties: false
ConfigurationVersion:
type: object
properties:
version_id:
type: string
example: fdE0LO4d2GftiGvPyeYbgpstRWyLrEdm
datetime:
$ref: '#/components/schemas/Date'
description: >-
The date and time Sensible created this version ID for the config.
Sensible creates a new version ID for a config when you:
1. publish a config to an environment in the Sensible app
2. create or edit the configuration through the Sensible API. Publishing or unpublishing an
existing configuration version using the Sensible API doesn't trigger the creation of a new version ID.
environments:
type: array
items:
type: string
example: [production, development]
draft:
type: boolean
example: false
description: >-
The version list returned by this endpoint contains a single draft version ID that's used to manage the editor state in the Sensible app.
This draft version ID is never published to the development or production environments.
required:
- version_id
- datetime
- draft
additionalProperties: false
PostConfiguration:
type: object
properties:
name:
$ref: '#/components/schemas/ConfigurationName'
configuration:
$ref: '#/components/schemas/StringifiedConfigurationRequest'
example: |
{ "fingerprint": { "tests": [ "anyco", "quoted coverage changes" ] }, "preprocessors": [{ "type": "pageRange", "startPage": 0, "endPage": 2 }], "fields": [{ "id": "_driver_name_raw", "anchor": "name of driver", "method": { "id": "label", "position": "below" } }], "computed_fields": [{ "id": "driver_name_last", "method": { "id": "split", "source_id": "_driver_name_raw", "separator": ", ", "index": 1 } } ] }