@fleetless/contracts 13.3.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 (98) hide show
  1. package/CHANGELOG.md +141 -0
  2. package/artifacts/openapi.json +1983 -784
  3. package/artifacts/routes.json +224 -208
  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-deletion-summary.schema.json +0 -7
  9. package/artifacts/schema/app-invitation-list-response.schema.json +13 -6
  10. package/artifacts/schema/app-invitation.schema.json +5 -5
  11. package/artifacts/schema/app-list-response.schema.json +6 -6
  12. package/artifacts/schema/app-lock.schema.json +30 -0
  13. package/artifacts/schema/app-user-list-response.schema.json +13 -6
  14. package/artifacts/schema/app-user.schema.json +13 -6
  15. package/artifacts/schema/app.schema.json +6 -6
  16. package/artifacts/schema/auth-ok.schema.json +20 -6
  17. package/artifacts/schema/camera-list-response.schema.json +1 -1
  18. package/artifacts/schema/client-identity.schema.json +21 -6
  19. package/artifacts/schema/cloud-config.schema.json +359 -5
  20. package/artifacts/schema/config-draft-response.schema.json +359 -5
  21. package/artifacts/schema/config-version-response.schema.json +359 -5
  22. package/artifacts/schema/create-app-invitation-request.schema.json +4 -4
  23. package/artifacts/schema/create-app-user-request.schema.json +4 -4
  24. package/artifacts/schema/create-org-role-request.schema.json +33 -0
  25. package/artifacts/schema/dangling-reference.schema.json +129 -0
  26. package/artifacts/schema/datapoint-config.schema.json +35 -0
  27. package/artifacts/schema/datapoint-list-response.schema.json +1 -1
  28. package/artifacts/schema/effective-capability.schema.json +104 -0
  29. package/artifacts/schema/effective-rights-query.schema.json +19 -0
  30. package/artifacts/schema/effective-rights-response.schema.json +310 -0
  31. package/artifacts/schema/effective-robot-rights.schema.json +266 -0
  32. package/artifacts/schema/invoke-or-service-response.schema.json +1 -1
  33. package/artifacts/schema/invoke-response.schema.json +1 -1
  34. package/artifacts/schema/journal-intent-v2-body.schema.json +74 -0
  35. package/artifacts/schema/journal-intent-v2.schema.json +84 -0
  36. package/artifacts/schema/journal-replay-receipt-body.schema.json +1 -0
  37. package/artifacts/schema/journal-replay-receipt.schema.json +1 -0
  38. package/artifacts/schema/mcp-robot-datasheet.schema.json +2 -2
  39. package/artifacts/schema/org-role-list-response.schema.json +205 -0
  40. package/artifacts/schema/org-role.schema.json +59 -0
  41. package/artifacts/schema/patch-app-user-request.schema.json +4 -4
  42. package/artifacts/schema/patch-org-role-request.schema.json +38 -0
  43. package/artifacts/schema/publish-config-response.schema.json +48 -1
  44. package/artifacts/schema/publisher-config.schema.json +35 -0
  45. package/artifacts/schema/put-role-defaults-request.schema.json +127 -0
  46. package/artifacts/schema/reference-place.schema.json +111 -0
  47. package/artifacts/schema/rename-slug-response.schema.json +4 -3
  48. package/artifacts/schema/robot-config-doc.schema.json +359 -5
  49. package/artifacts/schema/role-cycle-details.schema.json +18 -0
  50. package/artifacts/schema/role-defaults-response.schema.json +59 -0
  51. package/artifacts/schema/role-rename-preview.schema.json +146 -0
  52. package/artifacts/schema/service-config.schema.json +35 -0
  53. package/artifacts/schema/slug-usage-response.schema.json +4 -3
  54. package/artifacts/schema/update-app-request.schema.json +0 -12
  55. package/dist/app-users.d.ts +11 -8
  56. package/dist/app-users.js +18 -10
  57. package/dist/apps.d.ts +242 -71
  58. package/dist/apps.js +205 -151
  59. package/dist/audit.d.ts +3 -3
  60. package/dist/billing.d.ts +10 -10
  61. package/dist/client-auth.d.ts +5 -2
  62. package/dist/client-auth.js +11 -3
  63. package/dist/client-robots.d.ts +1 -1
  64. package/dist/client-robots.js +1 -1
  65. package/dist/common.d.ts +1 -1
  66. package/dist/common.js +1 -1
  67. package/dist/config-issues.d.ts +1 -1
  68. package/dist/config-issues.js +1 -1
  69. package/dist/config.d.ts +77 -11
  70. package/dist/config.js +108 -14
  71. package/dist/errors.d.ts +14 -5
  72. package/dist/errors.js +37 -24
  73. package/dist/index.d.ts +18 -8
  74. package/dist/index.js +14 -4
  75. package/dist/journal-intents.d.ts +30 -0
  76. package/dist/journal-intents.js +3 -0
  77. package/dist/legal-acceptances.d.ts +2 -2
  78. package/dist/mcp.d.ts +5 -37
  79. package/dist/mcp.js +4 -14
  80. package/dist/org-roles.d.ts +182 -0
  81. package/dist/org-roles.js +198 -0
  82. package/dist/plans.d.ts +6 -6
  83. package/dist/protocol.d.ts +19 -1
  84. package/dist/realtime.d.ts +6 -3
  85. package/dist/realtime.js +1 -1
  86. package/dist/rest.d.ts +76 -25
  87. package/dist/rest.js +41 -29
  88. package/dist/rights.d.ts +197 -0
  89. package/dist/rights.js +396 -0
  90. package/dist/routes.js +185 -134
  91. package/package.json +1 -1
  92. package/artifacts/schema/mcp-role-preview-response.schema.json +0 -134
  93. package/artifacts/schema/role-delete-query.schema.json +0 -13
  94. package/artifacts/schema/role-in-use-details.schema.json +0 -28
  95. package/artifacts/schema/role-list-response.schema.json +0 -48
  96. package/artifacts/schema/role-permissions.schema.json +0 -61
  97. package/artifacts/schema/role-rename-request.schema.json +0 -16
  98. 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}": {
@@ -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": {
@@ -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": {
@@ -7486,7 +7526,7 @@
7486
7526
  "/api/robots/{id}/config/rename-slug": {
7487
7527
  "post": {
7488
7528
  "operationId": "post_api_robots_id_config_rename_slug",
7489
- "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.",
7490
7530
  "tags": [
7491
7531
  "config"
7492
7532
  ],
@@ -7518,7 +7558,7 @@
7518
7558
  }
7519
7559
  },
7520
7560
  "default": {
7521
- "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`.",
7522
7562
  "content": {
7523
7563
  "application/json": {
7524
7564
  "schema": {
@@ -7528,7 +7568,7 @@
7528
7568
  }
7529
7569
  }
7530
7570
  },
7531
- "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.",
7532
7572
  "requestBody": {
7533
7573
  "required": true,
7534
7574
  "content": {
@@ -7595,7 +7635,7 @@
7595
7635
  }
7596
7636
  }
7597
7637
  },
7598
- "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."
7599
7639
  }
7600
7640
  },
7601
7641
  "/api/robots/{id}/alerts": {
@@ -8131,7 +8171,7 @@
8131
8171
  }
8132
8172
  }
8133
8173
  },
8134
- "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."
8135
8175
  }
8136
8176
  },
8137
8177
  "/api/robots/{id}/jobs/{slug}": {
@@ -8194,7 +8234,7 @@
8194
8234
  }
8195
8235
  }
8196
8236
  },
8197
- "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.",
8198
8238
  "requestBody": {
8199
8239
  "required": true,
8200
8240
  "content": {
@@ -11317,20 +11357,19 @@
11317
11357
  "format": "uuid",
11318
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)$"
11319
11359
  },
11320
- "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."
11321
11361
  },
11322
- "default_role_id": {
11362
+ "default_role": {
11323
11363
  "anyOf": [
11324
11364
  {
11325
11365
  "type": "string",
11326
- "format": "uuid",
11327
- "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}$"
11328
11367
  },
11329
11368
  {
11330
11369
  "type": "null"
11331
11370
  }
11332
11371
  ],
11333
- "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`."
11334
11373
  },
11335
11374
  "created_at": {
11336
11375
  "type": "string",
@@ -11345,11 +11384,223 @@
11345
11384
  "name",
11346
11385
  "identifier",
11347
11386
  "robot_ids",
11348
- "default_role_id",
11387
+ "default_role",
11349
11388
  "created_at"
11350
11389
  ],
11351
11390
  "additionalProperties": false
11352
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
+ },
11353
11604
  "app-auth-config": {
11354
11605
  "type": "object",
11355
11606
  "properties": {
@@ -11613,12 +11864,6 @@
11613
11864
  "maximum": 9007199254740991,
11614
11865
  "description": "App users deleted with the app. They are the developer's own customers, not Fleetless users, and exist in no other app."
11615
11866
  },
11616
- "role_count": {
11617
- "type": "integer",
11618
- "minimum": 0,
11619
- "maximum": 9007199254740991,
11620
- "description": "Roles deleted with the app, each with its per-robot slug grants."
11621
- },
11622
11867
  "server_key_count": {
11623
11868
  "type": "integer",
11624
11869
  "minimum": 0,
@@ -11646,7 +11891,6 @@
11646
11891
  },
11647
11892
  "required": [
11648
11893
  "user_count",
11649
- "role_count",
11650
11894
  "server_key_count",
11651
11895
  "invitation_count",
11652
11896
  "oidc_provider_count",
@@ -11675,11 +11919,10 @@
11675
11919
  "pattern": "^(?!\\.)(?!.*\\.\\.)([A-Za-z0-9_'+\\-\\.]*)[A-Za-z0-9_+-]@([A-Za-z0-9][A-Za-z0-9\\-]*\\.)+[A-Za-z]{2,}$",
11676
11920
  "description": "The address the invitation was addressed to."
11677
11921
  },
11678
- "role_id": {
11922
+ "role": {
11679
11923
  "type": "string",
11680
- "format": "uuid",
11681
- "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)$",
11682
- "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."
11683
11926
  },
11684
11927
  "expires_at": {
11685
11928
  "type": "string",
@@ -11708,7 +11951,7 @@
11708
11951
  "id",
11709
11952
  "app_id",
11710
11953
  "email",
11711
- "role_id",
11954
+ "role",
11712
11955
  "expires_at",
11713
11956
  "accept_url",
11714
11957
  "mail"
@@ -11741,11 +11984,17 @@
11741
11984
  "pattern": "^(?!\\.)(?!.*\\.\\.)([A-Za-z0-9_'+\\-\\.]*)[A-Za-z0-9_+-]@([A-Za-z0-9][A-Za-z0-9\\-]*\\.)+[A-Za-z]{2,}$",
11742
11985
  "description": "The address the invitation was addressed to."
11743
11986
  },
11744
- "role_id": {
11745
- "type": "string",
11746
- "format": "uuid",
11747
- "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)$",
11748
- "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."
11749
11998
  },
11750
11999
  "expires_at": {
11751
12000
  "type": "string",
@@ -11758,7 +12007,7 @@
11758
12007
  "id",
11759
12008
  "app_id",
11760
12009
  "email",
11761
- "role_id",
12010
+ "role",
11762
12011
  "expires_at"
11763
12012
  ],
11764
12013
  "additionalProperties": false
@@ -11811,20 +12060,19 @@
11811
12060
  "format": "uuid",
11812
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)$"
11813
12062
  },
11814
- "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."
11815
12064
  },
11816
- "default_role_id": {
12065
+ "default_role": {
11817
12066
  "anyOf": [
11818
12067
  {
11819
12068
  "type": "string",
11820
- "format": "uuid",
11821
- "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}$"
11822
12070
  },
11823
12071
  {
11824
12072
  "type": "null"
11825
12073
  }
11826
12074
  ],
11827
- "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`."
11828
12076
  },
11829
12077
  "created_at": {
11830
12078
  "type": "string",
@@ -11839,7 +12087,7 @@
11839
12087
  "name",
11840
12088
  "identifier",
11841
12089
  "robot_ids",
11842
- "default_role_id",
12090
+ "default_role",
11843
12091
  "created_at"
11844
12092
  ],
11845
12093
  "additionalProperties": false
@@ -12179,11 +12427,17 @@
12179
12427
  ],
12180
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."
12181
12429
  },
12182
- "role_id": {
12183
- "type": "string",
12184
- "format": "uuid",
12185
- "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)$",
12186
- "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."
12187
12441
  },
12188
12442
  "status": {
12189
12443
  "type": "string",
@@ -12268,7 +12522,7 @@
12268
12522
  "app_id",
12269
12523
  "email",
12270
12524
  "display_name",
12271
- "role_id",
12525
+ "role",
12272
12526
  "status",
12273
12527
  "has_password",
12274
12528
  "providers",
@@ -12317,11 +12571,17 @@
12317
12571
  ],
12318
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."
12319
12573
  },
12320
- "role_id": {
12321
- "type": "string",
12322
- "format": "uuid",
12323
- "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)$",
12324
- "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."
12325
12585
  },
12326
12586
  "status": {
12327
12587
  "type": "string",
@@ -12406,7 +12666,7 @@
12406
12666
  "app_id",
12407
12667
  "email",
12408
12668
  "display_name",
12409
- "role_id",
12669
+ "role",
12410
12670
  "status",
12411
12671
  "has_password",
12412
12672
  "providers",
@@ -21030,7 +21290,7 @@
21030
21290
  ],
21031
21291
  "additionalProperties": false
21032
21292
  },
21033
- "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."
21034
21294
  }
21035
21295
  },
21036
21296
  "required": [
@@ -22017,18 +22277,32 @@
22017
22277
  ],
22018
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."
22019
22279
  },
22020
- "role_id": {
22280
+ "role": {
22021
22281
  "anyOf": [
22022
22282
  {
22023
- "type": "string",
22024
- "format": "uuid",
22025
- "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
22026
22300
  },
22027
22301
  {
22028
22302
  "type": "null"
22029
22303
  }
22030
22304
  ],
22031
- "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."
22032
22306
  },
22033
22307
  "email": {
22034
22308
  "anyOf": [
@@ -22061,7 +22335,7 @@
22061
22335
  "app_user_id",
22062
22336
  "server_key_id",
22063
22337
  "app_id",
22064
- "role_id",
22338
+ "role",
22065
22339
  "email",
22066
22340
  "two_factor_enabled"
22067
22341
  ],
@@ -22992,6 +23266,24 @@
22992
23266
  "additionalProperties": false
22993
23267
  },
22994
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."
22995
23287
  }
22996
23288
  },
22997
23289
  "required": [
@@ -23000,7 +23292,7 @@
23000
23292
  ],
23001
23293
  "additionalProperties": false
23002
23294
  },
23003
- "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."
23004
23296
  },
23005
23297
  "actions": {
23006
23298
  "type": "object",
@@ -23142,6 +23434,24 @@
23142
23434
  "type": "string",
23143
23435
  "minLength": 1,
23144
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."
23145
23455
  }
23146
23456
  },
23147
23457
  "required": [
@@ -23150,7 +23460,7 @@
23150
23460
  ],
23151
23461
  "additionalProperties": false
23152
23462
  },
23153
- "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."
23154
23464
  },
23155
23465
  "services": {
23156
23466
  "type": "object",
@@ -23292,6 +23602,24 @@
23292
23602
  "type": "string",
23293
23603
  "minLength": 1,
23294
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."
23295
23623
  }
23296
23624
  },
23297
23625
  "required": [
@@ -23300,7 +23628,7 @@
23300
23628
  ],
23301
23629
  "additionalProperties": false
23302
23630
  },
23303
- "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."
23304
23632
  },
23305
23633
  "publishers": {
23306
23634
  "type": "object",
@@ -23475,6 +23803,24 @@
23475
23803
  "type": "string",
23476
23804
  "minLength": 1,
23477
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."
23478
23824
  }
23479
23825
  },
23480
23826
  "required": [
@@ -23486,7 +23832,7 @@
23486
23832
  ],
23487
23833
  "additionalProperties": false
23488
23834
  },
23489
- "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."
23490
23836
  },
23491
23837
  "cameras": {
23492
23838
  "type": "object",
@@ -23722,6 +24068,24 @@
23722
24068
  "type": "string",
23723
24069
  "minLength": 1,
23724
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."
23725
24089
  }
23726
24090
  },
23727
24091
  "required": [
@@ -23734,7 +24098,103 @@
23734
24098
  ],
23735
24099
  "additionalProperties": false
23736
24100
  },
23737
- "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."
23738
24198
  },
23739
24199
  "low_bandwidth": {
23740
24200
  "description": "Overrides for the bridge's low-bandwidth mode; see the section schema.",
@@ -24214,6 +24674,24 @@
24214
24674
  "additionalProperties": false
24215
24675
  },
24216
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."
24217
24695
  }
24218
24696
  },
24219
24697
  "required": [
@@ -24222,7 +24700,7 @@
24222
24700
  ],
24223
24701
  "additionalProperties": false
24224
24702
  },
24225
- "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."
24226
24704
  },
24227
24705
  "actions": {
24228
24706
  "type": "object",
@@ -24364,6 +24842,24 @@
24364
24842
  "type": "string",
24365
24843
  "minLength": 1,
24366
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."
24367
24863
  }
24368
24864
  },
24369
24865
  "required": [
@@ -24372,7 +24868,7 @@
24372
24868
  ],
24373
24869
  "additionalProperties": false
24374
24870
  },
24375
- "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."
24376
24872
  },
24377
24873
  "services": {
24378
24874
  "type": "object",
@@ -24514,6 +25010,24 @@
24514
25010
  "type": "string",
24515
25011
  "minLength": 1,
24516
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."
24517
25031
  }
24518
25032
  },
24519
25033
  "required": [
@@ -24522,7 +25036,7 @@
24522
25036
  ],
24523
25037
  "additionalProperties": false
24524
25038
  },
24525
- "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."
24526
25040
  },
24527
25041
  "publishers": {
24528
25042
  "type": "object",
@@ -24697,6 +25211,24 @@
24697
25211
  "type": "string",
24698
25212
  "minLength": 1,
24699
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."
24700
25232
  }
24701
25233
  },
24702
25234
  "required": [
@@ -24708,7 +25240,7 @@
24708
25240
  ],
24709
25241
  "additionalProperties": false
24710
25242
  },
24711
- "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."
24712
25244
  },
24713
25245
  "cameras": {
24714
25246
  "type": "object",
@@ -24944,6 +25476,24 @@
24944
25476
  "type": "string",
24945
25477
  "minLength": 1,
24946
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."
24947
25497
  }
24948
25498
  },
24949
25499
  "required": [
@@ -24956,7 +25506,103 @@
24956
25506
  ],
24957
25507
  "additionalProperties": false
24958
25508
  },
24959
- "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."
24960
25606
  },
24961
25607
  "low_bandwidth": {
24962
25608
  "description": "Overrides for the bridge's low-bandwidth mode; see the section schema.",
@@ -25498,11 +26144,10 @@
25498
26144
  "pattern": "^(?!\\.)(?!.*\\.\\.)([A-Za-z0-9_'+\\-\\.]*)[A-Za-z0-9_+-]@([A-Za-z0-9][A-Za-z0-9\\-]*\\.)+[A-Za-z]{2,}$",
25499
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."
25500
26146
  },
25501
- "role_id": {
25502
- "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.",
25503
26149
  "type": "string",
25504
- "format": "uuid",
25505
- "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}$"
25506
26151
  },
25507
26152
  "display_name": {
25508
26153
  "description": "An optional name to pre-fill the account with; the invitee can change it afterwards.",
@@ -25654,11 +26299,10 @@
25654
26299
  }
25655
26300
  ]
25656
26301
  },
25657
- "role_id": {
25658
- "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`.",
25659
26304
  "type": "string",
25660
- "format": "uuid",
25661
- "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}$"
25662
26306
  }
25663
26307
  },
25664
26308
  "required": [
@@ -25667,6 +26311,36 @@
25667
26311
  ],
25668
26312
  "additionalProperties": false
25669
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
+ },
25670
26344
  "create-passkey-request": {
25671
26345
  "type": "object",
25672
26346
  "properties": {
@@ -25988,7 +26662,7 @@
25988
26662
  ],
25989
26663
  "additionalProperties": false
25990
26664
  },
25991
- "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."
25992
26666
  }
25993
26667
  },
25994
26668
  "required": [
@@ -26308,6 +26982,315 @@
26308
26982
  ],
26309
26983
  "additionalProperties": false
26310
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
+ },
26311
27294
  "exposure-list-response": {
26312
27295
  "type": "object",
26313
27296
  "properties": {
@@ -27170,7 +28153,7 @@
27170
28153
  "action",
27171
28154
  "service"
27172
28155
  ],
27173
- "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."
27174
28157
  }
27175
28158
  },
27176
28159
  "required": [
@@ -29521,7 +30504,7 @@
29521
30504
  "capabilities": {
29522
30505
  "type": "object",
29523
30506
  "properties": {
29524
- "action_history": {
30507
+ "job_history": {
29525
30508
  "type": "boolean"
29526
30509
  },
29527
30510
  "assets": {
@@ -29529,7 +30512,7 @@
29529
30512
  }
29530
30513
  },
29531
30514
  "required": [
29532
- "action_history",
30515
+ "job_history",
29533
30516
  "assets"
29534
30517
  ],
29535
30518
  "additionalProperties": false
@@ -29619,139 +30602,6 @@
29619
30602
  ],
29620
30603
  "additionalProperties": false
29621
30604
  },
29622
- "mcp-role-preview-response": {
29623
- "type": "object",
29624
- "properties": {
29625
- "role_id": {
29626
- "type": "string",
29627
- "format": "uuid",
29628
- "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)$"
29629
- },
29630
- "robots": {
29631
- "maxItems": 500,
29632
- "type": "array",
29633
- "items": {
29634
- "type": "object",
29635
- "properties": {
29636
- "robot_id": {
29637
- "type": "string",
29638
- "format": "uuid",
29639
- "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)$"
29640
- },
29641
- "robot_name": {
29642
- "type": "string",
29643
- "minLength": 1,
29644
- "maxLength": 200
29645
- },
29646
- "capabilities": {
29647
- "type": "object",
29648
- "properties": {
29649
- "action_history": {
29650
- "type": "boolean"
29651
- },
29652
- "assets": {
29653
- "type": "boolean"
29654
- }
29655
- },
29656
- "required": [
29657
- "action_history",
29658
- "assets"
29659
- ],
29660
- "additionalProperties": false
29661
- },
29662
- "exposures": {
29663
- "maxItems": 2000,
29664
- "type": "array",
29665
- "items": {
29666
- "type": "object",
29667
- "properties": {
29668
- "slug": {
29669
- "type": "string",
29670
- "minLength": 2,
29671
- "maxLength": 63,
29672
- "pattern": "^[a-z][a-z0-9]*(?:_[a-z0-9]+)*$"
29673
- },
29674
- "kind": {
29675
- "type": "string",
29676
- "enum": [
29677
- "datapoint",
29678
- "service",
29679
- "action",
29680
- "publisher",
29681
- "camera"
29682
- ]
29683
- },
29684
- "description": {
29685
- "anyOf": [
29686
- {
29687
- "type": "string",
29688
- "maxLength": 2000
29689
- },
29690
- {
29691
- "type": "null"
29692
- }
29693
- ]
29694
- },
29695
- "unit": {
29696
- "anyOf": [
29697
- {
29698
- "type": "string",
29699
- "maxLength": 32
29700
- },
29701
- {
29702
- "type": "null"
29703
- }
29704
- ]
29705
- },
29706
- "decimals": {
29707
- "anyOf": [
29708
- {
29709
- "type": "integer",
29710
- "minimum": 0,
29711
- "maximum": 6
29712
- },
29713
- {
29714
- "type": "null"
29715
- }
29716
- ]
29717
- },
29718
- "input_schema": {
29719
- "anyOf": [
29720
- {},
29721
- {
29722
- "type": "null"
29723
- }
29724
- ]
29725
- }
29726
- },
29727
- "required": [
29728
- "slug",
29729
- "kind",
29730
- "description",
29731
- "unit",
29732
- "decimals",
29733
- "input_schema"
29734
- ],
29735
- "additionalProperties": false
29736
- }
29737
- }
29738
- },
29739
- "required": [
29740
- "robot_id",
29741
- "robot_name",
29742
- "capabilities",
29743
- "exposures"
29744
- ],
29745
- "additionalProperties": false
29746
- }
29747
- }
29748
- },
29749
- "required": [
29750
- "role_id",
29751
- "robots"
29752
- ],
29753
- "additionalProperties": false
29754
- },
29755
30605
  "oauth-token-request": {
29756
30606
  "oneOf": [
29757
30607
  {
@@ -30762,6 +31612,266 @@
30762
31612
  ],
30763
31613
  "additionalProperties": false
30764
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
+ },
30765
31875
  "org-usage-response": {
30766
31876
  "type": "object",
30767
31877
  "properties": {
@@ -30923,11 +32033,10 @@
30923
32033
  }
30924
32034
  ]
30925
32035
  },
30926
- "role_id": {
30927
- "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.",
30928
32038
  "type": "string",
30929
- "format": "uuid",
30930
- "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}$"
30931
32040
  },
30932
32041
  "status": {
30933
32042
  "type": "string",
@@ -31040,6 +32149,41 @@
31040
32149
  ],
31041
32150
  "additionalProperties": false
31042
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
+ },
31043
32187
  "patch-robot-request": {
31044
32188
  "type": "object",
31045
32189
  "properties": {
@@ -35440,11 +36584,58 @@
35440
36584
  "type": "string",
35441
36585
  "format": "date-time",
35442
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."
35443
36633
  }
35444
36634
  },
35445
36635
  "required": [
35446
36636
  "version",
35447
- "published_at"
36637
+ "published_at",
36638
+ "warnings"
35448
36639
  ],
35449
36640
  "additionalProperties": false
35450
36641
  },
@@ -38798,52 +39989,168 @@
38798
39989
  "additionalProperties": {}
38799
39990
  }
38800
39991
  ]
38801
- }
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."
38802
40034
  }
38803
40035
  },
38804
40036
  "required": [
38805
40037
  "details"
38806
- ]
40038
+ ],
40039
+ "additionalProperties": false
38807
40040
  },
38808
- "put-robot-details-response": {
40041
+ "put-role-defaults-request": {
38809
40042
  "type": "object",
38810
40043
  "properties": {
38811
- "details": {
40044
+ "defaults": {
38812
40045
  "type": "object",
38813
- "propertyNames": {
38814
- "type": "string",
38815
- "pattern": "^[a-z][a-z0-9_-]{0,63}$"
38816
- },
38817
- "additionalProperties": {
38818
- "anyOf": [
38819
- {
38820
- "type": "string",
38821
- "maxLength": 4096
38822
- },
38823
- {
38824
- "type": "number"
38825
- },
38826
- {
38827
- "type": "boolean"
38828
- },
38829
- {
38830
- "type": "array",
38831
- "items": {}
38832
- },
38833
- {
38834
- "type": "object",
38835
- "propertyNames": {
38836
- "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}$"
38837
40053
  },
38838
- "additionalProperties": {}
38839
- }
38840
- ]
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
+ }
38841
40147
  },
38842
- "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."
38843
40150
  }
38844
40151
  },
38845
40152
  "required": [
38846
- "details"
40153
+ "defaults"
38847
40154
  ],
38848
40155
  "additionalProperties": false
38849
40156
  },
@@ -39070,10 +40377,11 @@
39070
40377
  "rename-slug-response": {
39071
40378
  "type": "object",
39072
40379
  "properties": {
39073
- "rewritten_grants": {
40380
+ "rewritten_locks": {
39074
40381
  "type": "integer",
39075
40382
  "minimum": 0,
39076
- "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."
39077
40385
  },
39078
40386
  "history_moved": {
39079
40387
  "type": "boolean"
@@ -39084,7 +40392,7 @@
39084
40392
  }
39085
40393
  },
39086
40394
  "required": [
39087
- "rewritten_grants",
40395
+ "rewritten_locks",
39088
40396
  "history_moved",
39089
40397
  "requires_publish"
39090
40398
  ],
@@ -39843,159 +41151,61 @@
39843
41151
  ],
39844
41152
  "additionalProperties": false
39845
41153
  },
39846
- "role": {
39847
- "type": "object",
39848
- "properties": {
39849
- "id": {
39850
- "type": "string",
39851
- "format": "uuid",
39852
- "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)$",
39853
- "description": "The role, and what an app user's `role_id` and an app's `default_role_id` refer to."
39854
- },
39855
- "app_id": {
39856
- "type": "string",
39857
- "format": "uuid",
39858
- "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)$",
39859
- "description": "The app this role belongs to. Roles are never shared between apps, so a role id from another app reads as `not_found`."
39860
- },
39861
- "name": {
39862
- "type": "string",
39863
- "minLength": 1,
39864
- "maxLength": 60,
39865
- "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`."
39866
- },
39867
- "builtin": {
39868
- "type": "boolean",
39869
- "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."
39870
- }
39871
- },
39872
- "required": [
39873
- "id",
39874
- "app_id",
39875
- "name",
39876
- "builtin"
39877
- ],
39878
- "additionalProperties": false
39879
- },
39880
- "role-list-response": {
41154
+ "role-defaults-response": {
39881
41155
  "type": "object",
39882
41156
  "properties": {
39883
- "roles": {
39884
- "type": "array",
39885
- "items": {
39886
- "type": "object",
39887
- "properties": {
39888
- "id": {
39889
- "type": "string",
39890
- "format": "uuid",
39891
- "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)$",
39892
- "description": "The role, and what an app user's `role_id` and an app's `default_role_id` refer to."
39893
- },
39894
- "app_id": {
39895
- "type": "string",
39896
- "format": "uuid",
39897
- "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)$",
39898
- "description": "The app this role belongs to. Roles are never shared between apps, so a role id from another app reads as `not_found`."
39899
- },
39900
- "name": {
39901
- "type": "string",
39902
- "minLength": 1,
39903
- "maxLength": 60,
39904
- "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"
39905
41164
  },
39906
- "builtin": {
39907
- "type": "boolean",
39908
- "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."
39909
- }
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."
39910
41166
  },
39911
- "required": [
39912
- "id",
39913
- "app_id",
39914
- "name",
39915
- "builtin"
39916
- ],
39917
- "additionalProperties": false
39918
- },
39919
- "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."
39920
- }
39921
- },
39922
- "required": [
39923
- "roles"
39924
- ],
39925
- "additionalProperties": false
39926
- },
39927
- "role-permissions": {
39928
- "type": "object",
39929
- "properties": {
39930
- "role_id": {
39931
- "type": "string",
39932
- "format": "uuid",
39933
- "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)$"
39934
- },
39935
- "grants": {
39936
- "type": "array",
39937
- "items": {
39938
- "type": "object",
39939
- "properties": {
39940
- "robot_id": {
39941
- "type": "string",
39942
- "format": "uuid",
39943
- "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"
39944
41171
  },
39945
- "slugs": {
39946
- "type": "array",
39947
- "items": {
39948
- "type": "string",
39949
- "minLength": 2,
39950
- "maxLength": 63,
39951
- "pattern": "^[a-z][a-z0-9]*(?:_[a-z0-9]+)*$"
39952
- }
39953
- }
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."
39954
41173
  },
39955
- "required": [
39956
- "robot_id",
39957
- "slugs"
39958
- ]
39959
- }
39960
- },
39961
- "capabilities": {
39962
- "type": "object",
39963
- "properties": {
39964
- "action_history": {
39965
- "type": "boolean"
39966
- },
39967
- "presence": {
39968
- "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."
39969
41180
  },
39970
41181
  "assets": {
39971
- "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."
39972
41194
  }
39973
41195
  },
39974
41196
  "required": [
39975
- "action_history",
39976
- "presence",
39977
- "assets"
39978
- ]
39979
- }
39980
- },
39981
- "required": [
39982
- "role_id",
39983
- "grants",
39984
- "capabilities"
39985
- ]
39986
- },
39987
- "role-rename-request": {
39988
- "type": "object",
39989
- "properties": {
39990
- "name": {
39991
- "type": "string",
39992
- "minLength": 1,
39993
- "maxLength": 60,
39994
- "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."
39995
41205
  }
39996
41206
  },
39997
41207
  "required": [
39998
- "name"
41208
+ "defaults"
39999
41209
  ],
40000
41210
  "additionalProperties": false
40001
41211
  },
@@ -40092,10 +41302,11 @@
40092
41302
  "slug-usage-response": {
40093
41303
  "type": "object",
40094
41304
  "properties": {
40095
- "grant_count": {
41305
+ "lock_count": {
40096
41306
  "type": "integer",
40097
41307
  "minimum": 0,
40098
- "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."
40099
41310
  },
40100
41311
  "app_identifiers": {
40101
41312
  "type": "array",
@@ -40113,7 +41324,7 @@
40113
41324
  }
40114
41325
  },
40115
41326
  "required": [
40116
- "grant_count",
41327
+ "lock_count",
40117
41328
  "app_identifiers",
40118
41329
  "has_recorded_history",
40119
41330
  "alert_count"
@@ -40504,18 +41715,6 @@
40504
41715
  "format": "uuid",
40505
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)$"
40506
41717
  }
40507
- },
40508
- "default_role_id": {
40509
- "anyOf": [
40510
- {
40511
- "type": "string",
40512
- "format": "uuid",
40513
- "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)$"
40514
- },
40515
- {
40516
- "type": "null"
40517
- }
40518
- ]
40519
41718
  }
40520
41719
  },
40521
41720
  "additionalProperties": false