@talonic/docs 0.21.97 → 0.21.99

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/openapi.json CHANGED
@@ -1963,6 +1963,18 @@
1963
1963
  ],
1964
1964
  "default": "extract",
1965
1965
  "description": "`extract`: text only, for a following `POST /v1/extract`. `ingest`: full processing into workspace data."
1966
+ },
1967
+ "parties": {
1968
+ "type": "array",
1969
+ "maxItems": 500,
1970
+ "description": "The document's parties as your system has them, the same as `PUT /v1/documents/{id}/parties`. They decide the document's labels and so its place in the Collections tree.",
1971
+ "items": {
1972
+ "$ref": "#/components/schemas/DocumentParty"
1973
+ }
1974
+ },
1975
+ "parties_complete": {
1976
+ "type": "boolean",
1977
+ "description": "`parties` names every party of the document."
1966
1978
  }
1967
1979
  }
1968
1980
  }
@@ -65998,89 +66010,15 @@
65998
66010
  }
65999
66011
  }
66000
66012
  },
66001
- "/v1/documents/batch-metadata/import": {
66002
- "post": {
66003
- "operationId": "importDocumentBatchMetadata",
66004
- "x-audience": "public",
66005
- "tags": [
66006
- "Documents"
66007
- ],
66008
- "summary": "Import source batch ids from a CSV",
66009
- "description": "Sets the source batch id on existing documents from a CSV upload (`file`, up to 20 MB). Answers how many documents were updated and which named ones were not found. 403 for a person whose document visibility a rule narrows, because the import matches against every document of the workspace. Requires the `documents:write` scope. The key's person must be an Admin of the workspace, as in the web app; in a workspace whose model configuration Talonic manages this answers 403 `insufficient_role`.",
66010
- "security": [
66011
- {
66012
- "BearerAuth": []
66013
- }
66014
- ],
66015
- "x-required-scopes": [
66016
- "documents:write"
66017
- ],
66018
- "requestBody": {
66019
- "required": true,
66020
- "content": {
66021
- "multipart/form-data": {
66022
- "schema": {
66023
- "type": "object",
66024
- "properties": {
66025
- "file": {
66026
- "type": "string",
66027
- "format": "binary",
66028
- "description": "CSV with a header row."
66029
- }
66030
- },
66031
- "required": [
66032
- "file"
66033
- ]
66034
- }
66035
- }
66036
- }
66037
- },
66038
- "responses": {
66039
- "201": {
66040
- "description": "OK",
66041
- "content": {
66042
- "application/json": {
66043
- "schema": {
66044
- "type": "object",
66045
- "properties": {
66046
- "updated": {
66047
- "type": "integer"
66048
- },
66049
- "not_found": {
66050
- "type": "array",
66051
- "items": {
66052
- "type": "string"
66053
- }
66054
- }
66055
- }
66056
- }
66057
- }
66058
- }
66059
- },
66060
- "400": {
66061
- "$ref": "#/components/responses/BadRequest"
66062
- },
66063
- "401": {
66064
- "$ref": "#/components/responses/Unauthorized"
66065
- },
66066
- "403": {
66067
- "$ref": "#/components/responses/Forbidden"
66068
- },
66069
- "429": {
66070
- "$ref": "#/components/responses/RateLimitExceeded"
66071
- }
66072
- }
66073
- }
66074
- },
66075
- "/v1/documents/display-name-rule": {
66013
+ "/v1/documents/{id}/collections": {
66076
66014
  "get": {
66077
- "operationId": "getDisplayNameRule",
66015
+ "operationId": "explainDocumentCollections",
66078
66016
  "x-audience": "public",
66079
66017
  "tags": [
66080
- "Documents"
66018
+ "Collections"
66081
66019
  ],
66082
- "summary": "Get the readable-name rule",
66083
- "description": "The workspace's rule for deriving a readable name from each filename, its check state, and a sample of current filename → name pairs. Requires the `read` scope (or `documents:read`). Any member of the workspace may call it. The sample lists only documents the key's person can see.",
66020
+ "summary": "Explain a document's collections",
66021
+ "description": "Why the document sits where it does: each of its labels, whether it was derived or set by a person, with the evidence you may see behind it, and each collection it is in, with why (`rule`, `hand` or `held` by a limit). `pending` and `unresolved` say whether its labels are still settling. 404 when the key's person may not read the document. Requires the `read` scope (or `documents:read`). Any member of the workspace may call it.",
66084
66022
  "security": [
66085
66023
  {
66086
66024
  "BearerAuth": []
@@ -66089,72 +66027,17 @@
66089
66027
  "x-required-scopes": [
66090
66028
  "read"
66091
66029
  ],
66092
- "responses": {
66093
- "200": {
66094
- "description": "OK",
66095
- "content": {
66096
- "application/json": {
66097
- "schema": {
66098
- "type": "object",
66099
- "additionalProperties": true
66100
- }
66101
- }
66102
- }
66103
- },
66104
- "401": {
66105
- "$ref": "#/components/responses/Unauthorized"
66106
- },
66107
- "403": {
66108
- "$ref": "#/components/responses/Forbidden"
66109
- },
66110
- "429": {
66111
- "$ref": "#/components/responses/RateLimitExceeded"
66112
- }
66113
- }
66114
- },
66115
- "patch": {
66116
- "operationId": "setDisplayNameRule",
66117
- "x-audience": "public",
66118
- "tags": [
66119
- "Documents"
66120
- ],
66121
- "summary": "Set the readable-name rule",
66122
- "description": "`off` derives nothing and clears stored names, `default` tidies each filename, `lua` runs your `script` (reads `record.filename`, calls `record:set('display_name', value)`). Takes effect for new documents; apply it to existing ones with the backfill. Requires the `documents:write` scope. The key's person must be an Admin of the workspace (the `workspace` permission), as in the web app.",
66123
- "security": [
66030
+ "parameters": [
66124
66031
  {
66125
- "BearerAuth": []
66126
- }
66127
- ],
66128
- "x-required-scopes": [
66129
- "documents:write"
66130
- ],
66131
- "requestBody": {
66132
- "required": true,
66133
- "content": {
66134
- "application/json": {
66135
- "schema": {
66136
- "type": "object",
66137
- "properties": {
66138
- "mode": {
66139
- "type": "string",
66140
- "enum": [
66141
- "off",
66142
- "default",
66143
- "lua"
66144
- ]
66145
- },
66146
- "script": {
66147
- "type": "string",
66148
- "maxLength": 20000
66149
- }
66150
- },
66151
- "required": [
66152
- "mode"
66153
- ]
66154
- }
66032
+ "name": "id",
66033
+ "in": "path",
66034
+ "required": true,
66035
+ "schema": {
66036
+ "type": "string",
66037
+ "format": "uuid"
66155
66038
  }
66156
66039
  }
66157
- },
66040
+ ],
66158
66041
  "responses": {
66159
66042
  "200": {
66160
66043
  "description": "OK",
@@ -66176,21 +66059,24 @@
66176
66059
  "403": {
66177
66060
  "$ref": "#/components/responses/Forbidden"
66178
66061
  },
66062
+ "404": {
66063
+ "$ref": "#/components/responses/NotFound"
66064
+ },
66179
66065
  "429": {
66180
66066
  "$ref": "#/components/responses/RateLimitExceeded"
66181
66067
  }
66182
66068
  }
66183
66069
  }
66184
66070
  },
66185
- "/v1/documents/display-name-rule/preview": {
66186
- "post": {
66187
- "operationId": "previewDisplayNameRule",
66071
+ "/v1/documents/{id}/traits": {
66072
+ "patch": {
66073
+ "operationId": "setDocumentLabels",
66188
66074
  "x-audience": "public",
66189
66075
  "tags": [
66190
- "Documents"
66076
+ "Collections"
66191
66077
  ],
66192
- "summary": "Try a readable-name script",
66193
- "description": "Runs a candidate `lua_script` over a sample of real filenames (default 50, at most 200) without saving it. Requires the `documents:write` scope. The key's person must be an Admin of the workspace (the `workspace` permission), as in the web app. The sample is drawn only from documents the key's person can see.",
66078
+ "summary": "Change a document's labels by hand",
66079
+ "description": "Adds and removes labels on one document (`add`, `remove`, each at most 50 labels such as `relationship:client`). A person's labels are kept whenever the document's labels are derived again. Refused (403) when the change would move the document into or out of a limited collection the key's person may not manage. Requires the `documents:write` scope. The key's person must be allowed to edit in the workspace, as in the web app.",
66194
66080
  "security": [
66195
66081
  {
66196
66082
  "BearerAuth": []
@@ -66199,74 +66085,17 @@
66199
66085
  "x-required-scopes": [
66200
66086
  "documents:write"
66201
66087
  ],
66202
- "requestBody": {
66203
- "required": true,
66204
- "content": {
66205
- "application/json": {
66206
- "schema": {
66207
- "type": "object",
66208
- "properties": {
66209
- "lua_script": {
66210
- "type": "string",
66211
- "maxLength": 20000
66212
- },
66213
- "sample_size": {
66214
- "type": "integer",
66215
- "minimum": 1,
66216
- "maximum": 200
66217
- }
66218
- },
66219
- "required": [
66220
- "lua_script"
66221
- ]
66222
- }
66223
- }
66224
- }
66225
- },
66226
- "responses": {
66227
- "200": {
66228
- "description": "OK",
66229
- "content": {
66230
- "application/json": {
66231
- "schema": {
66232
- "type": "object",
66233
- "additionalProperties": true
66234
- }
66235
- }
66236
- }
66237
- },
66238
- "400": {
66239
- "$ref": "#/components/responses/BadRequest"
66240
- },
66241
- "401": {
66242
- "$ref": "#/components/responses/Unauthorized"
66243
- },
66244
- "403": {
66245
- "$ref": "#/components/responses/Forbidden"
66246
- },
66247
- "429": {
66248
- "$ref": "#/components/responses/RateLimitExceeded"
66249
- }
66250
- }
66251
- }
66252
- },
66253
- "/v1/documents/display-name-rule/generate-script": {
66254
- "post": {
66255
- "operationId": "generateDisplayNameScript",
66256
- "x-audience": "public",
66257
- "tags": [
66258
- "Documents"
66259
- ],
66260
- "summary": "Draft a readable-name script from an instruction",
66261
- "description": "Drafts a rule script from a plain-language `instruction` (\"drop the number in front of the name\"), grounded in the workspace's own filenames. Saves nothing. Requires the `documents:write` scope. The key's person must be an Admin of the workspace (the `workspace` permission), as in the web app. Only filenames of documents the key's person can see are used and returned.",
66262
- "security": [
66088
+ "parameters": [
66263
66089
  {
66264
- "BearerAuth": []
66090
+ "name": "id",
66091
+ "in": "path",
66092
+ "required": true,
66093
+ "schema": {
66094
+ "type": "string",
66095
+ "format": "uuid"
66096
+ }
66265
66097
  }
66266
66098
  ],
66267
- "x-required-scopes": [
66268
- "documents:write"
66269
- ],
66270
66099
  "requestBody": {
66271
66100
  "required": true,
66272
66101
  "content": {
@@ -66274,19 +66103,512 @@
66274
66103
  "schema": {
66275
66104
  "type": "object",
66276
66105
  "properties": {
66277
- "instruction": {
66278
- "type": "string",
66279
- "maxLength": 2000
66106
+ "add": {
66107
+ "type": "array",
66108
+ "maxItems": 50,
66109
+ "items": {
66110
+ "type": "string",
66111
+ "maxLength": 200
66112
+ }
66280
66113
  },
66281
- "sample_size": {
66282
- "type": "integer",
66283
- "minimum": 1,
66284
- "maximum": 200
66114
+ "remove": {
66115
+ "type": "array",
66116
+ "maxItems": 50,
66117
+ "items": {
66118
+ "type": "string",
66119
+ "maxLength": 200
66120
+ }
66285
66121
  }
66286
- },
66287
- "required": [
66288
- "instruction"
66289
- ]
66122
+ }
66123
+ }
66124
+ }
66125
+ }
66126
+ },
66127
+ "responses": {
66128
+ "200": {
66129
+ "description": "OK",
66130
+ "content": {
66131
+ "application/json": {
66132
+ "schema": {
66133
+ "type": "object",
66134
+ "additionalProperties": true
66135
+ }
66136
+ }
66137
+ }
66138
+ },
66139
+ "400": {
66140
+ "$ref": "#/components/responses/BadRequest"
66141
+ },
66142
+ "401": {
66143
+ "$ref": "#/components/responses/Unauthorized"
66144
+ },
66145
+ "403": {
66146
+ "$ref": "#/components/responses/Forbidden"
66147
+ },
66148
+ "404": {
66149
+ "$ref": "#/components/responses/NotFound"
66150
+ },
66151
+ "429": {
66152
+ "$ref": "#/components/responses/RateLimitExceeded"
66153
+ }
66154
+ }
66155
+ }
66156
+ },
66157
+ "/v1/documents/{id}/move": {
66158
+ "post": {
66159
+ "operationId": "moveDocumentBetweenCollections",
66160
+ "x-audience": "public",
66161
+ "tags": [
66162
+ "Collections"
66163
+ ],
66164
+ "summary": "Move a document between collections",
66165
+ "description": "Takes the document out of `from`, puts it into `to`, or both. A collection that sorts by labels keeps the document out once it is moved out. Any member moves between plain collections; a limited collection needs a person its limit admits or an owner; an enforced collection or an account needs an owner (403 otherwise). 404 when the key's person may not read the document. Requires the `documents:write` scope. The key's person must be allowed to edit in the workspace, as in the web app.",
66166
+ "security": [
66167
+ {
66168
+ "BearerAuth": []
66169
+ }
66170
+ ],
66171
+ "x-required-scopes": [
66172
+ "documents:write"
66173
+ ],
66174
+ "parameters": [
66175
+ {
66176
+ "name": "id",
66177
+ "in": "path",
66178
+ "required": true,
66179
+ "schema": {
66180
+ "type": "string",
66181
+ "format": "uuid"
66182
+ }
66183
+ }
66184
+ ],
66185
+ "requestBody": {
66186
+ "required": true,
66187
+ "content": {
66188
+ "application/json": {
66189
+ "schema": {
66190
+ "type": "object",
66191
+ "properties": {
66192
+ "from": {
66193
+ "type": "string",
66194
+ "format": "uuid",
66195
+ "nullable": true
66196
+ },
66197
+ "to": {
66198
+ "type": "string",
66199
+ "format": "uuid",
66200
+ "nullable": true
66201
+ }
66202
+ }
66203
+ }
66204
+ }
66205
+ }
66206
+ },
66207
+ "responses": {
66208
+ "200": {
66209
+ "description": "OK",
66210
+ "content": {
66211
+ "application/json": {
66212
+ "schema": {
66213
+ "type": "object",
66214
+ "additionalProperties": true
66215
+ }
66216
+ }
66217
+ }
66218
+ },
66219
+ "400": {
66220
+ "$ref": "#/components/responses/BadRequest"
66221
+ },
66222
+ "401": {
66223
+ "$ref": "#/components/responses/Unauthorized"
66224
+ },
66225
+ "403": {
66226
+ "$ref": "#/components/responses/Forbidden"
66227
+ },
66228
+ "404": {
66229
+ "$ref": "#/components/responses/NotFound"
66230
+ },
66231
+ "409": {
66232
+ "$ref": "#/components/responses/Conflict"
66233
+ },
66234
+ "429": {
66235
+ "$ref": "#/components/responses/RateLimitExceeded"
66236
+ }
66237
+ }
66238
+ }
66239
+ },
66240
+ "/v1/documents/{id}/parties": {
66241
+ "put": {
66242
+ "operationId": "setDocumentParties",
66243
+ "x-audience": "public",
66244
+ "tags": [
66245
+ "Collections"
66246
+ ],
66247
+ "summary": "Set a document's parties",
66248
+ "description": "Hands over the document's parties as your system has them, the way a connected mailbox does at import: typed identifiers with an optional role, and whether the list is `complete` (only a complete list whose every party is your own makes a document internal). The document's labels are derived again at once; a party nobody in the directory knows yet may leave the document `pending` for a short while, during which it stays under every limit. Requires the `documents:write` scope. The key's person must be allowed to edit in the workspace, as in the web app.",
66249
+ "security": [
66250
+ {
66251
+ "BearerAuth": []
66252
+ }
66253
+ ],
66254
+ "x-required-scopes": [
66255
+ "documents:write"
66256
+ ],
66257
+ "parameters": [
66258
+ {
66259
+ "name": "id",
66260
+ "in": "path",
66261
+ "required": true,
66262
+ "schema": {
66263
+ "type": "string",
66264
+ "format": "uuid"
66265
+ }
66266
+ }
66267
+ ],
66268
+ "requestBody": {
66269
+ "required": true,
66270
+ "content": {
66271
+ "application/json": {
66272
+ "schema": {
66273
+ "type": "object",
66274
+ "required": [
66275
+ "parties"
66276
+ ],
66277
+ "properties": {
66278
+ "parties": {
66279
+ "type": "array",
66280
+ "maxItems": 500,
66281
+ "items": {
66282
+ "$ref": "#/components/schemas/DocumentParty"
66283
+ }
66284
+ },
66285
+ "complete": {
66286
+ "type": "boolean"
66287
+ }
66288
+ }
66289
+ }
66290
+ }
66291
+ }
66292
+ },
66293
+ "responses": {
66294
+ "200": {
66295
+ "description": "OK",
66296
+ "content": {
66297
+ "application/json": {
66298
+ "schema": {
66299
+ "type": "object",
66300
+ "additionalProperties": true
66301
+ }
66302
+ }
66303
+ }
66304
+ },
66305
+ "400": {
66306
+ "$ref": "#/components/responses/BadRequest"
66307
+ },
66308
+ "401": {
66309
+ "$ref": "#/components/responses/Unauthorized"
66310
+ },
66311
+ "403": {
66312
+ "$ref": "#/components/responses/Forbidden"
66313
+ },
66314
+ "404": {
66315
+ "$ref": "#/components/responses/NotFound"
66316
+ },
66317
+ "429": {
66318
+ "$ref": "#/components/responses/RateLimitExceeded"
66319
+ }
66320
+ }
66321
+ }
66322
+ },
66323
+ "/v1/documents/batch-metadata/import": {
66324
+ "post": {
66325
+ "operationId": "importDocumentBatchMetadata",
66326
+ "x-audience": "public",
66327
+ "tags": [
66328
+ "Documents"
66329
+ ],
66330
+ "summary": "Import source batch ids from a CSV",
66331
+ "description": "Sets the source batch id on existing documents from a CSV upload (`file`, up to 20 MB). Answers how many documents were updated and which named ones were not found. 403 for a person whose document visibility a rule narrows, because the import matches against every document of the workspace. Requires the `documents:write` scope. The key's person must be an Admin of the workspace, as in the web app; in a workspace whose model configuration Talonic manages this answers 403 `insufficient_role`.",
66332
+ "security": [
66333
+ {
66334
+ "BearerAuth": []
66335
+ }
66336
+ ],
66337
+ "x-required-scopes": [
66338
+ "documents:write"
66339
+ ],
66340
+ "requestBody": {
66341
+ "required": true,
66342
+ "content": {
66343
+ "multipart/form-data": {
66344
+ "schema": {
66345
+ "type": "object",
66346
+ "properties": {
66347
+ "file": {
66348
+ "type": "string",
66349
+ "format": "binary",
66350
+ "description": "CSV with a header row."
66351
+ }
66352
+ },
66353
+ "required": [
66354
+ "file"
66355
+ ]
66356
+ }
66357
+ }
66358
+ }
66359
+ },
66360
+ "responses": {
66361
+ "201": {
66362
+ "description": "OK",
66363
+ "content": {
66364
+ "application/json": {
66365
+ "schema": {
66366
+ "type": "object",
66367
+ "properties": {
66368
+ "updated": {
66369
+ "type": "integer"
66370
+ },
66371
+ "not_found": {
66372
+ "type": "array",
66373
+ "items": {
66374
+ "type": "string"
66375
+ }
66376
+ }
66377
+ }
66378
+ }
66379
+ }
66380
+ }
66381
+ },
66382
+ "400": {
66383
+ "$ref": "#/components/responses/BadRequest"
66384
+ },
66385
+ "401": {
66386
+ "$ref": "#/components/responses/Unauthorized"
66387
+ },
66388
+ "403": {
66389
+ "$ref": "#/components/responses/Forbidden"
66390
+ },
66391
+ "429": {
66392
+ "$ref": "#/components/responses/RateLimitExceeded"
66393
+ }
66394
+ }
66395
+ }
66396
+ },
66397
+ "/v1/documents/display-name-rule": {
66398
+ "get": {
66399
+ "operationId": "getDisplayNameRule",
66400
+ "x-audience": "public",
66401
+ "tags": [
66402
+ "Documents"
66403
+ ],
66404
+ "summary": "Get the readable-name rule",
66405
+ "description": "The workspace's rule for deriving a readable name from each filename, its check state, and a sample of current filename → name pairs. Requires the `read` scope (or `documents:read`). Any member of the workspace may call it. The sample lists only documents the key's person can see.",
66406
+ "security": [
66407
+ {
66408
+ "BearerAuth": []
66409
+ }
66410
+ ],
66411
+ "x-required-scopes": [
66412
+ "read"
66413
+ ],
66414
+ "responses": {
66415
+ "200": {
66416
+ "description": "OK",
66417
+ "content": {
66418
+ "application/json": {
66419
+ "schema": {
66420
+ "type": "object",
66421
+ "additionalProperties": true
66422
+ }
66423
+ }
66424
+ }
66425
+ },
66426
+ "401": {
66427
+ "$ref": "#/components/responses/Unauthorized"
66428
+ },
66429
+ "403": {
66430
+ "$ref": "#/components/responses/Forbidden"
66431
+ },
66432
+ "429": {
66433
+ "$ref": "#/components/responses/RateLimitExceeded"
66434
+ }
66435
+ }
66436
+ },
66437
+ "patch": {
66438
+ "operationId": "setDisplayNameRule",
66439
+ "x-audience": "public",
66440
+ "tags": [
66441
+ "Documents"
66442
+ ],
66443
+ "summary": "Set the readable-name rule",
66444
+ "description": "`off` derives nothing and clears stored names, `default` tidies each filename, `lua` runs your `script` (reads `record.filename`, calls `record:set('display_name', value)`). Takes effect for new documents; apply it to existing ones with the backfill. Requires the `documents:write` scope. The key's person must be an Admin of the workspace (the `workspace` permission), as in the web app.",
66445
+ "security": [
66446
+ {
66447
+ "BearerAuth": []
66448
+ }
66449
+ ],
66450
+ "x-required-scopes": [
66451
+ "documents:write"
66452
+ ],
66453
+ "requestBody": {
66454
+ "required": true,
66455
+ "content": {
66456
+ "application/json": {
66457
+ "schema": {
66458
+ "type": "object",
66459
+ "properties": {
66460
+ "mode": {
66461
+ "type": "string",
66462
+ "enum": [
66463
+ "off",
66464
+ "default",
66465
+ "lua"
66466
+ ]
66467
+ },
66468
+ "script": {
66469
+ "type": "string",
66470
+ "maxLength": 20000
66471
+ }
66472
+ },
66473
+ "required": [
66474
+ "mode"
66475
+ ]
66476
+ }
66477
+ }
66478
+ }
66479
+ },
66480
+ "responses": {
66481
+ "200": {
66482
+ "description": "OK",
66483
+ "content": {
66484
+ "application/json": {
66485
+ "schema": {
66486
+ "type": "object",
66487
+ "additionalProperties": true
66488
+ }
66489
+ }
66490
+ }
66491
+ },
66492
+ "400": {
66493
+ "$ref": "#/components/responses/BadRequest"
66494
+ },
66495
+ "401": {
66496
+ "$ref": "#/components/responses/Unauthorized"
66497
+ },
66498
+ "403": {
66499
+ "$ref": "#/components/responses/Forbidden"
66500
+ },
66501
+ "429": {
66502
+ "$ref": "#/components/responses/RateLimitExceeded"
66503
+ }
66504
+ }
66505
+ }
66506
+ },
66507
+ "/v1/documents/display-name-rule/preview": {
66508
+ "post": {
66509
+ "operationId": "previewDisplayNameRule",
66510
+ "x-audience": "public",
66511
+ "tags": [
66512
+ "Documents"
66513
+ ],
66514
+ "summary": "Try a readable-name script",
66515
+ "description": "Runs a candidate `lua_script` over a sample of real filenames (default 50, at most 200) without saving it. Requires the `documents:write` scope. The key's person must be an Admin of the workspace (the `workspace` permission), as in the web app. The sample is drawn only from documents the key's person can see.",
66516
+ "security": [
66517
+ {
66518
+ "BearerAuth": []
66519
+ }
66520
+ ],
66521
+ "x-required-scopes": [
66522
+ "documents:write"
66523
+ ],
66524
+ "requestBody": {
66525
+ "required": true,
66526
+ "content": {
66527
+ "application/json": {
66528
+ "schema": {
66529
+ "type": "object",
66530
+ "properties": {
66531
+ "lua_script": {
66532
+ "type": "string",
66533
+ "maxLength": 20000
66534
+ },
66535
+ "sample_size": {
66536
+ "type": "integer",
66537
+ "minimum": 1,
66538
+ "maximum": 200
66539
+ }
66540
+ },
66541
+ "required": [
66542
+ "lua_script"
66543
+ ]
66544
+ }
66545
+ }
66546
+ }
66547
+ },
66548
+ "responses": {
66549
+ "200": {
66550
+ "description": "OK",
66551
+ "content": {
66552
+ "application/json": {
66553
+ "schema": {
66554
+ "type": "object",
66555
+ "additionalProperties": true
66556
+ }
66557
+ }
66558
+ }
66559
+ },
66560
+ "400": {
66561
+ "$ref": "#/components/responses/BadRequest"
66562
+ },
66563
+ "401": {
66564
+ "$ref": "#/components/responses/Unauthorized"
66565
+ },
66566
+ "403": {
66567
+ "$ref": "#/components/responses/Forbidden"
66568
+ },
66569
+ "429": {
66570
+ "$ref": "#/components/responses/RateLimitExceeded"
66571
+ }
66572
+ }
66573
+ }
66574
+ },
66575
+ "/v1/documents/display-name-rule/generate-script": {
66576
+ "post": {
66577
+ "operationId": "generateDisplayNameScript",
66578
+ "x-audience": "public",
66579
+ "tags": [
66580
+ "Documents"
66581
+ ],
66582
+ "summary": "Draft a readable-name script from an instruction",
66583
+ "description": "Drafts a rule script from a plain-language `instruction` (\"drop the number in front of the name\"), grounded in the workspace's own filenames. Saves nothing. Requires the `documents:write` scope. The key's person must be an Admin of the workspace (the `workspace` permission), as in the web app. Only filenames of documents the key's person can see are used and returned.",
66584
+ "security": [
66585
+ {
66586
+ "BearerAuth": []
66587
+ }
66588
+ ],
66589
+ "x-required-scopes": [
66590
+ "documents:write"
66591
+ ],
66592
+ "requestBody": {
66593
+ "required": true,
66594
+ "content": {
66595
+ "application/json": {
66596
+ "schema": {
66597
+ "type": "object",
66598
+ "properties": {
66599
+ "instruction": {
66600
+ "type": "string",
66601
+ "maxLength": 2000
66602
+ },
66603
+ "sample_size": {
66604
+ "type": "integer",
66605
+ "minimum": 1,
66606
+ "maximum": 200
66607
+ }
66608
+ },
66609
+ "required": [
66610
+ "instruction"
66611
+ ]
66290
66612
  }
66291
66613
  }
66292
66614
  }
@@ -66540,15 +66862,293 @@
66540
66862
  }
66541
66863
  }
66542
66864
  },
66543
- "/v1/collections/mine": {
66865
+ "/v1/collections/mine": {
66866
+ "get": {
66867
+ "operationId": "listMyCollections",
66868
+ "x-audience": "public",
66869
+ "tags": [
66870
+ "Collections"
66871
+ ],
66872
+ "summary": "List the collections assigned to me",
66873
+ "description": "The collections assigned to the key's person, and whether that limits what they see. Requires the `read` scope (or `documents:read`). Any member of the workspace may call it.",
66874
+ "security": [
66875
+ {
66876
+ "BearerAuth": []
66877
+ }
66878
+ ],
66879
+ "x-required-scopes": [
66880
+ "read"
66881
+ ],
66882
+ "responses": {
66883
+ "200": {
66884
+ "description": "OK",
66885
+ "content": {
66886
+ "application/json": {
66887
+ "schema": {
66888
+ "type": "object",
66889
+ "properties": {
66890
+ "collections": {
66891
+ "type": "array",
66892
+ "items": {
66893
+ "type": "object",
66894
+ "additionalProperties": true
66895
+ }
66896
+ },
66897
+ "restricted": {
66898
+ "type": "boolean"
66899
+ }
66900
+ }
66901
+ }
66902
+ }
66903
+ }
66904
+ },
66905
+ "401": {
66906
+ "$ref": "#/components/responses/Unauthorized"
66907
+ },
66908
+ "403": {
66909
+ "$ref": "#/components/responses/Forbidden"
66910
+ },
66911
+ "429": {
66912
+ "$ref": "#/components/responses/RateLimitExceeded"
66913
+ }
66914
+ }
66915
+ }
66916
+ },
66917
+ "/v1/collections/counts": {
66918
+ "get": {
66919
+ "operationId": "getCollectionCounts",
66920
+ "x-audience": "public",
66921
+ "tags": [
66922
+ "Collections"
66923
+ ],
66924
+ "summary": "Count documents per collection",
66925
+ "description": "Visible-document counts per collection. Requires the `read` scope (or `documents:read`). Any member of the workspace may call it.",
66926
+ "security": [
66927
+ {
66928
+ "BearerAuth": []
66929
+ }
66930
+ ],
66931
+ "x-required-scopes": [
66932
+ "read"
66933
+ ],
66934
+ "responses": {
66935
+ "200": {
66936
+ "description": "OK",
66937
+ "content": {
66938
+ "application/json": {
66939
+ "schema": {
66940
+ "type": "object",
66941
+ "properties": {
66942
+ "collections": {
66943
+ "type": "array",
66944
+ "items": {
66945
+ "type": "object",
66946
+ "additionalProperties": true
66947
+ }
66948
+ }
66949
+ }
66950
+ }
66951
+ }
66952
+ }
66953
+ },
66954
+ "401": {
66955
+ "$ref": "#/components/responses/Unauthorized"
66956
+ },
66957
+ "403": {
66958
+ "$ref": "#/components/responses/Forbidden"
66959
+ },
66960
+ "429": {
66961
+ "$ref": "#/components/responses/RateLimitExceeded"
66962
+ }
66963
+ }
66964
+ }
66965
+ },
66966
+ "/v1/collections/config": {
66967
+ "get": {
66968
+ "operationId": "getCollectionsConfig",
66969
+ "x-audience": "public",
66970
+ "tags": [
66971
+ "Collections"
66972
+ ],
66973
+ "summary": "Get the collections configuration",
66974
+ "description": "The workspace's collections as one configuration document: each collection that has a `key` with its name, the labels it sorts by (`match`, or `any` for several label sets) and its children, plus the workspace's relationship kinds, own domains and whether relationships may be inferred. Who may read a limited collection (`only`), the directory's configured entries and the default views appear for a workspace owner only. Requires the `read` scope (or `documents:read`). Any member of the workspace may call it.",
66975
+ "security": [
66976
+ {
66977
+ "BearerAuth": []
66978
+ }
66979
+ ],
66980
+ "x-required-scopes": [
66981
+ "read"
66982
+ ],
66983
+ "responses": {
66984
+ "200": {
66985
+ "description": "OK",
66986
+ "content": {
66987
+ "application/json": {
66988
+ "schema": {
66989
+ "type": "object",
66990
+ "additionalProperties": true
66991
+ }
66992
+ }
66993
+ }
66994
+ },
66995
+ "400": {
66996
+ "$ref": "#/components/responses/BadRequest"
66997
+ },
66998
+ "401": {
66999
+ "$ref": "#/components/responses/Unauthorized"
67000
+ },
67001
+ "403": {
67002
+ "$ref": "#/components/responses/Forbidden"
67003
+ },
67004
+ "429": {
67005
+ "$ref": "#/components/responses/RateLimitExceeded"
67006
+ }
67007
+ }
67008
+ },
67009
+ "put": {
67010
+ "operationId": "applyCollectionsConfig",
67011
+ "x-audience": "public",
67012
+ "tags": [
67013
+ "Collections"
67014
+ ],
67015
+ "summary": "Apply a collections configuration",
67016
+ "description": "Applies a configuration document: every problem is reported at once (400 with `details.problems`) before anything changes, then everything is saved together. Collections are matched by their path of keys, so applying the same document twice changes nothing. With `dry_run=true` nothing is saved and the answer lists what would be created, changed and removed, how many documents each collection would hold for you, and for each limit how many documents it hides from how many people. `prune=true` removes keyed collections the document does not name, and refuses (409) one that still has a limit or documents placed by hand. A key with no person cannot change `only` (403). Requires the `documents:write` scope. The key's person must be an Admin of the workspace (the `workspace` permission), as in the web app.",
67017
+ "security": [
67018
+ {
67019
+ "BearerAuth": []
67020
+ }
67021
+ ],
67022
+ "x-required-scopes": [
67023
+ "documents:write"
67024
+ ],
67025
+ "parameters": [
67026
+ {
67027
+ "name": "dry_run",
67028
+ "in": "query",
67029
+ "required": false,
67030
+ "schema": {
67031
+ "type": "boolean",
67032
+ "default": false
67033
+ },
67034
+ "description": "Check and preview the change; nothing is saved."
67035
+ },
67036
+ {
67037
+ "name": "prune",
67038
+ "in": "query",
67039
+ "required": false,
67040
+ "schema": {
67041
+ "type": "boolean",
67042
+ "default": false
67043
+ },
67044
+ "description": "Remove keyed collections the document does not name."
67045
+ }
67046
+ ],
67047
+ "requestBody": {
67048
+ "required": true,
67049
+ "content": {
67050
+ "application/json": {
67051
+ "schema": {
67052
+ "type": "object",
67053
+ "properties": {
67054
+ "document": {
67055
+ "type": "object",
67056
+ "additionalProperties": true,
67057
+ "description": "The configuration document."
67058
+ },
67059
+ "yaml": {
67060
+ "type": "string",
67061
+ "maxLength": 1000000,
67062
+ "description": "The configuration document as YAML or JSON text."
67063
+ }
67064
+ }
67065
+ }
67066
+ }
67067
+ }
67068
+ },
67069
+ "responses": {
67070
+ "200": {
67071
+ "description": "OK",
67072
+ "content": {
67073
+ "application/json": {
67074
+ "schema": {
67075
+ "type": "object",
67076
+ "additionalProperties": true
67077
+ }
67078
+ }
67079
+ }
67080
+ },
67081
+ "400": {
67082
+ "$ref": "#/components/responses/BadRequest"
67083
+ },
67084
+ "401": {
67085
+ "$ref": "#/components/responses/Unauthorized"
67086
+ },
67087
+ "403": {
67088
+ "$ref": "#/components/responses/Forbidden"
67089
+ },
67090
+ "409": {
67091
+ "$ref": "#/components/responses/Conflict"
67092
+ },
67093
+ "429": {
67094
+ "$ref": "#/components/responses/RateLimitExceeded"
67095
+ }
67096
+ }
67097
+ }
67098
+ },
67099
+ "/v1/collections/proposal": {
67100
+ "post": {
67101
+ "operationId": "proposeCollectionsConfig",
67102
+ "x-audience": "public",
67103
+ "tags": [
67104
+ "Collections"
67105
+ ],
67106
+ "summary": "Propose a collections configuration",
67107
+ "description": "A configuration document built from the workspace's own documents, as far as the key's person may read them: one top-level collection per channel with documents, children for the labels common enough to be worth one, and, when the workspace has conversations and fewer than two relationship kinds, kinds suggested from its most frequent outside organisations (only when relationships may be inferred). Nothing is saved, and no limit is ever proposed: edit it and apply it with `PUT /v1/collections/config`. Requires the `read` scope (or `documents:read`). The key's person must be an Admin of the workspace (the `workspace` permission), as in the web app.",
67108
+ "security": [
67109
+ {
67110
+ "BearerAuth": []
67111
+ }
67112
+ ],
67113
+ "x-required-scopes": [
67114
+ "read"
67115
+ ],
67116
+ "responses": {
67117
+ "200": {
67118
+ "description": "OK",
67119
+ "content": {
67120
+ "application/json": {
67121
+ "schema": {
67122
+ "type": "object",
67123
+ "additionalProperties": true
67124
+ }
67125
+ }
67126
+ }
67127
+ },
67128
+ "400": {
67129
+ "$ref": "#/components/responses/BadRequest"
67130
+ },
67131
+ "401": {
67132
+ "$ref": "#/components/responses/Unauthorized"
67133
+ },
67134
+ "403": {
67135
+ "$ref": "#/components/responses/Forbidden"
67136
+ },
67137
+ "429": {
67138
+ "$ref": "#/components/responses/RateLimitExceeded"
67139
+ }
67140
+ }
67141
+ }
67142
+ },
67143
+ "/v1/collections/directory": {
66544
67144
  "get": {
66545
- "operationId": "listMyCollections",
67145
+ "operationId": "listCollectionsDirectory",
66546
67146
  "x-audience": "public",
66547
67147
  "tags": [
66548
67148
  "Collections"
66549
67149
  ],
66550
- "summary": "List the collections assigned to me",
66551
- "description": "The collections assigned to the key's person, and whether that limits what they see. Requires the `read` scope (or `documents:read`). Any member of the workspace may call it.",
67150
+ "summary": "List the relationship directory",
67151
+ "description": "Who is who: each identifier (an address, a domain, a phone number, a handle) with what that party is to the workspace and where that came from (`person`, `config`, `record` or `read`). Each entry is shown only where the key's person may see its evidence: configured and corrected entries for an owner, an entry from a record when the person may read that record, an entry from a conversation when the person may read that conversation. Requires the `read` scope (or `documents:read`). Any member of the workspace may call it.",
66552
67152
  "security": [
66553
67153
  {
66554
67154
  "BearerAuth": []
@@ -66564,22 +67164,14 @@
66564
67164
  "application/json": {
66565
67165
  "schema": {
66566
67166
  "type": "object",
66567
- "properties": {
66568
- "collections": {
66569
- "type": "array",
66570
- "items": {
66571
- "type": "object",
66572
- "additionalProperties": true
66573
- }
66574
- },
66575
- "restricted": {
66576
- "type": "boolean"
66577
- }
66578
- }
67167
+ "additionalProperties": true
66579
67168
  }
66580
67169
  }
66581
67170
  }
66582
67171
  },
67172
+ "400": {
67173
+ "$ref": "#/components/responses/BadRequest"
67174
+ },
66583
67175
  "401": {
66584
67176
  "$ref": "#/components/responses/Unauthorized"
66585
67177
  },
@@ -66590,25 +67182,68 @@
66590
67182
  "$ref": "#/components/responses/RateLimitExceeded"
66591
67183
  }
66592
67184
  }
66593
- }
66594
- },
66595
- "/v1/collections/counts": {
66596
- "get": {
66597
- "operationId": "getCollectionCounts",
67185
+ },
67186
+ "put": {
67187
+ "operationId": "saveCollectionsDirectory",
66598
67188
  "x-audience": "public",
66599
67189
  "tags": [
66600
67190
  "Collections"
66601
67191
  ],
66602
- "summary": "Count documents per collection",
66603
- "description": "Visible-document counts per collection. Requires the `read` scope (or `documents:read`). Any member of the workspace may call it.",
67192
+ "summary": "Correct the relationship directory",
67193
+ "description": "Sets entries as a person's correction (they outrank configuration, records and conversations for their identifier) and removes entries by id. The documents of every identifier touched are relabelled; `wait` waits up to 60 seconds and `pending` counts what is still to follow. Requires the `documents:write` scope. The key's person must be an Admin of the workspace (the `workspace` permission), as in the web app.",
66604
67194
  "security": [
66605
67195
  {
66606
67196
  "BearerAuth": []
66607
67197
  }
66608
67198
  ],
66609
67199
  "x-required-scopes": [
66610
- "read"
67200
+ "documents:write"
66611
67201
  ],
67202
+ "requestBody": {
67203
+ "required": true,
67204
+ "content": {
67205
+ "application/json": {
67206
+ "schema": {
67207
+ "type": "object",
67208
+ "properties": {
67209
+ "entries": {
67210
+ "type": "array",
67211
+ "maxItems": 200,
67212
+ "items": {
67213
+ "type": "object",
67214
+ "required": [
67215
+ "match_value",
67216
+ "relationship"
67217
+ ],
67218
+ "properties": {
67219
+ "match_value": {
67220
+ "type": "string",
67221
+ "description": "A typed identifier: `domain:acme.com`, `email:jane@acme.com`, `phone:…`, `handle:…` or `entity:…`."
67222
+ },
67223
+ "relationship": {
67224
+ "type": "string",
67225
+ "description": "A relationship kind of the workspace (its slug), or `own` / `other`."
67226
+ }
67227
+ }
67228
+ }
67229
+ },
67230
+ "remove": {
67231
+ "type": "array",
67232
+ "maxItems": 200,
67233
+ "items": {
67234
+ "type": "string",
67235
+ "format": "uuid"
67236
+ }
67237
+ },
67238
+ "wait": {
67239
+ "type": "boolean",
67240
+ "description": "Wait up to 60 seconds for the documents to be relabelled."
67241
+ }
67242
+ }
67243
+ }
67244
+ }
67245
+ }
67246
+ },
66612
67247
  "responses": {
66613
67248
  "200": {
66614
67249
  "description": "OK",
@@ -66616,25 +67251,23 @@
66616
67251
  "application/json": {
66617
67252
  "schema": {
66618
67253
  "type": "object",
66619
- "properties": {
66620
- "collections": {
66621
- "type": "array",
66622
- "items": {
66623
- "type": "object",
66624
- "additionalProperties": true
66625
- }
66626
- }
66627
- }
67254
+ "additionalProperties": true
66628
67255
  }
66629
67256
  }
66630
67257
  }
66631
67258
  },
67259
+ "400": {
67260
+ "$ref": "#/components/responses/BadRequest"
67261
+ },
66632
67262
  "401": {
66633
67263
  "$ref": "#/components/responses/Unauthorized"
66634
67264
  },
66635
67265
  "403": {
66636
67266
  "$ref": "#/components/responses/Forbidden"
66637
67267
  },
67268
+ "404": {
67269
+ "$ref": "#/components/responses/NotFound"
67270
+ },
66638
67271
  "429": {
66639
67272
  "$ref": "#/components/responses/RateLimitExceeded"
66640
67273
  }
@@ -67175,6 +67808,11 @@
67175
67808
  "type": "string",
67176
67809
  "format": "uuid"
67177
67810
  }
67811
+ },
67812
+ "move": {
67813
+ "type": "boolean",
67814
+ "default": false,
67815
+ "description": "On an account: move documents that belong to another account into this one instead of refusing them (409). Ignored on a plain collection."
67178
67816
  }
67179
67817
  },
67180
67818
  "required": [
@@ -77126,30 +77764,216 @@
77126
77764
  }
77127
77765
  }
77128
77766
  },
77129
- "/v1/records/compartments/{id}/bindings/{bindingId}": {
77130
- "delete": {
77131
- "operationId": "removeCompartmentBinding",
77767
+ "/v1/records/compartments/{id}/bindings/{bindingId}": {
77768
+ "delete": {
77769
+ "operationId": "removeCompartmentBinding",
77770
+ "x-required-scopes": [
77771
+ "team:write"
77772
+ ],
77773
+ "x-audience": "public",
77774
+ "summary": "Remove a compartment binding",
77775
+ "description": "Takes a source, document type or document out of a compartment.\n\nScope: `team:write`. The person behind the credential needs the `team` permission\n(Admins by default).\n",
77776
+ "tags": [
77777
+ "Records"
77778
+ ],
77779
+ "parameters": [
77780
+ {
77781
+ "name": "id",
77782
+ "in": "path",
77783
+ "required": true,
77784
+ "schema": {
77785
+ "type": "string",
77786
+ "format": "uuid"
77787
+ }
77788
+ },
77789
+ {
77790
+ "name": "bindingId",
77791
+ "in": "path",
77792
+ "required": true,
77793
+ "schema": {
77794
+ "type": "string",
77795
+ "format": "uuid"
77796
+ }
77797
+ }
77798
+ ],
77799
+ "responses": {
77800
+ "200": {
77801
+ "description": "Remove a compartment binding: done.",
77802
+ "content": {
77803
+ "application/json": {
77804
+ "schema": {
77805
+ "type": [
77806
+ "object",
77807
+ "array"
77808
+ ]
77809
+ }
77810
+ }
77811
+ }
77812
+ },
77813
+ "400": {
77814
+ "$ref": "#/components/responses/BadRequest"
77815
+ },
77816
+ "401": {
77817
+ "$ref": "#/components/responses/Unauthorized"
77818
+ },
77819
+ "403": {
77820
+ "$ref": "#/components/responses/Forbidden"
77821
+ },
77822
+ "404": {
77823
+ "$ref": "#/components/responses/NotFound"
77824
+ },
77825
+ "429": {
77826
+ "$ref": "#/components/responses/RateLimitExceeded"
77827
+ }
77828
+ }
77829
+ }
77830
+ },
77831
+ "/v1/team/members": {
77832
+ "get": {
77833
+ "operationId": "listTeamMembers",
77834
+ "x-required-scopes": [
77835
+ "team:read"
77836
+ ],
77837
+ "x-audience": "public",
77838
+ "summary": "List members",
77839
+ "description": "Every member with role and status. Permissions are included when the person holds\n`team`.\n\nScope: `team:read`. Any active member of the workspace.\n",
77840
+ "tags": [
77841
+ "Team"
77842
+ ],
77843
+ "responses": {
77844
+ "200": {
77845
+ "description": "List members.",
77846
+ "content": {
77847
+ "application/json": {
77848
+ "schema": {
77849
+ "type": [
77850
+ "object",
77851
+ "array"
77852
+ ]
77853
+ }
77854
+ }
77855
+ }
77856
+ },
77857
+ "401": {
77858
+ "$ref": "#/components/responses/Unauthorized"
77859
+ },
77860
+ "403": {
77861
+ "$ref": "#/components/responses/Forbidden"
77862
+ },
77863
+ "429": {
77864
+ "$ref": "#/components/responses/RateLimitExceeded"
77865
+ }
77866
+ }
77867
+ }
77868
+ },
77869
+ "/v1/team/pending": {
77870
+ "get": {
77871
+ "operationId": "listPendingMembers",
77872
+ "x-required-scopes": [
77873
+ "team:read"
77874
+ ],
77875
+ "x-audience": "public",
77876
+ "summary": "List pending members",
77877
+ "description": "People who asked to join and wait for approval.\n\nScope: `team:read`. The person behind the credential needs the `team` permission (Admins\nby default).\n",
77878
+ "tags": [
77879
+ "Team"
77880
+ ],
77881
+ "responses": {
77882
+ "200": {
77883
+ "description": "List pending members.",
77884
+ "content": {
77885
+ "application/json": {
77886
+ "schema": {
77887
+ "type": [
77888
+ "object",
77889
+ "array"
77890
+ ]
77891
+ }
77892
+ }
77893
+ }
77894
+ },
77895
+ "401": {
77896
+ "$ref": "#/components/responses/Unauthorized"
77897
+ },
77898
+ "403": {
77899
+ "$ref": "#/components/responses/Forbidden"
77900
+ },
77901
+ "429": {
77902
+ "$ref": "#/components/responses/RateLimitExceeded"
77903
+ }
77904
+ }
77905
+ }
77906
+ },
77907
+ "/v1/team/members/{userId}/approve": {
77908
+ "post": {
77909
+ "operationId": "approveMember",
77910
+ "x-required-scopes": [
77911
+ "team:write"
77912
+ ],
77913
+ "x-audience": "public",
77914
+ "summary": "Approve a pending member",
77915
+ "description": "Admits a person who asked to join. Nobody changes their own role or permissions, so a\ncredential can never promote the person it acts for; a change may grant only permissions\nthat person holds, and the workspace always keeps a member who holds `team`.\n\nScope: `team:write`. The person behind the credential needs the `team` permission\n(Admins by default).\n",
77916
+ "tags": [
77917
+ "Team"
77918
+ ],
77919
+ "parameters": [
77920
+ {
77921
+ "name": "userId",
77922
+ "in": "path",
77923
+ "required": true,
77924
+ "schema": {
77925
+ "type": "string",
77926
+ "format": "uuid"
77927
+ }
77928
+ }
77929
+ ],
77930
+ "responses": {
77931
+ "200": {
77932
+ "description": "Approve a pending member: done.",
77933
+ "content": {
77934
+ "application/json": {
77935
+ "schema": {
77936
+ "type": [
77937
+ "object",
77938
+ "array"
77939
+ ]
77940
+ }
77941
+ }
77942
+ }
77943
+ },
77944
+ "400": {
77945
+ "$ref": "#/components/responses/BadRequest"
77946
+ },
77947
+ "401": {
77948
+ "$ref": "#/components/responses/Unauthorized"
77949
+ },
77950
+ "403": {
77951
+ "$ref": "#/components/responses/Forbidden"
77952
+ },
77953
+ "404": {
77954
+ "$ref": "#/components/responses/NotFound"
77955
+ },
77956
+ "429": {
77957
+ "$ref": "#/components/responses/RateLimitExceeded"
77958
+ }
77959
+ }
77960
+ }
77961
+ },
77962
+ "/v1/team/members/{userId}/reject": {
77963
+ "post": {
77964
+ "operationId": "rejectMember",
77132
77965
  "x-required-scopes": [
77133
77966
  "team:write"
77134
77967
  ],
77135
77968
  "x-audience": "public",
77136
- "summary": "Remove a compartment binding",
77137
- "description": "Takes a source, document type or document out of a compartment.\n\nScope: `team:write`. The person behind the credential needs the `team` permission\n(Admins by default).\n",
77969
+ "summary": "Reject a pending member",
77970
+ "description": "Declines a request to join.\n\nScope: `team:write`. The person behind the credential needs the `team` permission\n(Admins by default).\n",
77138
77971
  "tags": [
77139
- "Records"
77972
+ "Team"
77140
77973
  ],
77141
77974
  "parameters": [
77142
77975
  {
77143
- "name": "id",
77144
- "in": "path",
77145
- "required": true,
77146
- "schema": {
77147
- "type": "string",
77148
- "format": "uuid"
77149
- }
77150
- },
77151
- {
77152
- "name": "bindingId",
77976
+ "name": "userId",
77153
77977
  "in": "path",
77154
77978
  "required": true,
77155
77979
  "schema": {
@@ -77160,7 +77984,7 @@
77160
77984
  ],
77161
77985
  "responses": {
77162
77986
  "200": {
77163
- "description": "Remove a compartment binding: done.",
77987
+ "description": "Reject a pending member: done.",
77164
77988
  "content": {
77165
77989
  "application/json": {
77166
77990
  "schema": {
@@ -77190,21 +78014,55 @@
77190
78014
  }
77191
78015
  }
77192
78016
  },
77193
- "/v1/team/members": {
77194
- "get": {
77195
- "operationId": "listTeamMembers",
78017
+ "/v1/team/invite": {
78018
+ "post": {
78019
+ "operationId": "inviteMember",
77196
78020
  "x-required-scopes": [
77197
- "team:read"
78021
+ "team:write"
77198
78022
  ],
77199
78023
  "x-audience": "public",
77200
- "summary": "List members",
77201
- "description": "Every member with role and status. Permissions are included when the person holds\n`team`.\n\nScope: `team:read`. Any active member of the workspace.\n",
78024
+ "summary": "Invite a member",
78025
+ "description": "Invites a person by e-mail with a role. Nobody changes their own role or permissions, so\na credential can never promote the person it acts for; a change may grant only\npermissions that person holds, and the workspace always keeps a member who holds `team`.\n\nScope: `team:write`. The person behind the credential needs the `team` permission\n(Admins by default).\n",
77202
78026
  "tags": [
77203
78027
  "Team"
77204
78028
  ],
78029
+ "requestBody": {
78030
+ "required": true,
78031
+ "content": {
78032
+ "application/json": {
78033
+ "schema": {
78034
+ "type": "object",
78035
+ "properties": {
78036
+ "email": {
78037
+ "type": "string",
78038
+ "format": "email"
78039
+ },
78040
+ "role": {
78041
+ "type": "string",
78042
+ "enum": [
78043
+ "owner",
78044
+ "senior_member",
78045
+ "member",
78046
+ "viewer",
78047
+ "none"
78048
+ ]
78049
+ },
78050
+ "password": {
78051
+ "type": "string",
78052
+ "description": "Only for workspaces that sign in with e-mail and password."
78053
+ }
78054
+ },
78055
+ "required": [
78056
+ "email",
78057
+ "role"
78058
+ ]
78059
+ }
78060
+ }
78061
+ }
78062
+ },
77205
78063
  "responses": {
77206
- "200": {
77207
- "description": "List members.",
78064
+ "201": {
78065
+ "description": "Invite a member: done.",
77208
78066
  "content": {
77209
78067
  "application/json": {
77210
78068
  "schema": {
@@ -77216,6 +78074,9 @@
77216
78074
  }
77217
78075
  }
77218
78076
  },
78077
+ "400": {
78078
+ "$ref": "#/components/responses/BadRequest"
78079
+ },
77219
78080
  "401": {
77220
78081
  "$ref": "#/components/responses/Unauthorized"
77221
78082
  },
@@ -77228,21 +78089,32 @@
77228
78089
  }
77229
78090
  }
77230
78091
  },
77231
- "/v1/team/pending": {
77232
- "get": {
77233
- "operationId": "listPendingMembers",
78092
+ "/v1/team/invites/{userId}/resend": {
78093
+ "post": {
78094
+ "operationId": "resendInvite",
77234
78095
  "x-required-scopes": [
77235
- "team:read"
78096
+ "team:write"
77236
78097
  ],
77237
78098
  "x-audience": "public",
77238
- "summary": "List pending members",
77239
- "description": "People who asked to join and wait for approval.\n\nScope: `team:read`. The person behind the credential needs the `team` permission (Admins\nby default).\n",
78099
+ "summary": "Resend an invitation",
78100
+ "description": "Sends an invited person a new single-use sign-in link; the earlier link stops working.\nOnly an open invitation can be resent (404 otherwise), and only by someone who holds\nevery permission the invitation grants.\n\nScope: `team:write`. The person behind the credential needs the `team` permission\n(Admins by default).\n",
77240
78101
  "tags": [
77241
78102
  "Team"
77242
78103
  ],
78104
+ "parameters": [
78105
+ {
78106
+ "name": "userId",
78107
+ "in": "path",
78108
+ "required": true,
78109
+ "schema": {
78110
+ "type": "string",
78111
+ "format": "uuid"
78112
+ }
78113
+ }
78114
+ ],
77243
78115
  "responses": {
77244
- "200": {
77245
- "description": "List pending members.",
78116
+ "201": {
78117
+ "description": "Resend an invitation: done.",
77246
78118
  "content": {
77247
78119
  "application/json": {
77248
78120
  "schema": {
@@ -77254,27 +78126,33 @@
77254
78126
  }
77255
78127
  }
77256
78128
  },
78129
+ "400": {
78130
+ "$ref": "#/components/responses/BadRequest"
78131
+ },
77257
78132
  "401": {
77258
78133
  "$ref": "#/components/responses/Unauthorized"
77259
78134
  },
77260
78135
  "403": {
77261
78136
  "$ref": "#/components/responses/Forbidden"
77262
78137
  },
78138
+ "404": {
78139
+ "$ref": "#/components/responses/NotFound"
78140
+ },
77263
78141
  "429": {
77264
78142
  "$ref": "#/components/responses/RateLimitExceeded"
77265
78143
  }
77266
78144
  }
77267
78145
  }
77268
78146
  },
77269
- "/v1/team/members/{userId}/approve": {
77270
- "post": {
77271
- "operationId": "approveMember",
78147
+ "/v1/team/invites/{userId}": {
78148
+ "delete": {
78149
+ "operationId": "revokeInvite",
77272
78150
  "x-required-scopes": [
77273
78151
  "team:write"
77274
78152
  ],
77275
78153
  "x-audience": "public",
77276
- "summary": "Approve a pending member",
77277
- "description": "Admits a person who asked to join. Nobody changes their own role or permissions, so a\ncredential can never promote the person it acts for; a change may grant only permissions\nthat person holds, and the workspace always keeps a member who holds `team`.\n\nScope: `team:write`. The person behind the credential needs the `team` permission\n(Admins by default).\n",
78154
+ "summary": "Withdraw an invitation",
78155
+ "description": "Withdraws an open invitation: the pending membership ends and the link stops working.\n404 when the person has no open invitation in this workspace.\n\nScope: `team:write`. The person behind the credential needs the `team` permission\n(Admins by default).\n",
77278
78156
  "tags": [
77279
78157
  "Team"
77280
78158
  ],
@@ -77291,7 +78169,7 @@
77291
78169
  ],
77292
78170
  "responses": {
77293
78171
  "200": {
77294
- "description": "Approve a pending member: done.",
78172
+ "description": "Withdraw an invitation: done.",
77295
78173
  "content": {
77296
78174
  "application/json": {
77297
78175
  "schema": {
@@ -77321,70 +78199,63 @@
77321
78199
  }
77322
78200
  }
77323
78201
  },
77324
- "/v1/team/members/{userId}/reject": {
77325
- "post": {
77326
- "operationId": "rejectMember",
78202
+ "/v1/team/invite-policy": {
78203
+ "get": {
78204
+ "operationId": "getInvitePolicy",
77327
78205
  "x-required-scopes": [
77328
- "team:write"
78206
+ "team:read"
77329
78207
  ],
77330
78208
  "x-audience": "public",
77331
- "summary": "Reject a pending member",
77332
- "description": "Declines a request to join.\n\nScope: `team:write`. The person behind the credential needs the `team` permission\n(Admins by default).\n",
78209
+ "summary": "Read the invitation policy",
78210
+ "description": "Whether team managers may invite addresses outside the workspace's own e-mail domain\n(`external_domains`: `allow` or `block`), and that domain (`email_domain`).\n\nScope: `team:read`. The person behind the credential needs the `team` permission\n(Admins by default).\n",
77333
78211
  "tags": [
77334
78212
  "Team"
77335
78213
  ],
77336
- "parameters": [
77337
- {
77338
- "name": "userId",
77339
- "in": "path",
77340
- "required": true,
77341
- "schema": {
77342
- "type": "string",
77343
- "format": "uuid"
77344
- }
77345
- }
77346
- ],
77347
78214
  "responses": {
77348
78215
  "200": {
77349
- "description": "Reject a pending member: done.",
78216
+ "description": "The invitation policy.",
77350
78217
  "content": {
77351
78218
  "application/json": {
77352
78219
  "schema": {
77353
- "type": [
77354
- "object",
77355
- "array"
77356
- ]
78220
+ "type": "object",
78221
+ "properties": {
78222
+ "external_domains": {
78223
+ "type": "string",
78224
+ "enum": [
78225
+ "allow",
78226
+ "block"
78227
+ ]
78228
+ },
78229
+ "email_domain": {
78230
+ "type": [
78231
+ "string",
78232
+ "null"
78233
+ ]
78234
+ }
78235
+ }
77357
78236
  }
77358
78237
  }
77359
78238
  }
77360
78239
  },
77361
- "400": {
77362
- "$ref": "#/components/responses/BadRequest"
77363
- },
77364
78240
  "401": {
77365
78241
  "$ref": "#/components/responses/Unauthorized"
77366
78242
  },
77367
78243
  "403": {
77368
78244
  "$ref": "#/components/responses/Forbidden"
77369
78245
  },
77370
- "404": {
77371
- "$ref": "#/components/responses/NotFound"
77372
- },
77373
78246
  "429": {
77374
78247
  "$ref": "#/components/responses/RateLimitExceeded"
77375
78248
  }
77376
78249
  }
77377
- }
77378
- },
77379
- "/v1/team/invite": {
77380
- "post": {
77381
- "operationId": "inviteMember",
78250
+ },
78251
+ "put": {
78252
+ "operationId": "setInvitePolicy",
77382
78253
  "x-required-scopes": [
77383
78254
  "team:write"
77384
78255
  ],
77385
78256
  "x-audience": "public",
77386
- "summary": "Invite a member",
77387
- "description": "Invites a person by e-mail with a role. Nobody changes their own role or permissions, so\na credential can never promote the person it acts for; a change may grant only\npermissions that person holds, and the workspace always keeps a member who holds `team`.\n\nScope: `team:write`. The person behind the credential needs the `team` permission\n(Admins by default).\n",
78257
+ "summary": "Change the invitation policy",
78258
+ "description": "Sets whether addresses outside the workspace's own e-mail domain may be invited. `block`\nneeds the workspace to have an e-mail domain of its own (400 otherwise).\n\nScope: `team:write`. The person behind the credential needs the `team` permission\n(Admins by default).\n",
77388
78259
  "tags": [
77389
78260
  "Team"
77390
78261
  ],
@@ -77395,43 +78266,43 @@
77395
78266
  "schema": {
77396
78267
  "type": "object",
77397
78268
  "properties": {
77398
- "email": {
77399
- "type": "string",
77400
- "format": "email"
77401
- },
77402
- "role": {
78269
+ "external_domains": {
77403
78270
  "type": "string",
77404
78271
  "enum": [
77405
- "owner",
77406
- "senior_member",
77407
- "member",
77408
- "viewer",
77409
- "none"
78272
+ "allow",
78273
+ "block"
77410
78274
  ]
77411
- },
77412
- "password": {
77413
- "type": "string",
77414
- "description": "Only for workspaces that sign in with e-mail and password."
77415
78275
  }
77416
78276
  },
77417
78277
  "required": [
77418
- "email",
77419
- "role"
78278
+ "external_domains"
77420
78279
  ]
77421
78280
  }
77422
78281
  }
77423
78282
  }
77424
78283
  },
77425
78284
  "responses": {
77426
- "201": {
77427
- "description": "Invite a member: done.",
78285
+ "200": {
78286
+ "description": "Change the invitation policy: done.",
77428
78287
  "content": {
77429
78288
  "application/json": {
77430
78289
  "schema": {
77431
- "type": [
77432
- "object",
77433
- "array"
77434
- ]
78290
+ "type": "object",
78291
+ "properties": {
78292
+ "external_domains": {
78293
+ "type": "string",
78294
+ "enum": [
78295
+ "allow",
78296
+ "block"
78297
+ ]
78298
+ },
78299
+ "email_domain": {
78300
+ "type": [
78301
+ "string",
78302
+ "null"
78303
+ ]
78304
+ }
78305
+ }
77435
78306
  }
77436
78307
  }
77437
78308
  }
@@ -79778,6 +80649,64 @@
79778
80649
  }
79779
80650
  }
79780
80651
  },
80652
+ "/v1/thread/starters": {
80653
+ "get": {
80654
+ "operationId": "getThreadStarters",
80655
+ "x-audience": "public",
80656
+ "x-required-scopes": [
80657
+ "thread:read"
80658
+ ],
80659
+ "summary": "Read conversation starters",
80660
+ "description": "What an empty conversation offers to start from, as data: whether you have written yet (`fresh`), up to three company names and three kinds of documents you can see, and whether the workspace keeps reported figures. 404 when the thread is not available to you.\n",
80661
+ "tags": [
80662
+ "Thread"
80663
+ ],
80664
+ "responses": {
80665
+ "200": {
80666
+ "description": "OK",
80667
+ "content": {
80668
+ "application/json": {
80669
+ "schema": {
80670
+ "type": "object",
80671
+ "properties": {
80672
+ "fresh": {
80673
+ "type": "boolean"
80674
+ },
80675
+ "companies": {
80676
+ "type": "array",
80677
+ "items": {
80678
+ "type": "string"
80679
+ }
80680
+ },
80681
+ "kinds": {
80682
+ "type": "array",
80683
+ "items": {
80684
+ "type": "string"
80685
+ }
80686
+ },
80687
+ "reported_figures": {
80688
+ "type": "boolean"
80689
+ }
80690
+ }
80691
+ }
80692
+ }
80693
+ }
80694
+ },
80695
+ "401": {
80696
+ "$ref": "#/components/responses/Unauthorized"
80697
+ },
80698
+ "403": {
80699
+ "$ref": "#/components/responses/Forbidden"
80700
+ },
80701
+ "404": {
80702
+ "$ref": "#/components/responses/NotFound"
80703
+ },
80704
+ "429": {
80705
+ "$ref": "#/components/responses/RateLimitExceeded"
80706
+ }
80707
+ }
80708
+ }
80709
+ },
79781
80710
  "/v1/thread/events": {
79782
80711
  "get": {
79783
80712
  "operationId": "listThreadEvents",
@@ -84866,6 +85795,31 @@
84866
85795
  }
84867
85796
  },
84868
85797
  "schemas": {
85798
+ "DocumentParty": {
85799
+ "type": "object",
85800
+ "required": [
85801
+ "id"
85802
+ ],
85803
+ "description": "One party of a document: a typed identifier and, optionally, its role. An address also stands for its domain unless it is a public mail provider's.",
85804
+ "properties": {
85805
+ "id": {
85806
+ "type": "string",
85807
+ "maxLength": 320,
85808
+ "description": "`email:jane@acme.com`, `domain:acme.com`, `phone:+4930123456`, `handle:<scope>:<id>` or `entity:<id>` (a bare address reads as `email:`).",
85809
+ "example": "email:jane@acme.com"
85810
+ },
85811
+ "role": {
85812
+ "type": "string",
85813
+ "enum": [
85814
+ "from",
85815
+ "to",
85816
+ "cc",
85817
+ "attendee",
85818
+ "author"
85819
+ ]
85820
+ }
85821
+ }
85822
+ },
84869
85823
  "Account": {
84870
85824
  "type": "object",
84871
85825
  "required": [