-
Notifications
You must be signed in to change notification settings - Fork 173
Expand file tree
/
Copy pathdocspell-openapi.yml
More file actions
9108 lines (8865 loc) · 250 KB
/
docspell-openapi.yml
File metadata and controls
9108 lines (8865 loc) · 250 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:
title: Docspell
version: 0.44.0-SNAPSHOT
description: |
This is the remote API to Docspell. Docspell is a free document
management system focused on small groups or families.
The routes can be divided into protected, unprotected routes and
admin routes. The unprotected, or open routes are at `/open/*`
while the protected routes are at `/sec/*` and admin routes are at
`/admin/*`. Open routes don't require authenticated access and can
be used by any user. The protected routes require an authenticated
user. The admin routes require a special http header with a value
from the config file. They are disabled by default, you need to
specify a secret in order to enable admin routes.
license:
name: AGPLv3
url: https://spdx.org/licenses/AGPL-3.0-or-later.html
externalDocs:
description: Docspell Homepage
url: https://docspell.org
servers:
- url: /api/v1
description: Current host
security: []
paths:
/api/info/version:
get:
operationId: "api-info-version"
tags: [ Information ]
summary: Get version information.
description: |
Returns information about this software.
responses:
422:
description: BadRequest
200:
description: Ok
content:
application/json:
schema:
$ref: "#/components/schemas/VersionInfo"
/open/auth/login:
post:
operationId: "open-auth-login"
tags: [ Authentication ]
summary: Authenticate with account name and password.
description: |
Authenticate with account name and password. The account name
is comprised of the collective id and user id separated by
slash, backslash or whitespace.
If successful, an authentication token is returned that can be
used for subsequent calls to protected routes.
If the account has two-factor auth enabled, the returned token
must be used to supply the second factor.
requestBody:
content:
application/json:
schema:
$ref: "#/components/schemas/UserPass"
responses:
422:
description: BadRequest
200:
description: Ok
content:
application/json:
schema:
$ref: "#/components/schemas/AuthResult"
/open/auth/two-factor:
post:
operationId: "open-auth-two-factor"
tags: [ Authentication ]
summary: Provide the second factor to finalize authentication
description: |
After a login with account name and password, a second factor
must be supplied (only for accounts that enabled it) in order
to complete login.
If the code is correct, a new token is returned that can be
used for subsequent calls to protected routes.
requestBody:
content:
application/json:
schema:
$ref: "#/components/schemas/SecondFactor"
responses:
422:
description: BadRequest
200:
description: Ok
content:
application/json:
schema:
$ref: "#/components/schemas/AuthResult"
/open/auth/openid/{providerId}:
get:
operationId: "open-auth-openid"
tags: [ Authentication ]
summary: Authenticates via OIDC at the external provider given by its id
description: |
Initiates the ["Authorization Code
Flow"](https://openid.net/specs/openid-connect-core-1_0.html#CodeFlowAuth)
as described in the OpenID Connect specification. This only is
enabled, if an external provider has been configured correctly
in the config file.
This will redirect to the external provider to authenticate
the user. Once authenticated, the user is redirected back to
the `/resume` endpoint.
parameters:
- $ref: "#/components/parameters/providerId"
responses:
422:
description: BadRequest
302:
description: Found. Redirect to external authentication provider
200:
description: Not used, is only here because openid requires it
/open/auth/openid/{providerId}/resume:
get:
operationId: "open-auth-openid-resume"
tags: [ Authentication ]
summary: The callback URL for the authentication provider
description: |
This URL is used to redirect the user back to the application
by the authentication provider after login is completed.
This will then try to find (or create) the account at docspell
using information about the user provided by the
authentication provider. If the required information cannot be
found, the user cannot be logged into the application.
If the process completed successfully, this endpoint redirects
into the web application which will take over from here.
parameters:
- $ref: "#/components/parameters/providerId"
responses:
422:
description: BadRequest
303:
description: See Other. Redirect to the webapp
200:
description: Not used, is only here because openid requires it
/open/checkfile/{id}/{checksum}:
get:
operationId: "open-checkfile-checksum-by-id"
tags: [ Upload ]
summary: Check if a file is in docspell (via source).
description: |
Checks if a file with the given SHA-256 checksum is in
docspell. The id is a *source id* configured by a collective.
The result shows all items that contains a file with the given
checksum.
parameters:
- $ref: "#/components/parameters/id"
- $ref: "#/components/parameters/checksum"
responses:
422:
description: BadRequest
200:
description: Ok
content:
application/json:
schema:
$ref: "#/components/schemas/CheckFileResult"
/open/upload/item/{id}:
post:
operationId: "open-upload-new-item-by-source"
tags: [ Upload ]
summary: Upload files to docspell (via source).
description: |
Upload a file to docspell for processing. The id is a *source
id* configured by a collective. Files are submitted for
processing which eventually resuts in an item in the inbox of
the corresponding collective.
The request must be a `multipart/form-data` request, where the
first part has name `meta`, is optional and may contain upload
metadata as JSON. Checkout the structure `ItemUploadMeta` at
the end if it is not shown here. Other parts specify the
files. Multiple files can be specified, but at least on is
required.
The upload meta data can be used to tell, whether multiple
files are one item, or if each file should become a single
item. By default, each file will be a one item.
parameters:
- $ref: "#/components/parameters/id"
requestBody:
content:
multipart/form-data:
schema:
type: object
properties:
meta:
$ref: "#/components/schemas/ItemUploadMeta"
file:
type: array
items:
type: string
format: binary
responses:
422:
description: BadRequest
200:
description: Ok
content:
application/json:
schema:
$ref: "#/components/schemas/BasicResult"
/open/upload/item/{itemId}/{id}:
post:
operationId: "open-upload-to-item-by-source"
tags: [ Upload ]
summary: Upload files to an existing item (via source).
description: |
Upload a file to docspell for processing. The id is a *source
id* configured by a collective. Files are submitted for
processing which eventually resuts in an item in the inbox of
the corresponding collective. This endpoint associates the
files to an existing item identified by its `itemId`.
The request must be a `multipart/form-data` request, where the
first part has name `meta`, is optional and may contain upload
metadata as JSON. Checkout the structure `ItemUploadMeta` at
the end if it is not shown here. Other parts specify the
files. Multiple files can be specified, but at least on is
required.
Upload meta data is ignored.
parameters:
- $ref: "#/components/parameters/id"
- $ref: "#/components/parameters/itemId"
requestBody:
content:
multipart/form-data:
schema:
type: object
properties:
meta:
$ref: "#/components/schemas/ItemUploadMeta"
file:
type: array
items:
type: string
format: binary
responses:
422:
description: BadRequest
200:
description: Ok
content:
application/json:
schema:
$ref: "#/components/schemas/BasicResult"
/admin/fts/reIndexAll:
post:
operationId: "admin-fts-reindex-all"
tags: [Full-Text Index, Admin]
summary: Re-creates the full-text index.
description: |
Clears the full-text index and inserts all data from the
database. This migh take a while to complete. The response
returns immediately. A task is submitted that will be executed
by a job executor. Note that this affects all data of all
collectives.
This is an admin route, so you need to provide the secret from
the config file as header `Docspell-Admin-Secret`.
security:
- adminHeader: []
responses:
422:
description: BadRequest
200:
description: Ok
content:
application/json:
schema:
$ref: "#/components/schemas/BasicResult"
/sec/fts/reIndex:
post:
operationId: "sec-fts-reindex"
tags: [Full-Text Index]
summary: Re-creates the full-text index for the current collective
description: |
Clears the full-text index for all data belonging to the
current collective and inserts the data from the database. The
response is immediately returned and a task is submitted that
will be executed by a job executor.
responses:
422:
description: BadRequest
200:
description: Ok
content:
application/json:
schema:
$ref: "#/components/schemas/BasicResult"
/sec/checkfile/{checksum}:
get:
operationId: "sec-checkfile-by-checksum"
tags: [ Upload ]
summary: Check if a file is in docspell (authenticated).
description: |
Checks if a file with the given SHA-256 checksum is in
docspell.
The result shows all items that contains a file with the given
checksum.
security:
- authTokenHeader: []
parameters:
- $ref: "#/components/parameters/checksum"
responses:
422:
description: BadRequest
200:
description: Ok
content:
application/json:
schema:
$ref: "#/components/schemas/CheckFileResult"
/sec/upload/item:
post:
operationId: "sec-upload-new-item"
tags: [ Upload ]
summary: Upload files to docspell (authenticated).
description: |
Upload files to docspell for processing. This route is meant
for authenticated users that upload files to their account.
Everything else is the same as with the
`/open/upload/item/{id}` endpoint.
The request must be a "multipart/form-data" request, where the
first part is optional and may contain upload metadata as
JSON. Other parts specify the files. Multiple files can be
specified, but at least one is required.
The upload meta data can be used to tell, whether multiple
files are one item, or if each file should become a single
item. By default, each file will be a one item.
security:
- authTokenHeader: []
requestBody:
content:
multipart/form-data:
schema:
type: object
properties:
meta:
$ref: "#/components/schemas/ItemUploadMeta"
file:
type: array
items:
type: string
format: binary
responses:
422:
description: BadRequest
200:
description: Ok
content:
application/json:
schema:
$ref: "#/components/schemas/BasicResult"
/sec/upload/{itemId}:
post:
operationId: "sec-upload-to-item"
tags: [ Upload ]
summary: Upload files to an existing item (authenticated).
description: |
Upload files to docspell for processing. This route is meant
for authenticated users that upload files to their account.
This endpoint will associate the files to an existing item
identified by its `itemId`.
Everything else is the same as with the
`/open/upload/item/{itemId}/{id}` endpoint.
The request must be a "multipart/form-data" request, where the
first part is optional and may contain upload metadata as
JSON. Other parts specify the files. Multiple files can be
specified, but at least on is required.
The upload meta data is ignored, since the item already
exists.
security:
- authTokenHeader: []
parameters:
- $ref: "#/components/parameters/itemId"
requestBody:
content:
multipart/form-data:
schema:
type: object
properties:
meta:
$ref: "#/components/schemas/ItemUploadMeta"
file:
type: array
items:
type: string
format: binary
responses:
422:
description: BadRequest
200:
description: Ok
content:
application/json:
schema:
$ref: "#/components/schemas/BasicResult"
/sec/downloadAll/prefetch:
post:
operationId: "sec-downloadall-prefetch"
tags: [Download]
summary: Return information about a potential zip download
description: |
This endpoint calculates the number of files and
(uncompressed) size of the zip file that would be created with
this request.
It also checks against configured thresholds and tells whether
the server allows to ask for a download using this query.
security:
- authTokenHeader: []
requestBody:
content:
application/json:
schema:
$ref: "#/components/schemas/DownloadAllRequest"
responses:
422:
description: BadRequest
200:
description: Ok
content:
application/json:
schema:
$ref: "#/components/schemas/DownloadAllSummary"
/sec/downloadAll/submit:
post:
operationId: "sec-downloadall-submit"
tags: [Download]
summary: Submits a job to create a zip containing all files in the query
description: |
A job is submitted to create a ZIP file containing all the
files that are included in the given query.
Once the job is done, the returned ID can be used to download
the zip file.
security:
- authTokenHeader: []
requestBody:
content:
application/json:
schema:
$ref: "#/components/schemas/DownloadAllRequest"
responses:
422:
description: BadRequest
200:
description: Ok
content:
application/json:
schema:
$ref: "#/components/schemas/DownloadAllSummary"
/sec/downloadAll/cancel/{id}:
put:
operationId: "sec-downloadall-cancel"
tags: [Download]
summary: Cancels potentially running jobs to create a download archive
description: |
If a job is running (created via the `submit` endpoint) to
prepare a zip file for download, it is cancelled. The id is
the download id as defined in the `prefetch` or `submit`
responses.
parameters:
- $ref: "#/components/parameters/id"
security:
- authTokenHeader: []
responses:
422:
description: BadRequest
200:
description: Ok
content:
application/json:
schema:
$ref: "#/components/schemas/BasicResult"
/sec/downloadAll/file/{id}:
get:
operationId: "sec-downloadall-get-file"
tags: [Download]
summary: Download the zip file given the id
description: |
Download the zip file to the given id.
parameters:
- $ref: "#/components/parameters/id"
security:
- authTokenHeader: []
responses:
422:
description: BadRequest
404:
description: NotFound
200:
description: Ok
content:
application/octet-stream:
schema:
type: string
format: binary
delete:
operationId: "sec-downloadall-delete-file"
tags: [Download]
summary: Deletets the zip file given the id
description: |
Deletes the zip file to the given id.
parameters:
- $ref: "#/components/parameters/id"
security:
- authTokenHeader: []
responses:
422:
description: BadRequest
200:
description: Ok
content:
application/json:
schema:
$ref: "#/components/schemas/BasicResult"
/open/integration/item/{id}:
get:
operationId: "open-integration-item-check-collective"
tags: [ Integration Endpoint ]
summary: Check if integration endpoint is available.
description: |
Allows to check whether an integration endpoint is enabled for
a collective. The collective is given by the `id` parameter.
It returns not found (404) if the endpoint is disabled (either
globally by an admin or by a specific collective). It returns
403 (or 401 if http-basic is enabled) if authorization fails.
The response body is empty (an empty json object).
parameters:
- $ref: "#/components/parameters/id"
responses:
422:
description: BadRequest
200:
description: Ok
content:
application/json:
schema:
type: object
404:
description: Not Found
403:
description: Forbidden
401:
description: Unauthorized
post:
operationId: "open-integration-item-upload"
tags: [ Integration Endpoint, Upload ]
summary: Upload files to docspell (Integration Endpoint).
description: |
Upload a file to docspell for processing. The id is a
*collective name*. This route only exists, if enabled by an
admin in the configuration. The route might be protected by
different methods, all configurable via the configuration:
- A specific header must be prestent
- username/password via HTTP Basic mechanism
- a specific source ip
Files are submitted for processing to the specified
collective, which eventually resuts in an item in their inbox.
The request must be a `multipart/form-data` request, where the
first part has name `meta`, is optional and may contain upload
metadata as JSON. Checkout the structure `ItemUploadMeta` at
the end if it is not shown here. Other parts specify the
files. Multiple files can be specified, but at least on is
required.
parameters:
- $ref: "#/components/parameters/id"
requestBody:
content:
multipart/form-data:
schema:
type: object
properties:
meta:
$ref: "#/components/schemas/ItemUploadMeta"
file:
type: array
items:
type: string
format: binary
responses:
422:
description: BadRequest
200:
description: Ok
content:
application/json:
schema:
$ref: "#/components/schemas/BasicResult"
/open/integration/checkfile/{id}/{checksum}:
get:
operationId: "open-integration-checkfile-by-checksum"
tags: [ Integration Endpoint, Upload ]
summary: Check if a file is in docspell (Integration Endpoint).
description: |
Checks if a file with the given SHA-256 checksum is in
docspell. The `id` is the *collective name*. This route only
exists, if it is enabled in the configuration file.
The result shows all items that contains a file with the given
checksum.
security:
- authTokenHeader: []
parameters:
- $ref: "#/components/parameters/id"
- $ref: "#/components/parameters/checksum"
responses:
422:
description: BadRequest
200:
description: Ok
content:
application/json:
schema:
$ref: "#/components/schemas/CheckFileResult"
/open/signup/register:
post:
operationId: "open-signup-register"
tags: [ Registration ]
summary: Register a new account.
description: |
Create a new account by creating a collective and user.
requestBody:
content:
application/json:
schema:
$ref: "#/components/schemas/Registration"
responses:
422:
description: BadRequest
200:
description: Ok
content:
application/json:
schema:
$ref: "#/components/schemas/BasicResult"
/open/signup/newinvite:
post:
operationId: "open-signup-newinvite"
tags: [ Registration ]
summary: Generate a new invite.
description: |
When signup mode is set to "invite", docspell requires an
invitation key when signing up. These keys can be created
here. Creating such keys requires an admin role, and since
docspell has no such concept, a password from the
configuration file is required for this action.
requestBody:
content:
application/json:
schema:
$ref: "#/components/schemas/GenInvite"
responses:
422:
description: BadRequest
200:
description: Ok
content:
application/json:
schema:
$ref: "#/components/schemas/InviteResult"
/open/share/verify:
post:
operationId: "open-share-verify"
tags: [ Share ]
summary: Verify a secret for a share
description: |
Given the share id and optionally a password, it verifies the
correctness of the given data. As a result, a token is
returned that must be used with all `share/*` routes. If the
password is missing, but required, the response indicates
this. Then the requests needs to be replayed with the correct
password to retrieve the token.
The token is also added as a session cookie to the response.
The token is used to avoid passing the user define password
with every request.
requestBody:
content:
application/json:
schema:
$ref: "#/components/schemas/ShareSecret"
responses:
422:
description: BadRequest
200:
description: Ok
content:
application/json:
schema:
$ref: "#/components/schemas/ShareVerifyResult"
/sec/auth/session:
post:
operationId: "sec-auth-session"
tags: [ Authentication ]
summary: Authentication with a token
description: |
Authenticate with a token. This can be used to get a new
authentication token based on another valid one.
security:
- authTokenHeader: []
responses:
422:
description: BadRequest
200:
description: Ok
content:
application/json:
schema:
$ref: "#/components/schemas/AuthResult"
/sec/auth/logout:
post:
operationId: "sec-auth-logout"
tags: [ Authentication ]
summary: Logout.
description: |
This route informs the server about a logout. This is not
strictly necessary.
security:
- authTokenHeader: []
responses:
422:
description: BadRequest
200:
description: Ok
/sec/tag:
get:
operationId: "sec-tag-get-all"
tags: [ Tags ]
summary: Get a list of tags
description: |
Return a list of all configured tags. The `sort` query
parameter is optional and can specify how the list is sorted.
Possible values are: `name`, `-name`, `category`, `-category`.
security:
- authTokenHeader: []
parameters:
- $ref: "#/components/parameters/q"
- $ref: "#/components/parameters/sort"
responses:
422:
description: BadRequest
200:
description: Ok
content:
application/json:
schema:
$ref: "#/components/schemas/TagList"
post:
operationId: "sec-tag-new"
tags: [ Tags ]
summary: Create a new tag.
description: |
Create a new tag. If a tag with this name already exists, an
error is returned. The id in the input structure is ignored.
security:
- authTokenHeader: []
requestBody:
content:
application/json:
schema:
$ref: "#/components/schemas/Tag"
responses:
422:
description: BadRequest
200:
description: Ok
content:
application/json:
schema:
$ref: "#/components/schemas/BasicResult"
put:
operationId: "sec-tag-edit"
tags: [ Tags ]
summary: Change an existing tag.
description: |
Changes an existing tag. The tag is looked up by its id and
all properties are changed as given.
security:
- authTokenHeader: []
requestBody:
content:
application/json:
schema:
$ref: "#/components/schemas/Tag"
responses:
422:
description: BadRequest
200:
description: Ok
content:
application/json:
schema:
$ref: "#/components/schemas/BasicResult"
/sec/tag/{id}:
delete:
operationId: "sec-tag-delete-by-id"
tags: [ Tags ]
summary: Delete a tag.
description: |
Deletes a tag. This also removes this tags from all items.
security:
- authTokenHeader: []
parameters:
- $ref: "#/components/parameters/id"
responses:
422:
description: BadRequest
200:
description: Ok
content:
application/json:
schema:
$ref: "#/components/schemas/BasicResult"
/sec/organization:
get:
operationId: "sec-org-get-all"
tags: [ Organization ]
summary: Get a list of organizations.
description: |
Return a list of all organizations. Only name and id are
returned. If `full` is specified, the list contains all
organization data. The `sort` parameter can be either `name`
or `-name` to specify the order.
security:
- authTokenHeader: []
parameters:
- $ref: "#/components/parameters/full"
- $ref: "#/components/parameters/q"
- $ref: "#/components/parameters/sort"
responses:
422:
description: BadRequest
200:
description: Ok
content:
application/json:
schema:
oneOf:
- $ref: "#/components/schemas/ReferenceList"
- $ref: "#/components/schemas/OrganizationList"
post:
operationId: "sec-org-new"
tags: [ Organization ]
summary: Create a new organization.
description: |
Create a new organizaion. If an organization with this name already exists, an
error is returned. The id attribute of the request structure is ignored.
security:
- authTokenHeader: []
requestBody:
content:
application/json:
schema:
$ref: "#/components/schemas/Organization"
responses:
422:
description: BadRequest
200:
description: Ok
content:
application/json:
schema:
$ref: "#/components/schemas/BasicResult"
put:
operationId: "sec-org-edit"
tags: [ Organization ]
summary: Change an existing organization.
description: |
Changes an existing organization. The organization is looked up by its id and
all properties are changed as given.
security:
- authTokenHeader: []
requestBody:
content:
application/json:
schema:
$ref: "#/components/schemas/Organization"
responses:
422:
description: BadRequest
200:
description: Ok
content:
application/json:
schema:
$ref: "#/components/schemas/BasicResult"
/sec/organization/{id}:
get:
operationId: "sec-org-details"
tags: [ Organization ]
summary: Get a list of organizations.
description: |
Return details about an organization.
security:
- authTokenHeader: []
parameters:
- $ref: "#/components/parameters/id"
responses:
422:
description: BadRequest
200:
description: Ok
content:
application/json:
schema:
$ref: "#/components/schemas/Organization"
delete:
operationId: "sec-org-delete-by-id"
tags: [ Organization ]
summary: Delete a organization by its id.
description: |
Deletes an organization.
security:
- authTokenHeader: []
parameters:
- $ref: "#/components/parameters/id"
responses:
422:
description: BadRequest
200:
description: Ok
content:
application/json:
schema:
$ref: "#/components/schemas/BasicResult"
/sec/person:
get:
operationId: "sec-persion-get-all"
tags: [ Person ]
summary: Get a list of persons.
description: |
Return a list of all persons. Only name and id are returned
unless the `full` parameter is specified. The `sort` parameter
can be used to control the order of the result. Use one of:
`name`, `-name`, `org`, `-org`. Note that order by `org` only
works when retrieving the full list.
security:
- authTokenHeader: []
parameters:
- $ref: "#/components/parameters/full"
- $ref: "#/components/parameters/q"
- $ref: "#/components/parameters/sort"
responses:
422:
description: BadRequest
200:
description: Ok
content:
application/json:
schema:
oneOf:
- $ref: "#/components/schemas/ReferenceList"