@fleetless/contracts 13.2.0 → 14.0.0

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 (100) hide show
  1. package/CHANGELOG.md +169 -0
  2. package/artifacts/openapi.json +2092 -787
  3. package/artifacts/routes.json +229 -230
  4. package/artifacts/schema/access-warning.schema.json +51 -0
  5. package/artifacts/schema/action-config.schema.json +35 -0
  6. package/artifacts/schema/app-access-response.schema.json +136 -0
  7. package/artifacts/schema/app-access.schema.json +80 -0
  8. package/artifacts/schema/app-auth-config.schema.json +15 -0
  9. package/artifacts/schema/app-deletion-summary.schema.json +0 -7
  10. package/artifacts/schema/app-invitation-list-response.schema.json +13 -6
  11. package/artifacts/schema/app-invitation.schema.json +5 -5
  12. package/artifacts/schema/app-list-response.schema.json +6 -6
  13. package/artifacts/schema/app-lock.schema.json +30 -0
  14. package/artifacts/schema/app-user-list-response.schema.json +13 -6
  15. package/artifacts/schema/app-user.schema.json +13 -6
  16. package/artifacts/schema/app.schema.json +6 -6
  17. package/artifacts/schema/auth-ok.schema.json +20 -6
  18. package/artifacts/schema/camera-list-response.schema.json +1 -1
  19. package/artifacts/schema/client-identity.schema.json +21 -6
  20. package/artifacts/schema/cloud-config.schema.json +359 -5
  21. package/artifacts/schema/config-draft-response.schema.json +389 -5
  22. package/artifacts/schema/config-version-response.schema.json +389 -5
  23. package/artifacts/schema/config-versions-response.schema.json +30 -0
  24. package/artifacts/schema/create-app-invitation-request.schema.json +4 -4
  25. package/artifacts/schema/create-app-user-request.schema.json +4 -4
  26. package/artifacts/schema/create-org-role-request.schema.json +33 -0
  27. package/artifacts/schema/dangling-reference.schema.json +129 -0
  28. package/artifacts/schema/datapoint-config.schema.json +35 -0
  29. package/artifacts/schema/datapoint-list-response.schema.json +1 -1
  30. package/artifacts/schema/effective-capability.schema.json +104 -0
  31. package/artifacts/schema/effective-rights-query.schema.json +19 -0
  32. package/artifacts/schema/effective-rights-response.schema.json +310 -0
  33. package/artifacts/schema/effective-robot-rights.schema.json +266 -0
  34. package/artifacts/schema/invoke-or-service-response.schema.json +1 -1
  35. package/artifacts/schema/invoke-response.schema.json +1 -1
  36. package/artifacts/schema/journal-intent-v2-body.schema.json +74 -0
  37. package/artifacts/schema/journal-intent-v2.schema.json +84 -0
  38. package/artifacts/schema/journal-replay-receipt-body.schema.json +1 -0
  39. package/artifacts/schema/journal-replay-receipt.schema.json +1 -0
  40. package/artifacts/schema/mcp-robot-datasheet.schema.json +2 -2
  41. package/artifacts/schema/org-role-list-response.schema.json +205 -0
  42. package/artifacts/schema/org-role.schema.json +59 -0
  43. package/artifacts/schema/patch-app-user-request.schema.json +4 -4
  44. package/artifacts/schema/patch-org-role-request.schema.json +38 -0
  45. package/artifacts/schema/publish-config-response.schema.json +48 -1
  46. package/artifacts/schema/publisher-config.schema.json +35 -0
  47. package/artifacts/schema/put-role-defaults-request.schema.json +127 -0
  48. package/artifacts/schema/reference-place.schema.json +111 -0
  49. package/artifacts/schema/rename-slug-response.schema.json +4 -3
  50. package/artifacts/schema/robot-config-doc.schema.json +359 -5
  51. package/artifacts/schema/role-cycle-details.schema.json +18 -0
  52. package/artifacts/schema/role-defaults-response.schema.json +59 -0
  53. package/artifacts/schema/role-rename-preview.schema.json +146 -0
  54. package/artifacts/schema/service-config.schema.json +35 -0
  55. package/artifacts/schema/slug-usage-response.schema.json +4 -3
  56. package/artifacts/schema/update-app-request.schema.json +0 -12
  57. package/dist/app-users.d.ts +30 -10
  58. package/dist/app-users.js +32 -12
  59. package/dist/apps.d.ts +242 -71
  60. package/dist/apps.js +205 -151
  61. package/dist/audit.d.ts +3 -3
  62. package/dist/billing.d.ts +10 -10
  63. package/dist/client-auth.d.ts +5 -2
  64. package/dist/client-auth.js +11 -3
  65. package/dist/client-robots.d.ts +1 -1
  66. package/dist/client-robots.js +1 -1
  67. package/dist/common.d.ts +1 -1
  68. package/dist/common.js +1 -1
  69. package/dist/config-issues.d.ts +1 -1
  70. package/dist/config-issues.js +1 -1
  71. package/dist/config.d.ts +77 -11
  72. package/dist/config.js +108 -14
  73. package/dist/errors.d.ts +14 -5
  74. package/dist/errors.js +37 -24
  75. package/dist/index.d.ts +22 -12
  76. package/dist/index.js +16 -6
  77. package/dist/journal-intents.d.ts +30 -0
  78. package/dist/journal-intents.js +3 -0
  79. package/dist/legal-acceptances.d.ts +2 -2
  80. package/dist/mcp.d.ts +5 -37
  81. package/dist/mcp.js +4 -14
  82. package/dist/org-roles.d.ts +182 -0
  83. package/dist/org-roles.js +198 -0
  84. package/dist/plans.d.ts +6 -6
  85. package/dist/protocol.d.ts +19 -1
  86. package/dist/realtime.d.ts +6 -3
  87. package/dist/realtime.js +1 -1
  88. package/dist/rest.d.ts +104 -25
  89. package/dist/rest.js +67 -29
  90. package/dist/rights.d.ts +197 -0
  91. package/dist/rights.js +396 -0
  92. package/dist/routes.js +190 -148
  93. package/package.json +1 -1
  94. package/artifacts/schema/mcp-role-preview-response.schema.json +0 -134
  95. package/artifacts/schema/role-delete-query.schema.json +0 -13
  96. package/artifacts/schema/role-in-use-details.schema.json +0 -28
  97. package/artifacts/schema/role-list-response.schema.json +0 -48
  98. package/artifacts/schema/role-permissions.schema.json +0 -61
  99. package/artifacts/schema/role-rename-request.schema.json +0 -16
  100. package/artifacts/schema/role.schema.json +0 -35
@@ -1031,6 +1031,271 @@
1031
1031
  }
1032
1032
  }
1033
1033
  },
1034
+ "/api/org/roles": {
1035
+ "get": {
1036
+ "operationId": "get_api_org_roles",
1037
+ "summary": "Lists the organization's roles with how much depends on each, and the keys that are written somewhere but are no role.",
1038
+ "tags": [
1039
+ "org"
1040
+ ],
1041
+ "security": [
1042
+ {
1043
+ "developerSession": []
1044
+ }
1045
+ ],
1046
+ "parameters": [],
1047
+ "responses": {
1048
+ "200": {
1049
+ "description": "Success.",
1050
+ "content": {
1051
+ "application/json": {
1052
+ "schema": {
1053
+ "$ref": "#/components/schemas/org-role-list-response"
1054
+ }
1055
+ }
1056
+ }
1057
+ },
1058
+ "default": {
1059
+ "description": "An error envelope. Codes this route is known to answer: `unauthorized`, `token_expired`, `token_revoked`.",
1060
+ "content": {
1061
+ "application/json": {
1062
+ "schema": {
1063
+ "$ref": "#/components/schemas/api-error"
1064
+ }
1065
+ }
1066
+ }
1067
+ }
1068
+ },
1069
+ "description": "Roles belong to the organization and are shared by all its apps; console members hold none and are never filtered by them. Each role carries the number of app users that hold it, of invitations that carry it, of apps that use it as their default and of places in documents that name it. `dangling` lists the keys that are written somewhere and are no role, each with every place that writes it, so a deleted or misspelled key can be found. None of this is an error: a key that names no role grants nothing and is reported here."
1070
+ },
1071
+ "post": {
1072
+ "operationId": "post_api_org_roles",
1073
+ "summary": "Creates an organization role.",
1074
+ "tags": [
1075
+ "org"
1076
+ ],
1077
+ "security": [
1078
+ {
1079
+ "developerSession": []
1080
+ }
1081
+ ],
1082
+ "parameters": [],
1083
+ "responses": {
1084
+ "201": {
1085
+ "description": "Success.",
1086
+ "content": {
1087
+ "application/json": {
1088
+ "schema": {
1089
+ "$ref": "#/components/schemas/org-role"
1090
+ }
1091
+ }
1092
+ }
1093
+ },
1094
+ "default": {
1095
+ "description": "An error envelope. Codes this route is known to answer: `unauthorized`, `token_expired`, `token_revoked`, `validation_error`, `role_cycle`, `role_key_taken`.",
1096
+ "content": {
1097
+ "application/json": {
1098
+ "schema": {
1099
+ "$ref": "#/components/schemas/api-error"
1100
+ }
1101
+ }
1102
+ }
1103
+ }
1104
+ },
1105
+ "description": "An organization holds at most 50 roles; the next one is `400 validation_error`. A key in `inherits` that names no role is accepted and warns: inheritance through it grants nothing until a role with that key exists. A role that would inherit from itself, as `inherits` naming its own key does, is `400 role_cycle`. A key that another role has is `409 role_key_taken`.",
1106
+ "requestBody": {
1107
+ "required": true,
1108
+ "content": {
1109
+ "application/json": {
1110
+ "schema": {
1111
+ "$ref": "#/components/schemas/create-org-role-request"
1112
+ }
1113
+ }
1114
+ }
1115
+ }
1116
+ }
1117
+ },
1118
+ "/api/org/roles/{key}": {
1119
+ "patch": {
1120
+ "operationId": "patch_api_org_roles_key",
1121
+ "summary": "Changes a role's name, its parents or its key.",
1122
+ "tags": [
1123
+ "org"
1124
+ ],
1125
+ "security": [
1126
+ {
1127
+ "developerSession": []
1128
+ }
1129
+ ],
1130
+ "parameters": [
1131
+ {
1132
+ "name": "key",
1133
+ "in": "path",
1134
+ "required": true,
1135
+ "description": "The role's key, as listed by `GET /api/org/roles`; a key that names no role answers `404`.",
1136
+ "schema": {
1137
+ "type": "string"
1138
+ }
1139
+ }
1140
+ ],
1141
+ "responses": {
1142
+ "200": {
1143
+ "description": "Success.",
1144
+ "content": {
1145
+ "application/json": {
1146
+ "schema": {
1147
+ "$ref": "#/components/schemas/org-role"
1148
+ }
1149
+ }
1150
+ }
1151
+ },
1152
+ "default": {
1153
+ "description": "An error envelope. Codes this route is known to answer: `unauthorized`, `token_expired`, `token_revoked`, `validation_error`, `not_found`, `role_cycle`, `role_key_taken`, `confirmation_required`.",
1154
+ "content": {
1155
+ "application/json": {
1156
+ "schema": {
1157
+ "$ref": "#/components/schemas/api-error"
1158
+ }
1159
+ }
1160
+ }
1161
+ }
1162
+ },
1163
+ "description": "A field that is left out stays as it is; `inherits` replaces the whole list. A change to `inherits` that would lead back to the role is `400 role_cycle`, with the loop in `details`. \n\n**Renaming the key is one call or two.** Without `update_references`, the rename is accepted at once; everything that still names the old key, in documents, assignments, invitations, default roles, other roles and organization defaults, keeps it and turns into a warning. With `update_references: true` and no `confirm`, a rename that has places to rewrite changes nothing and answers `409 confirmation_required` whose `details` is a `roleRenamePreview`: every place that would be rewritten, the document it is in, the version a published document would get, and a `confirm` token. A rename with no place to rewrite applies at once and needs no token. The second call repeats the same body with `confirm` set to that token and rewrites all of it in one transaction. Assignments and role rows change directly; each affected published `fleetless.yaml` gets a new version that differs only in the key, and an existing draft is updated the same way. If the places changed between the two calls, the token is stale and the second call answers a new preview instead of applying. A new key that another role has is `409 role_key_taken`.",
1164
+ "requestBody": {
1165
+ "required": true,
1166
+ "content": {
1167
+ "application/json": {
1168
+ "schema": {
1169
+ "$ref": "#/components/schemas/patch-org-role-request"
1170
+ }
1171
+ }
1172
+ }
1173
+ }
1174
+ },
1175
+ "delete": {
1176
+ "operationId": "delete_api_org_roles_key",
1177
+ "summary": "Deletes a role at once.",
1178
+ "tags": [
1179
+ "org"
1180
+ ],
1181
+ "security": [
1182
+ {
1183
+ "developerSession": []
1184
+ }
1185
+ ],
1186
+ "parameters": [
1187
+ {
1188
+ "name": "key",
1189
+ "in": "path",
1190
+ "required": true,
1191
+ "description": "The role's key, as listed by `GET /api/org/roles`; a key that names no role answers `404`.",
1192
+ "schema": {
1193
+ "type": "string"
1194
+ }
1195
+ }
1196
+ ],
1197
+ "responses": {
1198
+ "204": {
1199
+ "description": "Success."
1200
+ },
1201
+ "default": {
1202
+ "description": "An error envelope. Codes this route is known to answer: `unauthorized`, `token_expired`, `token_revoked`, `validation_error`, `not_found`.",
1203
+ "content": {
1204
+ "application/json": {
1205
+ "schema": {
1206
+ "$ref": "#/components/schemas/api-error"
1207
+ }
1208
+ }
1209
+ }
1210
+ }
1211
+ },
1212
+ "description": "Nothing is moved and nothing is refused for what depends on the role. App users that hold it keep their account and can sign in, with no rights from the role; everything that names the key turns into a warning and is listed under `dangling` of `GET /api/org/roles`. Live subscriptions that relied on the role are re-checked at once. Creating a role with the same key later makes the places that name it count again."
1213
+ }
1214
+ },
1215
+ "/api/org/roles/defaults": {
1216
+ "get": {
1217
+ "operationId": "get_api_org_roles_defaults",
1218
+ "summary": "Reads the organization's default roles for each kind of access.",
1219
+ "tags": [
1220
+ "org"
1221
+ ],
1222
+ "security": [
1223
+ {
1224
+ "developerSession": []
1225
+ }
1226
+ ],
1227
+ "parameters": [],
1228
+ "responses": {
1229
+ "200": {
1230
+ "description": "Success.",
1231
+ "content": {
1232
+ "application/json": {
1233
+ "schema": {
1234
+ "$ref": "#/components/schemas/role-defaults-response"
1235
+ }
1236
+ }
1237
+ }
1238
+ },
1239
+ "default": {
1240
+ "description": "An error envelope. Codes this route is known to answer: `unauthorized`, `token_expired`, `token_revoked`.",
1241
+ "content": {
1242
+ "application/json": {
1243
+ "schema": {
1244
+ "$ref": "#/components/schemas/api-error"
1245
+ }
1246
+ }
1247
+ }
1248
+ }
1249
+ },
1250
+ "description": "Every kind of access is present; an empty list means nobody holds it, not even the most senior role. A default applies where a robot's published `fleetless.yaml` names no role for the thing asked about. A new organization starts with `observe` for `read` and `assets`, and `operate` for `invoke`, `publish` and `job_history`."
1251
+ },
1252
+ "put": {
1253
+ "operationId": "put_api_org_roles_defaults",
1254
+ "summary": "Changes the organization's default roles for the named kinds of access.",
1255
+ "tags": [
1256
+ "org"
1257
+ ],
1258
+ "security": [
1259
+ {
1260
+ "developerSession": []
1261
+ }
1262
+ ],
1263
+ "parameters": [],
1264
+ "responses": {
1265
+ "200": {
1266
+ "description": "Success.",
1267
+ "content": {
1268
+ "application/json": {
1269
+ "schema": {
1270
+ "$ref": "#/components/schemas/role-defaults-response"
1271
+ }
1272
+ }
1273
+ }
1274
+ },
1275
+ "default": {
1276
+ "description": "An error envelope. Codes this route is known to answer: `unauthorized`, `token_expired`, `token_revoked`, `validation_error`.",
1277
+ "content": {
1278
+ "application/json": {
1279
+ "schema": {
1280
+ "$ref": "#/components/schemas/api-error"
1281
+ }
1282
+ }
1283
+ }
1284
+ }
1285
+ },
1286
+ "description": "Despite the verb, kinds that are not named keep their default; `null` or `[]` sets a kind to nobody. A key that names no role is accepted and warns, and grants nothing. Answers all the defaults as they stand afterwards. A default that narrows who holds a kind re-checks the live subscriptions it affects.",
1287
+ "requestBody": {
1288
+ "required": true,
1289
+ "content": {
1290
+ "application/json": {
1291
+ "schema": {
1292
+ "$ref": "#/components/schemas/put-role-defaults-request"
1293
+ }
1294
+ }
1295
+ }
1296
+ }
1297
+ }
1298
+ },
1034
1299
  "/api/audit": {
1035
1300
  "get": {
1036
1301
  "operationId": "get_api_audit",
@@ -1390,7 +1655,7 @@
1390
1655
  }
1391
1656
  }
1392
1657
  },
1393
- "description": "Every robot id is checked before anything is created, so a bad one never leaves a robotless app to clean up. The identifier `mcp` is reserved by the central MCP server and refused as a `validation_error`. An app belongs to the org and to nothing inside it: the group an app used to be created in, and the `409 target_state_conflict` that refused the Org Admins one, are both gone with the group model.",
1658
+ "description": "Every robot id is checked before anything is created, so a bad one never leaves a robotless app to clean up. The identifier `mcp` is reserved by the central MCP server and refused as a `validation_error`. An app belongs to the org and to nothing inside it: the group an app used to be created in, and the `409 target_state_conflict` that refused the Org Admins one, are both gone with the group model. A new app has no default role: `default_role` is `null` until `PUT /api/apps/:id/access` sets one.",
1394
1659
  "requestBody": {
1395
1660
  "required": true,
1396
1661
  "content": {
@@ -1484,11 +1749,11 @@
1484
1749
  }
1485
1750
  }
1486
1751
  },
1487
- "description": "An app belonging to another org reads exactly like one that does not exist — `404`, never a `403`."
1752
+ "description": "An app belonging to another org reads exactly like one that does not exist — `404`, never a `403`. `default_role` is the key as stored, or `null` when the app has none; a key that names no role is shown as it is, and `GET /api/apps/:id/access` warns about it."
1488
1753
  },
1489
1754
  "patch": {
1490
1755
  "operationId": "patch_api_apps_id",
1491
- "summary": "Changes an app's name, its attached robots or its default role.",
1756
+ "summary": "Changes an app's name or its attached robots.",
1492
1757
  "tags": [
1493
1758
  "apps"
1494
1759
  ],
@@ -1530,7 +1795,7 @@
1530
1795
  }
1531
1796
  }
1532
1797
  },
1533
- "description": "A `default_role_id` naming a role of another app is refused: it is the one cross-app authorization check this shape can carry. Changing the robot set closes every live subscription the app's users hold, since a grant may no longer name a reachable robot.",
1798
+ "description": "The default role is not set here: `PUT /api/apps/:id/access` replaces it together with the locks, and a body that names a default role, by id or by key, is `400 validation_error`. Changing the robot set closes every live subscription the app's users hold, since a robot they were using may no longer be reachable.",
1534
1799
  "requestBody": {
1535
1800
  "required": true,
1536
1801
  "content": {
@@ -1579,7 +1844,7 @@
1579
1844
  }
1580
1845
  }
1581
1846
  },
1582
- "description": "An app outside the caller's org answers `404`, as an unknown id does. A full cascade — its users, roles, server keys, invitations, OIDC provider configuration and mail templates all go, recorded once as `app.deleted` carrying an `appDeletionSummary`. Its robots are untouched: they belong to the org, not to the app. \n\n**No `force` parameter** — see `GET /api/apps/:id/deletion-preview`."
1847
+ "description": "An app outside the caller's org answers `404`, as an unknown id does. A full cascade — its users, server keys, invitations, OIDC provider configuration and mail templates all go, recorded once as `app.deleted` carrying an `appDeletionSummary`. Its robots and the organization's roles are untouched: they belong to the org, not to the app. \n\n**No `force` parameter** — see `GET /api/apps/:id/deletion-preview`."
1583
1848
  }
1584
1849
  },
1585
1850
  "/api/apps/{id}/deletion-preview": {
@@ -1630,10 +1895,10 @@
1630
1895
  "description": "The same shape the delete's own audit event carries, computed by the same function on purpose: the confirmation dialog and the eventual receipt agree by construction, and any difference between them is real drift rather than two estimates that quietly disagree. \n\n**No `force` parameter, unlike the robot pair this is modelled on.** A robot's open live session is a single nameable state whose interruption is its own hazard, which is why that route makes the caller pass `force` explicitly. An app has no equivalent state to force past, and inventing one would be a guess wearing a guard's clothes — this preview is the guard."
1631
1896
  }
1632
1897
  },
1633
- "/api/apps/{id}/roles": {
1898
+ "/api/apps/{id}/server-keys": {
1634
1899
  "post": {
1635
- "operationId": "post_api_apps_id_roles",
1636
- "summary": "Creates a custom role on the app.",
1900
+ "operationId": "post_api_apps_id_server_keys",
1901
+ "summary": "Mints a server key for the app and returns the raw secret once.",
1637
1902
  "tags": [
1638
1903
  "apps"
1639
1904
  ],
@@ -1659,7 +1924,7 @@
1659
1924
  "content": {
1660
1925
  "application/json": {
1661
1926
  "schema": {
1662
- "$ref": "#/components/schemas/role"
1927
+ "$ref": "#/components/schemas/create-server-key-response"
1663
1928
  }
1664
1929
  }
1665
1930
  }
@@ -1675,11 +1940,11 @@
1675
1940
  }
1676
1941
  }
1677
1942
  },
1678
- "description": "The body is `{ \"name\": string }` — non-empty, trimmed, at most 60 characters as on `role.name` — and is deliberately not a contract shape: contracts define the `role` this answers with, not this one trivial request. **The answer is a bare `role`, not an envelope**, unlike the listing beside it."
1943
+ "description": "A server key carries full app rights and outlives its creator's removal. The body is `{ \"name\": string }`, too trivial to be a contract shape. `key` is the only moment the raw secret exists outside the caller's hands — it is never in a listing, never in an audit event, and cannot be read back."
1679
1944
  },
1680
1945
  "get": {
1681
- "operationId": "get_api_apps_id_roles",
1682
- "summary": "Lists the app's roles, builtin and custom.",
1946
+ "operationId": "get_api_apps_id_server_keys",
1947
+ "summary": "Lists the app's server keys as metadata, never the secrets.",
1683
1948
  "tags": [
1684
1949
  "apps"
1685
1950
  ],
@@ -1705,7 +1970,7 @@
1705
1970
  "content": {
1706
1971
  "application/json": {
1707
1972
  "schema": {
1708
- "$ref": "#/components/schemas/role-list-response"
1973
+ "$ref": "#/components/schemas/server-key-list-response"
1709
1974
  }
1710
1975
  }
1711
1976
  }
@@ -1721,13 +1986,13 @@
1721
1986
  }
1722
1987
  }
1723
1988
  },
1724
- "description": "Answers `{ \"roles\": [role, …] }`, builtin roles included — a role a developer never created is still one a user can hold."
1989
+ "description": "Answers `{ \"server_keys\": [serverKey, …] }`. `serverKey` names the five fields it carries rather than spreading the stored row — that is what keeps this listing from becoming a second place a credential leaves the cloud."
1725
1990
  }
1726
1991
  },
1727
- "/api/apps/{id}/roles/{roleId}/permissions": {
1728
- "put": {
1729
- "operationId": "put_api_apps_id_roles_roleId_permissions",
1730
- "summary": "Replaces a role's grants and capabilities in one write.",
1992
+ "/api/apps/{id}/server-keys/{keyId}/rotate": {
1993
+ "post": {
1994
+ "operationId": "post_api_apps_id_server_keys_keyId_rotate",
1995
+ "summary": "Replaces a server key's secret in place and returns the new one once.",
1731
1996
  "tags": [
1732
1997
  "apps"
1733
1998
  ],
@@ -1747,10 +2012,10 @@
1747
2012
  }
1748
2013
  },
1749
2014
  {
1750
- "name": "roleId",
2015
+ "name": "keyId",
1751
2016
  "in": "path",
1752
2017
  "required": true,
1753
- "description": "The role's uuid, from `GET /api/apps/:id/roles`; a role of another app answers `404`.",
2018
+ "description": "The server key's uuid, from `GET /api/apps/:id/server-keys`; a key of another app answers `404`.",
1754
2019
  "schema": {
1755
2020
  "type": "string"
1756
2021
  }
@@ -1762,13 +2027,13 @@
1762
2027
  "content": {
1763
2028
  "application/json": {
1764
2029
  "schema": {
1765
- "$ref": "#/components/schemas/role-permissions"
2030
+ "$ref": "#/components/schemas/create-server-key-response"
1766
2031
  }
1767
2032
  }
1768
2033
  }
1769
2034
  },
1770
2035
  "default": {
1771
- "description": "An error envelope. Codes this route is known to answer: `unauthorized`, `token_expired`, `token_revoked`, `invalid_uuid`, `not_found`, `validation_error`.",
2036
+ "description": "An error envelope. Codes this route is known to answer: `unauthorized`, `token_expired`, `token_revoked`, `invalid_uuid`, `not_found`.",
1772
2037
  "content": {
1773
2038
  "application/json": {
1774
2039
  "schema": {
@@ -1778,21 +2043,13 @@
1778
2043
  }
1779
2044
  }
1780
2045
  },
1781
- "description": "`role_id` in the body must name the role in the path, compared case-insensitively — a uuid is a value, not a string, and a client that uppercases them consistently must not be refused for repeating what the path says. A grant naming a robot the app does not have is refused rather than stored: a permission for something the role cannot reach reads as authoritative to whoever writes the next consumer. Every user holding this role has their live subscriptions re-authorized.",
1782
- "requestBody": {
1783
- "required": true,
1784
- "content": {
1785
- "application/json": {
1786
- "schema": {
1787
- "$ref": "#/components/schemas/role-permissions"
1788
- }
1789
- }
1790
- }
1791
- }
1792
- },
1793
- "get": {
1794
- "operationId": "get_api_apps_id_roles_roleId_permissions",
1795
- "summary": "Reads a role's grants and capabilities.",
2046
+ "description": "The old secret is refused from this call on, and any `/realtime` socket that authenticated with it is closed — rotation is what a developer reaches for when a key has leaked, and the holder of that socket is exactly who they are rotating against."
2047
+ }
2048
+ },
2049
+ "/api/apps/{id}/server-keys/{keyId}": {
2050
+ "delete": {
2051
+ "operationId": "delete_api_apps_id_server_keys_keyId",
2052
+ "summary": "Revokes a server key and closes every socket holding it.",
1796
2053
  "tags": [
1797
2054
  "apps"
1798
2055
  ],
@@ -1812,25 +2069,18 @@
1812
2069
  }
1813
2070
  },
1814
2071
  {
1815
- "name": "roleId",
2072
+ "name": "keyId",
1816
2073
  "in": "path",
1817
2074
  "required": true,
1818
- "description": "The role's uuid, from `GET /api/apps/:id/roles`; a role of another app answers `404`.",
2075
+ "description": "The server key's uuid, from `GET /api/apps/:id/server-keys`; a key of another app answers `404`.",
1819
2076
  "schema": {
1820
2077
  "type": "string"
1821
2078
  }
1822
2079
  }
1823
2080
  ],
1824
2081
  "responses": {
1825
- "200": {
1826
- "description": "Success.",
1827
- "content": {
1828
- "application/json": {
1829
- "schema": {
1830
- "$ref": "#/components/schemas/role-permissions"
1831
- }
1832
- }
1833
- }
2082
+ "204": {
2083
+ "description": "Success."
1834
2084
  },
1835
2085
  "default": {
1836
2086
  "description": "An error envelope. Codes this route is known to answer: `unauthorized`, `token_expired`, `token_revoked`, `invalid_uuid`, `not_found`.",
@@ -1842,13 +2092,14 @@
1842
2092
  }
1843
2093
  }
1844
2094
  }
1845
- }
2095
+ },
2096
+ "description": "The key stops working at once. Minting, rotating and revoking all decide who may speak for the whole app."
1846
2097
  }
1847
2098
  },
1848
- "/api/apps/{id}/roles/{roleId}/mcp-tools": {
2099
+ "/api/apps/{id}/access": {
1849
2100
  "get": {
1850
- "operationId": "get_api_apps_id_roles_roleId_mcp_tools",
1851
- "summary": "Previews the robot datasheets an MCP caller holding this role would be offered.",
2101
+ "operationId": "get_api_apps_id_access",
2102
+ "summary": "Reads what an app locks and which role its users get by default, with what is out of step in it.",
1852
2103
  "tags": [
1853
2104
  "apps"
1854
2105
  ],
@@ -1866,15 +2117,6 @@
1866
2117
  "schema": {
1867
2118
  "type": "string"
1868
2119
  }
1869
- },
1870
- {
1871
- "name": "roleId",
1872
- "in": "path",
1873
- "required": true,
1874
- "description": "The role's uuid, from `GET /api/apps/:id/roles`; a role of another app answers `404`.",
1875
- "schema": {
1876
- "type": "string"
1877
- }
1878
2120
  }
1879
2121
  ],
1880
2122
  "responses": {
@@ -1883,7 +2125,7 @@
1883
2125
  "content": {
1884
2126
  "application/json": {
1885
2127
  "schema": {
1886
- "$ref": "#/components/schemas/mcp-role-preview-response"
2128
+ "$ref": "#/components/schemas/app-access-response"
1887
2129
  }
1888
2130
  }
1889
2131
  }
@@ -1899,13 +2141,11 @@
1899
2141
  }
1900
2142
  }
1901
2143
  },
1902
- "description": "Built by the same builder the MCP server's own `robots.describe` uses, so the two cannot drift. It answers what the role *would* be offered and consults nothing about any user's actual MCP entitlement. A robot the role grants nothing on still appears, with an empty `exposures` — dropping it would read as \"not attached\", which is a different fact."
1903
- }
1904
- },
1905
- "/api/apps/{id}/roles/{roleId}": {
1906
- "patch": {
1907
- "operationId": "patch_api_apps_id_roles_roleId",
1908
- "summary": "Renames a role; its users keep it.",
2144
+ "description": "An app can only lock, never extend: roles decide who may use what, and a lock takes capabilities away from every user and server key of the app, whatever their role. `warnings` lists what the access names that does not exist as written, such as a default role that is no role or a lock on a slug the robot does not have. None of it is an error. `revision` identifies the access as it stands: send it back with the next `PUT` and a write composed from a stale read is refused."
2145
+ },
2146
+ "put": {
2147
+ "operationId": "put_api_apps_id_access",
2148
+ "summary": "Replaces what an app locks and which role its users get by default.",
1909
2149
  "tags": [
1910
2150
  "apps"
1911
2151
  ],
@@ -1923,15 +2163,6 @@
1923
2163
  "schema": {
1924
2164
  "type": "string"
1925
2165
  }
1926
- },
1927
- {
1928
- "name": "roleId",
1929
- "in": "path",
1930
- "required": true,
1931
- "description": "The role's uuid, from `GET /api/apps/:id/roles`; a role of another app answers `404`.",
1932
- "schema": {
1933
- "type": "string"
1934
- }
1935
2166
  }
1936
2167
  ],
1937
2168
  "responses": {
@@ -1940,13 +2171,13 @@
1940
2171
  "content": {
1941
2172
  "application/json": {
1942
2173
  "schema": {
1943
- "$ref": "#/components/schemas/role"
2174
+ "$ref": "#/components/schemas/app-access-response"
1944
2175
  }
1945
2176
  }
1946
2177
  }
1947
2178
  },
1948
2179
  "default": {
1949
- "description": "An error envelope. Codes this route is known to answer: `unauthorized`, `token_expired`, `token_revoked`, `invalid_uuid`, `not_found`, `validation_error`, `role_name_taken`.",
2180
+ "description": "An error envelope. Codes this route is known to answer: `unauthorized`, `token_expired`, `token_revoked`, `invalid_uuid`, `validation_error`, `not_found`, `target_state_conflict`.",
1950
2181
  "content": {
1951
2182
  "application/json": {
1952
2183
  "schema": {
@@ -1956,21 +2187,23 @@
1956
2187
  }
1957
2188
  }
1958
2189
  },
1959
- "description": "Names are unique per app, compared exactly as stored after trimming. Built-in roles can be renamed.",
2190
+ "description": "A full replacement: the body is exactly what the app has afterwards, so a lock that is not in it is lifted. A default role that is no role, a lock on a slug the robot does not have and a lock on a robot the app does not attach are accepted and come back as `warnings`. A change that can narrow rights re-checks the live subscriptions of the app's users at once. \n\n**Send the `revision` you read.** The access can change under a caller without a write of its own: a slug rename adds the new name to every lock that lists the old one, and detaching a robot drops its lock. A body composed before such a change would lift the lock it added, so a `revision` that is no longer the stored one is `409 target_state_conflict` naming `revision` (rule `stale`), and nothing is written, audited or announced; read the access again and compose the body anew. Left out, the body replaces whatever is stored, as before: the last writer wins. A `revision` that is not a revision is `400 validation_error`.",
1960
2191
  "requestBody": {
1961
2192
  "required": true,
1962
2193
  "content": {
1963
2194
  "application/json": {
1964
2195
  "schema": {
1965
- "$ref": "#/components/schemas/role-rename-request"
2196
+ "$ref": "#/components/schemas/app-access"
1966
2197
  }
1967
2198
  }
1968
2199
  }
1969
2200
  }
1970
- },
1971
- "delete": {
1972
- "operationId": "delete_api_apps_id_roles_roleId",
1973
- "summary": "Deletes a role, moving its users, pending invitations and default-role status to another role.",
2201
+ }
2202
+ },
2203
+ "/api/apps/{id}/effective-rights": {
2204
+ "get": {
2205
+ "operationId": "get_api_apps_id_effective_rights",
2206
+ "summary": "Shows what one role, or one app user, may use on each robot the app attaches.",
1974
2207
  "tags": [
1975
2208
  "apps"
1976
2209
  ],
@@ -1990,20 +2223,21 @@
1990
2223
  }
1991
2224
  },
1992
2225
  {
1993
- "name": "roleId",
1994
- "in": "path",
1995
- "required": true,
1996
- "description": "The role's uuid, from `GET /api/apps/:id/roles`; a role of another app answers `404`.",
2226
+ "name": "role",
2227
+ "in": "query",
2228
+ "required": false,
1997
2229
  "schema": {
1998
- "type": "string"
2230
+ "description": "A role key to look at the app as. A key that names no role is not an error: the answer says `role_known: false` and grants nothing.",
2231
+ "type": "string",
2232
+ "pattern": "^(?!defaults$)[a-z][a-z0-9_]{0,62}$"
1999
2233
  }
2000
2234
  },
2001
2235
  {
2002
- "name": "move_to",
2236
+ "name": "user",
2003
2237
  "in": "query",
2004
2238
  "required": false,
2005
2239
  "schema": {
2006
- "description": "Another role of the same app that takes over the deleted role's app users, pending invitations and, when it applies, the app's default. The role itself or a role of another app answers `400 validation_error`.",
2240
+ "description": "An app user of this app, to look at the app as that user's role. A user of another app answers `404`.",
2007
2241
  "type": "string",
2008
2242
  "format": "uuid",
2009
2243
  "pattern": "^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"
@@ -2011,59 +2245,18 @@
2011
2245
  }
2012
2246
  ],
2013
2247
  "responses": {
2014
- "204": {
2015
- "description": "Success."
2016
- },
2017
- "default": {
2018
- "description": "An error envelope. Codes this route is known to answer: `unauthorized`, `token_expired`, `token_revoked`, `invalid_uuid`, `not_found`, `validation_error`, `role_in_use`, `last_role`.",
2019
- "content": {
2020
- "application/json": {
2021
- "schema": {
2022
- "$ref": "#/components/schemas/api-error"
2023
- }
2024
- }
2025
- }
2026
- }
2027
- },
2028
- "description": "Without `move_to`, a role that app users or pending invitations hold, or that is the app's default, answers `409 role_in_use` with `{ users, invitations, is_default }`. With `move_to` — another role of the same app, else `400 validation_error` — one transaction moves `app_users.role_id`, pending invitations and `default_role_id`, then deletes the role and its permissions. The app's only role answers `409 last_role`. Built-in roles can be deleted like any other."
2029
- }
2030
- },
2031
- "/api/apps/{id}/server-keys": {
2032
- "post": {
2033
- "operationId": "post_api_apps_id_server_keys",
2034
- "summary": "Mints a server key for the app and returns the raw secret once.",
2035
- "tags": [
2036
- "apps"
2037
- ],
2038
- "security": [
2039
- {
2040
- "developerSession": []
2041
- }
2042
- ],
2043
- "parameters": [
2044
- {
2045
- "name": "id",
2046
- "in": "path",
2047
- "required": true,
2048
- "description": "The app's uuid, as returned by `POST /api/apps` or listed by `GET /api/apps`.",
2049
- "schema": {
2050
- "type": "string"
2051
- }
2052
- }
2053
- ],
2054
- "responses": {
2055
- "201": {
2248
+ "200": {
2056
2249
  "description": "Success.",
2057
2250
  "content": {
2058
2251
  "application/json": {
2059
2252
  "schema": {
2060
- "$ref": "#/components/schemas/create-server-key-response"
2253
+ "$ref": "#/components/schemas/effective-rights-response"
2061
2254
  }
2062
2255
  }
2063
2256
  }
2064
2257
  },
2065
2258
  "default": {
2066
- "description": "An error envelope. Codes this route is known to answer: `unauthorized`, `token_expired`, `token_revoked`, `invalid_uuid`, `not_found`, `validation_error`.",
2259
+ "description": "An error envelope. Codes this route is known to answer: `unauthorized`, `token_expired`, `token_revoked`, `invalid_uuid`, `validation_error`, `not_found`.",
2067
2260
  "content": {
2068
2261
  "application/json": {
2069
2262
  "schema": {
@@ -2073,11 +2266,13 @@
2073
2266
  }
2074
2267
  }
2075
2268
  },
2076
- "description": "A server key carries full app rights and outlives its creator's removal. The body is `{ \"name\": string }`, the same trivial shape role creation takes. `key` is the only moment the raw secret exists outside the caller's hands — it is never in a listing, never in an audit event, and cannot be read back."
2077
- },
2269
+ "description": "Name exactly one of `role` and `user`; both or neither is `400 validation_error`. Per attached robot, every capability is listed with whether it is granted, the requirement, where that came from (the entry, rule n of `access.rules`, or the organization default), the inherited role that satisfied it and whether the app locks it; the datasheet is the one an MCP session of that role would get. Only the published configuration counts: a robot with nothing published has no exposures, and its `assets` and `job_history` follow the organization defaults. `reachable` says whether a session of the role reaches the robot at all; a robot it does not reach is still listed, with every capability that explains why. A role that is no role is not an error; it answers `role_known: false` with nothing granted, and so does a user who is not `active`. A user of another app answers `404`."
2270
+ }
2271
+ },
2272
+ "/api/apps/{id}/users": {
2078
2273
  "get": {
2079
- "operationId": "get_api_apps_id_server_keys",
2080
- "summary": "Lists the app's server keys as metadata, never the secrets.",
2274
+ "operationId": "get_api_apps_id_users",
2275
+ "summary": "Lists the app's users — the developer's own customers, not the Fleetless team.",
2081
2276
  "tags": [
2082
2277
  "apps"
2083
2278
  ],
@@ -2103,7 +2298,7 @@
2103
2298
  "content": {
2104
2299
  "application/json": {
2105
2300
  "schema": {
2106
- "$ref": "#/components/schemas/server-key-list-response"
2301
+ "$ref": "#/components/schemas/app-user-list-response"
2107
2302
  }
2108
2303
  }
2109
2304
  }
@@ -2119,13 +2314,11 @@
2119
2314
  }
2120
2315
  }
2121
2316
  },
2122
- "description": "Answers `{ \"server_keys\": [serverKey, …] }`. `serverKey` names the five fields it carries rather than spreading the stored row — that is what keeps this listing from becoming a second place a credential leaves the cloud."
2123
- }
2124
- },
2125
- "/api/apps/{id}/server-keys/{keyId}/rotate": {
2317
+ "description": "Answers `{ \"users\": [appUser, …] }`. **A different identity space from `GET /api/org/users`**, and nothing joins the two: an app user belongs to exactly one app, their address is unique per app rather than globally, and the same address may exist as unrelated accounts in several apps of one org. No password hash, no token and no provider secret appears here — `appUser` names the fields it carries rather than spreading the stored row. An account that holds no role key lists with `role: null`; it reaches nothing until `PATCH /api/apps/:id/users/:userId` gives it one."
2318
+ },
2126
2319
  "post": {
2127
- "operationId": "post_api_apps_id_server_keys_keyId_rotate",
2128
- "summary": "Replaces a server key's secret in place and returns the new one once.",
2320
+ "operationId": "post_api_apps_id_users",
2321
+ "summary": "Creates an app user directly, without an invitation or a self-registration.",
2129
2322
  "tags": [
2130
2323
  "apps"
2131
2324
  ],
@@ -2143,30 +2336,21 @@
2143
2336
  "schema": {
2144
2337
  "type": "string"
2145
2338
  }
2146
- },
2147
- {
2148
- "name": "keyId",
2149
- "in": "path",
2150
- "required": true,
2151
- "description": "The server key's uuid, from `GET /api/apps/:id/server-keys`; a key of another app answers `404`.",
2152
- "schema": {
2153
- "type": "string"
2154
- }
2155
2339
  }
2156
2340
  ],
2157
2341
  "responses": {
2158
- "200": {
2342
+ "201": {
2159
2343
  "description": "Success.",
2160
2344
  "content": {
2161
2345
  "application/json": {
2162
2346
  "schema": {
2163
- "$ref": "#/components/schemas/create-server-key-response"
2347
+ "$ref": "#/components/schemas/app-user"
2164
2348
  }
2165
2349
  }
2166
2350
  }
2167
2351
  },
2168
2352
  "default": {
2169
- "description": "An error envelope. Codes this route is known to answer: `unauthorized`, `token_expired`, `token_revoked`, `invalid_uuid`, `not_found`.",
2353
+ "description": "An error envelope. Codes this route is known to answer: `unauthorized`, `token_expired`, `token_revoked`, `invalid_uuid`, `validation_error`, `not_found`, `email_taken`, `target_state_conflict`, `quota_exceeded`.",
2170
2354
  "content": {
2171
2355
  "application/json": {
2172
2356
  "schema": {
@@ -2176,13 +2360,23 @@
2176
2360
  }
2177
2361
  }
2178
2362
  },
2179
- "description": "The old secret is refused from this call on, and any `/realtime` socket that authenticated with it is closed — rotation is what a developer reaches for when a key has leaked, and the holder of that socket is exactly who they are rotating against."
2363
+ "description": "The developer-authenticated door into the app's user table, and the one place `409 email_taken` is an honest answer about an app user: the caller is authenticated into this app already, so telling them the address is taken discloses nothing they could not read from the listing beside it. `POST /api/client/register` answers `202` to the same fact, because there the caller is a stranger. `404 not_found` is the app. The `role` is a key of the organization's roles: a malformed one is `400 validation_error`, and a well-formed one is stored as given even when it names no role, which grants nothing and shows up under `dangling` of `GET /api/org/roles`. **The password policy answers `400 validation_error`**, not a code of its own: the twelve-character minimum is the `password` field's schema rule, and every route that takes a password refuses a short one exactly the way it refuses any other malformed field. An account created here is `active` immediately: a developer entering somebody by hand has made the decision the verification mail automates, and its address counts as proven. `409 target_state_conflict` names `default_role` with rule `not_set` when `role` is absent and the app has no default role — there would be no role to give the user, so nothing is created. \n\n**`409 quota_exceeded` when the org holds as many app users as `max_end_users` allows**, counted across every app of the org — the same number `GET /api/org/quotas` reports as `usage.max_end_users`, since the same address in two apps is two accounts. `details` carries `{ quota, limit }`, as every count quota's refusal does. The check is at **creation** only: an existing user signs in, is patched and is deleted at the quota exactly as under it, because a protection limit that also froze the accounts already made would be an outage rather than a limit.",
2364
+ "requestBody": {
2365
+ "required": true,
2366
+ "content": {
2367
+ "application/json": {
2368
+ "schema": {
2369
+ "$ref": "#/components/schemas/create-app-user-request"
2370
+ }
2371
+ }
2372
+ }
2373
+ }
2180
2374
  }
2181
2375
  },
2182
- "/api/apps/{id}/server-keys/{keyId}": {
2183
- "delete": {
2184
- "operationId": "delete_api_apps_id_server_keys_keyId",
2185
- "summary": "Revokes a server key and closes every socket holding it.",
2376
+ "/api/apps/{id}/users/{userId}": {
2377
+ "get": {
2378
+ "operationId": "get_api_apps_id_users_userId",
2379
+ "summary": "Reads one user of the app.",
2186
2380
  "tags": [
2187
2381
  "apps"
2188
2382
  ],
@@ -2202,51 +2396,10 @@
2202
2396
  }
2203
2397
  },
2204
2398
  {
2205
- "name": "keyId",
2206
- "in": "path",
2207
- "required": true,
2208
- "description": "The server key's uuid, from `GET /api/apps/:id/server-keys`; a key of another app answers `404`.",
2209
- "schema": {
2210
- "type": "string"
2211
- }
2212
- }
2213
- ],
2214
- "responses": {
2215
- "204": {
2216
- "description": "Success."
2217
- },
2218
- "default": {
2219
- "description": "An error envelope. Codes this route is known to answer: `unauthorized`, `token_expired`, `token_revoked`, `invalid_uuid`, `not_found`.",
2220
- "content": {
2221
- "application/json": {
2222
- "schema": {
2223
- "$ref": "#/components/schemas/api-error"
2224
- }
2225
- }
2226
- }
2227
- }
2228
- },
2229
- "description": "The key stops working at once. Minting, rotating and revoking all decide who may speak for the whole app."
2230
- }
2231
- },
2232
- "/api/apps/{id}/users": {
2233
- "get": {
2234
- "operationId": "get_api_apps_id_users",
2235
- "summary": "Lists the app's users — the developer's own customers, not the Fleetless team.",
2236
- "tags": [
2237
- "apps"
2238
- ],
2239
- "security": [
2240
- {
2241
- "developerSession": []
2242
- }
2243
- ],
2244
- "parameters": [
2245
- {
2246
- "name": "id",
2399
+ "name": "userId",
2247
2400
  "in": "path",
2248
2401
  "required": true,
2249
- "description": "The app's uuid, as returned by `POST /api/apps` or listed by `GET /api/apps`.",
2402
+ "description": "The app user's uuid, from `GET /api/apps/:id/users`; a user of another app answers `404`.",
2250
2403
  "schema": {
2251
2404
  "type": "string"
2252
2405
  }
@@ -2258,7 +2411,7 @@
2258
2411
  "content": {
2259
2412
  "application/json": {
2260
2413
  "schema": {
2261
- "$ref": "#/components/schemas/app-user-list-response"
2414
+ "$ref": "#/components/schemas/app-user"
2262
2415
  }
2263
2416
  }
2264
2417
  }
@@ -2274,11 +2427,11 @@
2274
2427
  }
2275
2428
  }
2276
2429
  },
2277
- "description": "Answers `{ \"users\": [appUser, …] }`. **A different identity space from `GET /api/org/users`**, and nothing joins the two: an app user belongs to exactly one app, their address is unique per app rather than globally, and the same address may exist as unrelated accounts in several apps of one org. No password hash, no token and no provider secret appears here — `appUser` names the fields it carries rather than spreading the stored row."
2430
+ "description": "A user of another app, or of another org, reads exactly like one that does not exist — `404`, never a `403`."
2278
2431
  },
2279
- "post": {
2280
- "operationId": "post_api_apps_id_users",
2281
- "summary": "Creates an app user directly, without an invitation or a self-registration.",
2432
+ "patch": {
2433
+ "operationId": "patch_api_apps_id_users_userId",
2434
+ "summary": "Changes an app user's display name, role or status.",
2282
2435
  "tags": [
2283
2436
  "apps"
2284
2437
  ],
@@ -2296,10 +2449,19 @@
2296
2449
  "schema": {
2297
2450
  "type": "string"
2298
2451
  }
2452
+ },
2453
+ {
2454
+ "name": "userId",
2455
+ "in": "path",
2456
+ "required": true,
2457
+ "description": "The app user's uuid, from `GET /api/apps/:id/users`; a user of another app answers `404`.",
2458
+ "schema": {
2459
+ "type": "string"
2460
+ }
2299
2461
  }
2300
2462
  ],
2301
2463
  "responses": {
2302
- "201": {
2464
+ "200": {
2303
2465
  "description": "Success.",
2304
2466
  "content": {
2305
2467
  "application/json": {
@@ -2310,7 +2472,7 @@
2310
2472
  }
2311
2473
  },
2312
2474
  "default": {
2313
- "description": "An error envelope. Codes this route is known to answer: `unauthorized`, `token_expired`, `token_revoked`, `invalid_uuid`, `validation_error`, `not_found`, `email_taken`, `target_state_conflict`, `quota_exceeded`.",
2475
+ "description": "An error envelope. Codes this route is known to answer: `unauthorized`, `token_expired`, `token_revoked`, `invalid_uuid`, `validation_error`, `not_found`, `target_state_conflict`.",
2314
2476
  "content": {
2315
2477
  "application/json": {
2316
2478
  "schema": {
@@ -2320,23 +2482,21 @@
2320
2482
  }
2321
2483
  }
2322
2484
  },
2323
- "description": "The developer-authenticated door into the app's user table, and the one place `409 email_taken` is an honest answer about an app user: the caller is authenticated into this app already, so telling them the address is taken discloses nothing they could not read from the listing beside it. `POST /api/client/register` answers `202` to the same fact, because there the caller is a stranger. `404 not_found` is the app, or a `role_id` that is not a role of it — a role of another app is refused rather than stored, since a user holding one would carry rights nothing in this app can resolve. **The password policy answers `400 validation_error`**, not a code of its own: the twelve-character minimum is the `password` field's schema rule, and every route that takes a password refuses a short one exactly the way it refuses any other malformed field. An account created here is `active` immediately: a developer entering somebody by hand has made the decision the verification mail automates, and its address counts as proven. `409 target_state_conflict` names `default_role_id` when `role_id` is absent and the app has no default role, or its default names a role that no longer resolves — a user with no role holds rights nothing in this app can read, so nothing is created. \n\n**`409 quota_exceeded` when the org holds as many app users as `max_end_users` allows**, counted across every app of the org — the same number `GET /api/org/quotas` reports as `usage.max_end_users`, since the same address in two apps is two accounts. `details` carries `{ quota, limit }`, as every count quota's refusal does. The check is at **creation** only: an existing user signs in, is patched and is deleted at the quota exactly as under it, because a protection limit that also froze the accounts already made would be an outage rather than a limit.",
2485
+ "description": "The address is immutable: it is half of what identifies the account within the app, and a rewrite would silently move every token and invitation addressed to the old one. Setting `status` to `blocked` ends every session the user holds and closes their live `/realtime` subscriptions — blocking somebody who keeps a working socket is not blocking them. Moving them back to `active` mints nothing; they log in again. \n\n**`active` is a way out of `blocked` and out of nothing else.** An account still `pending_verification` answers `409 target_state_conflict` naming `status` with rule `unverified`: activating it would let somebody who typed an address they do not own log in without ever spending the mailed token. Unblocking restores the status the account had — `active` for one whose address was proven, `pending_verification` for one blocked before it ever verified. A write that names the status the account already holds changes nothing and mints no event, so it does not end the sessions a re-sent form would otherwise have killed. A `role` is stored as given, as creation does: a malformed key is `400 validation_error`, one that names no role grants nothing, and the same key the user already holds changes nothing. A changed role is applied to the user's open subscriptions at once, and those the new role no longer allows end.",
2324
2486
  "requestBody": {
2325
2487
  "required": true,
2326
2488
  "content": {
2327
2489
  "application/json": {
2328
2490
  "schema": {
2329
- "$ref": "#/components/schemas/create-app-user-request"
2491
+ "$ref": "#/components/schemas/patch-app-user-request"
2330
2492
  }
2331
2493
  }
2332
2494
  }
2333
2495
  }
2334
- }
2335
- },
2336
- "/api/apps/{id}/users/{userId}": {
2337
- "get": {
2338
- "operationId": "get_api_apps_id_users_userId",
2339
- "summary": "Reads one user of the app.",
2496
+ },
2497
+ "delete": {
2498
+ "operationId": "delete_api_apps_id_users_userId",
2499
+ "summary": "Deletes an app user and ends every session they hold.",
2340
2500
  "tags": [
2341
2501
  "apps"
2342
2502
  ],
@@ -2366,15 +2526,8 @@
2366
2526
  }
2367
2527
  ],
2368
2528
  "responses": {
2369
- "200": {
2370
- "description": "Success.",
2371
- "content": {
2372
- "application/json": {
2373
- "schema": {
2374
- "$ref": "#/components/schemas/app-user"
2375
- }
2376
- }
2377
- }
2529
+ "204": {
2530
+ "description": "Success."
2378
2531
  },
2379
2532
  "default": {
2380
2533
  "description": "An error envelope. Codes this route is known to answer: `unauthorized`, `token_expired`, `token_revoked`, `invalid_uuid`, `not_found`.",
@@ -2387,11 +2540,13 @@
2387
2540
  }
2388
2541
  }
2389
2542
  },
2390
- "description": "A user of another app, or of another org, reads exactly like one that does not exist — `404`, never a `403`."
2391
- },
2392
- "patch": {
2393
- "operationId": "patch_api_apps_id_users_userId",
2394
- "summary": "Changes an app user's display name, role or status.",
2543
+ "description": "Sessions are revoked before the row goes, for the reason `DELETE /api/org/users/:id` states: a live user with a dead session is recoverable by retrying, a deleted user whose token still works is not. Outstanding invitations and unspent tokens for that address are expired with it — a link mailed before the deletion is a standing re-admission ticket. **Nothing outside this app is touched**: a Fleetless user sharing the address keeps their console account, and an account with the same address in a sibling app is a different person as far as this platform is concerned."
2544
+ }
2545
+ },
2546
+ "/api/apps/{id}/users/{userId}/reset-password": {
2547
+ "post": {
2548
+ "operationId": "post_api_apps_id_users_userId_reset_password",
2549
+ "summary": "Mails an app user a password-reset link on the developer's behalf.",
2395
2550
  "tags": [
2396
2551
  "apps"
2397
2552
  ],
@@ -2421,18 +2576,18 @@
2421
2576
  }
2422
2577
  ],
2423
2578
  "responses": {
2424
- "200": {
2579
+ "202": {
2425
2580
  "description": "Success.",
2426
2581
  "content": {
2427
2582
  "application/json": {
2428
2583
  "schema": {
2429
- "$ref": "#/components/schemas/app-user"
2584
+ "$ref": "#/components/schemas/mail-outcome"
2430
2585
  }
2431
2586
  }
2432
2587
  }
2433
2588
  },
2434
2589
  "default": {
2435
- "description": "An error envelope. Codes this route is known to answer: `unauthorized`, `token_expired`, `token_revoked`, `invalid_uuid`, `validation_error`, `not_found`, `target_state_conflict`.",
2590
+ "description": "An error envelope. Codes this route is known to answer: `unauthorized`, `token_expired`, `token_revoked`, `invalid_uuid`, `not_found`, `target_state_conflict`, `method_not_allowed`.",
2436
2591
  "content": {
2437
2592
  "application/json": {
2438
2593
  "schema": {
@@ -2442,21 +2597,13 @@
2442
2597
  }
2443
2598
  }
2444
2599
  },
2445
- "description": "The address is immutable: it is half of what identifies the account within the app, and a rewrite would silently move every token and invitation addressed to the old one. Setting `status` to `blocked` ends every session the user holds and closes their live `/realtime` subscriptions — blocking somebody who keeps a working socket is not blocking them. Moving them back to `active` mints nothing; they log in again. \n\n**`active` is a way out of `blocked` and out of nothing else.** An account still `pending_verification` answers `409 target_state_conflict` naming `status` with rule `unverified`: activating it would let somebody who typed an address they do not own log in without ever spending the mailed token. Unblocking restores the status the account had — `active` for one whose address was proven, `pending_verification` for one blocked before it ever verified. A write that names the status the account already holds changes nothing and mints no event, so it does not end the sessions a re-sent form would otherwise have killed. A `role_id` naming a role of another app is `404 not_found`, the same refusal creation makes.",
2446
- "requestBody": {
2447
- "required": true,
2448
- "content": {
2449
- "application/json": {
2450
- "schema": {
2451
- "$ref": "#/components/schemas/patch-app-user-request"
2452
- }
2453
- }
2454
- }
2455
- }
2456
- },
2600
+ "description": "The support door beside `POST /api/client/password/reset`, refused like it with `403 method_not_allowed` while the app has the password method off: the same one-hour token and the same link, triggered by a developer for a user who asked them rather than the form. **No enumeration discipline applies** — the caller is authenticated into the app and can read the user list — so this one answers what actually happened: `{ \"mail\": mailStatus }`, where `not_configured` is a deployment without a mailer and `failed` is the state worth somebody's attention. The link points at the app's `reset_url`, or at the hosted reset page when the app has configured none. `409 target_state_conflict` names `password` with rule `not_set` for an account that has none — an OIDC-only app user, whom a reset link would hand a second, quieter door — and `status` with rule `blocked` for a blocked one, since `POST /api/client/password/reset` mails a blocked account nothing and the two doors may not disagree. Setting the password directly is deliberately not offered; a developer who could would hold their customers' credentials."
2601
+ }
2602
+ },
2603
+ "/api/apps/{id}/users/{userId}/two-factor": {
2457
2604
  "delete": {
2458
- "operationId": "delete_api_apps_id_users_userId",
2459
- "summary": "Deletes an app user and ends every session they hold.",
2605
+ "operationId": "delete_api_apps_id_users_userId_two_factor",
2606
+ "summary": "Removes an app user's authenticator and recovery codes and ends every session they hold.",
2460
2607
  "tags": [
2461
2608
  "apps"
2462
2609
  ],
@@ -2500,120 +2647,13 @@
2500
2647
  }
2501
2648
  }
2502
2649
  },
2503
- "description": "Sessions are revoked before the row goes, for the reason `DELETE /api/org/users/:id` states: a live user with a dead session is recoverable by retrying, a deleted user whose token still works is not. Outstanding invitations and unspent tokens for that address are expired with it — a link mailed before the deletion is a standing re-admission ticket. **Nothing outside this app is touched**: a Fleetless user sharing the address keeps their console account, and an account with the same address in a sibling app is a different person as far as this platform is concerned."
2650
+ "description": "The support door for a person who lost their authenticator and their recovery codes. The authenticator and every recovery code go, and so does every session of the account — whoever held one may be the reason for the reset. **A user with no second factor answers `204` too**: that is the end state being asked for. When the app requires two-factor, the person sets it up again at their next sign-in, before any session exists. Audited as `app_user.two_factor_reset`."
2504
2651
  }
2505
2652
  },
2506
- "/api/apps/{id}/users/{userId}/reset-password": {
2507
- "post": {
2508
- "operationId": "post_api_apps_id_users_userId_reset_password",
2509
- "summary": "Mails an app user a password-reset link on the developer's behalf.",
2510
- "tags": [
2511
- "apps"
2512
- ],
2513
- "security": [
2514
- {
2515
- "developerSession": []
2516
- }
2517
- ],
2518
- "parameters": [
2519
- {
2520
- "name": "id",
2521
- "in": "path",
2522
- "required": true,
2523
- "description": "The app's uuid, as returned by `POST /api/apps` or listed by `GET /api/apps`.",
2524
- "schema": {
2525
- "type": "string"
2526
- }
2527
- },
2528
- {
2529
- "name": "userId",
2530
- "in": "path",
2531
- "required": true,
2532
- "description": "The app user's uuid, from `GET /api/apps/:id/users`; a user of another app answers `404`.",
2533
- "schema": {
2534
- "type": "string"
2535
- }
2536
- }
2537
- ],
2538
- "responses": {
2539
- "202": {
2540
- "description": "Success.",
2541
- "content": {
2542
- "application/json": {
2543
- "schema": {
2544
- "$ref": "#/components/schemas/mail-outcome"
2545
- }
2546
- }
2547
- }
2548
- },
2549
- "default": {
2550
- "description": "An error envelope. Codes this route is known to answer: `unauthorized`, `token_expired`, `token_revoked`, `invalid_uuid`, `not_found`, `target_state_conflict`, `method_not_allowed`.",
2551
- "content": {
2552
- "application/json": {
2553
- "schema": {
2554
- "$ref": "#/components/schemas/api-error"
2555
- }
2556
- }
2557
- }
2558
- }
2559
- },
2560
- "description": "The support door beside `POST /api/client/password/reset`, refused like it with `403 method_not_allowed` while the app has the password method off: the same one-hour token and the same link, triggered by a developer for a user who asked them rather than the form. **No enumeration discipline applies** — the caller is authenticated into the app and can read the user list — so this one answers what actually happened: `{ \"mail\": mailStatus }`, where `not_configured` is a deployment without a mailer and `failed` is the state worth somebody's attention. The link points at the app's `reset_url`, or at the hosted reset page when the app has configured none. `409 target_state_conflict` names `password` with rule `not_set` for an account that has none — an OIDC-only app user, whom a reset link would hand a second, quieter door — and `status` with rule `blocked` for a blocked one, since `POST /api/client/password/reset` mails a blocked account nothing and the two doors may not disagree. Setting the password directly is deliberately not offered; a developer who could would hold their customers' credentials."
2561
- }
2562
- },
2563
- "/api/apps/{id}/users/{userId}/two-factor": {
2564
- "delete": {
2565
- "operationId": "delete_api_apps_id_users_userId_two_factor",
2566
- "summary": "Removes an app user's authenticator and recovery codes and ends every session they hold.",
2567
- "tags": [
2568
- "apps"
2569
- ],
2570
- "security": [
2571
- {
2572
- "developerSession": []
2573
- }
2574
- ],
2575
- "parameters": [
2576
- {
2577
- "name": "id",
2578
- "in": "path",
2579
- "required": true,
2580
- "description": "The app's uuid, as returned by `POST /api/apps` or listed by `GET /api/apps`.",
2581
- "schema": {
2582
- "type": "string"
2583
- }
2584
- },
2585
- {
2586
- "name": "userId",
2587
- "in": "path",
2588
- "required": true,
2589
- "description": "The app user's uuid, from `GET /api/apps/:id/users`; a user of another app answers `404`.",
2590
- "schema": {
2591
- "type": "string"
2592
- }
2593
- }
2594
- ],
2595
- "responses": {
2596
- "204": {
2597
- "description": "Success."
2598
- },
2599
- "default": {
2600
- "description": "An error envelope. Codes this route is known to answer: `unauthorized`, `token_expired`, `token_revoked`, `invalid_uuid`, `not_found`.",
2601
- "content": {
2602
- "application/json": {
2603
- "schema": {
2604
- "$ref": "#/components/schemas/api-error"
2605
- }
2606
- }
2607
- }
2608
- }
2609
- },
2610
- "description": "The support door for a person who lost their authenticator and their recovery codes. The authenticator and every recovery code go, and so does every session of the account — whoever held one may be the reason for the reset. **A user with no second factor answers `204` too**: that is the end state being asked for. When the app requires two-factor, the person sets it up again at their next sign-in, before any session exists. Audited as `app_user.two_factor_reset`."
2611
- }
2612
- },
2613
- "/api/apps/{id}/users/{userId}/mcp-grants": {
2614
- "get": {
2615
- "operationId": "get_api_apps_id_users_userId_mcp_grants",
2616
- "summary": "Lists the MCP clients one app user has consented to.",
2653
+ "/api/apps/{id}/users/{userId}/mcp-grants": {
2654
+ "get": {
2655
+ "operationId": "get_api_apps_id_users_userId_mcp_grants",
2656
+ "summary": "Lists the MCP clients one app user has consented to.",
2617
2657
  "tags": [
2618
2658
  "apps"
2619
2659
  ],
@@ -2771,7 +2811,7 @@
2771
2811
  }
2772
2812
  }
2773
2813
  },
2774
- "description": "Answers `{ \"invitations\": [pendingAppInvitation, …] }` — pending only, since an accepted invitation is history rather than something to revoke. **No `accept_url`**, the rule the team listing already keeps: this list exists so a developer can see what is outstanding and withdraw it, and neither needs the token, while a list that carried it would turn every screenshot and browser-history entry of that page into a live credential for somebody else's account. `mail` is omitted too — it described what happened at creation time, and re-serving it invites a reader to take it as current."
2814
+ "description": "Answers `{ \"invitations\": [pendingAppInvitation, …] }` — pending only, since an accepted invitation is history rather than something to revoke. **No `accept_url`**, the rule the team listing already keeps: this list exists so a developer can see what is outstanding and withdraw it, and neither needs the token, while a list that carried it would turn every screenshot and browser-history entry of that page into a live credential for somebody else's account. `mail` is omitted too — it described what happened at creation time, and re-serving it invites a reader to take it as current. An invitation that holds no role key and whose app has no default role lists with `role: null`; accepting or reissuing it is `409 target_state_conflict` naming `default_role`."
2775
2815
  },
2776
2816
  "post": {
2777
2817
  "operationId": "post_api_apps_id_invitations",
@@ -2817,7 +2857,7 @@
2817
2857
  }
2818
2858
  }
2819
2859
  },
2820
- "description": "**An app user, not a team member.** `POST /api/org/invitations` is the other space and leads to the console; this link leads into the developer's own app. The role is resolved and stored now, so a later change to `default_role_id` does not re-aim a link already sent. An invitation **always bypasses `allowed_domains`**. \n\nThe answer carries `accept_url`: the app's `invite_url` with the token in it, or the Fleetless-hosted invitation page when the app has configured none — so mailing it is never refused for a missing URL. `409 target_state_conflict` names `default_role_id` when `role_id` is absent and the app has no default role, or its default no longer resolves: an invitation that names no role has nothing to hand its acceptor, so it is refused here rather than at the acceptance a week later. `409 email_taken` is an address the app already has as a user; `404 not_found` is the app or a `role_id` that is not one of its roles. \n\nCreating shares the reissue route's ceiling of **five invitation mails a minute per app**, answering `429 rate_limited` with `retry_after_ms`: re-creating an invitation for one address replaces it and mails again, so a limit that bound only reissue would be a limit on the wrong door.",
2860
+ "description": "**An app user, not a team member.** `POST /api/org/invitations` is the other space and leads to the console; this link leads into the developer's own app. The role is resolved and stored now, so a later change to `default_role` does not re-aim a link already sent. An invitation **always bypasses `allowed_domains`**. \n\nThe answer carries `accept_url`: the app's `invite_url` with the token in it, or the Fleetless-hosted invitation page when the app has configured none — so mailing it is never refused for a missing URL. `409 target_state_conflict` names `default_role` with rule `not_set` when `role` is absent and the app has no default role: an invitation that names no role has nothing to hand its acceptor, so it is refused here rather than at the acceptance a week later. A `role` that names no role is accepted and grants nothing; a malformed key is `400 validation_error`. `409 email_taken` is an address the app already has as a user; `404 not_found` is the app. \n\nCreating shares the reissue route's ceiling of **five invitation mails a minute per app**, answering `429 rate_limited` with `retry_after_ms`: re-creating an invitation for one address replaces it and mails again, so a limit that bound only reissue would be a limit on the wrong door.",
2821
2861
  "requestBody": {
2822
2862
  "required": true,
2823
2863
  "content": {
@@ -2874,7 +2914,7 @@
2874
2914
  }
2875
2915
  },
2876
2916
  "default": {
2877
- "description": "An error envelope. Codes this route is known to answer: `unauthorized`, `token_expired`, `token_revoked`, `invalid_uuid`, `not_found`, `rate_limited`.",
2917
+ "description": "An error envelope. Codes this route is known to answer: `unauthorized`, `token_expired`, `token_revoked`, `invalid_uuid`, `not_found`, `target_state_conflict`, `rate_limited`.",
2878
2918
  "content": {
2879
2919
  "application/json": {
2880
2920
  "schema": {
@@ -2884,7 +2924,7 @@
2884
2924
  }
2885
2925
  }
2886
2926
  },
2887
- "description": "The old link stops resolving the instant this returns: the row is found by token hash and the previous hash is gone. Two live links to one invitation would reopen the door the listing's missing `accept_url` closes. \n\n**The answer carries a new `id`.** The old row is revoked and a fresh one takes its place, so a caller holding the previous `id` gets `404` from its next revoke or reissue: re-read the listing after this call rather than keeping the id you sent. The seven days start again. \n\nLimited server-side to **five reissues a minute per app** — shared with `POST /api/apps/:id/invitations`, since both mint a link and mail it — answering `429 rate_limited` with `retry_after_ms`. A disabled button is a hint, this is the limit. An invitation that has already been accepted is not pending and answers `404`."
2927
+ "description": "The old link stops resolving the instant this returns: the row is found by token hash and the previous hash is gone. Two live links to one invitation would reopen the door the listing's missing `accept_url` closes. \n\n**The answer carries a new `id`.** The old row is revoked and a fresh one takes its place, so a caller holding the previous `id` gets `404` from its next revoke or reissue: re-read the listing after this call rather than keeping the id you sent. The new invitation holds the same role, and the seven days start again. An invitation that holds no role key and whose app has no default role is refused with `409 target_state_conflict` naming `default_role` (rule `not_set`) before the old link is revoked: set the default role, or revoke it and invite again. \n\nLimited server-side to **five reissues a minute per app** — shared with `POST /api/apps/:id/invitations`, since both mint a link and mail it — answering `429 rate_limited` with `retry_after_ms`. A disabled button is a hint, this is the limit. An invitation that has already been accepted is not pending and answers `404`."
2888
2928
  }
2889
2929
  },
2890
2930
  "/api/apps/{id}/invitations/{invId}": {
@@ -3594,7 +3634,7 @@
3594
3634
  }
3595
3635
  }
3596
3636
  },
3597
- "description": "The body is the **raw image**, not JSON, so it has no request schema: `Content-Type` is one of `HOSTED_LOGO_TYPES` (`image/png`, `image/svg+xml`) and anything else is `415 unsupported_media_type`. At most `HOSTED_LOGO_MAX_BYTES` (100 KB); a larger body, or one that is not the image its type names, is `400 validation_error`. A new logo replaces the stored one. The hosted pages load it from `hosted_logo_url` as an image only, and the cloud serves an SVG sandboxed, so a script inside one never runs."
3637
+ "description": "The body is the **raw image**, not JSON, so it has no request schema: `Content-Type` is one of `HOSTED_LOGO_TYPES` (`image/png`, `image/svg+xml`) and anything else is `415 unsupported_media_type`. At most `HOSTED_LOGO_MAX_BYTES` (512 KB); a larger body, or one that is not the image its type names, is `400 validation_error`. A new logo replaces the stored one. The hosted pages load it from `hosted_logo_url` as an image only, and the cloud serves an SVG sandboxed, so a script inside one never runs."
3598
3638
  },
3599
3639
  "delete": {
3600
3640
  "operationId": "delete_api_apps_id_auth_config_logo",
@@ -4853,7 +4893,7 @@
4853
4893
  }
4854
4894
  }
4855
4895
  },
4856
- "description": "JSON-RPC over MCP's Streamable HTTP, so neither the request nor the response is a shape contracts describes — exactly as `POST /mcp` is, and stateless for the same reason: a fresh transport per request, no session id, nothing surviving the call. **App users only.** The tools are this app's robots filtered by the caller's role, built by the same builder `GET /api/apps/:id/roles/:roleId/mcp-tools` previews, so the console's preview and the live catalog cannot drift. The console tool family belongs to the central endpoint and is offered here to nobody. \n\n**The bearer is verified inside the handler**, not by a route guard, for the two reasons the central endpoint gives — the identity comes from the token and the path names none of it, and the refusal has to carry a `WWW-Authenticate` challenge a guard shared with the REST surface does not send. The challenge names **this app's** protected-resource document (RFC 9728's `resource_metadata`), which is how an MCP client discovers the right authorization server from a bare `401`; pointing it at the central document would send every app's client to the wrong sign-in. \n\n**`404 not_found` covers an identifier no app carries AND an app whose `appAuthConfig.mcp_enabled` is off — one answer for both, the same one the two metadata documents and `register` give.** A separate `403 mcp_disabled` here would hand an anonymous caller a three-way oracle (`404` = no such app, `403` = the app exists with MCP off, `401` = the app exists and is live), which is exactly the distinction discovery collapses; there is no point collapsing it in one place and publishing it in another. The switch is re-read on every request rather than cached off the token, so a developer turning it off ends the sessions already running, and it is decided **before the bearer is looked at** — the reverse of the usual order, and deliberate: it is a fact about the path, an app identifier is public, and an absent server that answered `401` would send a client hunting a credential no credential can satisfy. `401 unauthorized` is a missing, unverifiable or expired bearer, an `aud` that is not this endpoint, or **a consent this person has since withdrawn from the client the token was minted for**: the access token names its client, and the standing consent is re-read here on every request exactly as the account is, so `DELETE /api/client/mcp/grants/:clientId` and its developer twin bite at the next call rather than when the token expires. `403 forbidden` is a token that verifies and is not this app's user: another app's session, a Fleetless user's central `mcp_session`, an account that is `blocked` or still `pending_verification`, or a foreign `Origin`."
4896
+ "description": "JSON-RPC over MCP's Streamable HTTP, so neither the request nor the response is a shape contracts describes — exactly as `POST /mcp` is, and stateless for the same reason: a fresh transport per request, no session id, nothing surviving the call. **App users only.** The tools are this app's robots filtered by the caller's role, built by the same builder `GET /api/robots/:id/datasheet` answers, so the datasheet and the live catalog cannot drift. The console tool family belongs to the central endpoint and is offered here to nobody. \n\n**The bearer is verified inside the handler**, not by a route guard, for the two reasons the central endpoint gives — the identity comes from the token and the path names none of it, and the refusal has to carry a `WWW-Authenticate` challenge a guard shared with the REST surface does not send. The challenge names **this app's** protected-resource document (RFC 9728's `resource_metadata`), which is how an MCP client discovers the right authorization server from a bare `401`; pointing it at the central document would send every app's client to the wrong sign-in. \n\n**`404 not_found` covers an identifier no app carries AND an app whose `appAuthConfig.mcp_enabled` is off — one answer for both, the same one the two metadata documents and `register` give.** A separate `403 mcp_disabled` here would hand an anonymous caller a three-way oracle (`404` = no such app, `403` = the app exists with MCP off, `401` = the app exists and is live), which is exactly the distinction discovery collapses; there is no point collapsing it in one place and publishing it in another. The switch is re-read on every request rather than cached off the token, so a developer turning it off ends the sessions already running, and it is decided **before the bearer is looked at** — the reverse of the usual order, and deliberate: it is a fact about the path, an app identifier is public, and an absent server that answered `401` would send a client hunting a credential no credential can satisfy. `401 unauthorized` is a missing, unverifiable or expired bearer, an `aud` that is not this endpoint, or **a consent this person has since withdrawn from the client the token was minted for**: the access token names its client, and the standing consent is re-read here on every request exactly as the account is, so `DELETE /api/client/mcp/grants/:clientId` and its developer twin bite at the next call rather than when the token expires. `403 forbidden` is a token that verifies and is not this app's user: another app's session, a Fleetless user's central `mcp_session`, an account that is `blocked` or still `pending_verification`, or a foreign `Origin`."
4857
4897
  },
4858
4898
  "get": {
4859
4899
  "operationId": "get_mcp_appIdentifier",
@@ -5384,7 +5424,7 @@
5384
5424
  }
5385
5425
  }
5386
5426
  },
5387
- "description": "**`202` and an empty body for every request policy allows** — a new address, one this app already knows and one it does not answer identically, in status, body and timing. An answer that depended on existence would be the account-enumeration oracle the whole client family is built to avoid. The account cannot log in until the mailed link is spent; `POST /api/client/verify-email` is what does that. \n\n**An address on an account still `pending_verification` is re-registered, not ignored.** The password and display name from this call replace what is stored, every outstanding verification link for the address stops working, and a fresh one is mailed. Otherwise whoever typed an address first would own the password of the account its real owner later verifies. An address on an `active` account changes nothing and sends nothing — that account has already been proven, and its way back in is `POST /api/client/password/reset`. Neither case is visible in the answer. \n\nThe refusals it *does* make are about policy or about what the caller typed, never about a person. `403 registration_closed` when the app has self-registration off and `403 domain_not_allowed` when the address is outside `allowed_domains`: both are the developer's own configuration, and a stranger learns the app's policy rather than who is in it. **A password under twelve characters is part of that `400 validation_error`** and not a code of its own — the minimum is the `password` field's schema rule, and the error names the field, which is what a form needs to mark it. The same `400` names `password` when one is missing while the app's password method is on, or sent while it is off: an email-code-only app registers people without one. `404 not_found` names an **app identifier no app carries**, and never an address: an app identifier is already public (it is in the MCP metadata path and in the developer's own URLs), while collapsing it into `registration_closed` sent a developer who mistyped their own identifier hunting a configuration bug that was not there. `409 target_state_conflict` when the app has no default role — there would be no role to give the person. An app with no `verify_url` is not refused: the mailed link points at the hosted confirmation page instead. \n\n**`409 quota_exceeded` when the org is at its `max_end_users` limit**, counted across every app of the org. It is the one refusal here that is answered **before the address is looked at** — and that ordering is the point rather than an implementation detail: a quota checked after the existence branch would answer `202` for an address the app already knows and `409` for one it does not, which is precisely the enumeration oracle every other line of this route exists to close. At the quota, every registration is refused identically, including one that would only have re-mailed a pending account's link.",
5427
+ "description": "**`202` and an empty body for every request policy allows** — a new address, one this app already knows and one it does not answer identically, in status, body and timing. An answer that depended on existence would be the account-enumeration oracle the whole client family is built to avoid. The account cannot log in until the mailed link is spent; `POST /api/client/verify-email` is what does that. \n\n**An address on an account still `pending_verification` is re-registered, not ignored.** The password and display name from this call replace what is stored, every outstanding verification link for the address stops working, and a fresh one is mailed. Otherwise whoever typed an address first would own the password of the account its real owner later verifies. An address on an `active` account changes nothing and sends nothing — that account has already been proven, and its way back in is `POST /api/client/password/reset`. Neither case is visible in the answer. \n\nThe refusals it *does* make are about policy or about what the caller typed, never about a person. `403 registration_closed` when the app has self-registration off and `403 domain_not_allowed` when the address is outside `allowed_domains`: both are the developer's own configuration, and a stranger learns the app's policy rather than who is in it. **A password under twelve characters is part of that `400 validation_error`** and not a code of its own — the minimum is the `password` field's schema rule, and the error names the field, which is what a form needs to mark it. The same `400` names `password` when one is missing while the app's password method is on, or sent while it is off: an email-code-only app registers people without one. `404 not_found` names an **app identifier no app carries**, and never an address: an app identifier is already public (it is in the MCP metadata path and in the developer's own URLs), while collapsing it into `registration_closed` sent a developer who mistyped their own identifier hunting a configuration bug that was not there. `409 target_state_conflict` naming `default_role` with rule `not_set` when the app has no default role — there would be no role to give the person. A default that names no role is not a refusal: the account holds the key and reaches nothing. An app with no `verify_url` is not refused: the mailed link points at the hosted confirmation page instead. \n\n**`409 quota_exceeded` when the org is at its `max_end_users` limit**, counted across every app of the org. It is the one refusal here that is answered **before the address is looked at** — and that ordering is the point rather than an implementation detail: a quota checked after the existence branch would answer `202` for an address the app already knows and `409` for one it does not, which is precisely the enumeration oracle every other line of this route exists to close. At the quota, every registration is refused identically, including one that would only have re-mailed a pending account's link.",
5388
5428
  "requestBody": {
5389
5429
  "required": true,
5390
5430
  "content": {
@@ -5590,7 +5630,7 @@
5590
5630
  }
5591
5631
  }
5592
5632
  },
5593
- "description": "**An app invitation, not a team one.** `POST /api/org/invitations/accept` is the other space and answers `204`; this one answers a session, because the person is landing in the developer's app and there is no second door for them to sign in through. The role is the one the invitation fixed at creation, so a later change to the app's default role does not re-aim a link already in somebody's inbox, and the invitation **bypasses `allowed_domains`** — a developer inviting somebody by hand has already made the decision the whitelist automates. The answer is a `clientSignInResult`: a `twoFactorChallenge` instead of tokens when the app requires two-factor. `password` is required while the app's password method is on and refused while it is off, both as `400 validation_error` naming the field. \n\n**One refusal for every token that does not work: `410 token_spent`** — unknown, expired past the seven days, revoked by the developer, or already accepted. There is one code because telling them apart would say whether a token ever existed, and because the one thing the holder of a dead link can do is ask the developer for a new one, whichever of the four it was. A chosen password under twelve characters is part of the `400 validation_error`, naming the `password` field. `409 email_taken` is an address this app has acquired since the invitation was written **as an account that is already in use** — the invitation stays outstanding rather than being spent, so the developer can revoke it or point the person at the login. An address that registered itself and is still `pending_verification` is not that state: accepting sets the password the invitee just chose, activates the account and gives it the invitation's role, because reading the invitation mail proves the address the verification link was waiting on. \n\n`409 target_state_conflict` names `role_id` with rule `not_set` when the role the invitation was fixed to has since been deleted and the app has no default role to fall back on: there is no access to hand the acceptor, and creating an account with none would be worse than saying so. \n\n**`409 quota_exceeded` when accepting would CREATE an account and the org is at its `max_end_users` limit**, counted across every app of the org. An invitation that names a row the developer already created, and one whose address is held by an unfinished self-registration, both finish an account that already counts — those are not refused, because the org is not one account larger afterwards. The token is not spent by the refusal: the developer can raise the limit, or delete somebody, and the same link still works.",
5633
+ "description": "**An app invitation, not a team one.** `POST /api/org/invitations/accept` is the other space and answers `204`; this one answers a session, because the person is landing in the developer's app and there is no second door for them to sign in through. The role is the one the invitation fixed at creation, so a later change to the app's default role does not re-aim a link already in somebody's inbox, and the invitation **bypasses `allowed_domains`** — a developer inviting somebody by hand has already made the decision the whitelist automates. The answer is a `clientSignInResult`: a `twoFactorChallenge` instead of tokens when the app requires two-factor. `password` is required while the app's password method is on and refused while it is off, both as `400 validation_error` naming the field. \n\n**One refusal for every token that does not work: `410 token_spent`** — unknown, expired past the seven days, revoked by the developer, or already accepted. There is one code because telling them apart would say whether a token ever existed, and because the one thing the holder of a dead link can do is ask the developer for a new one, whichever of the four it was. A chosen password under twelve characters is part of the `400 validation_error`, naming the `password` field. `409 email_taken` is an address this app has acquired since the invitation was written **as an account that is already in use** — the invitation stays outstanding rather than being spent, so the developer can revoke it or point the person at the login. An address that registered itself and is still `pending_verification` is not that state: accepting sets the password the invitee just chose, activates the account and gives it the invitation's role, because reading the invitation mail proves the address the verification link was waiting on. \n\n`409 target_state_conflict` names `default_role` with rule `not_set` when the invitation holds no role key (it lists with `role: null`) and the app has no default role to fall back on: there is no access to hand the acceptor, and creating an account with none would be worse than saying so. A role deleted since the invitation was issued is no obstacle: the account is created holding the key and reaches nothing. \n\n**`409 quota_exceeded` when accepting would CREATE an account and the org is at its `max_end_users` limit**, counted across every app of the org. An invitation that names a row the developer already created, and one whose address is held by an unfinished self-registration, both finish an account that already counts — those are not refused, because the org is not one account larger afterwards. The token is not spent by the refusal: the developer can raise the limit, or delete somebody, and the same link still works.",
5594
5634
  "requestBody": {
5595
5635
  "required": true,
5596
5636
  "content": {
@@ -5779,7 +5819,7 @@
5779
5819
  }
5780
5820
  }
5781
5821
  },
5782
- "description": "The one route that answers for all three caller kinds — a developer bearer, an app-user bearer and a server key — which is why the shape names each of `developer_id`, `app_user_id` and `server_key_id` and fills exactly one."
5822
+ "description": "The one route that answers for all three caller kinds — a developer bearer, an app-user bearer and a server key — which is why the shape names each of `developer_id`, `app_user_id` and `server_key_id` and fills exactly one. `role` is the organization role an app user holds, as its key and display name; it is `null` for a developer and a server key, and for an app user whose key names no role (the role was deleted), who signs in and reaches nothing."
5783
5823
  }
5784
5824
  },
5785
5825
  "/api/client/two-factor/verify": {
@@ -6957,13 +6997,13 @@
6957
6997
  }
6958
6998
  }
6959
6999
  },
6960
- "description": "A developer bearer sees the robot's whole list unfiltered; an end user or a server key sees only the slugs their role grants, and a robot their app does not attach answers `404` exactly as one that does not exist."
7000
+ "description": "A developer bearer sees the robot's whole list unfiltered; an end user sees only the slugs their role grants, a server key every slug its app does not lock, and a robot their app does not attach answers `404` exactly as one that does not exist."
6961
7001
  }
6962
7002
  },
6963
7003
  "/api/robots/{id}/exposures": {
6964
7004
  "get": {
6965
7005
  "operationId": "get_api_robots_id_exposures",
6966
- "summary": "Lists every grantable slug of a robot with its kind — the material the roles matrix is built from.",
7006
+ "summary": "Lists every exposed slug of a robot with its kind — the material an app picks its locks from.",
6967
7007
  "tags": [
6968
7008
  "robots"
6969
7009
  ],
@@ -7005,7 +7045,7 @@
7005
7045
  }
7006
7046
  }
7007
7047
  },
7008
- "description": "Developer-only: this is what a role *could* be granted, which is a configuration fact rather than something an end user is entitled to enumerate."
7048
+ "description": "Developer-only: this is what a role could be required to use and an app could lock, which is a configuration fact rather than something an end user is entitled to enumerate."
7009
7049
  }
7010
7050
  },
7011
7051
  "/api/robots/{id}/datapoints/{slug}": {
@@ -7166,7 +7206,7 @@
7166
7206
  }
7167
7207
  }
7168
7208
  },
7169
- "description": "**The REST twin of the MCP action `robots.describe`**: one answer per robot — every datapoint, action, service, publisher and camera the role grants, each with its `input_schema` where it takes parameters, plus the two capabilities that gate whole features, `action_history` and `assets`. A robot with nothing published answers an empty `exposures` list, never a refusal. A robot the caller does not reach — not attached to their app, or attached with a role that grants nothing on it — answers `404` exactly as one that does not exist. The app-user datapoint and camera listings under this prefix stay; this is the one read that also names actions, services, publishers and capabilities, which is what an app needs before it can draw a screen."
7209
+ "description": "**The REST twin of the MCP action `robots.describe`**: one answer per robot — every datapoint, action, service, publisher and camera the role grants, each with its `input_schema` where it takes parameters, plus the two capabilities that gate whole features, `job_history` and `assets`. A robot with nothing published answers an empty `exposures` list, never a refusal. A robot the caller does not reach — not attached to their app, or attached with a role that grants nothing on it — answers `404` exactly as one that does not exist. The app-user datapoint and camera listings under this prefix stay; this is the one read that also names actions, services, publishers and capabilities, which is what an app needs before it can draw a screen."
7170
7210
  }
7171
7211
  },
7172
7212
  "/api/robots/{id}/config/draft": {
@@ -7214,7 +7254,7 @@
7214
7254
  }
7215
7255
  }
7216
7256
  },
7217
- "description": "Issues are recomputed on every read and every write, so an editor never has to guess whether it may publish. `doc` is `null` for a draft that is valid YAML but not a Fleetless configuration — a state the format admits and the publish route refuses."
7257
+ "description": "Issues are recomputed on every read and every write, so an editor never has to guess whether it may publish. `doc` is `null` for a draft that is valid YAML but not a Fleetless configuration — a state the format admits and the publish route refuses. `updated_by` names the team member who saved it last, and is `null` when nobody has, or when the cloud itself rewrote the draft."
7218
7258
  },
7219
7259
  "put": {
7220
7260
  "operationId": "put_api_robots_id_config_draft",
@@ -7318,7 +7358,7 @@
7318
7358
  }
7319
7359
  }
7320
7360
  },
7321
- "description": "A draft that is valid YAML but not a Fleetless configuration is `422 draft_not_a_document`, carrying every issue rather than the blocking subset — nothing about that text is publishable, so there is no subset to pick, and the warning naming the checks that could not run is part of reading the list correctly. A document with `severity: \"error\"` issues is `422 validation_error` with just those. The draft's own text travels into the version, so a restore later returns what the author wrote rather than a re-rendering of it."
7361
+ "description": "A draft that is valid YAML but not a Fleetless configuration is `422 draft_not_a_document`, carrying every issue rather than the blocking subset — nothing about that text is publishable, so there is no subset to pick, and the warning naming the checks that could not run is part of reading the list correctly. A document with `severity: \"error\"` issues is `422 validation_error` with just those. The draft's own text travels into the version, so a restore later returns what the author wrote rather than a re-rendering of it. The answer carries `warnings`: every `warning` of the published document, role keys that name no role of the organization included. A warning never blocks a publish."
7322
7362
  }
7323
7363
  },
7324
7364
  "/api/robots/{id}/config/versions": {
@@ -7365,7 +7405,8 @@
7365
7405
  }
7366
7406
  }
7367
7407
  }
7368
- }
7408
+ },
7409
+ "description": "Each version carries `published_by`, the team member who published it, or `null` for a version published before the cloud recorded authors or by a member who has since been removed."
7369
7410
  }
7370
7411
  },
7371
7412
  "/api/robots/{id}/config/versions/{v}": {
@@ -7485,7 +7526,7 @@
7485
7526
  "/api/robots/{id}/config/rename-slug": {
7486
7527
  "post": {
7487
7528
  "operationId": "post_api_robots_id_config_rename_slug",
7488
- "summary": "Renames a slug in the draft and moves every role grant and the recorded history with the name.",
7529
+ "summary": "Renames a slug in the draft and moves the app locks and the recorded history with the name.",
7489
7530
  "tags": [
7490
7531
  "config"
7491
7532
  ],
@@ -7517,7 +7558,7 @@
7517
7558
  }
7518
7559
  },
7519
7560
  "default": {
7520
- "description": "An error envelope. Codes this route is known to answer: `unauthorized`, `token_expired`, `token_revoked`, `invalid_uuid`, `not_found`, `validation_error`, `draft_not_a_document`, `unknown_slug`, `reserved_slug`, `duplicate_slug`, `history_migrating`, `internal_error`.",
7561
+ "description": "An error envelope. Codes this route is known to answer: `unauthorized`, `token_expired`, `token_revoked`, `invalid_uuid`, `not_found`, `validation_error`, `draft_not_a_document`, `unknown_slug`, `reserved_slug`, `duplicate_slug`, `history_migrating`, `target_state_conflict`, `internal_error`.",
7521
7562
  "content": {
7522
7563
  "application/json": {
7523
7564
  "schema": {
@@ -7527,7 +7568,7 @@
7527
7568
  }
7528
7569
  }
7529
7570
  },
7530
- "description": "One transaction: the draft document and every app-role grant carrying the slug are rewritten, and the recorded history moves with the name without rewriting any stored sample, so a rename takes the same time however much history there is. Samples the robot still sends under the old slug until the next publish join the renamed history. The published configuration is immutable, so `requires_publish` says the rename is not live on the robot yet. A draft that is not a document is `409 draft_not_a_document` — the same word the usage preview uses for the same state. While the recorded history is being migrated the rename is refused with `409 history_migrating`; nothing is written, and the same request succeeds once the migration has finished.",
7571
+ "description": "One transaction: the draft document and every app lock that lists the slug are rewritten, and the recorded history moves with the name without rewriting any stored sample, so a rename takes the same time however much history there is. Locks follow the rename: a lock that listed the old slug lists the new one as well, in every app of the organization, so a locked capability stays locked; the old name stays in the lock until the next `PUT /api/apps/:id/access`, and `rewritten_locks` counts the locks touched. A lock that would grow past the most slugs it can hold refuses the whole rename with `409 target_state_conflict` naming `to` (rule `lock_full`); nothing is written. Samples the robot still sends under the old slug until the next publish join the renamed history. The published configuration is immutable, so `requires_publish` says the rename is not live on the robot yet. A draft that is not a document is `409 draft_not_a_document` — the same word the usage preview uses for the same state. While the recorded history is being migrated the rename is refused with `409 history_migrating`; nothing is written, and the same request succeeds once the migration has finished.",
7531
7572
  "requestBody": {
7532
7573
  "required": true,
7533
7574
  "content": {
@@ -7594,7 +7635,7 @@
7594
7635
  }
7595
7636
  }
7596
7637
  },
7597
- "description": "A draft that is valid YAML but not a Fleetless document is refused rather than answered with `alert_count: 0`: the two states are *this slug has no alerts* and *there is no document to ask*, and a zero cannot tell them apart — it would show a smaller blast radius than the rename actually has. The other three counts are real whatever the draft holds, and a partial answer to a preview whose whole purpose is to be complete is not worth the ambiguity."
7638
+ "description": "A draft that is valid YAML but not a Fleetless document is refused rather than answered with `alert_count: 0`: the two states are *this slug has no alerts* and *there is no document to ask*, and a zero cannot tell them apart — it would show a smaller blast radius than the rename actually has. The other three counts are real whatever the draft holds, and a partial answer to a preview whose whole purpose is to be complete is not worth the ambiguity. `lock_count` counts the app locks the rename would extend with the new name."
7598
7639
  }
7599
7640
  },
7600
7641
  "/api/robots/{id}/alerts": {
@@ -8130,7 +8171,7 @@
8130
8171
  }
8131
8172
  }
8132
8173
  },
8133
- "description": "Needs the `action_history` capability, and **this route is what makes that switch mean something** — it was unkeepable while nothing durable recorded what had run. Two residuals worth stating rather than implying away. `history` is a syntactically valid slug, and a static segment matches before a parameter, so a robot with a service literally slugged `history` can no longer be **read** through `GET /api/robots/:id/jobs/:slug`; invoking, cancelling and the listing are unaffected. And a run row names its actor by email address, so an end user holding this capability learns which other people have been driving the machine. `robot_id` in the query is shared with the org-wide read; a *different* one here is refused rather than quietly answered about the robot in the path."
8174
+ "description": "Needs the `job_history` capability, and **this route is what makes that switch mean something** — it was unkeepable while nothing durable recorded what had run. Two residuals worth stating rather than implying away. `history` is a syntactically valid slug, and a static segment matches before a parameter, so a robot with a service literally slugged `history` can no longer be **read** through `GET /api/robots/:id/jobs/:slug`; invoking, cancelling and the listing are unaffected. And a run row names its actor by email address, so an end user holding this capability learns which other people have been driving the machine. `robot_id` in the query is shared with the org-wide read; a *different* one here is refused rather than quietly answered about the robot in the path."
8134
8175
  }
8135
8176
  },
8136
8177
  "/api/robots/{id}/jobs/{slug}": {
@@ -8193,7 +8234,7 @@
8193
8234
  }
8194
8235
  }
8195
8236
  },
8196
- "description": "**One route for both kinds**, because a path segment naming the kind would demand a fact a role grant does not carry. An action answers `202` with an `invokeResponse` the moment the job exists; a service answers `200` with a `serviceCallResponse` once the result is in — two shapes, carried by one union (`invokeOrServiceResponse`) and told apart by whether `kind` or a bare `result` arrives. Parameters are checked **before** anything about the world (offline, busy): the same request must get the same verdict whether or not the robot happens to be reachable, or a developer testing against an offline robot never learns their parameters were wrong. A slug is `409 busy` while it holds a `running` job, an `unknown` one the robot has not accounted for yet, or an `external` goal someone else started; the refusal's `details.running` names that job, `state` and `origin` included. A service the robot reports as failed answers `502` carrying **the job's own error code**, which is an open set and not one of the codes above.",
8237
+ "description": "**One route for both kinds**, because a path segment naming the kind would demand a fact the rights model does not carry. An action answers `202` with an `invokeResponse` the moment the job exists; a service answers `200` with a `serviceCallResponse` once the result is in — two shapes, carried by one union (`invokeOrServiceResponse`) and told apart by whether `kind` or a bare `result` arrives. Parameters are checked **before** anything about the world (offline, busy): the same request must get the same verdict whether or not the robot happens to be reachable, or a developer testing against an offline robot never learns their parameters were wrong. A slug is `409 busy` while it holds a `running` job, an `unknown` one the robot has not accounted for yet, or an `external` goal someone else started; the refusal's `details.running` names that job, `state` and `origin` included. A service the robot reports as failed answers `502` carrying **the job's own error code**, which is an open set and not one of the codes above.",
8197
8238
  "requestBody": {
8198
8239
  "required": true,
8199
8240
  "content": {
@@ -11316,20 +11357,19 @@
11316
11357
  "format": "uuid",
11317
11358
  "pattern": "^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"
11318
11359
  },
11319
- "description": "The robots this app may reach, each referenced individually. Tags never grant rights, and a robot absent from this list is invisible to the app whatever a role grants."
11360
+ "description": "The robots this app may reach, each referenced individually. Tags never grant rights, and a robot absent from this list is invisible to the app. What a user of the app may use on an attached robot follows that robot's `fleetless.yaml` and the organization's defaults, less what the app locks."
11320
11361
  },
11321
- "default_role_id": {
11362
+ "default_role": {
11322
11363
  "anyOf": [
11323
11364
  {
11324
11365
  "type": "string",
11325
- "format": "uuid",
11326
- "pattern": "^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"
11366
+ "pattern": "^(?!defaults$)[a-z][a-z0-9_]{0,62}$"
11327
11367
  },
11328
11368
  {
11329
11369
  "type": "null"
11330
11370
  }
11331
11371
  ],
11332
- "description": "The role an app user gets when created or invited without an explicit one. `null` means this app has not chosen a default, the normal state of an app created before its roles were configured — and then a create or invite that omits `role_id` gets `validation_error`, not a user with no role. An invitation resolves the role when issued, so changing this never re-aims an outstanding one. The role must belong to this app, which `PATCH /api/apps/:id` checks and the schema cannot."
11372
+ "description": "The role, by key, that an app user gets when created, invited or self-registered without an explicit one. `null` means this app has not chosen a default, the normal state of an app until someone picks one, and then a create or invite that names no role is refused. An invitation resolves the role when issued, so changing this never re-aims an outstanding one. The key is shown as stored and may name no role, which grants nothing; `GET /api/apps/:id/access` warns about it. It is set by `PUT /api/apps/:id/access`, not by `PATCH /api/apps/:id`."
11333
11373
  },
11334
11374
  "created_at": {
11335
11375
  "type": "string",
@@ -11344,11 +11384,223 @@
11344
11384
  "name",
11345
11385
  "identifier",
11346
11386
  "robot_ids",
11347
- "default_role_id",
11387
+ "default_role",
11348
11388
  "created_at"
11349
11389
  ],
11350
11390
  "additionalProperties": false
11351
11391
  },
11392
+ "app-access": {
11393
+ "type": "object",
11394
+ "properties": {
11395
+ "default_role": {
11396
+ "anyOf": [
11397
+ {
11398
+ "type": "string",
11399
+ "pattern": "^(?!defaults$)[a-z][a-z0-9_]{0,62}$"
11400
+ },
11401
+ {
11402
+ "type": "null"
11403
+ }
11404
+ ],
11405
+ "description": "The role, by key, that an app user gets when created, invited or self-registered without an explicit one. `null` means the app has none, and a create or invite that names no role is refused. A key that names no role is accepted and warns; it grants nothing."
11406
+ },
11407
+ "locked_kinds": {
11408
+ "maxItems": 5,
11409
+ "type": "array",
11410
+ "items": {
11411
+ "type": "string",
11412
+ "enum": [
11413
+ "read",
11414
+ "invoke",
11415
+ "publish",
11416
+ "assets",
11417
+ "job_history"
11418
+ ]
11419
+ },
11420
+ "uniqueItems": true,
11421
+ "description": "Kinds of access locked for every user and server key of the app, on every robot it reaches: `read`, `invoke`, `publish`, `assets` or `job_history`, each at most once. The only way to lock `assets` or `job_history`, which belong to the robot as a whole."
11422
+ },
11423
+ "locked": {
11424
+ "maxItems": 1000,
11425
+ "type": "array",
11426
+ "items": {
11427
+ "type": "object",
11428
+ "properties": {
11429
+ "robot_id": {
11430
+ "type": "string",
11431
+ "format": "uuid",
11432
+ "pattern": "^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$",
11433
+ "description": "The robot whose capabilities are locked for this app."
11434
+ },
11435
+ "slugs": {
11436
+ "minItems": 1,
11437
+ "maxItems": 2000,
11438
+ "type": "array",
11439
+ "items": {
11440
+ "type": "string",
11441
+ "minLength": 2,
11442
+ "maxLength": 63,
11443
+ "pattern": "^[a-z][a-z0-9]*(?:_[a-z0-9]+)*$"
11444
+ },
11445
+ "uniqueItems": true,
11446
+ "description": "The slugs of that robot's exposures to lock, at least one and each named once, at most 2000. A slug the robot has no exposure for is accepted and warns, and locks nothing."
11447
+ }
11448
+ },
11449
+ "required": [
11450
+ "robot_id",
11451
+ "slugs"
11452
+ ],
11453
+ "additionalProperties": false
11454
+ },
11455
+ "description": "Single exposures locked on single robots, one entry per robot and at most 1000. A lock never grants anything: it only takes away what a role would give."
11456
+ },
11457
+ "revision": {
11458
+ "description": "The `revision` of the access this body was composed from, as `GET` or `PUT /api/apps/:id/access` answered it. When it is sent and the stored access has changed since, the write is refused with `409 target_state_conflict` naming `revision` (rule `stale`) and nothing is written; read the access again and compose the body anew. Left out, the body replaces whatever is stored: the last writer wins.",
11459
+ "type": "string",
11460
+ "pattern": "^[0-9a-f]{64}$"
11461
+ }
11462
+ },
11463
+ "required": [
11464
+ "default_role",
11465
+ "locked_kinds",
11466
+ "locked"
11467
+ ],
11468
+ "additionalProperties": false
11469
+ },
11470
+ "app-access-response": {
11471
+ "type": "object",
11472
+ "properties": {
11473
+ "default_role": {
11474
+ "anyOf": [
11475
+ {
11476
+ "type": "string",
11477
+ "pattern": "^(?!defaults$)[a-z][a-z0-9_]{0,62}$"
11478
+ },
11479
+ {
11480
+ "type": "null"
11481
+ }
11482
+ ],
11483
+ "description": "The role, by key, that an app user gets when created, invited or self-registered without an explicit one. `null` means the app has none, and a create or invite that names no role is refused. A key that names no role is accepted and warns; it grants nothing."
11484
+ },
11485
+ "locked_kinds": {
11486
+ "maxItems": 5,
11487
+ "type": "array",
11488
+ "items": {
11489
+ "type": "string",
11490
+ "enum": [
11491
+ "read",
11492
+ "invoke",
11493
+ "publish",
11494
+ "assets",
11495
+ "job_history"
11496
+ ]
11497
+ },
11498
+ "uniqueItems": true,
11499
+ "description": "Kinds of access locked for every user and server key of the app, on every robot it reaches: `read`, `invoke`, `publish`, `assets` or `job_history`, each at most once. The only way to lock `assets` or `job_history`, which belong to the robot as a whole."
11500
+ },
11501
+ "locked": {
11502
+ "maxItems": 1000,
11503
+ "type": "array",
11504
+ "items": {
11505
+ "type": "object",
11506
+ "properties": {
11507
+ "robot_id": {
11508
+ "type": "string",
11509
+ "format": "uuid",
11510
+ "pattern": "^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$",
11511
+ "description": "The robot whose capabilities are locked for this app."
11512
+ },
11513
+ "slugs": {
11514
+ "minItems": 1,
11515
+ "maxItems": 2000,
11516
+ "type": "array",
11517
+ "items": {
11518
+ "type": "string",
11519
+ "minLength": 2,
11520
+ "maxLength": 63,
11521
+ "pattern": "^[a-z][a-z0-9]*(?:_[a-z0-9]+)*$"
11522
+ },
11523
+ "uniqueItems": true,
11524
+ "description": "The slugs of that robot's exposures to lock, at least one and each named once, at most 2000. A slug the robot has no exposure for is accepted and warns, and locks nothing."
11525
+ }
11526
+ },
11527
+ "required": [
11528
+ "robot_id",
11529
+ "slugs"
11530
+ ],
11531
+ "additionalProperties": false
11532
+ },
11533
+ "description": "Single exposures locked on single robots, one entry per robot and at most 1000. A lock never grants anything: it only takes away what a role would give."
11534
+ },
11535
+ "revision": {
11536
+ "type": "string",
11537
+ "pattern": "^[0-9a-f]{64}$",
11538
+ "description": "The revision of the access as it stands. Send it back as `revision` of the next `PUT` to have that write refused when the access has changed in between."
11539
+ },
11540
+ "warnings": {
11541
+ "type": "array",
11542
+ "items": {
11543
+ "type": "object",
11544
+ "properties": {
11545
+ "code": {
11546
+ "type": "string",
11547
+ "enum": [
11548
+ "unknown_default_role",
11549
+ "unknown_lock_slug",
11550
+ "lock_robot_not_attached"
11551
+ ],
11552
+ "description": "`unknown_default_role`: the default role names no role of the organization. `unknown_lock_slug`: a lock names a slug the robot has no published exposure for. `lock_robot_not_attached`: a lock names a robot that is not attached to the app."
11553
+ },
11554
+ "message": {
11555
+ "type": "string",
11556
+ "minLength": 1,
11557
+ "description": "A sentence a person can read, naming the key, robot or slug."
11558
+ },
11559
+ "robot_id": {
11560
+ "anyOf": [
11561
+ {
11562
+ "type": "string",
11563
+ "format": "uuid",
11564
+ "pattern": "^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"
11565
+ },
11566
+ {
11567
+ "type": "null"
11568
+ }
11569
+ ],
11570
+ "description": "The robot a lock warning is about; `null` for `unknown_default_role`."
11571
+ },
11572
+ "slug": {
11573
+ "anyOf": [
11574
+ {
11575
+ "type": "string"
11576
+ },
11577
+ {
11578
+ "type": "null"
11579
+ }
11580
+ ],
11581
+ "description": "The slug an `unknown_lock_slug` warning is about; `null` for the other warnings."
11582
+ }
11583
+ },
11584
+ "required": [
11585
+ "code",
11586
+ "message",
11587
+ "robot_id",
11588
+ "slug"
11589
+ ],
11590
+ "additionalProperties": false
11591
+ },
11592
+ "description": "What the access names that does not exist as written. Empty when nothing is out of step."
11593
+ }
11594
+ },
11595
+ "required": [
11596
+ "default_role",
11597
+ "locked_kinds",
11598
+ "locked",
11599
+ "revision",
11600
+ "warnings"
11601
+ ],
11602
+ "additionalProperties": false
11603
+ },
11352
11604
  "app-auth-config": {
11353
11605
  "type": "object",
11354
11606
  "properties": {
@@ -11509,6 +11761,21 @@
11509
11761
  ],
11510
11762
  "description": "Where the hosted pages load the app's logo from, `<portal>/app/<identifier>/logo`, or `null` when no logo is stored. **Read-only** — the logo is written through `PUT /api/apps/:id/auth-config/logo`."
11511
11763
  },
11764
+ "hosted_logo_shape": {
11765
+ "description": "How the hosted pages lay the logo out: `square` beside the app's name, `wide` in place of it. **Read-only** — derived from the stored image, and `null` exactly when `hosted_logo_url` is `null`. An image whose size cannot be read is `square`. Absent when the server predates this field: read an absent field as unknown, not as `square`. The cloud always sends it.",
11766
+ "anyOf": [
11767
+ {
11768
+ "type": "string",
11769
+ "enum": [
11770
+ "square",
11771
+ "wide"
11772
+ ]
11773
+ },
11774
+ {
11775
+ "type": "null"
11776
+ }
11777
+ ]
11778
+ },
11512
11779
  "hosted_accent": {
11513
11780
  "anyOf": [
11514
11781
  {
@@ -11597,12 +11864,6 @@
11597
11864
  "maximum": 9007199254740991,
11598
11865
  "description": "App users deleted with the app. They are the developer's own customers, not Fleetless users, and exist in no other app."
11599
11866
  },
11600
- "role_count": {
11601
- "type": "integer",
11602
- "minimum": 0,
11603
- "maximum": 9007199254740991,
11604
- "description": "Roles deleted with the app, each with its per-robot slug grants."
11605
- },
11606
11867
  "server_key_count": {
11607
11868
  "type": "integer",
11608
11869
  "minimum": 0,
@@ -11630,7 +11891,6 @@
11630
11891
  },
11631
11892
  "required": [
11632
11893
  "user_count",
11633
- "role_count",
11634
11894
  "server_key_count",
11635
11895
  "invitation_count",
11636
11896
  "oidc_provider_count",
@@ -11659,11 +11919,10 @@
11659
11919
  "pattern": "^(?!\\.)(?!.*\\.\\.)([A-Za-z0-9_'+\\-\\.]*)[A-Za-z0-9_+-]@([A-Za-z0-9][A-Za-z0-9\\-]*\\.)+[A-Za-z]{2,}$",
11660
11920
  "description": "The address the invitation was addressed to."
11661
11921
  },
11662
- "role_id": {
11922
+ "role": {
11663
11923
  "type": "string",
11664
- "format": "uuid",
11665
- "pattern": "^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$",
11666
- "description": "The role the invitee holds once they accept. Resolved at creation, so a later change to the app's default role does not silently re-aim an outstanding invitation."
11924
+ "pattern": "^(?!defaults$)[a-z][a-z0-9_]{0,62}$",
11925
+ "description": "The key of the role the invitee holds once they accept. Resolved at creation, so a later change to the app's default role does not silently re-aim an outstanding invitation. A role deleted in the meantime leaves the key behind, and it grants nothing."
11667
11926
  },
11668
11927
  "expires_at": {
11669
11928
  "type": "string",
@@ -11692,7 +11951,7 @@
11692
11951
  "id",
11693
11952
  "app_id",
11694
11953
  "email",
11695
- "role_id",
11954
+ "role",
11696
11955
  "expires_at",
11697
11956
  "accept_url",
11698
11957
  "mail"
@@ -11725,11 +11984,17 @@
11725
11984
  "pattern": "^(?!\\.)(?!.*\\.\\.)([A-Za-z0-9_'+\\-\\.]*)[A-Za-z0-9_+-]@([A-Za-z0-9][A-Za-z0-9\\-]*\\.)+[A-Za-z]{2,}$",
11726
11985
  "description": "The address the invitation was addressed to."
11727
11986
  },
11728
- "role_id": {
11729
- "type": "string",
11730
- "format": "uuid",
11731
- "pattern": "^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$",
11732
- "description": "The role the invitee holds once they accept. Resolved at creation, so a later change to the app's default role does not silently re-aim an outstanding invitation."
11987
+ "role": {
11988
+ "anyOf": [
11989
+ {
11990
+ "type": "string",
11991
+ "pattern": "^(?!defaults$)[a-z][a-z0-9_]{0,62}$"
11992
+ },
11993
+ {
11994
+ "type": "null"
11995
+ }
11996
+ ],
11997
+ "description": "The key of the role the invitee holds once they accept, or `null` for an invitation that holds none and whose app has no default role to stand in for it. Such an invitation is answered `409 target_state_conflict` naming `default_role` when it is accepted or reissued: set the app's default role, or revoke it and invite again. A role deleted in the meantime leaves the key behind, and it grants nothing."
11733
11998
  },
11734
11999
  "expires_at": {
11735
12000
  "type": "string",
@@ -11742,7 +12007,7 @@
11742
12007
  "id",
11743
12008
  "app_id",
11744
12009
  "email",
11745
- "role_id",
12010
+ "role",
11746
12011
  "expires_at"
11747
12012
  ],
11748
12013
  "additionalProperties": false
@@ -11795,20 +12060,19 @@
11795
12060
  "format": "uuid",
11796
12061
  "pattern": "^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"
11797
12062
  },
11798
- "description": "The robots this app may reach, each referenced individually. Tags never grant rights, and a robot absent from this list is invisible to the app whatever a role grants."
12063
+ "description": "The robots this app may reach, each referenced individually. Tags never grant rights, and a robot absent from this list is invisible to the app. What a user of the app may use on an attached robot follows that robot's `fleetless.yaml` and the organization's defaults, less what the app locks."
11799
12064
  },
11800
- "default_role_id": {
12065
+ "default_role": {
11801
12066
  "anyOf": [
11802
12067
  {
11803
12068
  "type": "string",
11804
- "format": "uuid",
11805
- "pattern": "^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"
12069
+ "pattern": "^(?!defaults$)[a-z][a-z0-9_]{0,62}$"
11806
12070
  },
11807
12071
  {
11808
12072
  "type": "null"
11809
12073
  }
11810
12074
  ],
11811
- "description": "The role an app user gets when created or invited without an explicit one. `null` means this app has not chosen a default, the normal state of an app created before its roles were configured — and then a create or invite that omits `role_id` gets `validation_error`, not a user with no role. An invitation resolves the role when issued, so changing this never re-aims an outstanding one. The role must belong to this app, which `PATCH /api/apps/:id` checks and the schema cannot."
12075
+ "description": "The role, by key, that an app user gets when created, invited or self-registered without an explicit one. `null` means this app has not chosen a default, the normal state of an app until someone picks one, and then a create or invite that names no role is refused. An invitation resolves the role when issued, so changing this never re-aims an outstanding one. The key is shown as stored and may name no role, which grants nothing; `GET /api/apps/:id/access` warns about it. It is set by `PUT /api/apps/:id/access`, not by `PATCH /api/apps/:id`."
11812
12076
  },
11813
12077
  "created_at": {
11814
12078
  "type": "string",
@@ -11823,7 +12087,7 @@
11823
12087
  "name",
11824
12088
  "identifier",
11825
12089
  "robot_ids",
11826
- "default_role_id",
12090
+ "default_role",
11827
12091
  "created_at"
11828
12092
  ],
11829
12093
  "additionalProperties": false
@@ -12163,11 +12427,17 @@
12163
12427
  ],
12164
12428
  "description": "Optional human name, shown by the developer's own UI instead of the address where present. `null` when the user never supplied one; never used for authentication."
12165
12429
  },
12166
- "role_id": {
12167
- "type": "string",
12168
- "format": "uuid",
12169
- "pattern": "^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$",
12170
- "description": "The role that decides what this user may reach. Roles are the only visibility filter: what a role does not grant does not exist for that user."
12430
+ "role": {
12431
+ "anyOf": [
12432
+ {
12433
+ "type": "string",
12434
+ "pattern": "^(?!defaults$)[a-z][a-z0-9_]{0,62}$"
12435
+ },
12436
+ {
12437
+ "type": "null"
12438
+ }
12439
+ ],
12440
+ "description": "The key of the organization role this user holds, or `null` for an account that holds none (one the move to organization roles could not map to a key). The role, the robots' `fleetless.yaml` and what the app locks decide what the user may reach: what none of them grants does not exist for that user. The key is shown as stored, and it may name no role (the role was deleted since): that grants nothing, and the user can still sign in. Without a key the user reaches nothing and can still sign in; `PATCH /api/apps/:id/users/:userId` sets one."
12171
12441
  },
12172
12442
  "status": {
12173
12443
  "type": "string",
@@ -12252,7 +12522,7 @@
12252
12522
  "app_id",
12253
12523
  "email",
12254
12524
  "display_name",
12255
- "role_id",
12525
+ "role",
12256
12526
  "status",
12257
12527
  "has_password",
12258
12528
  "providers",
@@ -12301,11 +12571,17 @@
12301
12571
  ],
12302
12572
  "description": "Optional human name, shown by the developer's own UI instead of the address where present. `null` when the user never supplied one; never used for authentication."
12303
12573
  },
12304
- "role_id": {
12305
- "type": "string",
12306
- "format": "uuid",
12307
- "pattern": "^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$",
12308
- "description": "The role that decides what this user may reach. Roles are the only visibility filter: what a role does not grant does not exist for that user."
12574
+ "role": {
12575
+ "anyOf": [
12576
+ {
12577
+ "type": "string",
12578
+ "pattern": "^(?!defaults$)[a-z][a-z0-9_]{0,62}$"
12579
+ },
12580
+ {
12581
+ "type": "null"
12582
+ }
12583
+ ],
12584
+ "description": "The key of the organization role this user holds, or `null` for an account that holds none (one the move to organization roles could not map to a key). The role, the robots' `fleetless.yaml` and what the app locks decide what the user may reach: what none of them grants does not exist for that user. The key is shown as stored, and it may name no role (the role was deleted since): that grants nothing, and the user can still sign in. Without a key the user reaches nothing and can still sign in; `PATCH /api/apps/:id/users/:userId` sets one."
12309
12585
  },
12310
12586
  "status": {
12311
12587
  "type": "string",
@@ -12390,7 +12666,7 @@
12390
12666
  "app_id",
12391
12667
  "email",
12392
12668
  "display_name",
12393
- "role_id",
12669
+ "role",
12394
12670
  "status",
12395
12671
  "has_password",
12396
12672
  "providers",
@@ -21014,7 +21290,7 @@
21014
21290
  ],
21015
21291
  "additionalProperties": false
21016
21292
  },
21017
- "description": "Every camera the published configuration exposes on this robot **and** the caller's role grants. A developer sees all of them; an end user sees what their role allows."
21293
+ "description": "Every camera the published configuration exposes on this robot **and** the caller's role may use. A developer sees all of them; an end user sees what their role allows."
21018
21294
  }
21019
21295
  },
21020
21296
  "required": [
@@ -22001,18 +22277,32 @@
22001
22277
  ],
22002
22278
  "description": "The app this session belongs to, and `null` for a developer — a developer is organisation-scoped and owns the configuration of every robot in the organisation rather than reaching one through an app."
22003
22279
  },
22004
- "role_id": {
22280
+ "role": {
22005
22281
  "anyOf": [
22006
22282
  {
22007
- "type": "string",
22008
- "format": "uuid",
22009
- "pattern": "^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"
22283
+ "type": "object",
22284
+ "properties": {
22285
+ "key": {
22286
+ "type": "string",
22287
+ "pattern": "^(?!defaults$)[a-z][a-z0-9_]{0,62}$",
22288
+ "description": "The role's key, the same string `fleetless.yaml` and the organization's role list write."
22289
+ },
22290
+ "name": {
22291
+ "type": "string",
22292
+ "description": "The role's display name, for showing the caller what they hold. Changing it changes nothing about rights."
22293
+ }
22294
+ },
22295
+ "required": [
22296
+ "key",
22297
+ "name"
22298
+ ],
22299
+ "additionalProperties": false
22010
22300
  },
22011
22301
  {
22012
22302
  "type": "null"
22013
22303
  }
22014
22304
  ],
22015
- "description": "The role that decides what this caller may reach, and `null` for a developer. Roles are the only visibility filter: what a role does not grant does not exist for that user."
22305
+ "description": "The organization role that decides what this caller may reach: its key and display name. `null` when there is no role to name: for a developer and for a server key, which are not filtered by a role, and for an app user whose key names no role (the role was deleted), who then reaches nothing."
22016
22306
  },
22017
22307
  "email": {
22018
22308
  "anyOf": [
@@ -22045,7 +22335,7 @@
22045
22335
  "app_user_id",
22046
22336
  "server_key_id",
22047
22337
  "app_id",
22048
- "role_id",
22338
+ "role",
22049
22339
  "email",
22050
22340
  "two_factor_enabled"
22051
22341
  ],
@@ -22976,6 +23266,24 @@
22976
23266
  "additionalProperties": false
22977
23267
  },
22978
23268
  "description": "Alerts watching this value, keyed by slug; each moves between `ok` and `firing` and writes an org event on every transition. No mail is sent. **The key is the identity**, so renaming an alert is a delete plus a create: its runtime state is lost, and an alert that is still true fires again."
23269
+ },
23270
+ "role": {
23271
+ "anyOf": [
23272
+ {
23273
+ "type": "string",
23274
+ "pattern": "^(?!defaults$)[a-z][a-z0-9_]{0,62}$"
23275
+ },
23276
+ {
23277
+ "minItems": 1,
23278
+ "maxItems": 50,
23279
+ "type": "array",
23280
+ "items": {
23281
+ "type": "string",
23282
+ "pattern": "^(?!defaults$)[a-z][a-z0-9_]{0,62}$"
23283
+ }
23284
+ }
23285
+ ],
23286
+ "description": "Which role may read this datapoint: one role key, or a list of keys when several roles qualify. A role qualifies when it, or a role it inherits from, is named. Without this, the first rule of `access.rules` that fits the entry decides, and without a fitting rule the organization's default for `read` applies. A key that names no role of the organization is a warning when you publish, never an error, and grants nothing. The robot ignores it; the cloud enforces it."
22979
23287
  }
22980
23288
  },
22981
23289
  "required": [
@@ -22984,7 +23292,7 @@
22984
23292
  ],
22985
23293
  "additionalProperties": false
22986
23294
  },
22987
- "description": "Values the robot publishes, each one field of one topic or a whole topic, and **never several topics**. Keys are slugs, one namespace across all five exposure sections, which is what lets a role grant say `{robot, slug}` without naming a kind; `bridge_state` and `robot_details` are built-in, and `history` is reserved because `GET …/jobs/history` would shadow an action of that name; all three are refused when the document is validated."
23295
+ "description": "Values the robot publishes, each one field of one topic or a whole topic, and **never several topics**. Keys are slugs, one namespace across all five exposure sections, which is what lets an app lock name `{robot, slug}` without naming a kind; `bridge_state` and `robot_details` are built-in, `history` is reserved because `GET …/jobs/history` would shadow an action of that name, and `assets` and `job_history` are reserved because they name the robot-level capabilities; all five are refused when the document is validated."
22988
23296
  },
22989
23297
  "actions": {
22990
23298
  "type": "object",
@@ -23126,6 +23434,24 @@
23126
23434
  "type": "string",
23127
23435
  "minLength": 1,
23128
23436
  "maxLength": 2000
23437
+ },
23438
+ "role": {
23439
+ "anyOf": [
23440
+ {
23441
+ "type": "string",
23442
+ "pattern": "^(?!defaults$)[a-z][a-z0-9_]{0,62}$"
23443
+ },
23444
+ {
23445
+ "minItems": 1,
23446
+ "maxItems": 50,
23447
+ "type": "array",
23448
+ "items": {
23449
+ "type": "string",
23450
+ "pattern": "^(?!defaults$)[a-z][a-z0-9_]{0,62}$"
23451
+ }
23452
+ }
23453
+ ],
23454
+ "description": "Which role may start this action: one role key, or a list of keys when several roles qualify. A role qualifies when it, or a role it inherits from, is named. Without this, the first rule of `access.rules` that fits the entry decides, and without a fitting rule the organization's default for `invoke` applies. A key that names no role of the organization is a warning when you publish, never an error, and grants nothing. The robot ignores it; the cloud enforces it."
23129
23455
  }
23130
23456
  },
23131
23457
  "required": [
@@ -23134,7 +23460,7 @@
23134
23460
  ],
23135
23461
  "additionalProperties": false
23136
23462
  },
23137
- "description": "Things the robot does on request that take time, each reported as a job with progress. **At most one job runs per action slug**: a second call is refused `busy`, and every observer of that slug watches the same job. Keys are slugs, one namespace across all five exposure sections, which is what lets a role grant say `{robot, slug}` without naming a kind; `bridge_state` and `robot_details` are built-in, and `history` is reserved because `GET …/jobs/history` would shadow an action of that name; all three are refused when the document is validated."
23463
+ "description": "Things the robot does on request that take time, each reported as a job with progress. **At most one job runs per action slug**: a second call is refused `busy`, and every observer of that slug watches the same job. Keys are slugs, one namespace across all five exposure sections, which is what lets an app lock name `{robot, slug}` without naming a kind; `bridge_state` and `robot_details` are built-in, `history` is reserved because `GET …/jobs/history` would shadow an action of that name, and `assets` and `job_history` are reserved because they name the robot-level capabilities; all five are refused when the document is validated."
23138
23464
  },
23139
23465
  "services": {
23140
23466
  "type": "object",
@@ -23276,6 +23602,24 @@
23276
23602
  "type": "string",
23277
23603
  "minLength": 1,
23278
23604
  "maxLength": 2000
23605
+ },
23606
+ "role": {
23607
+ "anyOf": [
23608
+ {
23609
+ "type": "string",
23610
+ "pattern": "^(?!defaults$)[a-z][a-z0-9_]{0,62}$"
23611
+ },
23612
+ {
23613
+ "minItems": 1,
23614
+ "maxItems": 50,
23615
+ "type": "array",
23616
+ "items": {
23617
+ "type": "string",
23618
+ "pattern": "^(?!defaults$)[a-z][a-z0-9_]{0,62}$"
23619
+ }
23620
+ }
23621
+ ],
23622
+ "description": "Which role may call this service: one role key, or a list of keys when several roles qualify. A role qualifies when it, or a role it inherits from, is named. Without this, the first rule of `access.rules` that fits the entry decides, and without a fitting rule the organization's default for `invoke` applies. A key that names no role of the organization is a warning when you publish, never an error, and grants nothing. The robot ignores it; the cloud enforces it."
23279
23623
  }
23280
23624
  },
23281
23625
  "required": [
@@ -23284,7 +23628,7 @@
23284
23628
  ],
23285
23629
  "additionalProperties": false
23286
23630
  },
23287
- "description": "ROS service calls the robot answers — one request, one reply. Unlike an action a service reports **no progress** and the call returns with its result already on the job, so there is nothing left to observe; a second concurrent call is still refused `busy`, exactly as for an action. Keys are slugs, one namespace across all five exposure sections, which is what lets a role grant say `{robot, slug}` without naming a kind; `bridge_state` and `robot_details` are built-in, and `history` is reserved because `GET …/jobs/history` would shadow an action of that name; all three are refused when the document is validated."
23631
+ "description": "ROS service calls the robot answers — one request, one reply. Unlike an action a service reports **no progress** and the call returns with its result already on the job, so there is nothing left to observe; a second concurrent call is still refused `busy`, exactly as for an action. Keys are slugs, one namespace across all five exposure sections, which is what lets an app lock name `{robot, slug}` without naming a kind; `bridge_state` and `robot_details` are built-in, `history` is reserved because `GET …/jobs/history` would shadow an action of that name, and `assets` and `job_history` are reserved because they name the robot-level capabilities; all five are refused when the document is validated."
23288
23632
  },
23289
23633
  "publishers": {
23290
23634
  "type": "object",
@@ -23459,6 +23803,24 @@
23459
23803
  "type": "string",
23460
23804
  "minLength": 1,
23461
23805
  "maxLength": 2000
23806
+ },
23807
+ "role": {
23808
+ "anyOf": [
23809
+ {
23810
+ "type": "string",
23811
+ "pattern": "^(?!defaults$)[a-z][a-z0-9_]{0,62}$"
23812
+ },
23813
+ {
23814
+ "minItems": 1,
23815
+ "maxItems": 50,
23816
+ "type": "array",
23817
+ "items": {
23818
+ "type": "string",
23819
+ "pattern": "^(?!defaults$)[a-z][a-z0-9_]{0,62}$"
23820
+ }
23821
+ }
23822
+ ],
23823
+ "description": "Which role may send to this publisher, which is what driving the robot is: one role key, or a list of keys when several roles qualify. A role qualifies when it, or a role it inherits from, is named. Without this, the first rule of `access.rules` that fits the entry decides, and without a fitting rule the organization's default for `publish` applies. A key that names no role of the organization is a warning when you publish, never an error, and grants nothing. The robot ignores it; the cloud enforces it."
23462
23824
  }
23463
23825
  },
23464
23826
  "required": [
@@ -23470,7 +23832,7 @@
23470
23832
  ],
23471
23833
  "additionalProperties": false
23472
23834
  },
23473
- "description": "Topics clients may send to, and where the format's whole safety story lives. The `message` template fixes every value a caller cannot change, and **`failsafe` is required**: once a client falls silent the bridge sends the failsafe message itself, so an operator whose window closed does not leave a robot driving. Keys are slugs, one namespace across all five exposure sections, which is what lets a role grant say `{robot, slug}` without naming a kind; `bridge_state` and `robot_details` are built-in, and `history` is reserved because `GET …/jobs/history` would shadow an action of that name; all three are refused when the document is validated."
23835
+ "description": "Topics clients may send to, and where the format's whole safety story lives. The `message` template fixes every value a caller cannot change, and **`failsafe` is required**: once a client falls silent the bridge sends the failsafe message itself, so an operator whose window closed does not leave a robot driving. Keys are slugs, one namespace across all five exposure sections, which is what lets an app lock name `{robot, slug}` without naming a kind; `bridge_state` and `robot_details` are built-in, `history` is reserved because `GET …/jobs/history` would shadow an action of that name, and `assets` and `job_history` are reserved because they name the robot-level capabilities; all five are refused when the document is validated."
23474
23836
  },
23475
23837
  "cameras": {
23476
23838
  "type": "object",
@@ -23706,6 +24068,24 @@
23706
24068
  "type": "string",
23707
24069
  "minLength": 1,
23708
24070
  "maxLength": 2000
24071
+ },
24072
+ "role": {
24073
+ "anyOf": [
24074
+ {
24075
+ "type": "string",
24076
+ "pattern": "^(?!defaults$)[a-z][a-z0-9_]{0,62}$"
24077
+ },
24078
+ {
24079
+ "minItems": 1,
24080
+ "maxItems": 50,
24081
+ "type": "array",
24082
+ "items": {
24083
+ "type": "string",
24084
+ "pattern": "^(?!defaults$)[a-z][a-z0-9_]{0,62}$"
24085
+ }
24086
+ }
24087
+ ],
24088
+ "description": "Which role may see this camera: one role key, or a list of keys when several roles qualify. A role qualifies when it, or a role it inherits from, is named. Without this, the first rule of `access.rules` that fits the entry decides, and without a fitting rule the organization's default for `read` applies. A key that names no role of the organization is a warning when you publish, never an error, and grants nothing. The robot ignores it; the cloud enforces it."
23709
24089
  }
23710
24090
  },
23711
24091
  "required": [
@@ -23718,7 +24098,103 @@
23718
24098
  ],
23719
24099
  "additionalProperties": false
23720
24100
  },
23721
- "description": "Video the robot streams, and the still frames the cloud serves from it. `width`, `height`, `fps` and `bitrate_kbps` are what **the bridge produces before sending**, not what the camera captures — they live in the configuration rather than in a viewer's request precisely so that no viewer can make a robot send more. Keys are slugs, one namespace across all five exposure sections, which is what lets a role grant say `{robot, slug}` without naming a kind; `bridge_state` and `robot_details` are built-in, and `history` is reserved because `GET …/jobs/history` would shadow an action of that name; all three are refused when the document is validated."
24101
+ "description": "Video the robot streams, and the still frames the cloud serves from it. `width`, `height`, `fps` and `bitrate_kbps` are what **the bridge produces before sending**, not what the camera captures — they live in the configuration rather than in a viewer's request precisely so that no viewer can make a robot send more. Keys are slugs, one namespace across all five exposure sections, which is what lets an app lock name `{robot, slug}` without naming a kind; `bridge_state` and `robot_details` are built-in, `history` is reserved because `GET …/jobs/history` would shadow an action of that name, and `assets` and `job_history` are reserved because they name the robot-level capabilities; all five are refused when the document is validated."
24102
+ },
24103
+ "access": {
24104
+ "type": "object",
24105
+ "properties": {
24106
+ "rules": {
24107
+ "maxItems": 100,
24108
+ "type": "array",
24109
+ "items": {
24110
+ "type": "object",
24111
+ "properties": {
24112
+ "match": {
24113
+ "type": "string",
24114
+ "maxLength": 255,
24115
+ "pattern": "^(?:\\/(?:\\*\\*|(?![A-Za-z0-9_*]*\\*\\*)(?:\\*|[A-Za-z_])[A-Za-z0-9_*]*))+$",
24116
+ "description": "A glob over the ROS name an entry is exposed by: the `topic` of a datapoint or a publisher, the `ros_name` of a service or an action, the source topic of a camera that reads a ROS topic. `*` stands for one name segment, or for any characters inside one (`/joint_*`); `**` stands for any number of segments, none included, so `/arm/**` fits `/arm` and everything below it. Always absolute."
24117
+ },
24118
+ "kinds": {
24119
+ "minItems": 1,
24120
+ "maxItems": 3,
24121
+ "type": "array",
24122
+ "items": {
24123
+ "type": "string",
24124
+ "enum": [
24125
+ "read",
24126
+ "invoke",
24127
+ "publish"
24128
+ ]
24129
+ },
24130
+ "description": "Narrows the rule to some kinds of access. Without it the rule fits entries of every kind."
24131
+ },
24132
+ "role": {
24133
+ "anyOf": [
24134
+ {
24135
+ "type": "string",
24136
+ "pattern": "^(?!defaults$)[a-z][a-z0-9_]{0,62}$"
24137
+ },
24138
+ {
24139
+ "minItems": 1,
24140
+ "maxItems": 50,
24141
+ "type": "array",
24142
+ "items": {
24143
+ "type": "string",
24144
+ "pattern": "^(?!defaults$)[a-z][a-z0-9_]{0,62}$"
24145
+ }
24146
+ }
24147
+ ],
24148
+ "description": "The role that may use what this rule fits: one key, or a list of keys when several roles qualify. A role qualifies when it, or a role it inherits from, is named. A key that names no role of the organization is a warning when you publish and grants nothing."
24149
+ }
24150
+ },
24151
+ "required": [
24152
+ "match",
24153
+ "role"
24154
+ ],
24155
+ "additionalProperties": false
24156
+ },
24157
+ "description": "Ordered rules that give a role to every entry whose ROS name fits `match`, so a whole namespace is covered by one line. For an entry the order of precedence is its own `role`, then the first rule that fits it, then the organization's default for its kind. A rule that fits no entry of this document is a warning and changes nothing."
24158
+ },
24159
+ "assets": {
24160
+ "anyOf": [
24161
+ {
24162
+ "type": "string",
24163
+ "pattern": "^(?!defaults$)[a-z][a-z0-9_]{0,62}$"
24164
+ },
24165
+ {
24166
+ "minItems": 1,
24167
+ "maxItems": 50,
24168
+ "type": "array",
24169
+ "items": {
24170
+ "type": "string",
24171
+ "pattern": "^(?!defaults$)[a-z][a-z0-9_]{0,62}$"
24172
+ }
24173
+ }
24174
+ ],
24175
+ "description": "Who may use this robot's asset store — the meshes and the URDF a viewer draws it from — in place of the organization's default for `assets`. One role key, or a list of keys."
24176
+ },
24177
+ "job_history": {
24178
+ "anyOf": [
24179
+ {
24180
+ "type": "string",
24181
+ "pattern": "^(?!defaults$)[a-z][a-z0-9_]{0,62}$"
24182
+ },
24183
+ {
24184
+ "minItems": 1,
24185
+ "maxItems": 50,
24186
+ "type": "array",
24187
+ "items": {
24188
+ "type": "string",
24189
+ "pattern": "^(?!defaults$)[a-z][a-z0-9_]{0,62}$"
24190
+ }
24191
+ }
24192
+ ],
24193
+ "description": "Who may read this robot's job history, in place of the organization's default for `job_history`. One role key, or a list of keys. A run names the person who started it, so whoever may read the history learns who else has been driving the robot."
24194
+ }
24195
+ },
24196
+ "additionalProperties": false,
24197
+ "description": "Who may use what on this robot, beyond the `role` an entry can carry itself: ordered `rules` over ROS name patterns, and the robot-level `assets` and `job_history`. Everything in it is optional. For an entry the precedence is its own `role`, then the first rule that fits, then the organization's default for its kind; only the published version counts. The robot ignores this section."
23722
24198
  },
23723
24199
  "low_bandwidth": {
23724
24200
  "description": "Overrides for the bridge's low-bandwidth mode; see the section schema.",
@@ -23806,6 +24282,36 @@
23806
24282
  }
23807
24283
  ]
23808
24284
  },
24285
+ "updated_by": {
24286
+ "description": "Who saved the draft last. `null` when nobody has saved it yet, when the cloud itself rewrote it (a slug rename), when the member has since been removed, or when the draft is older than this field. Absent when the server predates this field: read an absent field as unknown, the same as `null`. The cloud always sends it.",
24287
+ "anyOf": [
24288
+ {
24289
+ "type": "object",
24290
+ "properties": {
24291
+ "id": {
24292
+ "type": "string",
24293
+ "format": "uuid",
24294
+ "pattern": "^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$",
24295
+ "description": "The team member's id."
24296
+ },
24297
+ "name": {
24298
+ "type": "string",
24299
+ "minLength": 1,
24300
+ "maxLength": 200,
24301
+ "description": "The member's display name, or the local part of the email address when the member has none. Never a full email address."
24302
+ }
24303
+ },
24304
+ "required": [
24305
+ "id",
24306
+ "name"
24307
+ ],
24308
+ "additionalProperties": false
24309
+ },
24310
+ {
24311
+ "type": "null"
24312
+ }
24313
+ ]
24314
+ },
23809
24315
  "issues": {
23810
24316
  "type": "array",
23811
24317
  "items": {
@@ -23873,6 +24379,36 @@
23873
24379
  "format": "date-time",
23874
24380
  "pattern": "^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d(?::[0-5]\\d(?:\\.\\d+)?)?(?:Z))$"
23875
24381
  },
24382
+ "published_by": {
24383
+ "description": "Who published the version. `null` when the member has since been removed, or when the version is older than this field. Absent when the server predates this field: read an absent field as unknown, the same as `null`. The cloud always sends it.",
24384
+ "anyOf": [
24385
+ {
24386
+ "type": "object",
24387
+ "properties": {
24388
+ "id": {
24389
+ "type": "string",
24390
+ "format": "uuid",
24391
+ "pattern": "^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$",
24392
+ "description": "The team member's id."
24393
+ },
24394
+ "name": {
24395
+ "type": "string",
24396
+ "minLength": 1,
24397
+ "maxLength": 200,
24398
+ "description": "The member's display name, or the local part of the email address when the member has none. Never a full email address."
24399
+ }
24400
+ },
24401
+ "required": [
24402
+ "id",
24403
+ "name"
24404
+ ],
24405
+ "additionalProperties": false
24406
+ },
24407
+ {
24408
+ "type": "null"
24409
+ }
24410
+ ]
24411
+ },
23876
24412
  "doc": {
23877
24413
  "type": "object",
23878
24414
  "properties": {
@@ -24138,6 +24674,24 @@
24138
24674
  "additionalProperties": false
24139
24675
  },
24140
24676
  "description": "Alerts watching this value, keyed by slug; each moves between `ok` and `firing` and writes an org event on every transition. No mail is sent. **The key is the identity**, so renaming an alert is a delete plus a create: its runtime state is lost, and an alert that is still true fires again."
24677
+ },
24678
+ "role": {
24679
+ "anyOf": [
24680
+ {
24681
+ "type": "string",
24682
+ "pattern": "^(?!defaults$)[a-z][a-z0-9_]{0,62}$"
24683
+ },
24684
+ {
24685
+ "minItems": 1,
24686
+ "maxItems": 50,
24687
+ "type": "array",
24688
+ "items": {
24689
+ "type": "string",
24690
+ "pattern": "^(?!defaults$)[a-z][a-z0-9_]{0,62}$"
24691
+ }
24692
+ }
24693
+ ],
24694
+ "description": "Which role may read this datapoint: one role key, or a list of keys when several roles qualify. A role qualifies when it, or a role it inherits from, is named. Without this, the first rule of `access.rules` that fits the entry decides, and without a fitting rule the organization's default for `read` applies. A key that names no role of the organization is a warning when you publish, never an error, and grants nothing. The robot ignores it; the cloud enforces it."
24141
24695
  }
24142
24696
  },
24143
24697
  "required": [
@@ -24146,7 +24700,7 @@
24146
24700
  ],
24147
24701
  "additionalProperties": false
24148
24702
  },
24149
- "description": "Values the robot publishes, each one field of one topic or a whole topic, and **never several topics**. Keys are slugs, one namespace across all five exposure sections, which is what lets a role grant say `{robot, slug}` without naming a kind; `bridge_state` and `robot_details` are built-in, and `history` is reserved because `GET …/jobs/history` would shadow an action of that name; all three are refused when the document is validated."
24703
+ "description": "Values the robot publishes, each one field of one topic or a whole topic, and **never several topics**. Keys are slugs, one namespace across all five exposure sections, which is what lets an app lock name `{robot, slug}` without naming a kind; `bridge_state` and `robot_details` are built-in, `history` is reserved because `GET …/jobs/history` would shadow an action of that name, and `assets` and `job_history` are reserved because they name the robot-level capabilities; all five are refused when the document is validated."
24150
24704
  },
24151
24705
  "actions": {
24152
24706
  "type": "object",
@@ -24288,6 +24842,24 @@
24288
24842
  "type": "string",
24289
24843
  "minLength": 1,
24290
24844
  "maxLength": 2000
24845
+ },
24846
+ "role": {
24847
+ "anyOf": [
24848
+ {
24849
+ "type": "string",
24850
+ "pattern": "^(?!defaults$)[a-z][a-z0-9_]{0,62}$"
24851
+ },
24852
+ {
24853
+ "minItems": 1,
24854
+ "maxItems": 50,
24855
+ "type": "array",
24856
+ "items": {
24857
+ "type": "string",
24858
+ "pattern": "^(?!defaults$)[a-z][a-z0-9_]{0,62}$"
24859
+ }
24860
+ }
24861
+ ],
24862
+ "description": "Which role may start this action: one role key, or a list of keys when several roles qualify. A role qualifies when it, or a role it inherits from, is named. Without this, the first rule of `access.rules` that fits the entry decides, and without a fitting rule the organization's default for `invoke` applies. A key that names no role of the organization is a warning when you publish, never an error, and grants nothing. The robot ignores it; the cloud enforces it."
24291
24863
  }
24292
24864
  },
24293
24865
  "required": [
@@ -24296,7 +24868,7 @@
24296
24868
  ],
24297
24869
  "additionalProperties": false
24298
24870
  },
24299
- "description": "Things the robot does on request that take time, each reported as a job with progress. **At most one job runs per action slug**: a second call is refused `busy`, and every observer of that slug watches the same job. Keys are slugs, one namespace across all five exposure sections, which is what lets a role grant say `{robot, slug}` without naming a kind; `bridge_state` and `robot_details` are built-in, and `history` is reserved because `GET …/jobs/history` would shadow an action of that name; all three are refused when the document is validated."
24871
+ "description": "Things the robot does on request that take time, each reported as a job with progress. **At most one job runs per action slug**: a second call is refused `busy`, and every observer of that slug watches the same job. Keys are slugs, one namespace across all five exposure sections, which is what lets an app lock name `{robot, slug}` without naming a kind; `bridge_state` and `robot_details` are built-in, `history` is reserved because `GET …/jobs/history` would shadow an action of that name, and `assets` and `job_history` are reserved because they name the robot-level capabilities; all five are refused when the document is validated."
24300
24872
  },
24301
24873
  "services": {
24302
24874
  "type": "object",
@@ -24438,6 +25010,24 @@
24438
25010
  "type": "string",
24439
25011
  "minLength": 1,
24440
25012
  "maxLength": 2000
25013
+ },
25014
+ "role": {
25015
+ "anyOf": [
25016
+ {
25017
+ "type": "string",
25018
+ "pattern": "^(?!defaults$)[a-z][a-z0-9_]{0,62}$"
25019
+ },
25020
+ {
25021
+ "minItems": 1,
25022
+ "maxItems": 50,
25023
+ "type": "array",
25024
+ "items": {
25025
+ "type": "string",
25026
+ "pattern": "^(?!defaults$)[a-z][a-z0-9_]{0,62}$"
25027
+ }
25028
+ }
25029
+ ],
25030
+ "description": "Which role may call this service: one role key, or a list of keys when several roles qualify. A role qualifies when it, or a role it inherits from, is named. Without this, the first rule of `access.rules` that fits the entry decides, and without a fitting rule the organization's default for `invoke` applies. A key that names no role of the organization is a warning when you publish, never an error, and grants nothing. The robot ignores it; the cloud enforces it."
24441
25031
  }
24442
25032
  },
24443
25033
  "required": [
@@ -24446,7 +25036,7 @@
24446
25036
  ],
24447
25037
  "additionalProperties": false
24448
25038
  },
24449
- "description": "ROS service calls the robot answers — one request, one reply. Unlike an action a service reports **no progress** and the call returns with its result already on the job, so there is nothing left to observe; a second concurrent call is still refused `busy`, exactly as for an action. Keys are slugs, one namespace across all five exposure sections, which is what lets a role grant say `{robot, slug}` without naming a kind; `bridge_state` and `robot_details` are built-in, and `history` is reserved because `GET …/jobs/history` would shadow an action of that name; all three are refused when the document is validated."
25039
+ "description": "ROS service calls the robot answers — one request, one reply. Unlike an action a service reports **no progress** and the call returns with its result already on the job, so there is nothing left to observe; a second concurrent call is still refused `busy`, exactly as for an action. Keys are slugs, one namespace across all five exposure sections, which is what lets an app lock name `{robot, slug}` without naming a kind; `bridge_state` and `robot_details` are built-in, `history` is reserved because `GET …/jobs/history` would shadow an action of that name, and `assets` and `job_history` are reserved because they name the robot-level capabilities; all five are refused when the document is validated."
24450
25040
  },
24451
25041
  "publishers": {
24452
25042
  "type": "object",
@@ -24621,6 +25211,24 @@
24621
25211
  "type": "string",
24622
25212
  "minLength": 1,
24623
25213
  "maxLength": 2000
25214
+ },
25215
+ "role": {
25216
+ "anyOf": [
25217
+ {
25218
+ "type": "string",
25219
+ "pattern": "^(?!defaults$)[a-z][a-z0-9_]{0,62}$"
25220
+ },
25221
+ {
25222
+ "minItems": 1,
25223
+ "maxItems": 50,
25224
+ "type": "array",
25225
+ "items": {
25226
+ "type": "string",
25227
+ "pattern": "^(?!defaults$)[a-z][a-z0-9_]{0,62}$"
25228
+ }
25229
+ }
25230
+ ],
25231
+ "description": "Which role may send to this publisher, which is what driving the robot is: one role key, or a list of keys when several roles qualify. A role qualifies when it, or a role it inherits from, is named. Without this, the first rule of `access.rules` that fits the entry decides, and without a fitting rule the organization's default for `publish` applies. A key that names no role of the organization is a warning when you publish, never an error, and grants nothing. The robot ignores it; the cloud enforces it."
24624
25232
  }
24625
25233
  },
24626
25234
  "required": [
@@ -24632,7 +25240,7 @@
24632
25240
  ],
24633
25241
  "additionalProperties": false
24634
25242
  },
24635
- "description": "Topics clients may send to, and where the format's whole safety story lives. The `message` template fixes every value a caller cannot change, and **`failsafe` is required**: once a client falls silent the bridge sends the failsafe message itself, so an operator whose window closed does not leave a robot driving. Keys are slugs, one namespace across all five exposure sections, which is what lets a role grant say `{robot, slug}` without naming a kind; `bridge_state` and `robot_details` are built-in, and `history` is reserved because `GET …/jobs/history` would shadow an action of that name; all three are refused when the document is validated."
25243
+ "description": "Topics clients may send to, and where the format's whole safety story lives. The `message` template fixes every value a caller cannot change, and **`failsafe` is required**: once a client falls silent the bridge sends the failsafe message itself, so an operator whose window closed does not leave a robot driving. Keys are slugs, one namespace across all five exposure sections, which is what lets an app lock name `{robot, slug}` without naming a kind; `bridge_state` and `robot_details` are built-in, `history` is reserved because `GET …/jobs/history` would shadow an action of that name, and `assets` and `job_history` are reserved because they name the robot-level capabilities; all five are refused when the document is validated."
24636
25244
  },
24637
25245
  "cameras": {
24638
25246
  "type": "object",
@@ -24868,6 +25476,24 @@
24868
25476
  "type": "string",
24869
25477
  "minLength": 1,
24870
25478
  "maxLength": 2000
25479
+ },
25480
+ "role": {
25481
+ "anyOf": [
25482
+ {
25483
+ "type": "string",
25484
+ "pattern": "^(?!defaults$)[a-z][a-z0-9_]{0,62}$"
25485
+ },
25486
+ {
25487
+ "minItems": 1,
25488
+ "maxItems": 50,
25489
+ "type": "array",
25490
+ "items": {
25491
+ "type": "string",
25492
+ "pattern": "^(?!defaults$)[a-z][a-z0-9_]{0,62}$"
25493
+ }
25494
+ }
25495
+ ],
25496
+ "description": "Which role may see this camera: one role key, or a list of keys when several roles qualify. A role qualifies when it, or a role it inherits from, is named. Without this, the first rule of `access.rules` that fits the entry decides, and without a fitting rule the organization's default for `read` applies. A key that names no role of the organization is a warning when you publish, never an error, and grants nothing. The robot ignores it; the cloud enforces it."
24871
25497
  }
24872
25498
  },
24873
25499
  "required": [
@@ -24880,7 +25506,103 @@
24880
25506
  ],
24881
25507
  "additionalProperties": false
24882
25508
  },
24883
- "description": "Video the robot streams, and the still frames the cloud serves from it. `width`, `height`, `fps` and `bitrate_kbps` are what **the bridge produces before sending**, not what the camera captures — they live in the configuration rather than in a viewer's request precisely so that no viewer can make a robot send more. Keys are slugs, one namespace across all five exposure sections, which is what lets a role grant say `{robot, slug}` without naming a kind; `bridge_state` and `robot_details` are built-in, and `history` is reserved because `GET …/jobs/history` would shadow an action of that name; all three are refused when the document is validated."
25509
+ "description": "Video the robot streams, and the still frames the cloud serves from it. `width`, `height`, `fps` and `bitrate_kbps` are what **the bridge produces before sending**, not what the camera captures — they live in the configuration rather than in a viewer's request precisely so that no viewer can make a robot send more. Keys are slugs, one namespace across all five exposure sections, which is what lets an app lock name `{robot, slug}` without naming a kind; `bridge_state` and `robot_details` are built-in, `history` is reserved because `GET …/jobs/history` would shadow an action of that name, and `assets` and `job_history` are reserved because they name the robot-level capabilities; all five are refused when the document is validated."
25510
+ },
25511
+ "access": {
25512
+ "type": "object",
25513
+ "properties": {
25514
+ "rules": {
25515
+ "maxItems": 100,
25516
+ "type": "array",
25517
+ "items": {
25518
+ "type": "object",
25519
+ "properties": {
25520
+ "match": {
25521
+ "type": "string",
25522
+ "maxLength": 255,
25523
+ "pattern": "^(?:\\/(?:\\*\\*|(?![A-Za-z0-9_*]*\\*\\*)(?:\\*|[A-Za-z_])[A-Za-z0-9_*]*))+$",
25524
+ "description": "A glob over the ROS name an entry is exposed by: the `topic` of a datapoint or a publisher, the `ros_name` of a service or an action, the source topic of a camera that reads a ROS topic. `*` stands for one name segment, or for any characters inside one (`/joint_*`); `**` stands for any number of segments, none included, so `/arm/**` fits `/arm` and everything below it. Always absolute."
25525
+ },
25526
+ "kinds": {
25527
+ "minItems": 1,
25528
+ "maxItems": 3,
25529
+ "type": "array",
25530
+ "items": {
25531
+ "type": "string",
25532
+ "enum": [
25533
+ "read",
25534
+ "invoke",
25535
+ "publish"
25536
+ ]
25537
+ },
25538
+ "description": "Narrows the rule to some kinds of access. Without it the rule fits entries of every kind."
25539
+ },
25540
+ "role": {
25541
+ "anyOf": [
25542
+ {
25543
+ "type": "string",
25544
+ "pattern": "^(?!defaults$)[a-z][a-z0-9_]{0,62}$"
25545
+ },
25546
+ {
25547
+ "minItems": 1,
25548
+ "maxItems": 50,
25549
+ "type": "array",
25550
+ "items": {
25551
+ "type": "string",
25552
+ "pattern": "^(?!defaults$)[a-z][a-z0-9_]{0,62}$"
25553
+ }
25554
+ }
25555
+ ],
25556
+ "description": "The role that may use what this rule fits: one key, or a list of keys when several roles qualify. A role qualifies when it, or a role it inherits from, is named. A key that names no role of the organization is a warning when you publish and grants nothing."
25557
+ }
25558
+ },
25559
+ "required": [
25560
+ "match",
25561
+ "role"
25562
+ ],
25563
+ "additionalProperties": false
25564
+ },
25565
+ "description": "Ordered rules that give a role to every entry whose ROS name fits `match`, so a whole namespace is covered by one line. For an entry the order of precedence is its own `role`, then the first rule that fits it, then the organization's default for its kind. A rule that fits no entry of this document is a warning and changes nothing."
25566
+ },
25567
+ "assets": {
25568
+ "anyOf": [
25569
+ {
25570
+ "type": "string",
25571
+ "pattern": "^(?!defaults$)[a-z][a-z0-9_]{0,62}$"
25572
+ },
25573
+ {
25574
+ "minItems": 1,
25575
+ "maxItems": 50,
25576
+ "type": "array",
25577
+ "items": {
25578
+ "type": "string",
25579
+ "pattern": "^(?!defaults$)[a-z][a-z0-9_]{0,62}$"
25580
+ }
25581
+ }
25582
+ ],
25583
+ "description": "Who may use this robot's asset store — the meshes and the URDF a viewer draws it from — in place of the organization's default for `assets`. One role key, or a list of keys."
25584
+ },
25585
+ "job_history": {
25586
+ "anyOf": [
25587
+ {
25588
+ "type": "string",
25589
+ "pattern": "^(?!defaults$)[a-z][a-z0-9_]{0,62}$"
25590
+ },
25591
+ {
25592
+ "minItems": 1,
25593
+ "maxItems": 50,
25594
+ "type": "array",
25595
+ "items": {
25596
+ "type": "string",
25597
+ "pattern": "^(?!defaults$)[a-z][a-z0-9_]{0,62}$"
25598
+ }
25599
+ }
25600
+ ],
25601
+ "description": "Who may read this robot's job history, in place of the organization's default for `job_history`. One role key, or a list of keys. A run names the person who started it, so whoever may read the history learns who else has been driving the robot."
25602
+ }
25603
+ },
25604
+ "additionalProperties": false,
25605
+ "description": "Who may use what on this robot, beyond the `role` an entry can carry itself: ordered `rules` over ROS name patterns, and the robot-level `assets` and `job_history`. Everything in it is optional. For an entry the precedence is its own `role`, then the first rule that fits, then the organization's default for its kind; only the published version counts. The robot ignores this section."
24884
25606
  },
24885
25607
  "low_bandwidth": {
24886
25608
  "description": "Overrides for the bridge's low-bandwidth mode; see the section schema.",
@@ -24977,6 +25699,36 @@
24977
25699
  "type": "string",
24978
25700
  "format": "date-time",
24979
25701
  "pattern": "^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d(?::[0-5]\\d(?:\\.\\d+)?)?(?:Z))$"
25702
+ },
25703
+ "published_by": {
25704
+ "description": "Who published the version. `null` when the member has since been removed, or when the version is older than this field. Absent when the server predates this field: read an absent field as unknown, the same as `null`. The cloud always sends it.",
25705
+ "anyOf": [
25706
+ {
25707
+ "type": "object",
25708
+ "properties": {
25709
+ "id": {
25710
+ "type": "string",
25711
+ "format": "uuid",
25712
+ "pattern": "^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$",
25713
+ "description": "The team member's id."
25714
+ },
25715
+ "name": {
25716
+ "type": "string",
25717
+ "minLength": 1,
25718
+ "maxLength": 200,
25719
+ "description": "The member's display name, or the local part of the email address when the member has none. Never a full email address."
25720
+ }
25721
+ },
25722
+ "required": [
25723
+ "id",
25724
+ "name"
25725
+ ],
25726
+ "additionalProperties": false
25727
+ },
25728
+ {
25729
+ "type": "null"
25730
+ }
25731
+ ]
24980
25732
  }
24981
25733
  },
24982
25734
  "required": [
@@ -25392,11 +26144,10 @@
25392
26144
  "pattern": "^(?!\\.)(?!.*\\.\\.)([A-Za-z0-9_'+\\-\\.]*)[A-Za-z0-9_+-]@([A-Za-z0-9][A-Za-z0-9\\-]*\\.)+[A-Za-z]{2,}$",
25393
26145
  "description": "The address to invite. An invitation always bypasses the domain whitelist — a developer inviting somebody by hand has already made the decision the whitelist automates."
25394
26146
  },
25395
- "role_id": {
25396
- "description": "The role the invitee gets on acceptance. Absent means the app's `default_role_id`.",
26147
+ "role": {
26148
+ "description": "The role the invitee gets on acceptance, by key. Absent means the app's `default_role`, and `409 target_state_conflict` naming `default_role` when the app has none. A key that names no role is accepted and grants nothing.",
25397
26149
  "type": "string",
25398
- "format": "uuid",
25399
- "pattern": "^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"
26150
+ "pattern": "^(?!defaults$)[a-z][a-z0-9_]{0,62}$"
25400
26151
  },
25401
26152
  "display_name": {
25402
26153
  "description": "An optional name to pre-fill the account with; the invitee can change it afterwards.",
@@ -25548,11 +26299,10 @@
25548
26299
  }
25549
26300
  ]
25550
26301
  },
25551
- "role_id": {
25552
- "description": "The role the new user holds. Absent means the app's `default_role_id`, and `409 target_state_conflict` when the app has none or its default no longer resolves; a role belonging to another app is `404 not_found`, the same refusal a role that never existed gets.",
26302
+ "role": {
26303
+ "description": "The role the new user holds, by key. Absent means the app's `default_role`, and `409 target_state_conflict` naming `default_role` when the app has none. A key that names no role is accepted and grants nothing; `GET /api/org/roles` lists it under `dangling`.",
25553
26304
  "type": "string",
25554
- "format": "uuid",
25555
- "pattern": "^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"
26305
+ "pattern": "^(?!defaults$)[a-z][a-z0-9_]{0,62}$"
25556
26306
  }
25557
26307
  },
25558
26308
  "required": [
@@ -25561,6 +26311,36 @@
25561
26311
  ],
25562
26312
  "additionalProperties": false
25563
26313
  },
26314
+ "create-org-role-request": {
26315
+ "type": "object",
26316
+ "properties": {
26317
+ "key": {
26318
+ "type": "string",
26319
+ "pattern": "^(?!defaults$)[a-z][a-z0-9_]{0,62}$",
26320
+ "description": "The new role's key, unique in the organization. Documents and assignments name the role by it."
26321
+ },
26322
+ "name": {
26323
+ "type": "string",
26324
+ "minLength": 1,
26325
+ "maxLength": 60,
26326
+ "description": "The display name, 1 to 60 characters; surrounding spaces are removed."
26327
+ },
26328
+ "inherits": {
26329
+ "description": "Keys of the roles to inherit from. A key that names no role is accepted and warns. Left out, the role inherits from nobody; a key that would lead back to this role is refused with `role_cycle`.",
26330
+ "maxItems": 50,
26331
+ "type": "array",
26332
+ "items": {
26333
+ "type": "string",
26334
+ "pattern": "^(?!defaults$)[a-z][a-z0-9_]{0,62}$"
26335
+ }
26336
+ }
26337
+ },
26338
+ "required": [
26339
+ "key",
26340
+ "name"
26341
+ ],
26342
+ "additionalProperties": false
26343
+ },
25564
26344
  "create-passkey-request": {
25565
26345
  "type": "object",
25566
26346
  "properties": {
@@ -25882,7 +26662,7 @@
25882
26662
  ],
25883
26663
  "additionalProperties": false
25884
26664
  },
25885
- "description": "Everything a client may read on this robot: the two built-ins, plus every datapoint the published configuration exposes and the caller's role grants."
26665
+ "description": "Everything a client may read on this robot: the two built-ins, plus every datapoint the published configuration exposes and the caller's role may read."
25886
26666
  }
25887
26667
  },
25888
26668
  "required": [
@@ -26202,6 +26982,315 @@
26202
26982
  ],
26203
26983
  "additionalProperties": false
26204
26984
  },
26985
+ "effective-rights-response": {
26986
+ "type": "object",
26987
+ "properties": {
26988
+ "role": {
26989
+ "anyOf": [
26990
+ {
26991
+ "type": "string"
26992
+ },
26993
+ {
26994
+ "type": "null"
26995
+ }
26996
+ ],
26997
+ "description": "The role key the answer is for: the one asked about, or the app user's own. `null` when the app user holds none."
26998
+ },
26999
+ "role_known": {
27000
+ "type": "boolean",
27001
+ "description": "Whether the key names a role of the organization. `false` means every capability below is not granted."
27002
+ },
27003
+ "user_id": {
27004
+ "anyOf": [
27005
+ {
27006
+ "type": "string",
27007
+ "format": "uuid",
27008
+ "pattern": "^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"
27009
+ },
27010
+ {
27011
+ "type": "null"
27012
+ }
27013
+ ],
27014
+ "description": "The app user asked about; `null` when a role was asked about. A user who is not `active` reaches nothing, whatever role they hold: every capability below is not granted."
27015
+ },
27016
+ "robots": {
27017
+ "type": "array",
27018
+ "items": {
27019
+ "type": "object",
27020
+ "properties": {
27021
+ "robot_id": {
27022
+ "type": "string",
27023
+ "format": "uuid",
27024
+ "pattern": "^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$",
27025
+ "description": "The robot, one that is attached to the app."
27026
+ },
27027
+ "robot_name": {
27028
+ "type": "string",
27029
+ "minLength": 1,
27030
+ "maxLength": 200,
27031
+ "description": "The robot's name."
27032
+ },
27033
+ "published_version": {
27034
+ "anyOf": [
27035
+ {
27036
+ "type": "integer",
27037
+ "exclusiveMinimum": 0,
27038
+ "maximum": 9007199254740991
27039
+ },
27040
+ {
27041
+ "type": "null"
27042
+ }
27043
+ ],
27044
+ "description": "The version of the robot's published `fleetless.yaml` that the answer was computed from; `null` when nothing is published."
27045
+ },
27046
+ "reachable": {
27047
+ "type": "boolean",
27048
+ "description": "Whether a session of this role reaches the robot at all: at least one slug or one capability is granted once the locks are applied. When `false`, `robots.describe` answers `not_found` for the robot and `robots.list` leaves it out; `capabilities` says why, and `datasheet` is the empty one."
27049
+ },
27050
+ "capabilities": {
27051
+ "type": "array",
27052
+ "items": {
27053
+ "type": "object",
27054
+ "properties": {
27055
+ "name": {
27056
+ "type": "string",
27057
+ "minLength": 2,
27058
+ "maxLength": 63,
27059
+ "pattern": "^[a-z][a-z0-9]*(?:_[a-z0-9]+)*$",
27060
+ "description": "The exposure's slug, or `assets` or `job_history` for the capabilities that belong to the robot as a whole."
27061
+ },
27062
+ "kind": {
27063
+ "type": "string",
27064
+ "enum": [
27065
+ "read",
27066
+ "invoke",
27067
+ "publish",
27068
+ "assets",
27069
+ "job_history"
27070
+ ],
27071
+ "description": "The kind of access the capability needs."
27072
+ },
27073
+ "granted": {
27074
+ "type": "boolean",
27075
+ "description": "Whether the role may use it: its requirement is met and the app has not locked it."
27076
+ },
27077
+ "requirement": {
27078
+ "type": "array",
27079
+ "items": {
27080
+ "type": "string"
27081
+ },
27082
+ "description": "The role keys that qualify, from the entry, the rule or the default that decided. Holding one of them, or inheriting from one, is enough. Empty when nobody qualifies."
27083
+ },
27084
+ "source": {
27085
+ "type": "string",
27086
+ "enum": [
27087
+ "entry",
27088
+ "rule",
27089
+ "robot",
27090
+ "org_default"
27091
+ ],
27092
+ "description": "Where the requirement came from: `entry` is the entry's own `role`, `rule` the first matching rule of `access.rules`, `robot` the robot's `access.assets` or `access.job_history`, and `org_default` the organization's default for the kind."
27093
+ },
27094
+ "rule_index": {
27095
+ "anyOf": [
27096
+ {
27097
+ "type": "integer",
27098
+ "minimum": 0,
27099
+ "maximum": 9007199254740991
27100
+ },
27101
+ {
27102
+ "type": "null"
27103
+ }
27104
+ ],
27105
+ "description": "For `rule`, the position of the deciding rule in `access.rules`, counted from zero; `null` otherwise."
27106
+ },
27107
+ "rule_match": {
27108
+ "anyOf": [
27109
+ {
27110
+ "type": "string"
27111
+ },
27112
+ {
27113
+ "type": "null"
27114
+ }
27115
+ ],
27116
+ "description": "For `rule`, that rule's `match` glob; `null` otherwise."
27117
+ },
27118
+ "satisfied_by": {
27119
+ "anyOf": [
27120
+ {
27121
+ "type": "string"
27122
+ },
27123
+ {
27124
+ "type": "null"
27125
+ }
27126
+ ],
27127
+ "description": "The key from `requirement` that the role holds through inheritance. `null` when the role is named in the requirement itself, and when it does not meet the requirement at all. Independent of locks."
27128
+ },
27129
+ "locked": {
27130
+ "type": "boolean",
27131
+ "description": "Whether the app locks this capability, as a kind or as a single lock. A lock wins over the requirement."
27132
+ },
27133
+ "unknown_roles": {
27134
+ "type": "array",
27135
+ "items": {
27136
+ "type": "string"
27137
+ },
27138
+ "description": "Keys in the requirement that name no role of the organization. They grant nothing."
27139
+ }
27140
+ },
27141
+ "required": [
27142
+ "name",
27143
+ "kind",
27144
+ "granted",
27145
+ "requirement",
27146
+ "source",
27147
+ "rule_index",
27148
+ "rule_match",
27149
+ "satisfied_by",
27150
+ "locked",
27151
+ "unknown_roles"
27152
+ ],
27153
+ "additionalProperties": false
27154
+ },
27155
+ "description": "Every capability of the published configuration, and `assets` and `job_history`, each granted or not."
27156
+ },
27157
+ "datasheet": {
27158
+ "type": "object",
27159
+ "properties": {
27160
+ "robot_id": {
27161
+ "type": "string",
27162
+ "format": "uuid",
27163
+ "pattern": "^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"
27164
+ },
27165
+ "robot_name": {
27166
+ "type": "string",
27167
+ "minLength": 1,
27168
+ "maxLength": 200
27169
+ },
27170
+ "capabilities": {
27171
+ "type": "object",
27172
+ "properties": {
27173
+ "job_history": {
27174
+ "type": "boolean"
27175
+ },
27176
+ "assets": {
27177
+ "type": "boolean"
27178
+ }
27179
+ },
27180
+ "required": [
27181
+ "job_history",
27182
+ "assets"
27183
+ ],
27184
+ "additionalProperties": false
27185
+ },
27186
+ "exposures": {
27187
+ "maxItems": 2000,
27188
+ "type": "array",
27189
+ "items": {
27190
+ "type": "object",
27191
+ "properties": {
27192
+ "slug": {
27193
+ "type": "string",
27194
+ "minLength": 2,
27195
+ "maxLength": 63,
27196
+ "pattern": "^[a-z][a-z0-9]*(?:_[a-z0-9]+)*$"
27197
+ },
27198
+ "kind": {
27199
+ "type": "string",
27200
+ "enum": [
27201
+ "datapoint",
27202
+ "service",
27203
+ "action",
27204
+ "publisher",
27205
+ "camera"
27206
+ ]
27207
+ },
27208
+ "description": {
27209
+ "anyOf": [
27210
+ {
27211
+ "type": "string",
27212
+ "maxLength": 2000
27213
+ },
27214
+ {
27215
+ "type": "null"
27216
+ }
27217
+ ]
27218
+ },
27219
+ "unit": {
27220
+ "anyOf": [
27221
+ {
27222
+ "type": "string",
27223
+ "maxLength": 32
27224
+ },
27225
+ {
27226
+ "type": "null"
27227
+ }
27228
+ ]
27229
+ },
27230
+ "decimals": {
27231
+ "anyOf": [
27232
+ {
27233
+ "type": "integer",
27234
+ "minimum": 0,
27235
+ "maximum": 6
27236
+ },
27237
+ {
27238
+ "type": "null"
27239
+ }
27240
+ ]
27241
+ },
27242
+ "input_schema": {
27243
+ "anyOf": [
27244
+ {},
27245
+ {
27246
+ "type": "null"
27247
+ }
27248
+ ]
27249
+ }
27250
+ },
27251
+ "required": [
27252
+ "slug",
27253
+ "kind",
27254
+ "description",
27255
+ "unit",
27256
+ "decimals",
27257
+ "input_schema"
27258
+ ],
27259
+ "additionalProperties": false
27260
+ }
27261
+ }
27262
+ },
27263
+ "required": [
27264
+ "robot_id",
27265
+ "robot_name",
27266
+ "capabilities",
27267
+ "exposures"
27268
+ ],
27269
+ "additionalProperties": false,
27270
+ "description": "The datasheet an MCP session of this role would get for the robot."
27271
+ }
27272
+ },
27273
+ "required": [
27274
+ "robot_id",
27275
+ "robot_name",
27276
+ "published_version",
27277
+ "reachable",
27278
+ "capabilities",
27279
+ "datasheet"
27280
+ ],
27281
+ "additionalProperties": false
27282
+ },
27283
+ "description": "The robots attached to the app, each with what the role may use."
27284
+ }
27285
+ },
27286
+ "required": [
27287
+ "role",
27288
+ "role_known",
27289
+ "user_id",
27290
+ "robots"
27291
+ ],
27292
+ "additionalProperties": false
27293
+ },
26205
27294
  "exposure-list-response": {
26206
27295
  "type": "object",
26207
27296
  "properties": {
@@ -27064,7 +28153,7 @@
27064
28153
  "action",
27065
28154
  "service"
27066
28155
  ],
27067
- "description": "Always `action` in this shape. A caller sends the same request for both kinds and cannot tell from a role grant which it invoked, so the answer says which it was rather than leaving it to be inferred from the shape."
28156
+ "description": "Always `action` in this shape. A caller sends the same request for both kinds and cannot tell from the slug alone which it invoked, so the answer says which it was rather than leaving it to be inferred from the shape."
27068
28157
  }
27069
28158
  },
27070
28159
  "required": [
@@ -29415,7 +30504,7 @@
29415
30504
  "capabilities": {
29416
30505
  "type": "object",
29417
30506
  "properties": {
29418
- "action_history": {
30507
+ "job_history": {
29419
30508
  "type": "boolean"
29420
30509
  },
29421
30510
  "assets": {
@@ -29423,7 +30512,7 @@
29423
30512
  }
29424
30513
  },
29425
30514
  "required": [
29426
- "action_history",
30515
+ "job_history",
29427
30516
  "assets"
29428
30517
  ],
29429
30518
  "additionalProperties": false
@@ -29513,139 +30602,6 @@
29513
30602
  ],
29514
30603
  "additionalProperties": false
29515
30604
  },
29516
- "mcp-role-preview-response": {
29517
- "type": "object",
29518
- "properties": {
29519
- "role_id": {
29520
- "type": "string",
29521
- "format": "uuid",
29522
- "pattern": "^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"
29523
- },
29524
- "robots": {
29525
- "maxItems": 500,
29526
- "type": "array",
29527
- "items": {
29528
- "type": "object",
29529
- "properties": {
29530
- "robot_id": {
29531
- "type": "string",
29532
- "format": "uuid",
29533
- "pattern": "^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"
29534
- },
29535
- "robot_name": {
29536
- "type": "string",
29537
- "minLength": 1,
29538
- "maxLength": 200
29539
- },
29540
- "capabilities": {
29541
- "type": "object",
29542
- "properties": {
29543
- "action_history": {
29544
- "type": "boolean"
29545
- },
29546
- "assets": {
29547
- "type": "boolean"
29548
- }
29549
- },
29550
- "required": [
29551
- "action_history",
29552
- "assets"
29553
- ],
29554
- "additionalProperties": false
29555
- },
29556
- "exposures": {
29557
- "maxItems": 2000,
29558
- "type": "array",
29559
- "items": {
29560
- "type": "object",
29561
- "properties": {
29562
- "slug": {
29563
- "type": "string",
29564
- "minLength": 2,
29565
- "maxLength": 63,
29566
- "pattern": "^[a-z][a-z0-9]*(?:_[a-z0-9]+)*$"
29567
- },
29568
- "kind": {
29569
- "type": "string",
29570
- "enum": [
29571
- "datapoint",
29572
- "service",
29573
- "action",
29574
- "publisher",
29575
- "camera"
29576
- ]
29577
- },
29578
- "description": {
29579
- "anyOf": [
29580
- {
29581
- "type": "string",
29582
- "maxLength": 2000
29583
- },
29584
- {
29585
- "type": "null"
29586
- }
29587
- ]
29588
- },
29589
- "unit": {
29590
- "anyOf": [
29591
- {
29592
- "type": "string",
29593
- "maxLength": 32
29594
- },
29595
- {
29596
- "type": "null"
29597
- }
29598
- ]
29599
- },
29600
- "decimals": {
29601
- "anyOf": [
29602
- {
29603
- "type": "integer",
29604
- "minimum": 0,
29605
- "maximum": 6
29606
- },
29607
- {
29608
- "type": "null"
29609
- }
29610
- ]
29611
- },
29612
- "input_schema": {
29613
- "anyOf": [
29614
- {},
29615
- {
29616
- "type": "null"
29617
- }
29618
- ]
29619
- }
29620
- },
29621
- "required": [
29622
- "slug",
29623
- "kind",
29624
- "description",
29625
- "unit",
29626
- "decimals",
29627
- "input_schema"
29628
- ],
29629
- "additionalProperties": false
29630
- }
29631
- }
29632
- },
29633
- "required": [
29634
- "robot_id",
29635
- "robot_name",
29636
- "capabilities",
29637
- "exposures"
29638
- ],
29639
- "additionalProperties": false
29640
- }
29641
- }
29642
- },
29643
- "required": [
29644
- "role_id",
29645
- "robots"
29646
- ],
29647
- "additionalProperties": false
29648
- },
29649
30605
  "oauth-token-request": {
29650
30606
  "oneOf": [
29651
30607
  {
@@ -30656,6 +31612,266 @@
30656
31612
  ],
30657
31613
  "additionalProperties": false
30658
31614
  },
31615
+ "org-role": {
31616
+ "type": "object",
31617
+ "properties": {
31618
+ "key": {
31619
+ "type": "string",
31620
+ "pattern": "^(?!defaults$)[a-z][a-z0-9_]{0,62}$",
31621
+ "description": "The role's key, as `fleetless.yaml` and every assignment write it. Unique in the organization."
31622
+ },
31623
+ "name": {
31624
+ "type": "string",
31625
+ "minLength": 1,
31626
+ "maxLength": 60,
31627
+ "description": "The display name, 1 to 60 characters and trimmed. Changing it changes nothing about rights."
31628
+ },
31629
+ "inherits": {
31630
+ "type": "array",
31631
+ "items": {
31632
+ "type": "string"
31633
+ },
31634
+ "description": "The keys of the roles this one inherits from. A role holds whatever its parents hold, and theirs in turn. A key that names no role is kept as written; inheritance through it grants nothing, and the key appears under `dangling`."
31635
+ },
31636
+ "users": {
31637
+ "type": "integer",
31638
+ "minimum": 0,
31639
+ "maximum": 9007199254740991,
31640
+ "description": "App users, in every app of the organization, who hold this role."
31641
+ },
31642
+ "invitations": {
31643
+ "type": "integer",
31644
+ "minimum": 0,
31645
+ "maximum": 9007199254740991,
31646
+ "description": "Invitations that carry this role."
31647
+ },
31648
+ "app_defaults": {
31649
+ "type": "integer",
31650
+ "minimum": 0,
31651
+ "maximum": 9007199254740991,
31652
+ "description": "Apps that use this role as their default role."
31653
+ },
31654
+ "references": {
31655
+ "type": "integer",
31656
+ "minimum": 0,
31657
+ "maximum": 9007199254740991,
31658
+ "description": "Places in documents that name this role, such as a `role` in a robot's `fleetless.yaml`. A rename with `update_references` rewrites them."
31659
+ }
31660
+ },
31661
+ "required": [
31662
+ "key",
31663
+ "name",
31664
+ "inherits",
31665
+ "users",
31666
+ "invitations",
31667
+ "app_defaults",
31668
+ "references"
31669
+ ],
31670
+ "additionalProperties": false
31671
+ },
31672
+ "org-role-list-response": {
31673
+ "type": "object",
31674
+ "properties": {
31675
+ "roles": {
31676
+ "type": "array",
31677
+ "items": {
31678
+ "type": "object",
31679
+ "properties": {
31680
+ "key": {
31681
+ "type": "string",
31682
+ "pattern": "^(?!defaults$)[a-z][a-z0-9_]{0,62}$",
31683
+ "description": "The role's key, as `fleetless.yaml` and every assignment write it. Unique in the organization."
31684
+ },
31685
+ "name": {
31686
+ "type": "string",
31687
+ "minLength": 1,
31688
+ "maxLength": 60,
31689
+ "description": "The display name, 1 to 60 characters and trimmed. Changing it changes nothing about rights."
31690
+ },
31691
+ "inherits": {
31692
+ "type": "array",
31693
+ "items": {
31694
+ "type": "string"
31695
+ },
31696
+ "description": "The keys of the roles this one inherits from. A role holds whatever its parents hold, and theirs in turn. A key that names no role is kept as written; inheritance through it grants nothing, and the key appears under `dangling`."
31697
+ },
31698
+ "users": {
31699
+ "type": "integer",
31700
+ "minimum": 0,
31701
+ "maximum": 9007199254740991,
31702
+ "description": "App users, in every app of the organization, who hold this role."
31703
+ },
31704
+ "invitations": {
31705
+ "type": "integer",
31706
+ "minimum": 0,
31707
+ "maximum": 9007199254740991,
31708
+ "description": "Invitations that carry this role."
31709
+ },
31710
+ "app_defaults": {
31711
+ "type": "integer",
31712
+ "minimum": 0,
31713
+ "maximum": 9007199254740991,
31714
+ "description": "Apps that use this role as their default role."
31715
+ },
31716
+ "references": {
31717
+ "type": "integer",
31718
+ "minimum": 0,
31719
+ "maximum": 9007199254740991,
31720
+ "description": "Places in documents that name this role, such as a `role` in a robot's `fleetless.yaml`. A rename with `update_references` rewrites them."
31721
+ }
31722
+ },
31723
+ "required": [
31724
+ "key",
31725
+ "name",
31726
+ "inherits",
31727
+ "users",
31728
+ "invitations",
31729
+ "app_defaults",
31730
+ "references"
31731
+ ],
31732
+ "additionalProperties": false
31733
+ },
31734
+ "description": "The organization's roles with their counts, in the order they were created: the roles every organization starts with (`observe`, `operate` and `admin`) come first."
31735
+ },
31736
+ "dangling": {
31737
+ "type": "array",
31738
+ "items": {
31739
+ "type": "object",
31740
+ "properties": {
31741
+ "key": {
31742
+ "type": "string",
31743
+ "description": "A key that names no role of the organization, because the role was deleted or renamed or never existed."
31744
+ },
31745
+ "places": {
31746
+ "type": "array",
31747
+ "items": {
31748
+ "type": "object",
31749
+ "properties": {
31750
+ "kind": {
31751
+ "type": "string",
31752
+ "enum": [
31753
+ "config",
31754
+ "app_user",
31755
+ "invitation",
31756
+ "app_default",
31757
+ "role_inherits",
31758
+ "org_default"
31759
+ ],
31760
+ "description": "What writes the key: `config` is a `role` or `access` value in a robot's `fleetless.yaml`, `app_user` an app user who holds it, `invitation` an invitation that carries it, `app_default` an app's default role, `role_inherits` another role that inherits from it, and `org_default` one of the organization's defaults."
31761
+ },
31762
+ "label": {
31763
+ "type": "string",
31764
+ "description": "What a person reads to find the place: the robot name (`config`), the e-mail address of the app user or of the invitee (`app_user`, `invitation`), the app name (`app_default`), the name of the inheriting role (`role_inherits`), or the access kind of an organization default (`org_default`)."
31765
+ },
31766
+ "path": {
31767
+ "anyOf": [
31768
+ {
31769
+ "type": "string"
31770
+ },
31771
+ {
31772
+ "type": "null"
31773
+ }
31774
+ ],
31775
+ "description": "Where the key is written. For `config`, the place in the YAML, such as `services.arm_home.role` or `access.rules[1].role`; for `role_inherits`, the key of the role that inherits from it, because display names are not unique; `null` for every other kind."
31776
+ },
31777
+ "robot_id": {
31778
+ "anyOf": [
31779
+ {
31780
+ "type": "string",
31781
+ "format": "uuid",
31782
+ "pattern": "^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"
31783
+ },
31784
+ {
31785
+ "type": "null"
31786
+ }
31787
+ ],
31788
+ "description": "The robot whose document holds the key (`config`); `null` for every other kind."
31789
+ },
31790
+ "app_id": {
31791
+ "anyOf": [
31792
+ {
31793
+ "type": "string",
31794
+ "format": "uuid",
31795
+ "pattern": "^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"
31796
+ },
31797
+ {
31798
+ "type": "null"
31799
+ }
31800
+ ],
31801
+ "description": "The app the user, invitation or default role belongs to (`app_user`, `invitation`, `app_default`); `null` for every other kind."
31802
+ },
31803
+ "user_id": {
31804
+ "anyOf": [
31805
+ {
31806
+ "type": "string",
31807
+ "format": "uuid",
31808
+ "pattern": "^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"
31809
+ },
31810
+ {
31811
+ "type": "null"
31812
+ }
31813
+ ],
31814
+ "description": "The app user who holds the key (`app_user`); `null` for every other kind."
31815
+ },
31816
+ "document": {
31817
+ "anyOf": [
31818
+ {
31819
+ "type": "string",
31820
+ "enum": [
31821
+ "published",
31822
+ "draft"
31823
+ ]
31824
+ },
31825
+ {
31826
+ "type": "null"
31827
+ }
31828
+ ],
31829
+ "description": "Which version of the robot's document holds the key (`config`): the published one or the draft; `null` for every other kind."
31830
+ },
31831
+ "new_version": {
31832
+ "anyOf": [
31833
+ {
31834
+ "type": "integer",
31835
+ "exclusiveMinimum": 0,
31836
+ "maximum": 9007199254740991
31837
+ },
31838
+ {
31839
+ "type": "null"
31840
+ }
31841
+ ],
31842
+ "description": "For a published document, the version number a rename with `update_references` would give it, a copy that differs only in the key; `null` for a draft and for every place that is no document."
31843
+ }
31844
+ },
31845
+ "required": [
31846
+ "kind",
31847
+ "label",
31848
+ "path",
31849
+ "robot_id",
31850
+ "app_id",
31851
+ "user_id",
31852
+ "document",
31853
+ "new_version"
31854
+ ],
31855
+ "additionalProperties": false
31856
+ },
31857
+ "description": "Every place that writes the key. It grants nothing wherever it is written; creating a role with this key makes the places count again."
31858
+ }
31859
+ },
31860
+ "required": [
31861
+ "key",
31862
+ "places"
31863
+ ],
31864
+ "additionalProperties": false
31865
+ },
31866
+ "description": "Keys written somewhere that are no role, each with its places. Empty when nothing is out of step."
31867
+ }
31868
+ },
31869
+ "required": [
31870
+ "roles",
31871
+ "dangling"
31872
+ ],
31873
+ "additionalProperties": false
31874
+ },
30659
31875
  "org-usage-response": {
30660
31876
  "type": "object",
30661
31877
  "properties": {
@@ -30817,11 +32033,10 @@
30817
32033
  }
30818
32034
  ]
30819
32035
  },
30820
- "role_id": {
30821
- "description": "The role the user holds from now on. A role belonging to another app is `404 not_found`, the same refusal a role that never existed gets; re-roling closes the user's live subscriptions.",
32036
+ "role": {
32037
+ "description": "The role the user holds from now on, by key. A key that names no role is accepted and grants nothing. The change applies at once: the user's live subscriptions are re-checked against the new role, and those it no longer allows end.",
30822
32038
  "type": "string",
30823
- "format": "uuid",
30824
- "pattern": "^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"
32039
+ "pattern": "^(?!defaults$)[a-z][a-z0-9_]{0,62}$"
30825
32040
  },
30826
32041
  "status": {
30827
32042
  "type": "string",
@@ -30934,6 +32149,41 @@
30934
32149
  ],
30935
32150
  "additionalProperties": false
30936
32151
  },
32152
+ "patch-org-role-request": {
32153
+ "type": "object",
32154
+ "properties": {
32155
+ "name": {
32156
+ "description": "A new display name, 1 to 60 characters; surrounding spaces are removed.",
32157
+ "type": "string",
32158
+ "minLength": 1,
32159
+ "maxLength": 60
32160
+ },
32161
+ "inherits": {
32162
+ "description": "The role's parents from now on. It replaces the whole list; `[]` removes every parent. A list that would lead back to this role is refused with `role_cycle`.",
32163
+ "maxItems": 50,
32164
+ "type": "array",
32165
+ "items": {
32166
+ "type": "string",
32167
+ "pattern": "^(?!defaults$)[a-z][a-z0-9_]{0,62}$"
32168
+ }
32169
+ },
32170
+ "key": {
32171
+ "description": "A new key. On its own, the rename is accepted at once and everything that still names the old key turns into a warning. To rewrite those places as well, add `update_references`.",
32172
+ "type": "string",
32173
+ "pattern": "^(?!defaults$)[a-z][a-z0-9_]{0,62}$"
32174
+ },
32175
+ "update_references": {
32176
+ "description": "With `key`: rewrite every place that names the old key to the new one, in one transaction. Without `confirm`, when there are places to rewrite the call changes nothing and answers `409 confirmation_required` with the preview; a rename with none applies at once and needs no token.",
32177
+ "type": "boolean"
32178
+ },
32179
+ "confirm": {
32180
+ "description": "The `confirm` token of the preview the caller was shown. It confirms that preview only; if the places to rewrite have changed since, the call answers a new preview.",
32181
+ "type": "string",
32182
+ "minLength": 1
32183
+ }
32184
+ },
32185
+ "additionalProperties": false
32186
+ },
30937
32187
  "patch-robot-request": {
30938
32188
  "type": "object",
30939
32189
  "properties": {
@@ -35334,11 +36584,58 @@
35334
36584
  "type": "string",
35335
36585
  "format": "date-time",
35336
36586
  "pattern": "^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d(?::[0-5]\\d(?:\\.\\d+)?)?(?:Z))$"
36587
+ },
36588
+ "warnings": {
36589
+ "type": "array",
36590
+ "items": {
36591
+ "type": "object",
36592
+ "properties": {
36593
+ "path": {
36594
+ "type": "string",
36595
+ "minLength": 1
36596
+ },
36597
+ "slug": {
36598
+ "anyOf": [
36599
+ {
36600
+ "type": "string"
36601
+ },
36602
+ {
36603
+ "type": "null"
36604
+ }
36605
+ ]
36606
+ },
36607
+ "code": {
36608
+ "type": "string",
36609
+ "minLength": 1
36610
+ },
36611
+ "message": {
36612
+ "type": "string",
36613
+ "minLength": 1
36614
+ },
36615
+ "severity": {
36616
+ "type": "string",
36617
+ "enum": [
36618
+ "error",
36619
+ "warning"
36620
+ ]
36621
+ }
36622
+ },
36623
+ "required": [
36624
+ "path",
36625
+ "slug",
36626
+ "code",
36627
+ "message",
36628
+ "severity"
36629
+ ],
36630
+ "additionalProperties": false
36631
+ },
36632
+ "description": "Every `warning` of the published document — an unknown topic, a role key that names no role of the organization, a rule that fits nothing. A warning never blocks a publish; it is here so the author does not have to go looking for it. `[]` for a document with none."
35337
36633
  }
35338
36634
  },
35339
36635
  "required": [
35340
36636
  "version",
35341
- "published_at"
36637
+ "published_at",
36638
+ "warnings"
35342
36639
  ],
35343
36640
  "additionalProperties": false
35344
36641
  },
@@ -38692,52 +39989,168 @@
38692
39989
  "additionalProperties": {}
38693
39990
  }
38694
39991
  ]
38695
- }
39992
+ }
39993
+ }
39994
+ },
39995
+ "required": [
39996
+ "details"
39997
+ ]
39998
+ },
39999
+ "put-robot-details-response": {
40000
+ "type": "object",
40001
+ "properties": {
40002
+ "details": {
40003
+ "type": "object",
40004
+ "propertyNames": {
40005
+ "type": "string",
40006
+ "pattern": "^[a-z][a-z0-9_-]{0,63}$"
40007
+ },
40008
+ "additionalProperties": {
40009
+ "anyOf": [
40010
+ {
40011
+ "type": "string",
40012
+ "maxLength": 4096
40013
+ },
40014
+ {
40015
+ "type": "number"
40016
+ },
40017
+ {
40018
+ "type": "boolean"
40019
+ },
40020
+ {
40021
+ "type": "array",
40022
+ "items": {}
40023
+ },
40024
+ {
40025
+ "type": "object",
40026
+ "propertyNames": {
40027
+ "type": "string"
40028
+ },
40029
+ "additionalProperties": {}
40030
+ }
40031
+ ]
40032
+ },
40033
+ "description": "The stored `robot_details` document, which is the one that was just sent — this route **replaces** the document rather than merging into it. Keys are the developer's own, lowercase and at most 64 characters; a value is a string of at most 4096 characters, a number, a boolean, an array or an object."
38696
40034
  }
38697
40035
  },
38698
40036
  "required": [
38699
40037
  "details"
38700
- ]
40038
+ ],
40039
+ "additionalProperties": false
38701
40040
  },
38702
- "put-robot-details-response": {
40041
+ "put-role-defaults-request": {
38703
40042
  "type": "object",
38704
40043
  "properties": {
38705
- "details": {
40044
+ "defaults": {
38706
40045
  "type": "object",
38707
- "propertyNames": {
38708
- "type": "string",
38709
- "pattern": "^[a-z][a-z0-9_-]{0,63}$"
38710
- },
38711
- "additionalProperties": {
38712
- "anyOf": [
38713
- {
38714
- "type": "string",
38715
- "maxLength": 4096
38716
- },
38717
- {
38718
- "type": "number"
38719
- },
38720
- {
38721
- "type": "boolean"
38722
- },
38723
- {
38724
- "type": "array",
38725
- "items": {}
38726
- },
38727
- {
38728
- "type": "object",
38729
- "propertyNames": {
38730
- "type": "string"
40046
+ "properties": {
40047
+ "read": {
40048
+ "description": "Reading datapoints and cameras. One role key, a list of keys, or `null` or `[]` for nobody. Left out, the kind keeps what it has. A key that names no role is accepted and warns.",
40049
+ "anyOf": [
40050
+ {
40051
+ "type": "string",
40052
+ "pattern": "^(?!defaults$)[a-z][a-z0-9_]{0,62}$"
38731
40053
  },
38732
- "additionalProperties": {}
38733
- }
38734
- ]
40054
+ {
40055
+ "maxItems": 50,
40056
+ "type": "array",
40057
+ "items": {
40058
+ "type": "string",
40059
+ "pattern": "^(?!defaults$)[a-z][a-z0-9_]{0,62}$"
40060
+ }
40061
+ },
40062
+ {
40063
+ "type": "null"
40064
+ }
40065
+ ]
40066
+ },
40067
+ "invoke": {
40068
+ "description": "Calling services and starting actions. One role key, a list of keys, or `null` or `[]` for nobody. Left out, the kind keeps what it has. A key that names no role is accepted and warns.",
40069
+ "anyOf": [
40070
+ {
40071
+ "type": "string",
40072
+ "pattern": "^(?!defaults$)[a-z][a-z0-9_]{0,62}$"
40073
+ },
40074
+ {
40075
+ "maxItems": 50,
40076
+ "type": "array",
40077
+ "items": {
40078
+ "type": "string",
40079
+ "pattern": "^(?!defaults$)[a-z][a-z0-9_]{0,62}$"
40080
+ }
40081
+ },
40082
+ {
40083
+ "type": "null"
40084
+ }
40085
+ ]
40086
+ },
40087
+ "publish": {
40088
+ "description": "Driving a robot through its publishers. One role key, a list of keys, or `null` or `[]` for nobody. Left out, the kind keeps what it has. A key that names no role is accepted and warns.",
40089
+ "anyOf": [
40090
+ {
40091
+ "type": "string",
40092
+ "pattern": "^(?!defaults$)[a-z][a-z0-9_]{0,62}$"
40093
+ },
40094
+ {
40095
+ "maxItems": 50,
40096
+ "type": "array",
40097
+ "items": {
40098
+ "type": "string",
40099
+ "pattern": "^(?!defaults$)[a-z][a-z0-9_]{0,62}$"
40100
+ }
40101
+ },
40102
+ {
40103
+ "type": "null"
40104
+ }
40105
+ ]
40106
+ },
40107
+ "assets": {
40108
+ "description": "A robot's asset files, such as its URDF and meshes. One role key, a list of keys, or `null` or `[]` for nobody. Left out, the kind keeps what it has. A key that names no role is accepted and warns.",
40109
+ "anyOf": [
40110
+ {
40111
+ "type": "string",
40112
+ "pattern": "^(?!defaults$)[a-z][a-z0-9_]{0,62}$"
40113
+ },
40114
+ {
40115
+ "maxItems": 50,
40116
+ "type": "array",
40117
+ "items": {
40118
+ "type": "string",
40119
+ "pattern": "^(?!defaults$)[a-z][a-z0-9_]{0,62}$"
40120
+ }
40121
+ },
40122
+ {
40123
+ "type": "null"
40124
+ }
40125
+ ]
40126
+ },
40127
+ "job_history": {
40128
+ "description": "The history of a robot's jobs. One role key, a list of keys, or `null` or `[]` for nobody. Left out, the kind keeps what it has. A key that names no role is accepted and warns.",
40129
+ "anyOf": [
40130
+ {
40131
+ "type": "string",
40132
+ "pattern": "^(?!defaults$)[a-z][a-z0-9_]{0,62}$"
40133
+ },
40134
+ {
40135
+ "maxItems": 50,
40136
+ "type": "array",
40137
+ "items": {
40138
+ "type": "string",
40139
+ "pattern": "^(?!defaults$)[a-z][a-z0-9_]{0,62}$"
40140
+ }
40141
+ },
40142
+ {
40143
+ "type": "null"
40144
+ }
40145
+ ]
40146
+ }
38735
40147
  },
38736
- "description": "The stored `robot_details` document, which is the one that was just sent — this route **replaces** the document rather than merging into it. Keys are the developer's own, lowercase and at most 64 characters; a value is a string of at most 4096 characters, a number, a boolean, an array or an object."
40148
+ "additionalProperties": false,
40149
+ "description": "The kinds to change. A kind that is not named keeps its current default, so this is a patch of the defaults and not a replacement."
38737
40150
  }
38738
40151
  },
38739
40152
  "required": [
38740
- "details"
40153
+ "defaults"
38741
40154
  ],
38742
40155
  "additionalProperties": false
38743
40156
  },
@@ -38964,10 +40377,11 @@
38964
40377
  "rename-slug-response": {
38965
40378
  "type": "object",
38966
40379
  "properties": {
38967
- "rewritten_grants": {
40380
+ "rewritten_locks": {
38968
40381
  "type": "integer",
38969
40382
  "minimum": 0,
38970
- "maximum": 9007199254740991
40383
+ "maximum": 9007199254740991,
40384
+ "description": "The app locks that listed the old slug and now list the new one as well. Locks follow a rename, in every app of the organization, so a renamed capability stays locked."
38971
40385
  },
38972
40386
  "history_moved": {
38973
40387
  "type": "boolean"
@@ -38978,7 +40392,7 @@
38978
40392
  }
38979
40393
  },
38980
40394
  "required": [
38981
- "rewritten_grants",
40395
+ "rewritten_locks",
38982
40396
  "history_moved",
38983
40397
  "requires_publish"
38984
40398
  ],
@@ -39737,159 +41151,61 @@
39737
41151
  ],
39738
41152
  "additionalProperties": false
39739
41153
  },
39740
- "role": {
39741
- "type": "object",
39742
- "properties": {
39743
- "id": {
39744
- "type": "string",
39745
- "format": "uuid",
39746
- "pattern": "^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$",
39747
- "description": "The role, and what an app user's `role_id` and an app's `default_role_id` refer to."
39748
- },
39749
- "app_id": {
39750
- "type": "string",
39751
- "format": "uuid",
39752
- "pattern": "^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$",
39753
- "description": "The app this role belongs to. Roles are never shared between apps, so a role id from another app reads as `not_found`."
39754
- },
39755
- "name": {
39756
- "type": "string",
39757
- "minLength": 1,
39758
- "maxLength": 60,
39759
- "description": "The role's name, shown wherever a user's access is chosen. The two roles every app starts with are named `observe` and `operate`."
39760
- },
39761
- "builtin": {
39762
- "type": "boolean",
39763
- "description": "`true` for the two roles every app starts with. Their **rights may be re-scoped** exactly like a custom role's, through `PUT /api/apps/:id/roles/:roleId/permissions` — the flag exists so the console can explain where they came from, not to protect them. Built-in roles can be renamed and deleted like any other; the flag only records that the cloud seeded them."
39764
- }
39765
- },
39766
- "required": [
39767
- "id",
39768
- "app_id",
39769
- "name",
39770
- "builtin"
39771
- ],
39772
- "additionalProperties": false
39773
- },
39774
- "role-list-response": {
41154
+ "role-defaults-response": {
39775
41155
  "type": "object",
39776
41156
  "properties": {
39777
- "roles": {
39778
- "type": "array",
39779
- "items": {
39780
- "type": "object",
39781
- "properties": {
39782
- "id": {
39783
- "type": "string",
39784
- "format": "uuid",
39785
- "pattern": "^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$",
39786
- "description": "The role, and what an app user's `role_id` and an app's `default_role_id` refer to."
39787
- },
39788
- "app_id": {
39789
- "type": "string",
39790
- "format": "uuid",
39791
- "pattern": "^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$",
39792
- "description": "The app this role belongs to. Roles are never shared between apps, so a role id from another app reads as `not_found`."
39793
- },
39794
- "name": {
39795
- "type": "string",
39796
- "minLength": 1,
39797
- "maxLength": 60,
39798
- "description": "The role's name, shown wherever a user's access is chosen. The two roles every app starts with are named `observe` and `operate`."
41157
+ "defaults": {
41158
+ "type": "object",
41159
+ "properties": {
41160
+ "read": {
41161
+ "type": "array",
41162
+ "items": {
41163
+ "type": "string"
39799
41164
  },
39800
- "builtin": {
39801
- "type": "boolean",
39802
- "description": "`true` for the two roles every app starts with. Their **rights may be re-scoped** exactly like a custom role's, through `PUT /api/apps/:id/roles/:roleId/permissions` — the flag exists so the console can explain where they came from, not to protect them. Built-in roles can be renamed and deleted like any other; the flag only records that the cloud seeded them."
39803
- }
41165
+ "description": "Reading datapoints and cameras. The roles that hold this kind of access by default; an empty list means nobody does, however senior the role."
39804
41166
  },
39805
- "required": [
39806
- "id",
39807
- "app_id",
39808
- "name",
39809
- "builtin"
39810
- ],
39811
- "additionalProperties": false
39812
- },
39813
- "description": "The app's roles, built-in and custom alike, ordered by `created_at` and then by `name`. The tie-break is not cosmetic — the two built-in roles are inserted in one statement and share a creation time to the microsecond, so never read a role by position."
39814
- }
39815
- },
39816
- "required": [
39817
- "roles"
39818
- ],
39819
- "additionalProperties": false
39820
- },
39821
- "role-permissions": {
39822
- "type": "object",
39823
- "properties": {
39824
- "role_id": {
39825
- "type": "string",
39826
- "format": "uuid",
39827
- "pattern": "^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"
39828
- },
39829
- "grants": {
39830
- "type": "array",
39831
- "items": {
39832
- "type": "object",
39833
- "properties": {
39834
- "robot_id": {
39835
- "type": "string",
39836
- "format": "uuid",
39837
- "pattern": "^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"
41167
+ "invoke": {
41168
+ "type": "array",
41169
+ "items": {
41170
+ "type": "string"
39838
41171
  },
39839
- "slugs": {
39840
- "type": "array",
39841
- "items": {
39842
- "type": "string",
39843
- "minLength": 2,
39844
- "maxLength": 63,
39845
- "pattern": "^[a-z][a-z0-9]*(?:_[a-z0-9]+)*$"
39846
- }
39847
- }
41172
+ "description": "Calling services and starting actions. The roles that hold this kind of access by default; an empty list means nobody does, however senior the role."
39848
41173
  },
39849
- "required": [
39850
- "robot_id",
39851
- "slugs"
39852
- ]
39853
- }
39854
- },
39855
- "capabilities": {
39856
- "type": "object",
39857
- "properties": {
39858
- "action_history": {
39859
- "type": "boolean"
39860
- },
39861
- "presence": {
39862
- "type": "boolean"
41174
+ "publish": {
41175
+ "type": "array",
41176
+ "items": {
41177
+ "type": "string"
41178
+ },
41179
+ "description": "Driving a robot through its publishers. The roles that hold this kind of access by default; an empty list means nobody does, however senior the role."
39863
41180
  },
39864
41181
  "assets": {
39865
- "type": "boolean"
41182
+ "type": "array",
41183
+ "items": {
41184
+ "type": "string"
41185
+ },
41186
+ "description": "A robot's asset files, such as its URDF and meshes. The roles that hold this kind of access by default; an empty list means nobody does, however senior the role."
41187
+ },
41188
+ "job_history": {
41189
+ "type": "array",
41190
+ "items": {
41191
+ "type": "string"
41192
+ },
41193
+ "description": "The history of a robot's jobs. The roles that hold this kind of access by default; an empty list means nobody does, however senior the role."
39866
41194
  }
39867
41195
  },
39868
41196
  "required": [
39869
- "action_history",
39870
- "presence",
39871
- "assets"
39872
- ]
39873
- }
39874
- },
39875
- "required": [
39876
- "role_id",
39877
- "grants",
39878
- "capabilities"
39879
- ]
39880
- },
39881
- "role-rename-request": {
39882
- "type": "object",
39883
- "properties": {
39884
- "name": {
39885
- "type": "string",
39886
- "minLength": 1,
39887
- "maxLength": 60,
39888
- "description": "The new name, trimmed, 1 to 60 characters. Unique per app: another role of this app with the same name answers `409 role_name_taken`. The role's users keep it under its new name."
41197
+ "read",
41198
+ "invoke",
41199
+ "publish",
41200
+ "assets",
41201
+ "job_history"
41202
+ ],
41203
+ "additionalProperties": false,
41204
+ "description": "Every kind of access, each with the keys of the roles that hold it when a robot's published configuration names nobody."
39889
41205
  }
39890
41206
  },
39891
41207
  "required": [
39892
- "name"
41208
+ "defaults"
39893
41209
  ],
39894
41210
  "additionalProperties": false
39895
41211
  },
@@ -39986,10 +41302,11 @@
39986
41302
  "slug-usage-response": {
39987
41303
  "type": "object",
39988
41304
  "properties": {
39989
- "grant_count": {
41305
+ "lock_count": {
39990
41306
  "type": "integer",
39991
41307
  "minimum": 0,
39992
- "maximum": 9007199254740991
41308
+ "maximum": 9007199254740991,
41309
+ "description": "The app locks that list this slug, which a rename would extend with the new name. The count is what the rename rewrites, in every app of the organization."
39993
41310
  },
39994
41311
  "app_identifiers": {
39995
41312
  "type": "array",
@@ -40007,7 +41324,7 @@
40007
41324
  }
40008
41325
  },
40009
41326
  "required": [
40010
- "grant_count",
41327
+ "lock_count",
40011
41328
  "app_identifiers",
40012
41329
  "has_recorded_history",
40013
41330
  "alert_count"
@@ -40398,18 +41715,6 @@
40398
41715
  "format": "uuid",
40399
41716
  "pattern": "^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"
40400
41717
  }
40401
- },
40402
- "default_role_id": {
40403
- "anyOf": [
40404
- {
40405
- "type": "string",
40406
- "format": "uuid",
40407
- "pattern": "^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"
40408
- },
40409
- {
40410
- "type": "null"
40411
- }
40412
- ]
40413
41718
  }
40414
41719
  },
40415
41720
  "additionalProperties": false