-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathlegalesign-api-v1-stainless.yaml
More file actions
3150 lines (3144 loc) · 88.9 KB
/
legalesign-api-v1-stainless.yaml
File metadata and controls
3150 lines (3144 loc) · 88.9 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
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.0
info:
description: >
Legalesign.com is an electronic signature software.
This is the documentation for its REST API.
Start by creating a trial account at https://legalesign.com/landing/free-trial/. Upon account activation, select the API dev option. Get an API key by emailing support@legalesign with background on your use-case and skills. You will be in sandbox mode that will limit you to 5 signers. Set up 2FA on your account and then login to https://logs.legalesign.com to access the API Dashboard, where you can manage you api key, webhooks, and sandbox signers. Contact support to move to production mode when you are ready.
For any queries contact us at support@legalesign.com.
version: "1.0.0"
title: Legalesign API
termsOfService: 'https://legalesign.com/opn/terms/'
contact:
email: support@legalesign.com
name: API support
url: https://legalesign.com/contact/
externalDocs:
description: Find out more about Legalesign API
url: 'https://apidocs.legalesign.com/'
servers:
- url: 'https://eu-api.legalesign.com/api/v1'
security:
- apikeyAuth: []
tags:
- name: attachment
description: Static email attachments
- name: document
description: Signing documents
- name: signer
description: Document signers
- name: templatetext
description: Text/html based templates
externalDocs:
description: Information about html/text templates
url: >-
https://legalesign.com/articles/esignature-api/using-htmltext-in-the-api/
- name: templatepdf
description: PDF based templates
- name: group
description: Groups (aka teams) contain everything
- name: member
description: A member is a user assigned to a group
- name: user
description: A user provides login access
- name: webhook
description: Event notifications/webhooks
externalDocs:
description: Information about callbacks
url: 'https://apidocs.legalesign.com/docs/webhooks'
paths:
/document/:
get:
tags:
- document
summary: Get signing documents
description: List (unarchived) signing documents. Use /status/ if you need high-level information.
operationId: getDocuments
parameters:
- name: group
in: query
description: Filter by a specific group, required.
required: true
schema:
type: string
- name: archived
in: query
description: 'Filter on archived status, default is false'
required: false
schema:
type: string
default: false
- name: email
in: query
description: Filter by signer email
required: false
schema:
type: string
- name: limit
in: query
description: >-
Length of dataset to return. Use with offset query to iterate
through results.
required: false
schema:
default: 20
type: integer
- name: offset
in: query
description: >-
Offset from start of dataset. Use with the limit query to iterate
through dataset.
required: false
schema:
type: integer
- name: status
in: query
description: Filter on document status
required: false
schema:
type: integer
- name: nosigners
in: query
description: Add value '1' to remove signers information for a faster query
required: false
schema:
type: string
- name: created_gt
in: query
description: Filter for those documents created after a certain time
required: false
schema:
type: string
format: date-time
- name: modified_gt
in: query
description: Filter for those documents modified after a certain time
required: false
schema:
type: string
format: date-time
responses:
'200':
description: 'successful operation, list of document objects'
content:
application/json:
schema:
$ref: '#/components/schemas/DocumentListResponse'
'400':
description: Invalid status value
post:
tags:
- document
summary: Create signing document
operationId: postDocument
responses:
'201':
description: >-
Success. Document URI will be in Location header. If
return_signer_links was set to true, the body will contain a JSON dict containing the signing links.
headers:
Location:
description: new document resource uri
schema:
type: string
format: uri
content:
application/json:
schema:
type: object
properties:
signer_1:
type: string
example:
signer_1: "https://app1.legalesign.com/esign/..."
'400':
description: 'Bad Request, read response for error information'
content:
application/json:
examples:
response:
value:
document:
name:
- This field is required.
'401':
description: Unauthorized
'429':
description: Throttled
'500':
description: 'Usually unparseable JSON, or mis-referenced object'
requestBody:
content:
application/json:
schema:
$ref: '#/components/schemas/DocumentPost'
description: Send a document to be signed
required: true
'/document/{docId}/':
parameters:
- name: docId
in: path
description: document id
required: true
schema:
type: string
format: uuid
get:
tags:
- document
summary: Get document
operationId: getDocument
responses:
'200':
description: successful operation
content:
application/json:
schema:
$ref: '#/components/schemas/DocumentResponseDetail'
delete:
tags:
- document
summary: Void/archive signing document
operationId: archiveDocument
description: >-
Delete does not remove permanently but sets it with status 40 (removed) and archives it.
responses:
'204':
description: successful operation
'/document/{docId}/fields/':
parameters:
- name: docId
in: path
description: document id
required: true
schema:
type: string
format: uuid
get:
tags:
- document
summary: Get document fields
operationId: getDocumentFields
responses:
'200':
description: operation successful
content:
application/json:
schema:
type: array
items:
type: object
properties:
element_type:
type: string
enum:
- signature
- initials
- admin
- text
fieldorder:
type: integer
nullable: true
label:
type: string
label_extra:
type: string
nullable: true
signer:
type: integer
state:
type: boolean
description: if saved by signer
validation:
$ref: '#/components/schemas/PdfFieldValidationEnum'
value:
type: string
'/document/{docId}/delete/':
parameters:
- name: docId
in: path
description: document id
required: true
schema:
type: string
format: uuid
delete:
tags:
- document
summary: Permanently delete signing document
operationId: deleteDocument
description: >-
Permanently deletes data and files. You must enable group automated deletion. We recommend archiveDocument.
responses:
'204':
description: Successful operation
'200':
description: Something went wrong, probably you need to allow automated deletions.
/group/:
get:
tags:
- group
summary: Get groups
operationId: getGroups
description: List groups the api user belongs to
parameters:
- name: offset
in: query
description: >-
Offset from start of dataset. Use with the limit query to iterate
through dataset.
required: false
schema:
type: integer
- name: limit
in: query
description: >-
Length of dataset to return. Use with offset query to iterate
through results.
required: false
schema:
type: integer
responses:
'200':
description: operation successful
content:
application/json:
schema:
$ref: '#/components/schemas/GroupListResponse'
post:
tags:
- group
summary: Create group
operationId: postGroup
responses:
'201':
description: operation successful
headers:
location:
description: resource_uri for new group
schema:
type: string
'400':
description: groups allowance exceeded or api permissions upgrade required
requestBody:
content:
application/json:
schema:
$ref: '#/components/schemas/GroupPost'
required: true
'/group/{groupId}/':
parameters:
- name: groupId
in: path
description: group id
required: true
schema:
type: string
get:
tags:
- group
summary: Get group
operationId: getGroup
parameters:
- name: groupId
in: path
description: ''
required: true
schema:
type: string
responses:
'200':
description: ok
content:
application/json:
schema:
$ref: '#/components/schemas/GroupResponse'
'/pdf/{docId}/':
get:
tags:
- document
summary: Location to download PDF
description: Get the PDF for a signing document
operationId: getDocumentPdf
parameters:
- name: docId
in: path
required: true
schema:
type: string
responses:
'200':
description: A PDF file
content:
application/pdf:
schema:
type: string
format: binary
'201':
description: Being de-archived, available in 4 hours
'302':
description: Redirect to the download location
headers:
location:
description: A short lived location for download, do not use Legalesign authentication
schema:
type: string
'/signer/{signerId}/':
get:
tags:
- signer
summary: Get signer
description: Get status and details of an individual signer
operationId: getSigner
parameters:
- name: signerId
in: path
description: ID of signer
required: true
schema:
type: string
responses:
'200':
description: operation successful
content:
application/json:
schema:
$ref: '#/components/schemas/SignerResponse'
'/signer/{signerId}/fields1/':
get:
tags:
- signer
summary: Get signer form fields
operationId: getSignerFields
parameters:
- name: signerId
in: path
description: ID of signer
required: true
schema:
type: string
responses:
'200':
description: operation successful
content:
application/json:
schema:
type: array
items:
type: object
properties:
label:
type: string
label_extra:
type: string
state:
type: boolean
fieldorder:
type: integer
nullable: true
value:
type: string
nullable: true
description: 'If the field is a signer file this value will be a short lived download URL'
'/signer/{signerId}/new-link/':
get:
tags:
- signer
summary: Get signer access link
operationId: getSignerLink
description: >-
Returns 1-use link for signer in Location header.
parameters:
- name: signerId
in: path
description: ID of signer
required: true
schema:
type: string
responses:
'201':
description: operation sucessful
headers:
Location:
description: Contains new link
schema:
type: string
'/signer/{signerId}/send-reminder/':
post:
tags:
- signer
summary: Send signer reminder email
operationId: postSignerReminder
parameters:
- name: signerId
in: path
required: true
schema:
type: string
responses:
'200':
description: operation successful
'401':
description: failed to send
requestBody:
content:
application/json:
schema:
$ref: '#/components/schemas/SendReminderPost'
description: Message text
required: true
'/status/{docId}/':
get:
tags:
- document
summary: Get signing document status
description: Faster short query for a document status
operationId: getStatus
parameters:
- name: docId
in: path
description: ID of document
required: true
schema:
type: string
responses:
'200':
description: operation successful
content:
application/json:
schema:
$ref: '#/components/schemas/StatusResponse'
/template/:
get:
tags:
- templatetext
summary: Get text templates
operationId: getTextTemplates
parameters:
- name: group
in: query
description: can be full resource_uri or only id
required: false
schema:
type: string
- name: limit
in: query
description: >-
Length of dataset to return. Use with offset query to iterate
through results.
required: false
schema:
type: integer
default: 20
- name: archive
in: query
required: false
schema:
type: string
- name: offset
in: query
description: >-
Offset from start of dataset. Use with the limit query to iterate
through dataset.
required: false
schema:
type: integer
responses:
'200':
description: list of text templates
content:
application/json:
schema:
$ref: '#/components/schemas/TemplateListResponse'
externalDocs:
description: Read me about text templates
url: 'https://legalesign.com/articles/esignature-api/using-htmltext-in-the-api/'
post:
tags:
- templatetext
summary: Create text template
description: >-
Create a new html/text template. This probably isn't the method you are looking for.
You can use the 'text' attribute in /document/ to create and send your HTML as a signing
document in one call.
operationId: postTextTemplate
responses:
'201':
description: operation successful
headers:
Location:
description: resource_uri for new template
schema:
type: string
requestBody:
content:
application/json:
schema:
$ref: '#/components/schemas/TemplatePost'
description: data for template creation
required: true
/templatepdf/:
get:
tags:
- templatepdf
summary: Get PDF templates
operationId: getPdfTemplates
parameters:
- name: archive
in: query
required: false
schema:
type: string
default: false
- name: group
in: query
description: can be full resource_uri or only id
required: false
schema:
type: string
- name: limit
in: query
description: >-
Length of dataset to return. Use with offset query to iterate
through results.
required: false
schema:
type: integer
default: 20
- name: offset
in: query
description: >-
Offset from start of dataset. Use with the limit query to iterate
through dataset.
required: false
schema:
type: integer
responses:
'200':
description: operation successful
content:
application/json:
schema:
$ref: '#/components/schemas/TemplatePdfListResponse'
post:
tags:
- templatepdf
summary: Create PDF template
description: Upload a PDF document you want to send to be signed
operationId: postPdfTemplate
responses:
'201':
description: operation successful
headers:
location:
description: resource_uri for new pdf template
schema:
type: string
requestBody:
content:
application/json:
schema:
$ref: '#/components/schemas/TemplatePdfFieldPost'
description: Data for PDF upload
required: true
'/templatepdf/{pdfId}/':
parameters:
- name: pdfId
in: path
description: uploaded PDF id
required: true
schema:
type: string
format: uuid
get:
summary: Get PDF template
operationId: getPdfTemplate
tags:
- templatepdf
responses:
'200':
description: PDF template details
content:
application/json:
schema:
$ref: '#/components/schemas/TemplatePdfResponse'
'/templatepdf/{pdfId}/edit-link/':
parameters:
- name: pdfId
in: path
description: uploaded PDF id
required: true
schema:
type: string
format: uuid
get:
tags:
- templatepdf
summary: Get PDF embeddable link
operationId: getPdfTemplateEditLink
responses:
'201':
description: One-use link for embedding the pdf edit page
headers:
location:
schema:
type: string
description: One-use link to pdf edit page.
content:
application/json:
schema:
type: string
'/templatepdf/{pdfId}/fields/':
parameters:
- name: pdfId
in: path
description: uploaded PDF id
required: true
schema:
type: string
format: uuid
get:
tags:
- templatepdf
summary: Get PDF template fields
operationId: getPdfTemplateFields
responses:
'200':
description: list of a pdf template fields
content:
application/json:
schema:
$ref: '#/components/schemas/TemplatePdfFieldsList'
post:
tags:
- templatepdf
summary: Create PDF template fields
description: Replace existing pdf fields with new ones
operationId: postPdfTemplateFields
responses:
'201':
description: operation successful
requestBody:
description: Replace PDF fields on a PDF template.
required: true
content:
application/json:
schema:
type: array
items:
$ref: '#/components/schemas/PdfFieldsPost'
'/template/{templateId}/':
parameters:
- name: templateId
in: path
description: saved html template id
required: true
schema:
type: string
format: uuid
get:
tags:
- templatetext
summary: Get text template
operationId: getTextTemplate
responses:
'200':
description: operation successful
content:
application/json:
schema:
$ref: '#/components/schemas/TemplateResponseDetail'
externalDocs:
description: Read-me about text templates
url: 'https://legalesign.com/articles/esignature-api/using-htmltext-in-the-api/'
patch:
tags:
- templatetext
summary: Update text template
operationId: patchTextTemplate
responses:
'202':
description: operation successful
requestBody:
content:
application/json:
schema:
$ref: '#/components/schemas/TemplateDetailPatch'
description: Updated text template object
required: true
components:
securitySchemes:
apikeyAuth:
type: apiKey
in: header
name: Authorization
schemas:
MemberResponse:
type: object
properties:
created:
type: string
format: date-time
group:
type: string
format: uri
modified:
type: string
format: date-time
permission:
$ref: '#/components/schemas/PermissionsEnum'
resource_uri:
type: string
format: uri
user:
type: string
format: uri
example:
created: 2020-05-20T:15:10
modified: 2020-05-20T:15:10
permission: 1
resource_uri: /api/v1/member/m0m0m0m0-m0m0-m0m0-m0m0-m0m0m0m0m0m0/
user: /api/v1/user/u0u0u0u0-u0u0-u0u0-u0u0-u0u0u0u0u0u0/
DocumentPost:
type: object
required:
- group
- name
- signers
description: >-
Send a document to be signed. In addition to the required fields, the POST must also
contain either text (raw html) or a reference to a saved template (html) or a
templatepdf (uploaded pdf). Also recommended - do_email, auto_archive and pdftext (if using pdf).
properties:
group:
type: string
format: uri
pattern: ^/api/v1/group/[-\w]{1,50}/$
name:
type: string
minLength: 1
maxLength: 60
text:
type: string
description: Raw html. This API call must contain either one of the attributes text, templatepdf, template.
templatepdf:
type: string
format: uri
pattern: ^/api/v1/templatepdf/[-\w]{1,60}/$
description: >-
Resource URI of templatepdf object. This API call must contain either one of the attributes text, templatepdf, template.
template:
type: string
pattern: ^/api/v1/template/[-\w]{1,60}/$
format: uri
description: >-
Resource URI of text template object. This call must contain either one of the attributes text, templatepdf, template.
signers:
type: array
items:
$ref: '#/components/schemas/DocumentSignerPost'
signature_type:
type: integer
description: Use 4 to get your executed PDF Certified. Recommended. Defaults to 1 (uses a sha256 hash for document integrity).
default: 1
append_pdf:
type: boolean
description: >-
Append Legalesign validation info to final PDF. If not included uses
the group default.
default: false
auto_archive:
type: boolean
description: Send to archive soon after signing. Keeps web app clutter free
default: true
do_email:
type: boolean
description: >-
Use Legalesign email to send notification emails. If false suppresses all emails.
default: false
cc_emails:
type: string
description: >-
Comma delimited string of email addresses that are notified of signing or rejection.
convert_sender_to_signer:
type: boolean
description: If any sender fields are left blank, convert them to fields for the first recipient.
footer:
type: string
description: >-
Text doc only. The footer for the final pdf. Use keyword
\"default\" to use group default footer.
footer_height:
type: integer
format: int64
description: >-
Text based doc only. Pixel height of PDF footer, if used. 1px =
0.025cm
header:
type: string
description: >-
Text based doc only. The header for the final pdf. Use keyword
\"default\" to use group header footer.
header_height:
type: integer
format: int64
description: >-
Text based doc only. Pixel height of final PDF footer, if used. 1px =
0.025cm
pdf_password:
type: string
pattern: ^[-\w ]{0,150}$
description: >-
Set a password. Must be ascii encode-able, you must also set signature_type to 4 and choose a pdf_password_type.
pdf_password_type:
type: integer
x-enum-varnames: ['passtype1','passtype2']
enum: [1,2]
description: 1 to store password, 2 for to delete from our records upon final signing.
pdftext:
type: object
description: >-
Assign values to PDF sender fields, use field labels as keys. Requires unique fields labels. See also strict_fields.
additionalProperties:
type: string
redirect:
type: string
maxLength: 250
pattern: ^https://
description: >-
URL to send the signer to after signing (instead of download page).
Your URL will include query parameters with ID and state information
as follows: YOUR-URL?signer=[signer_uid]&doc=[doc_id]&group=[group_id]&signer_state=[signer_status]&doc_state=[doc_status]
reminders:
type: string
pattern: ^(default|)$
description: Put 'default' if you wish to use the default reminder schedule in the group (go to web app to set default schedule)
return_signer_links:
type: boolean
description: Return document links for signers in the response BODY.
signers_in_order:
type: boolean
description: >-
Notify signers in their order sequence. If false all are notified
simulataneously.
signertext:
type: object
description: Add custom placeholders to signer fields, using labels as keys in an object (as for pdftext). Relies on unique labelling.
additionalProperties:
type: string
strict_fields:
type: boolean
description: pdftext fails silently for invalid field value, set to true to return an error
tag:
type: string
pattern: ^[-\w\[\]\:\;\/\.\, _]{0,250}$
maxLength: 250
tag1:
type: string
pattern: ^[-\w\[\]\:\;\/\.\, _]{0,250}$
maxLength: 250
tag2:
type: string
pattern: ^[-\w\[\]\:\;\/\.\, _]{0,250}$
maxLength: 250
user:
type: string
format: uri
description: Assign document another user in the group. Defaults to API
TemplateDetailPatch:
type: string
description: json with any fields to update
TemplateListResponse:
properties:
meta:
$ref: '#/components/schemas/ListMeta'
objects:
type: array
items:
$ref: '#/components/schemas/TemplateResponse'
TemplatePdfFieldsList:
properties:
meta:
$ref: '#/components/schemas/ListMeta'
objects:
type: array
items:
$ref: '#/components/schemas/TemplatePdfFieldDetail'
example:
- ax: 0.215025906735751
ay: 0.367795045508885
bx: 0.446891191709845
by: 0.425434569754081
element_type: signature
fieldorder: null,
font_name': ''
font_size: 12
hide_border: false
label: Sign here,
label_extra: ''
logic_action: null
logic_group: ''
map_to: ''
optional: false
options: ''
page: 1,
signer: 1
substantive: false
validation: None
value': ''
- ax: 0.20207253886010362
ay: 0.23421773535334944
bx: 0.47797927461139894
by: 0.24702651851894872
element_type: text
font_name: liberation
font_size: 11
hide_border: False
label: ''