@celigo/api-specs 0.2.289 → 0.2.291

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.
Files changed (53) hide show
  1. package/dist/account.yml +70 -59
  2. package/dist/agent.yml +30 -19
  3. package/dist/agentgroup.yml +30 -19
  4. package/dist/ai-agent.yml +46 -30
  5. package/dist/alert.yml +30 -19
  6. package/dist/api.yml +31 -20
  7. package/dist/apim.yml +30 -19
  8. package/dist/asynchelper.yml +48 -37
  9. package/dist/audit.yml +30 -19
  10. package/dist/bartendertemplate.yml +30 -19
  11. package/dist/connection.yml +92 -64
  12. package/dist/connector.yml +30 -19
  13. package/dist/ediprofile.yml +43 -32
  14. package/dist/editransaction.yml +30 -19
  15. package/dist/enduser.yml +30 -19
  16. package/dist/environment.yml +30 -19
  17. package/dist/eventreport.yml +70 -59
  18. package/dist/export.yml +71 -60
  19. package/dist/filedefinition.yml +65 -54
  20. package/dist/fileserver.yml +30 -19
  21. package/dist/filestorage.yml +30 -19
  22. package/dist/flow.yml +31 -20
  23. package/dist/guardrail.yml +85 -68
  24. package/dist/httpconnector.yml +71 -60
  25. package/dist/httpconnectorendpoint.yml +30 -19
  26. package/dist/httpconnectorresource.yml +31 -20
  27. package/dist/iclient.yml +51 -40
  28. package/dist/import.yml +103 -81
  29. package/dist/integration.yml +37 -26
  30. package/dist/job.yml +30 -19
  31. package/dist/lookupcache.yml +35 -24
  32. package/dist/marketplace.yml +30 -19
  33. package/dist/mcp-oauth-provider.yml +42 -31
  34. package/dist/mcp-server.yml +52 -41
  35. package/dist/networkpolicy.yml +30 -19
  36. package/dist/notification.yml +30 -19
  37. package/dist/processor.yml +70 -59
  38. package/dist/profile.yml +43 -32
  39. package/dist/recyclebin.yml +30 -19
  40. package/dist/script.yml +70 -59
  41. package/dist/stack.yml +30 -19
  42. package/dist/state.yml +30 -19
  43. package/dist/storagequery.yml +30 -19
  44. package/dist/subscription.yml +70 -19
  45. package/dist/sync.yml +30 -19
  46. package/dist/tag.yml +46 -35
  47. package/dist/template.yml +30 -19
  48. package/dist/tool.yml +72 -50
  49. package/dist/topic.yml +30 -19
  50. package/dist/tradingpartnerconnector.yml +31 -20
  51. package/dist/user.yml +30 -19
  52. package/package.json +1 -1
  53. package/schemas.json +1 -1
package/dist/import.yml CHANGED
@@ -333,8 +333,8 @@ paths:
333
333
  | Path | Operations | Description |
334
334
  |------|------------|-------------|
335
335
  | `/debugUntil` | `replace`, `add`, `remove` | Step debug-capture expiry (ISO-8601, at most 3600 seconds from now — a later value is rejected with 422 `update_not_allowed`); `remove` stops capture and succeeds even when the field is absent |
336
- | `/aiAgent/attachedKnowledgeBaseIds` | `replace`, `add`, `remove` | Knowledge bases an AI agent import retrieves from, always as the whole list: `replace` or `add` with the full array (an id that is not a knowledge base in this environment is rejected with 422 `attached_knowledge_base_invalid`), `remove` drops the field. PATCH is the only way to detach — `replace` with `[]` or `remove` clears the list, while a PUT with `[]` keeps the stored ids. `add` at `/-` and `remove` at an array index are rejected with 422 |
337
- | `/guardrail/aiAgent/attachedKnowledgeBaseIds` | `replace`, `add`, `remove` | The same list on an `ai_agent` guardrail import, with the same operations and errors |
336
+ | `/aiAgent/attachedKnowledgeBaseIds` | `replace`, `add`, `remove` | Knowledge bases an AI agent import retrieves from: `replace` sets the whole list (`[]` detaches all), `add` with a full array also replaces it, `add` at `/-` appends one id, and `remove` drops the field. An id that is not a knowledge base in this environment is rejected with 422 `attached_knowledge_base_invalid`, and `remove` at an array index with 422 |
337
+ | `/guardrail/aiAgent/attachedKnowledgeBaseIds` | `replace`, `add`, `remove` | The same list on an `ai_agent` guardrail import, with the same operations and errors, except that `add` at `/-` is rejected with 422 while the field is absent |
338
338
 
339
339
  All other paths are rejected with `422` (`"/name is not a whitelisted property"`).
340
340
  operationId: patchImport
@@ -10384,13 +10384,12 @@ components:
10384
10384
  uniqueItems: true
10385
10385
  default: []
10386
10386
  description: |-
10387
- Knowledge bases the agent retrieves from, for every provider. An agent with none attached
10388
- returns `[]`, except one whose last POST or PUT predates this field and one after a PATCH
10389
- `remove`: both omit the key. On PUT a non-empty array becomes the stored list (duplicate
10390
- ids collapse to their first occurrence), while omitting the list, `null`, and `[]` keep a
10391
- stored list and write `[]` where the key is absent; clear a stored list with
10392
- `PATCH /v1/imports/{_id}` — `replace` with `[]` or `remove` on
10393
- `/aiAgent/attachedKnowledgeBaseIds`.
10387
+ Knowledge bases the agent retrieves from, for every provider. A PUT stores exactly the list
10388
+ its body carries: an array becomes the stored list (duplicate ids collapse to their first
10389
+ occurrence, `[]` detaches every knowledge base), and a body without the field, or with
10390
+ `null`, removes it. A stored empty list reads back as `[]` — what an agent created without
10391
+ the field gets — and the key is omitted where the list was never written (an agent created
10392
+ before this field existed) or was removed, by such a PUT or by a PATCH `remove`.
10394
10393
  items:
10395
10394
  type: string
10396
10395
  format: objectId
@@ -10402,9 +10401,15 @@ components:
10402
10401
  with 422 `attached_knowledge_base_invalid` naming the ids, and more than 50 distinct
10403
10402
  ids fails with 422 `invalid_field` on `aiAgent.attachedKnowledgeBaseIds`.
10404
10403
  - |-
10405
- Sending `[]` on PUT does not detach anything; use PATCH `replace` with `[]` or
10406
- `remove` on the whole path. PATCH `add` at `/aiAgent/attachedKnowledgeBaseIds/-`
10407
- does not append — it fails with 422 — so send the complete list with `replace`.
10404
+ A PUT that leaves the field out detaches every knowledge base, exactly like `[]` or
10405
+ `null`: when a PUT changes anything else on the agent, send the list back as it was
10406
+ read.
10407
+ - |-
10408
+ To change the list alone use `PATCH /v1/imports/{_id}`: `replace` on
10409
+ `/aiAgent/attachedKnowledgeBaseIds` with the complete list (`[]` detaches all), or `add`
10410
+ at `/aiAgent/attachedKnowledgeBaseIds/-` to append one id — an id already attached
10411
+ changes nothing. `remove` at an array index fails with 422 ("Remove at array index is
10412
+ not supported"), so detach one id by replacing the list without it.
10408
10413
  openai:
10409
10414
  type: object
10410
10415
  description: |
@@ -11929,11 +11934,10 @@ components:
11929
11934
  uniqueItems: true
11930
11935
  description: |-
11931
11936
  Knowledge bases the guardrail's model retrieves from, for every provider. Present only once
11932
- set: a guardrail created without the list has no field, and a PATCH `remove` drops it
11933
- again. On PUT a non-empty array replaces the stored list (duplicate ids collapse to their
11934
- first occurrence), while omitting the list, `null`, and `[]` all keep it; clear it with
11935
- `PATCH /v1/imports/{_id}` — `replace` with `[]` or `remove` on
11936
- `/guardrail/aiAgent/attachedKnowledgeBaseIds`.
11937
+ set: a guardrail created without the list has no field, and a PATCH `remove`, or a PUT
11938
+ that omits the list or sends `null`, drops it again. A PUT stores exactly the list its body
11939
+ carries — duplicate ids collapse to their first occurrence, and `[]` detaches every
11940
+ knowledge base.
11937
11941
  items:
11938
11942
  type: string
11939
11943
  format: objectId
@@ -11946,10 +11950,17 @@ components:
11946
11950
  ids fails with 422 `invalid_field` on `guardrail.aiAgent.attachedKnowledgeBaseIds`
11947
11951
  (the message names `aiAgent.attachedKnowledgeBaseIds`).
11948
11952
  - |-
11949
- Sending `[]` on PUT does not detach anything; use PATCH `replace` with `[]` or
11950
- `remove` on the whole path. PATCH `add` at
11951
- `/guardrail/aiAgent/attachedKnowledgeBaseIds/-` does not append — it fails with
11952
- 422 — so send the complete list with `replace`.
11953
+ A PUT that leaves the field out detaches every knowledge base, exactly like `[]` or
11954
+ `null`: when a PUT changes anything else on the guardrail, send the list back as it was
11955
+ read.
11956
+ - |-
11957
+ To change the list alone use `PATCH /v1/imports/{_id}`: `replace` on
11958
+ `/guardrail/aiAgent/attachedKnowledgeBaseIds` with the complete list (`[]` detaches
11959
+ all) works whether or not the field exists. `add` at
11960
+ `/guardrail/aiAgent/attachedKnowledgeBaseIds/-` appends one id only where the field
11961
+ exists — on a guardrail without it the request fails with 422
11962
+ ("guardrail.aiAgent.attachedKnowledgeBaseIds is not an array") — and `remove` at an
11963
+ array index fails with 422.
11953
11964
  openai:
11954
11965
  type: object
11955
11966
  description: |
@@ -18805,6 +18816,46 @@ components:
18805
18816
  (`GET /v1/{flows|apis|tools}/{containerId}/{_id}/requests`). Read-only on PUT —
18806
18817
  written only by `PATCH /v1/imports/{_id}` on `/debugUntil`, at most 3600 seconds
18807
18818
  ahead (`422` `update_not_allowed` beyond that); `remove` stops capture.
18819
+ Error:
18820
+ type: object
18821
+ description: Standard error response envelope returned by integrator.io APIs.
18822
+ properties:
18823
+ errors:
18824
+ type: array
18825
+ description: List of errors that occurred while processing the request.
18826
+ items:
18827
+ type: object
18828
+ properties:
18829
+ code:
18830
+ oneOf:
18831
+ - type: string
18832
+ - type: integer
18833
+ description: |-
18834
+ Machine-readable error code. Usually a string like
18835
+ `invalid_ref`, `missing_required_field`, or `unauthorized`;
18836
+ may be an **integer** when the error mirrors an upstream HTTP
18837
+ status (e.g. `500`) — most commonly returned by connection-ping
18838
+ and adaptor-proxy responses.
18839
+ message:
18840
+ type: string
18841
+ description: Human-readable description of the error.
18842
+ field:
18843
+ type: string
18844
+ description: |-
18845
+ Optional pointer to the document field that caused the error.
18846
+ Used by structural validation errors (`missing_required_field`,
18847
+ `invalid_ref`) to indicate which field is at fault
18848
+ (e.g. `_id`, `type`, `http.baseURI`).
18849
+ source:
18850
+ type: string
18851
+ description: |-
18852
+ Optional origin layer for the error — e.g. `application` when
18853
+ the error came from the remote system the adaptor called,
18854
+ `connector` when the adaptor itself rejected the request.
18855
+ required:
18856
+ - message
18857
+ required:
18858
+ - errors
18808
18859
  Request:
18809
18860
  type: object
18810
18861
  description: |-
@@ -18942,46 +18993,6 @@ components:
18942
18993
  directory:
18943
18994
  required:
18944
18995
  - storageRootId
18945
- Error:
18946
- type: object
18947
- description: Standard error response envelope returned by integrator.io APIs.
18948
- properties:
18949
- errors:
18950
- type: array
18951
- description: List of errors that occurred while processing the request.
18952
- items:
18953
- type: object
18954
- properties:
18955
- code:
18956
- oneOf:
18957
- - type: string
18958
- - type: integer
18959
- description: |-
18960
- Machine-readable error code. Usually a string like
18961
- `invalid_ref`, `missing_required_field`, or `unauthorized`;
18962
- may be an **integer** when the error mirrors an upstream HTTP
18963
- status (e.g. `500`) — most commonly returned by connection-ping
18964
- and adaptor-proxy responses.
18965
- message:
18966
- type: string
18967
- description: Human-readable description of the error.
18968
- field:
18969
- type: string
18970
- description: |-
18971
- Optional pointer to the document field that caused the error.
18972
- Used by structural validation errors (`missing_required_field`,
18973
- `invalid_ref`) to indicate which field is at fault
18974
- (e.g. `_id`, `type`, `http.baseURI`).
18975
- source:
18976
- type: string
18977
- description: |-
18978
- Optional origin layer for the error — e.g. `application` when
18979
- the error came from the remote system the adaptor called,
18980
- `connector` when the adaptor itself rejected the request.
18981
- required:
18982
- - message
18983
- required:
18984
- - errors
18985
18996
  JsonPatchOperation:
18986
18997
  type: object
18987
18998
  description: A single JSON Patch operation (RFC 6902).
@@ -19483,29 +19494,34 @@ components:
19483
19494
  responses:
19484
19495
  401-unauthorized:
19485
19496
  description: |-
19486
- Unauthorized. The request lacks a valid bearer token, or the provided token
19487
- failed to authenticate.
19488
-
19489
- Note: the 401 response is produced by the auth middleware **before** the
19490
- request reaches the endpoint handler, so it does **not** follow the
19491
- standard `{errors: [...]}` envelope. Instead the body is a bare
19492
- `{message: string}` object with no `code`, no `errors` array. Callers
19493
- handling 401s should key off the HTTP status and the `message` string,
19494
- not try to destructure an `errors[]`.
19497
+ Unauthorized, in one of two shapes.
19498
+
19499
+ No valid bearer token: the auth middleware answers before the endpoint
19500
+ handler runs, with a bare `{message: string}` body — no `code`, no
19501
+ `errors` array — so key off the HTTP status and `message`.
19502
+
19503
+ An API token with a custom scope calling an operation its scope does not
19504
+ grant: the token authenticated, and the body is the standard
19505
+ `{errors: [...]}` envelope with code `access_restricted`. Observed on
19506
+ `GET /v1/connections` and `GET /v1/exports/{_id}`: a full-access API token
19507
+ passed both, a personal access token `GET /v1/exports/{_id}`.
19495
19508
  content:
19496
19509
  application/json:
19497
19510
  schema:
19498
- type: object
19499
- properties:
19500
- message:
19501
- type: string
19502
- description: |-
19503
- Human-readable description of the auth failure. Known values:
19504
- - `"Unauthorized"` — no `Authorization` header on the request.
19505
- - `"Bearer Authentication Failed"` — header present but token
19506
- is invalid, revoked, or expired.
19507
- required:
19508
- - message
19511
+ oneOf:
19512
+ - type: object
19513
+ description: The auth middleware's bare body for a missing or invalid token.
19514
+ properties:
19515
+ message:
19516
+ type: string
19517
+ description: |-
19518
+ Human-readable description of the auth failure. Known values:
19519
+ - `"Unauthorized"` — no `Authorization` header on the request.
19520
+ - `"Bearer Authentication Failed"` — header present but token
19521
+ is invalid, revoked, or expired.
19522
+ required:
19523
+ - message
19524
+ - $ref: '#/components/schemas/Error'
19509
19525
  examples:
19510
19526
  missing_token:
19511
19527
  summary: No Authorization header sent
@@ -19515,6 +19531,12 @@ components:
19515
19531
  summary: Bearer token invalid or revoked
19516
19532
  value:
19517
19533
  message: Bearer Authentication Failed
19534
+ scoped_token:
19535
+ summary: An API token with a custom scope reading a resource
19536
+ value:
19537
+ errors:
19538
+ - code: access_restricted
19539
+ message: You don't have the required permissions to perform the action.
19518
19540
  400-bad-request:
19519
19541
  description: |
19520
19542
  Bad request. The server could not understand the request because of malformed syntax or invalid parameters.
@@ -4854,13 +4854,6 @@ components:
4854
4854
  x-celigo-refModel: topics
4855
4855
  examples:
4856
4856
  - - 6aab2870265e1cf39fcbee4d
4857
- Request:
4858
- type: object
4859
- description: Fields that can be sent when creating or updating an integration.
4860
- required:
4861
- - name
4862
- allOf:
4863
- - $ref: '#/components/schemas/IntegrationBase'
4864
4857
  Error:
4865
4858
  type: object
4866
4859
  description: Standard error response envelope returned by integrator.io APIs.
@@ -4901,6 +4894,13 @@ components:
4901
4894
  - message
4902
4895
  required:
4903
4896
  - errors
4897
+ Request:
4898
+ type: object
4899
+ description: Fields that can be sent when creating or updating an integration.
4900
+ required:
4901
+ - name
4902
+ allOf:
4903
+ - $ref: '#/components/schemas/IntegrationBase'
4904
4904
  JsonPatchOperation:
4905
4905
  type: object
4906
4906
  description: A single JSON Patch operation (RFC 6902).
@@ -5807,29 +5807,34 @@ components:
5807
5807
  responses:
5808
5808
  401-unauthorized:
5809
5809
  description: |-
5810
- Unauthorized. The request lacks a valid bearer token, or the provided token
5811
- failed to authenticate.
5810
+ Unauthorized, in one of two shapes.
5812
5811
 
5813
- Note: the 401 response is produced by the auth middleware **before** the
5814
- request reaches the endpoint handler, so it does **not** follow the
5815
- standard `{errors: [...]}` envelope. Instead the body is a bare
5816
- `{message: string}` object with no `code`, no `errors` array. Callers
5817
- handling 401s should key off the HTTP status and the `message` string,
5818
- not try to destructure an `errors[]`.
5812
+ No valid bearer token: the auth middleware answers before the endpoint
5813
+ handler runs, with a bare `{message: string}` body — no `code`, no
5814
+ `errors` array — so key off the HTTP status and `message`.
5815
+
5816
+ An API token with a custom scope calling an operation its scope does not
5817
+ grant: the token authenticated, and the body is the standard
5818
+ `{errors: [...]}` envelope with code `access_restricted`. Observed on
5819
+ `GET /v1/connections` and `GET /v1/exports/{_id}`: a full-access API token
5820
+ passed both, a personal access token `GET /v1/exports/{_id}`.
5819
5821
  content:
5820
5822
  application/json:
5821
5823
  schema:
5822
- type: object
5823
- properties:
5824
- message:
5825
- type: string
5826
- description: |-
5827
- Human-readable description of the auth failure. Known values:
5828
- - `"Unauthorized"` — no `Authorization` header on the request.
5829
- - `"Bearer Authentication Failed"` — header present but token
5830
- is invalid, revoked, or expired.
5831
- required:
5832
- - message
5824
+ oneOf:
5825
+ - type: object
5826
+ description: The auth middleware's bare body for a missing or invalid token.
5827
+ properties:
5828
+ message:
5829
+ type: string
5830
+ description: |-
5831
+ Human-readable description of the auth failure. Known values:
5832
+ - `"Unauthorized"` — no `Authorization` header on the request.
5833
+ - `"Bearer Authentication Failed"` — header present but token
5834
+ is invalid, revoked, or expired.
5835
+ required:
5836
+ - message
5837
+ - $ref: '#/components/schemas/Error'
5833
5838
  examples:
5834
5839
  missing_token:
5835
5840
  summary: No Authorization header sent
@@ -5839,6 +5844,12 @@ components:
5839
5844
  summary: Bearer token invalid or revoked
5840
5845
  value:
5841
5846
  message: Bearer Authentication Failed
5847
+ scoped_token:
5848
+ summary: An API token with a custom scope reading a resource
5849
+ value:
5850
+ errors:
5851
+ - code: access_restricted
5852
+ message: You don't have the required permissions to perform the action.
5842
5853
  400-bad-request:
5843
5854
  description: |
5844
5855
  Bad request. The server could not understand the request because of malformed syntax or invalid parameters.
package/dist/job.yml CHANGED
@@ -2155,29 +2155,34 @@ components:
2155
2155
  responses:
2156
2156
  401-unauthorized:
2157
2157
  description: |-
2158
- Unauthorized. The request lacks a valid bearer token, or the provided token
2159
- failed to authenticate.
2158
+ Unauthorized, in one of two shapes.
2160
2159
 
2161
- Note: the 401 response is produced by the auth middleware **before** the
2162
- request reaches the endpoint handler, so it does **not** follow the
2163
- standard `{errors: [...]}` envelope. Instead the body is a bare
2164
- `{message: string}` object with no `code`, no `errors` array. Callers
2165
- handling 401s should key off the HTTP status and the `message` string,
2166
- not try to destructure an `errors[]`.
2160
+ No valid bearer token: the auth middleware answers before the endpoint
2161
+ handler runs, with a bare `{message: string}` body — no `code`, no
2162
+ `errors` array — so key off the HTTP status and `message`.
2163
+
2164
+ An API token with a custom scope calling an operation its scope does not
2165
+ grant: the token authenticated, and the body is the standard
2166
+ `{errors: [...]}` envelope with code `access_restricted`. Observed on
2167
+ `GET /v1/connections` and `GET /v1/exports/{_id}`: a full-access API token
2168
+ passed both, a personal access token `GET /v1/exports/{_id}`.
2167
2169
  content:
2168
2170
  application/json:
2169
2171
  schema:
2170
- type: object
2171
- properties:
2172
- message:
2173
- type: string
2174
- description: |-
2175
- Human-readable description of the auth failure. Known values:
2176
- - `"Unauthorized"` — no `Authorization` header on the request.
2177
- - `"Bearer Authentication Failed"` — header present but token
2178
- is invalid, revoked, or expired.
2179
- required:
2180
- - message
2172
+ oneOf:
2173
+ - type: object
2174
+ description: The auth middleware's bare body for a missing or invalid token.
2175
+ properties:
2176
+ message:
2177
+ type: string
2178
+ description: |-
2179
+ Human-readable description of the auth failure. Known values:
2180
+ - `"Unauthorized"` — no `Authorization` header on the request.
2181
+ - `"Bearer Authentication Failed"` — header present but token
2182
+ is invalid, revoked, or expired.
2183
+ required:
2184
+ - message
2185
+ - $ref: '#/components/schemas/Error'
2181
2186
  examples:
2182
2187
  missing_token:
2183
2188
  summary: No Authorization header sent
@@ -2187,6 +2192,12 @@ components:
2187
2192
  summary: Bearer token invalid or revoked
2188
2193
  value:
2189
2194
  message: Bearer Authentication Failed
2195
+ scoped_token:
2196
+ summary: An API token with a custom scope reading a resource
2197
+ value:
2198
+ errors:
2199
+ - code: access_restricted
2200
+ message: You don't have the required permissions to perform the action.
2190
2201
  400-bad-request:
2191
2202
  description: |
2192
2203
  Bad request. The server could not understand the request because of malformed syntax or invalid parameters.
@@ -973,11 +973,6 @@ components:
973
973
  description: When the draft cache expires and will be automatically deleted. Only present when `draft` is `true`.
974
974
  examples:
975
975
  - '2026-05-08T17:29:30.726Z'
976
- Request:
977
- type: object
978
- description: Writable fields for creating or updating a lookup cache.
979
- allOf:
980
- - $ref: '#/components/schemas/LookupCacheBase'
981
976
  Error:
982
977
  type: object
983
978
  description: Standard error response envelope returned by integrator.io APIs.
@@ -1018,6 +1013,11 @@ components:
1018
1013
  - message
1019
1014
  required:
1020
1015
  - errors
1016
+ Request:
1017
+ type: object
1018
+ description: Writable fields for creating or updating a lookup cache.
1019
+ allOf:
1020
+ - $ref: '#/components/schemas/LookupCacheBase'
1021
1021
  JsonPatchOperation:
1022
1022
  type: object
1023
1023
  description: A single JSON Patch operation (RFC 6902).
@@ -1412,29 +1412,34 @@ components:
1412
1412
  responses:
1413
1413
  401-unauthorized:
1414
1414
  description: |-
1415
- Unauthorized. The request lacks a valid bearer token, or the provided token
1416
- failed to authenticate.
1415
+ Unauthorized, in one of two shapes.
1416
+
1417
+ No valid bearer token: the auth middleware answers before the endpoint
1418
+ handler runs, with a bare `{message: string}` body — no `code`, no
1419
+ `errors` array — so key off the HTTP status and `message`.
1417
1420
 
1418
- Note: the 401 response is produced by the auth middleware **before** the
1419
- request reaches the endpoint handler, so it does **not** follow the
1420
- standard `{errors: [...]}` envelope. Instead the body is a bare
1421
- `{message: string}` object with no `code`, no `errors` array. Callers
1422
- handling 401s should key off the HTTP status and the `message` string,
1423
- not try to destructure an `errors[]`.
1421
+ An API token with a custom scope calling an operation its scope does not
1422
+ grant: the token authenticated, and the body is the standard
1423
+ `{errors: [...]}` envelope with code `access_restricted`. Observed on
1424
+ `GET /v1/connections` and `GET /v1/exports/{_id}`: a full-access API token
1425
+ passed both, a personal access token `GET /v1/exports/{_id}`.
1424
1426
  content:
1425
1427
  application/json:
1426
1428
  schema:
1427
- type: object
1428
- properties:
1429
- message:
1430
- type: string
1431
- description: |-
1432
- Human-readable description of the auth failure. Known values:
1433
- - `"Unauthorized"` — no `Authorization` header on the request.
1434
- - `"Bearer Authentication Failed"` — header present but token
1435
- is invalid, revoked, or expired.
1436
- required:
1437
- - message
1429
+ oneOf:
1430
+ - type: object
1431
+ description: The auth middleware's bare body for a missing or invalid token.
1432
+ properties:
1433
+ message:
1434
+ type: string
1435
+ description: |-
1436
+ Human-readable description of the auth failure. Known values:
1437
+ - `"Unauthorized"` — no `Authorization` header on the request.
1438
+ - `"Bearer Authentication Failed"` — header present but token
1439
+ is invalid, revoked, or expired.
1440
+ required:
1441
+ - message
1442
+ - $ref: '#/components/schemas/Error'
1438
1443
  examples:
1439
1444
  missing_token:
1440
1445
  summary: No Authorization header sent
@@ -1444,6 +1449,12 @@ components:
1444
1449
  summary: Bearer token invalid or revoked
1445
1450
  value:
1446
1451
  message: Bearer Authentication Failed
1452
+ scoped_token:
1453
+ summary: An API token with a custom scope reading a resource
1454
+ value:
1455
+ errors:
1456
+ - code: access_restricted
1457
+ message: You don't have the required permissions to perform the action.
1447
1458
  400-bad-request:
1448
1459
  description: |
1449
1460
  Bad request. The server could not understand the request because of malformed syntax or invalid parameters.
@@ -961,29 +961,34 @@ components:
961
961
  responses:
962
962
  401-unauthorized:
963
963
  description: |-
964
- Unauthorized. The request lacks a valid bearer token, or the provided token
965
- failed to authenticate.
964
+ Unauthorized, in one of two shapes.
966
965
 
967
- Note: the 401 response is produced by the auth middleware **before** the
968
- request reaches the endpoint handler, so it does **not** follow the
969
- standard `{errors: [...]}` envelope. Instead the body is a bare
970
- `{message: string}` object with no `code`, no `errors` array. Callers
971
- handling 401s should key off the HTTP status and the `message` string,
972
- not try to destructure an `errors[]`.
966
+ No valid bearer token: the auth middleware answers before the endpoint
967
+ handler runs, with a bare `{message: string}` body — no `code`, no
968
+ `errors` array — so key off the HTTP status and `message`.
969
+
970
+ An API token with a custom scope calling an operation its scope does not
971
+ grant: the token authenticated, and the body is the standard
972
+ `{errors: [...]}` envelope with code `access_restricted`. Observed on
973
+ `GET /v1/connections` and `GET /v1/exports/{_id}`: a full-access API token
974
+ passed both, a personal access token `GET /v1/exports/{_id}`.
973
975
  content:
974
976
  application/json:
975
977
  schema:
976
- type: object
977
- properties:
978
- message:
979
- type: string
980
- description: |-
981
- Human-readable description of the auth failure. Known values:
982
- - `"Unauthorized"` — no `Authorization` header on the request.
983
- - `"Bearer Authentication Failed"` — header present but token
984
- is invalid, revoked, or expired.
985
- required:
986
- - message
978
+ oneOf:
979
+ - type: object
980
+ description: The auth middleware's bare body for a missing or invalid token.
981
+ properties:
982
+ message:
983
+ type: string
984
+ description: |-
985
+ Human-readable description of the auth failure. Known values:
986
+ - `"Unauthorized"` — no `Authorization` header on the request.
987
+ - `"Bearer Authentication Failed"` — header present but token
988
+ is invalid, revoked, or expired.
989
+ required:
990
+ - message
991
+ - $ref: '#/components/schemas/Error'
987
992
  examples:
988
993
  missing_token:
989
994
  summary: No Authorization header sent
@@ -993,5 +998,11 @@ components:
993
998
  summary: Bearer token invalid or revoked
994
999
  value:
995
1000
  message: Bearer Authentication Failed
1001
+ scoped_token:
1002
+ summary: An API token with a custom scope reading a resource
1003
+ value:
1004
+ errors:
1005
+ - code: access_restricted
1006
+ message: You don't have the required permissions to perform the action.
996
1007
  x-enable-proxy: true
997
1008
  x-internal: false