@fleetless/contracts 14.0.0 → 15.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.
- package/CHANGELOG.md +163 -0
- package/artifacts/openapi.json +19842 -11398
- package/artifacts/routes.json +1160 -39
- package/artifacts/schema/addon-catalogue-entry.schema.json +3 -1
- package/artifacts/schema/admin-plan-change-request.schema.json +26 -0
- package/artifacts/schema/app-deletion-summary.schema.json +15 -1
- package/artifacts/schema/asset-plan-limit-details.schema.json +3 -1
- package/artifacts/schema/cloud-config.schema.json +5 -5
- package/artifacts/schema/collection-actor.schema.json +35 -0
- package/artifacts/schema/collection-definitions-response.schema.json +612 -0
- package/artifacts/schema/collection-event.schema.json +216 -0
- package/artifacts/schema/collection-export-query.schema.json +56 -0
- package/artifacts/schema/collection-filter.schema.json +9 -0
- package/artifacts/schema/collection-import-preview.schema.json +143 -0
- package/artifacts/schema/collection-import-request.schema.json +105 -0
- package/artifacts/schema/collection-import-result.schema.json +38 -0
- package/artifacts/schema/collection-list-response.schema.json +119 -0
- package/artifacts/schema/collection-record-get-query.schema.json +12 -0
- package/artifacts/schema/collection-record-history-query.schema.json +35 -0
- package/artifacts/schema/collection-record-history-response.schema.json +389 -0
- package/artifacts/schema/collection-record-list-query.schema.json +67 -0
- package/artifacts/schema/collection-record-list-response.schema.json +212 -0
- package/artifacts/schema/collection-record-restore-request.schema.json +14 -0
- package/artifacts/schema/collection-record-write.schema.json +31 -0
- package/artifacts/schema/collection-record.schema.json +180 -0
- package/artifacts/schema/collection-revision.schema.json +295 -0
- package/artifacts/schema/collection-subscribe-error.schema.json +31 -0
- package/artifacts/schema/collection-subscribe.schema.json +48 -0
- package/artifacts/schema/collection-subscribed.schema.json +22 -0
- package/artifacts/schema/collection-summary.schema.json +92 -0
- package/artifacts/schema/collection-unsubscribe.schema.json +22 -0
- package/artifacts/schema/collections-access-change.schema.json +34 -0
- package/artifacts/schema/collections-document.schema.json +732 -0
- package/artifacts/schema/collections-draft-response.schema.json +845 -0
- package/artifacts/schema/collections-effect.schema.json +384 -0
- package/artifacts/schema/collections-issue.schema.json +36 -0
- package/artifacts/schema/collections-publish-request.schema.json +18 -0
- package/artifacts/schema/collections-publish-response.schema.json +450 -0
- package/artifacts/schema/collections-purge-preview.schema.json +60 -0
- package/artifacts/schema/collections-purge-request.schema.json +27 -0
- package/artifacts/schema/collections-purge-response.schema.json +30 -0
- package/artifacts/schema/collections-restore-preview-query.schema.json +20 -0
- package/artifacts/schema/collections-restore-preview.schema.json +581 -0
- package/artifacts/schema/collections-restore-request.schema.json +27 -0
- package/artifacts/schema/collections-restore-response.schema.json +455 -0
- package/artifacts/schema/collections-schema-preview.schema.json +519 -0
- package/artifacts/schema/collections-schema-published.schema.json +22 -0
- package/artifacts/schema/collections-version-response.schema.json +869 -0
- package/artifacts/schema/collections-version-summary.schema.json +139 -0
- package/artifacts/schema/collections-versions-response.schema.json +167 -0
- package/artifacts/schema/config-draft-response.schema.json +5 -5
- package/artifacts/schema/config-version-response.schema.json +5 -5
- package/artifacts/schema/confirmation-required-details.schema.json +13 -0
- package/artifacts/schema/dangling-reference.schema.json +7 -6
- package/artifacts/schema/datapoint-list-response.schema.json +2 -2
- package/artifacts/schema/effective-rights-response.schema.json +87 -1
- package/artifacts/schema/org-plan.schema.json +29 -1
- package/artifacts/schema/org-quota-usage-counts.schema.json +18 -0
- package/artifacts/schema/org-quota-usage.schema.json +47 -1
- package/artifacts/schema/org-quotas.schema.json +29 -1
- package/artifacts/schema/org-role-list-response.schema.json +8 -7
- package/artifacts/schema/org-role.schema.json +1 -1
- package/artifacts/schema/plan-catalogue-entry.schema.json +29 -1
- package/artifacts/schema/plan-change-decision-status-response.schema.json +29 -1
- package/artifacts/schema/plan-limit-details.schema.json +3 -1
- package/artifacts/schema/plan-limits.schema.json +29 -1
- package/artifacts/schema/plan-overrides.schema.json +26 -0
- package/artifacts/schema/put-collections-draft-request.schema.json +16 -0
- package/artifacts/schema/record-changed-details.schema.json +16 -0
- package/artifacts/schema/record-referenced-details.schema.json +35 -0
- package/artifacts/schema/reference-invalid-details.schema.json +25 -0
- package/artifacts/schema/reference-place.schema.json +7 -6
- package/artifacts/schema/required-missing-details.schema.json +19 -0
- package/artifacts/schema/robot-config-doc.schema.json +5 -5
- package/artifacts/schema/robot-deletion-summary.schema.json +33 -1
- package/artifacts/schema/role-collection-rights.schema.json +82 -0
- package/artifacts/schema/role-rename-preview.schema.json +7 -6
- package/dist/apps.d.ts +18 -2
- package/dist/apps.js +12 -2
- package/dist/audit.d.ts +32 -2
- package/dist/audit.js +40 -2
- package/dist/collections-issues.d.ts +67 -0
- package/dist/collections-issues.js +340 -0
- package/dist/collections-records.d.ts +562 -0
- package/dist/collections-records.js +525 -0
- package/dist/collections-rights.d.ts +17 -0
- package/dist/collections-rights.js +41 -0
- package/dist/collections-schema.d.ts +1064 -0
- package/dist/collections-schema.js +386 -0
- package/dist/collections-templates.d.ts +55 -0
- package/dist/collections-templates.js +137 -0
- package/dist/collections-transfer.d.ts +101 -0
- package/dist/collections-transfer.js +206 -0
- package/dist/collections-values.d.ts +67 -0
- package/dist/collections-values.js +284 -0
- package/dist/collections.d.ts +568 -0
- package/dist/collections.js +332 -0
- package/dist/config.d.ts +8 -8
- package/dist/config.js +13 -13
- package/dist/errors.d.ts +50 -1
- package/dist/errors.js +115 -0
- package/dist/index.d.ts +24 -8
- package/dist/index.js +13 -3
- package/dist/org-roles.d.ts +4 -0
- package/dist/org-roles.js +10 -9
- package/dist/plans.d.ts +19 -1
- package/dist/plans.js +21 -1
- package/dist/realtime.d.ts +166 -0
- package/dist/realtime.js +163 -0
- package/dist/rest.d.ts +28 -28
- package/dist/rest.js +39 -27
- package/dist/rights.d.ts +2 -2
- package/dist/rights.js +1 -1
- package/dist/routes.d.ts +1 -1
- package/dist/routes.js +495 -21
- package/package.json +1 -1
- package/artifacts/schema/put-robot-details-request.schema.json +0 -41
- package/artifacts/schema/put-robot-details-response.schema.json +0 -43
- package/artifacts/schema/robot-details-doc.schema.json +0 -33
package/artifacts/routes.json
CHANGED
|
@@ -28,6 +28,10 @@
|
|
|
28
28
|
"id": "apps",
|
|
29
29
|
"title": "Apps"
|
|
30
30
|
},
|
|
31
|
+
{
|
|
32
|
+
"id": "collections",
|
|
33
|
+
"title": "App collections"
|
|
34
|
+
},
|
|
31
35
|
{
|
|
32
36
|
"id": "robots",
|
|
33
37
|
"title": "Robots"
|
|
@@ -719,10 +723,11 @@
|
|
|
719
723
|
"not_found",
|
|
720
724
|
"role_cycle",
|
|
721
725
|
"role_key_taken",
|
|
722
|
-
"confirmation_required"
|
|
726
|
+
"confirmation_required",
|
|
727
|
+
"rate_limited"
|
|
723
728
|
],
|
|
724
729
|
"transport": "http",
|
|
725
|
-
"notes": "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`
|
|
730
|
+
"notes": "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` and each app's published collections schema get a new version that differs only in the key, and an existing draft of either 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 rename that has to rewrite the collections schema of an app whose collections are busy with a publish, a restore or a purge waits up to two seconds for it, then answers `429 rate_limited` with `retry_after_ms` and changes nothing; repeat the call. A schema whose text cannot be rewritten without losing it, because an access rule is an alias for instance, refuses the rename with `400 validation_error` naming `update_references` and changes nothing; rename the role without `update_references` and edit that schema by hand. A new key that another role has is `409 role_key_taken`."
|
|
726
731
|
},
|
|
727
732
|
{
|
|
728
733
|
"method": "DELETE",
|
|
@@ -1007,7 +1012,7 @@
|
|
|
1007
1012
|
"not_found"
|
|
1008
1013
|
],
|
|
1009
1014
|
"transport": "http",
|
|
1010
|
-
"notes": "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
|
|
1015
|
+
"notes": "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, mail templates, and collections with their records and history 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`."
|
|
1011
1016
|
},
|
|
1012
1017
|
{
|
|
1013
1018
|
"method": "POST",
|
|
@@ -1222,7 +1227,7 @@
|
|
|
1222
1227
|
"not_found"
|
|
1223
1228
|
],
|
|
1224
1229
|
"transport": "http",
|
|
1225
|
-
"notes": "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`."
|
|
1230
|
+
"notes": "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`. `collections` says what the role may do with the records of each collection of the latest published schema: read, create, and update and delete for every record, only the role's own, or none; it is empty when the app has no published schema."
|
|
1226
1231
|
},
|
|
1227
1232
|
{
|
|
1228
1233
|
"method": "GET",
|
|
@@ -5142,7 +5147,7 @@
|
|
|
5142
5147
|
"not_found"
|
|
5143
5148
|
],
|
|
5144
5149
|
"transport": "http",
|
|
5145
|
-
"notes": "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 — a robot that kept recording in between — rather than two estimates that quietly disagree."
|
|
5150
|
+
"notes": "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 — a robot that kept recording in between — rather than two estimates that quietly disagree. `collection_records` counts, per app, the app collection records that go with the robot."
|
|
5146
5151
|
},
|
|
5147
5152
|
{
|
|
5148
5153
|
"method": "DELETE",
|
|
@@ -5175,36 +5180,6 @@
|
|
|
5175
5180
|
"transport": "http",
|
|
5176
5181
|
"notes": "A robot outside the caller's org answers `404`, as an unknown id does. A full cascade — everything the robot produced goes, except the audit trail, which is a record of what happened and must survive the thing it happened to. An open live session is `409 robot_in_use` unless `?force=true` is passed, matched as the bare string so the caller has to actually say it. A cascade that fails partway is `500 robot_deletion_partial` with the progress, never a bare `internal_error` that would read as \"nothing happened\"."
|
|
5177
5182
|
},
|
|
5178
|
-
{
|
|
5179
|
-
"method": "PUT",
|
|
5180
|
-
"path": "/api/robots/:id/details",
|
|
5181
|
-
"section": "robots",
|
|
5182
|
-
"summary": "Replaces the developer-maintained details document shown alongside the robot.",
|
|
5183
|
-
"audience": "developer",
|
|
5184
|
-
"auth": "developer",
|
|
5185
|
-
"rateLimited": false,
|
|
5186
|
-
"ownerTier": false,
|
|
5187
|
-
"status": 200,
|
|
5188
|
-
"params": [
|
|
5189
|
-
{
|
|
5190
|
-
"name": "id",
|
|
5191
|
-
"description": "The robot's uuid, as returned by `POST /api/robots` or listed by `GET /api/robots`."
|
|
5192
|
-
}
|
|
5193
|
-
],
|
|
5194
|
-
"query": null,
|
|
5195
|
-
"request": "put-robot-details-request",
|
|
5196
|
-
"response": "put-robot-details-response",
|
|
5197
|
-
"errors": [
|
|
5198
|
-
"unauthorized",
|
|
5199
|
-
"token_expired",
|
|
5200
|
-
"token_revoked",
|
|
5201
|
-
"invalid_uuid",
|
|
5202
|
-
"not_found",
|
|
5203
|
-
"validation_error"
|
|
5204
|
-
],
|
|
5205
|
-
"transport": "http",
|
|
5206
|
-
"notes": "Answers `{ \"details\": robotDetailsDoc }` — the stored document, which is the one that was sent. The update is fanned out to every `/realtime` subscriber of the `robot_details` built-in, so a client watching the robot sees the new document without polling."
|
|
5207
|
-
},
|
|
5208
5183
|
{
|
|
5209
5184
|
"method": "GET",
|
|
5210
5185
|
"path": "/api/robots/:id/datapoints",
|
|
@@ -5298,7 +5273,7 @@
|
|
|
5298
5273
|
"no_data"
|
|
5299
5274
|
],
|
|
5300
5275
|
"transport": "http",
|
|
5301
|
-
"notes": "For a client caller the grant check runs **before** any existence lookup, with no extra query on either path to time: a denied slug and a nonexistent one must be one answer. That is why an ungranted slug is `403 forbidden` while a granted-but-unconfigured one is `404 unknown_datapoint` and a configured one with no sample yet is `404 no_data` — three facts a caller who is entitled to them needs told apart. The plane built-
|
|
5276
|
+
"notes": "For a client caller the grant check runs **before** any existence lookup, with no extra query on either path to time: a denied slug and a nonexistent one must be one answer. That is why an ungranted slug is `403 forbidden` while a granted-but-unconfigured one is `404 unknown_datapoint` and a configured one with no sample yet is `404 no_data` — three facts a caller who is entitled to them needs told apart. The plane built-in `bridge_state` answers here too, without appearing in any document."
|
|
5302
5277
|
},
|
|
5303
5278
|
{
|
|
5304
5279
|
"method": "GET",
|
|
@@ -6545,7 +6520,7 @@
|
|
|
6545
6520
|
"token_revoked"
|
|
6546
6521
|
],
|
|
6547
6522
|
"transport": "http",
|
|
6548
|
-
"notes": "Every dial is read at the moment of the call and nothing is cached, so an exhausted quota is self-evident from this one answer rather than something a developer needs audit access to discover. `max_end_users` counts app users only — an org admin is not an app user, and counting the whole pool would report the Owner an org has by construction as consumption. It is summed **across the org's apps**, because the same address in two apps is two accounts, and that sum is the number the four routes that create an app user refuse `409 quota_exceeded` against: `POST /api/apps/:id/users`, `POST /api/client/register`, `POST /api/client/invitations/accept`, and a federated sign-in that would create an account, which carries `quota_exceeded` back to the app as its error redirect. A gauge nothing enforces is a number that reads as a limit and is not one."
|
|
6523
|
+
"notes": "Every dial is read at the moment of the call and nothing is cached, so an exhausted quota is self-evident from this one answer rather than something a developer needs audit access to discover. `max_end_users` counts app users only — an org admin is not an app user, and counting the whole pool would report the Owner an org has by construction as consumption. It is summed **across the org's apps**, because the same address in two apps is two accounts, and that sum is the number the four routes that create an app user refuse `409 quota_exceeded` against: `POST /api/apps/:id/users`, `POST /api/client/register`, `POST /api/client/invitations/accept`, and a federated sign-in that would create an account, which carries `quota_exceeded` back to the app as its error redirect. A gauge nothing enforces is a number that reads as a limit and is not one. \n\n`collection_records` and `collection_bytes` are the plan limits of the same names, `null` when the plan leaves them to the contract, and their usage counts the **current** records of all the org's apps; a write or an import that would add data past either is refused `409 plan_limit` naming the key, and reads continue. `collection_history_bytes` is the size of the history and only informs: nothing is refused against it. A usage figure the cloud does not measure is absent, never `0`."
|
|
6549
6524
|
},
|
|
6550
6525
|
{
|
|
6551
6526
|
"method": "GET",
|
|
@@ -7403,6 +7378,1152 @@
|
|
|
7403
7378
|
"transport": "http",
|
|
7404
7379
|
"notes": "The body is the **raw file bytes**, not JSON, so it has no request schema; everything about the file — its kind, its name, its sync id and its announced size — rides in the `x-fleetless-asset-*` headers `ASSET_UPLOAD_HEADERS` names. The credential is a short-lived upload token minted by `POST /api/robots/:id/assets/sync`, verified in a `preParsing` hook so a refusal precedes the work rather than following it: a `preHandler` would already have buffered the whole file. **One file can be at most `ASSET_FILE_MAX_BYTES`**, on every plan and for every kind, the URDF included: an announced size over it answers `413 file_too_large` with `max_bytes` and `size_bytes` before a byte is buffered; without a truthful size, a body over the limit answers the same code with the bytes that arrived as `size_bytes`, or with `size_bytes: null` when it ran past the server's body limit and nobody counted the bytes. Retrying does not help. A file that fits but finds the store full answers `409 plan_limit` (or `409 quota_exceeded` for an organisation still on the beta) carrying `store_bytes`, `used_bytes` and `size_bytes`, while the sync carries on with the next file. Rate limited per robot inside that same hook, which is why `rateLimited` is `false`: there is no rate-limiting preHandler registered on this route. The URDF itself is never refused for the store; only meshes and textures are charged against it."
|
|
7405
7380
|
},
|
|
7381
|
+
{
|
|
7382
|
+
"method": "GET",
|
|
7383
|
+
"path": "/api/apps/:id/collections",
|
|
7384
|
+
"section": "collections",
|
|
7385
|
+
"summary": "Lists the collections of the published schema with their binding, counts, readers and warnings.",
|
|
7386
|
+
"audience": "developer",
|
|
7387
|
+
"auth": "developer",
|
|
7388
|
+
"rateLimited": false,
|
|
7389
|
+
"ownerTier": false,
|
|
7390
|
+
"status": 200,
|
|
7391
|
+
"params": [
|
|
7392
|
+
{
|
|
7393
|
+
"name": "id",
|
|
7394
|
+
"description": "The app's uuid, as returned by `POST /api/apps` or listed by `GET /api/apps`. A malformed id is `400 invalid_uuid`."
|
|
7395
|
+
}
|
|
7396
|
+
],
|
|
7397
|
+
"query": null,
|
|
7398
|
+
"request": null,
|
|
7399
|
+
"response": "collection-list-response",
|
|
7400
|
+
"errors": [
|
|
7401
|
+
"unauthorized",
|
|
7402
|
+
"token_expired",
|
|
7403
|
+
"token_revoked",
|
|
7404
|
+
"invalid_uuid",
|
|
7405
|
+
"not_found"
|
|
7406
|
+
],
|
|
7407
|
+
"transport": "http",
|
|
7408
|
+
"notes": "Per collection: the binding, how many records and fields it has, the roles that may read it, the size of its history and the warnings (`no_role_access`, `unknown_role`, `history_growing`). `version` is `null` and the list empty until a schema has been published. \n\n**Who may do what.** Developers and the app's server keys do everything with records. The schema, its versions and its restore are for developers only, and purging old history is for an organization owner alone. An app user's rights come from `access` in the published schema, per collection: `read`, `create`, `update` and `delete` each name roles, and `update` and `delete` can also say `{ all, own }`, where `own` compares `created_by` with the caller. A collection, or an action, that `access` does not mention is allowed to nobody. In a collection that belongs to robots a caller reaches only the records of robots the app has attached and the caller's role reaches. The history of a record is readable, and its revisions restorable, by whoever may update it; a deleted record is brought back with the right to create. \n\n**`404 collection_not_found` or `403 forbidden`.** A caller who has none of `read`, `create`, `update` and `delete` on a collection is answered `404 collection_not_found`, exactly as for a key the schema does not have, so a collection they may not touch cannot be found out by asking. A caller who has some right on it, but not the one the request needs, is answered `403 forbidden`."
|
|
7409
|
+
},
|
|
7410
|
+
{
|
|
7411
|
+
"method": "GET",
|
|
7412
|
+
"path": "/api/apps/:id/collections/schema/draft",
|
|
7413
|
+
"section": "collections",
|
|
7414
|
+
"summary": "Reads the app's schema draft, or the published version's text when there is no draft.",
|
|
7415
|
+
"audience": "developer",
|
|
7416
|
+
"auth": "developer",
|
|
7417
|
+
"rateLimited": false,
|
|
7418
|
+
"ownerTier": false,
|
|
7419
|
+
"status": 200,
|
|
7420
|
+
"params": [
|
|
7421
|
+
{
|
|
7422
|
+
"name": "id",
|
|
7423
|
+
"description": "The app's uuid, as returned by `POST /api/apps` or listed by `GET /api/apps`. A malformed id is `400 invalid_uuid`."
|
|
7424
|
+
}
|
|
7425
|
+
],
|
|
7426
|
+
"query": null,
|
|
7427
|
+
"request": null,
|
|
7428
|
+
"response": "collections-draft-response",
|
|
7429
|
+
"errors": [
|
|
7430
|
+
"unauthorized",
|
|
7431
|
+
"token_expired",
|
|
7432
|
+
"token_revoked",
|
|
7433
|
+
"invalid_uuid",
|
|
7434
|
+
"not_found"
|
|
7435
|
+
],
|
|
7436
|
+
"transport": "http",
|
|
7437
|
+
"notes": "`source` is the text a developer edits: the saved draft; without one, the text of the published version; before the first publish, empty. `updated_at: null` says no draft is saved. `doc` is the parsed document, `null` for empty text. \n\n**Developers only.** The schema routes (draft, preview, publish, versions, restore) can be used by a developer and by nobody else: no app role and no server key can be granted them, which is why none of them has a twin under `/api/client`. Rights for the records of the collections are written in the schema itself, as `access` on each collection, and take effect when it is published."
|
|
7438
|
+
},
|
|
7439
|
+
{
|
|
7440
|
+
"method": "PUT",
|
|
7441
|
+
"path": "/api/apps/:id/collections/schema/draft",
|
|
7442
|
+
"section": "collections",
|
|
7443
|
+
"summary": "Replaces the schema draft with a whole document and answers what was found in it.",
|
|
7444
|
+
"audience": "developer",
|
|
7445
|
+
"auth": "developer",
|
|
7446
|
+
"rateLimited": false,
|
|
7447
|
+
"ownerTier": false,
|
|
7448
|
+
"status": 200,
|
|
7449
|
+
"params": [
|
|
7450
|
+
{
|
|
7451
|
+
"name": "id",
|
|
7452
|
+
"description": "The app's uuid, as returned by `POST /api/apps` or listed by `GET /api/apps`. A malformed id is `400 invalid_uuid`."
|
|
7453
|
+
}
|
|
7454
|
+
],
|
|
7455
|
+
"query": null,
|
|
7456
|
+
"request": "put-collections-draft-request",
|
|
7457
|
+
"response": "collections-draft-response",
|
|
7458
|
+
"errors": [
|
|
7459
|
+
"unauthorized",
|
|
7460
|
+
"token_expired",
|
|
7461
|
+
"token_revoked",
|
|
7462
|
+
"invalid_uuid",
|
|
7463
|
+
"not_found",
|
|
7464
|
+
"validation_error"
|
|
7465
|
+
],
|
|
7466
|
+
"transport": "http",
|
|
7467
|
+
"notes": "The request carries the document as YAML or JSON text. **Unlike a robot's configuration draft, a document with errors is refused**: `400 validation_error`, with `details.fields` naming each error by its path in the document. A syntax error is refused the same way. What is saved comes back with its warnings and information in `issues`, such as an `access` that names a role the organization does not have. Saving the text of the published version again discards the draft, and `updated_at` is `null`."
|
|
7468
|
+
},
|
|
7469
|
+
{
|
|
7470
|
+
"method": "DELETE",
|
|
7471
|
+
"path": "/api/apps/:id/collections/schema/draft",
|
|
7472
|
+
"section": "collections",
|
|
7473
|
+
"summary": "Discards the schema draft.",
|
|
7474
|
+
"audience": "developer",
|
|
7475
|
+
"auth": "developer",
|
|
7476
|
+
"rateLimited": false,
|
|
7477
|
+
"ownerTier": false,
|
|
7478
|
+
"status": 204,
|
|
7479
|
+
"params": [
|
|
7480
|
+
{
|
|
7481
|
+
"name": "id",
|
|
7482
|
+
"description": "The app's uuid, as returned by `POST /api/apps` or listed by `GET /api/apps`. A malformed id is `400 invalid_uuid`."
|
|
7483
|
+
}
|
|
7484
|
+
],
|
|
7485
|
+
"query": null,
|
|
7486
|
+
"request": null,
|
|
7487
|
+
"response": null,
|
|
7488
|
+
"errors": [
|
|
7489
|
+
"unauthorized",
|
|
7490
|
+
"token_expired",
|
|
7491
|
+
"token_revoked",
|
|
7492
|
+
"invalid_uuid",
|
|
7493
|
+
"not_found"
|
|
7494
|
+
],
|
|
7495
|
+
"transport": "http",
|
|
7496
|
+
"notes": "The next `GET` of the draft answers the text of the published version again. The published version and the records are not touched."
|
|
7497
|
+
},
|
|
7498
|
+
{
|
|
7499
|
+
"method": "GET",
|
|
7500
|
+
"path": "/api/apps/:id/collections/schema/preview",
|
|
7501
|
+
"section": "collections",
|
|
7502
|
+
"summary": "Computes what publishing the draft would do to the data as it is now.",
|
|
7503
|
+
"audience": "developer",
|
|
7504
|
+
"auth": "developer",
|
|
7505
|
+
"rateLimited": false,
|
|
7506
|
+
"ownerTier": false,
|
|
7507
|
+
"status": 200,
|
|
7508
|
+
"params": [
|
|
7509
|
+
{
|
|
7510
|
+
"name": "id",
|
|
7511
|
+
"description": "The app's uuid, as returned by `POST /api/apps` or listed by `GET /api/apps`. A malformed id is `400 invalid_uuid`."
|
|
7512
|
+
}
|
|
7513
|
+
],
|
|
7514
|
+
"query": null,
|
|
7515
|
+
"request": null,
|
|
7516
|
+
"response": "collections-schema-preview",
|
|
7517
|
+
"errors": [
|
|
7518
|
+
"unauthorized",
|
|
7519
|
+
"token_expired",
|
|
7520
|
+
"token_revoked",
|
|
7521
|
+
"invalid_uuid",
|
|
7522
|
+
"not_found"
|
|
7523
|
+
],
|
|
7524
|
+
"transport": "http",
|
|
7525
|
+
"notes": "`effects` lists what would happen to existing records: collections removed or started again, fields removed or converted, values dropped, defaults filled. An effect that would change nothing is not listed, so an empty list means publishing touches no data. `access_changes` and the warnings in `issues` are information and need no confirmation. `token` stands for exactly the effects listed, on exactly this draft text and the version in force, and is `null` when there are no effects. `source_sha256` is the hash of the draft text that was previewed, for a publish to name even when there is no token. Nothing is written. Without a saved draft there is nothing to preview: `404 not_found`."
|
|
7526
|
+
},
|
|
7527
|
+
{
|
|
7528
|
+
"method": "POST",
|
|
7529
|
+
"path": "/api/apps/:id/collections/schema/publish",
|
|
7530
|
+
"section": "collections",
|
|
7531
|
+
"summary": "Publishes the draft as the next schema version.",
|
|
7532
|
+
"audience": "developer",
|
|
7533
|
+
"auth": "developer",
|
|
7534
|
+
"rateLimited": false,
|
|
7535
|
+
"ownerTier": false,
|
|
7536
|
+
"status": 200,
|
|
7537
|
+
"params": [
|
|
7538
|
+
{
|
|
7539
|
+
"name": "id",
|
|
7540
|
+
"description": "The app's uuid, as returned by `POST /api/apps` or listed by `GET /api/apps`. A malformed id is `400 invalid_uuid`."
|
|
7541
|
+
}
|
|
7542
|
+
],
|
|
7543
|
+
"query": null,
|
|
7544
|
+
"request": "collections-publish-request",
|
|
7545
|
+
"requestOptional": true,
|
|
7546
|
+
"response": "collections-publish-response",
|
|
7547
|
+
"errors": [
|
|
7548
|
+
"unauthorized",
|
|
7549
|
+
"token_expired",
|
|
7550
|
+
"token_revoked",
|
|
7551
|
+
"invalid_uuid",
|
|
7552
|
+
"not_found",
|
|
7553
|
+
"validation_error",
|
|
7554
|
+
"confirmation_required"
|
|
7555
|
+
],
|
|
7556
|
+
"transport": "http",
|
|
7557
|
+
"notes": "A publish whose preview lists no effects needs no body. One with effects needs the `token` of the current preview as `confirm`; a missing or outdated token is `409 confirmation_required` with the current preview, and its new token, in `details.preview`, and nothing is changed. If the data changed between the preview and the publish so that the effects differ, or somebody saved the draft again, the token is outdated and the caller confirms the new preview. To be sure that the draft published is the draft that was looked at, also when there are no effects and so no token, send the preview's `source_sha256`: a draft with another text is not published, and the answer is `409 confirmation_required` with the current preview. The new version, every effect on records with its revisions, and the audit entry `collection_schema.published` are written in one transaction or not at all. Afterwards every socket with a collection subscription in the app receives `collections_schema_published`, and subscriptions whose rights or collection are gone end. What the platform does itself, such as filling in defaults or creating the records of a collection with one record per robot, is never refused for a plan limit."
|
|
7558
|
+
},
|
|
7559
|
+
{
|
|
7560
|
+
"method": "GET",
|
|
7561
|
+
"path": "/api/apps/:id/collections/schema/versions",
|
|
7562
|
+
"section": "collections",
|
|
7563
|
+
"summary": "Lists the published schema versions, newest first.",
|
|
7564
|
+
"audience": "developer",
|
|
7565
|
+
"auth": "developer",
|
|
7566
|
+
"rateLimited": false,
|
|
7567
|
+
"ownerTier": false,
|
|
7568
|
+
"status": 200,
|
|
7569
|
+
"params": [
|
|
7570
|
+
{
|
|
7571
|
+
"name": "id",
|
|
7572
|
+
"description": "The app's uuid, as returned by `POST /api/apps` or listed by `GET /api/apps`. A malformed id is `400 invalid_uuid`."
|
|
7573
|
+
}
|
|
7574
|
+
],
|
|
7575
|
+
"query": null,
|
|
7576
|
+
"request": null,
|
|
7577
|
+
"response": "collections-versions-response",
|
|
7578
|
+
"errors": [
|
|
7579
|
+
"unauthorized",
|
|
7580
|
+
"token_expired",
|
|
7581
|
+
"token_revoked",
|
|
7582
|
+
"invalid_uuid",
|
|
7583
|
+
"not_found"
|
|
7584
|
+
],
|
|
7585
|
+
"transport": "http",
|
|
7586
|
+
"notes": "`current` is the version in force, `null` before the first publish. Each version says who published it, when, how many records or values its effects touched and whether restoring it can also put records back (`restore_with_data`). A version that a restore published says whether that restore also put records back (`with_data`) and, if it did, how many changes were reverted, records came back or were deleted, and records of deleted robots stayed lost (`reverted_totals`). Versions are kept for the life of the app."
|
|
7587
|
+
},
|
|
7588
|
+
{
|
|
7589
|
+
"method": "GET",
|
|
7590
|
+
"path": "/api/apps/:id/collections/schema/versions/:v",
|
|
7591
|
+
"section": "collections",
|
|
7592
|
+
"summary": "Reads one published version: its document and the text it was published from.",
|
|
7593
|
+
"audience": "developer",
|
|
7594
|
+
"auth": "developer",
|
|
7595
|
+
"rateLimited": false,
|
|
7596
|
+
"ownerTier": false,
|
|
7597
|
+
"status": 200,
|
|
7598
|
+
"params": [
|
|
7599
|
+
{
|
|
7600
|
+
"name": "id",
|
|
7601
|
+
"description": "The app's uuid, as returned by `POST /api/apps` or listed by `GET /api/apps`. A malformed id is `400 invalid_uuid`."
|
|
7602
|
+
},
|
|
7603
|
+
{
|
|
7604
|
+
"name": "v",
|
|
7605
|
+
"description": "The schema version number, as listed by `GET /api/apps/:id/collections/schema/versions`: a positive whole number of at most nine digits. Anything else is the same `404 not_found` as a version the app does not have."
|
|
7606
|
+
}
|
|
7607
|
+
],
|
|
7608
|
+
"query": null,
|
|
7609
|
+
"request": null,
|
|
7610
|
+
"response": "collections-version-response",
|
|
7611
|
+
"errors": [
|
|
7612
|
+
"unauthorized",
|
|
7613
|
+
"token_expired",
|
|
7614
|
+
"token_revoked",
|
|
7615
|
+
"invalid_uuid",
|
|
7616
|
+
"not_found"
|
|
7617
|
+
],
|
|
7618
|
+
"transport": "http",
|
|
7619
|
+
"notes": "A `:v` that is not a positive whole number of at most nine digits and one that names no version of this app are the same `404 not_found`."
|
|
7620
|
+
},
|
|
7621
|
+
{
|
|
7622
|
+
"method": "GET",
|
|
7623
|
+
"path": "/api/apps/:id/collections/schema/versions/:v/restore-preview",
|
|
7624
|
+
"section": "collections",
|
|
7625
|
+
"summary": "Computes what restoring a version would do, optionally including the records.",
|
|
7626
|
+
"audience": "developer",
|
|
7627
|
+
"auth": "developer",
|
|
7628
|
+
"rateLimited": false,
|
|
7629
|
+
"ownerTier": false,
|
|
7630
|
+
"status": 200,
|
|
7631
|
+
"params": [
|
|
7632
|
+
{
|
|
7633
|
+
"name": "id",
|
|
7634
|
+
"description": "The app's uuid, as returned by `POST /api/apps` or listed by `GET /api/apps`. A malformed id is `400 invalid_uuid`."
|
|
7635
|
+
},
|
|
7636
|
+
{
|
|
7637
|
+
"name": "v",
|
|
7638
|
+
"description": "The schema version number, as listed by `GET /api/apps/:id/collections/schema/versions`: a positive whole number of at most nine digits. Anything else is the same `404 not_found` as a version the app does not have."
|
|
7639
|
+
}
|
|
7640
|
+
],
|
|
7641
|
+
"query": "collections-restore-preview-query",
|
|
7642
|
+
"request": null,
|
|
7643
|
+
"response": "collections-restore-preview",
|
|
7644
|
+
"errors": [
|
|
7645
|
+
"unauthorized",
|
|
7646
|
+
"token_expired",
|
|
7647
|
+
"token_revoked",
|
|
7648
|
+
"invalid_uuid",
|
|
7649
|
+
"not_found",
|
|
7650
|
+
"validation_error"
|
|
7651
|
+
],
|
|
7652
|
+
"transport": "http",
|
|
7653
|
+
"notes": "Without `data` a restore publishes the version's document with the ordinary effects of a publish. With `data=true` it also puts records back to their state at the version's **restore point**, the moment before the version that replaced it was published, **only in the collections the schema difference between the current version and this one touches**; the others keep their data. `collections` deselects some of those. `data_possible` and `data_reason` say whether that can be done at all: not when the restore point is more than 90 days old, not after an owner purged the history it needs, not for the current version. Asking for the records when they cannot come back is `400 validation_error`. Records of robots that were deleted since cannot come back and are counted in `robots_gone`. `token` is `null` when the restore would change no data. A `:v` that is not a version of this app is `404 not_found`."
|
|
7654
|
+
},
|
|
7655
|
+
{
|
|
7656
|
+
"method": "POST",
|
|
7657
|
+
"path": "/api/apps/:id/collections/schema/versions/:v/restore",
|
|
7658
|
+
"section": "collections",
|
|
7659
|
+
"summary": "Restores a version by publishing its document as a new version, optionally with its records.",
|
|
7660
|
+
"audience": "developer",
|
|
7661
|
+
"auth": "developer",
|
|
7662
|
+
"rateLimited": false,
|
|
7663
|
+
"ownerTier": false,
|
|
7664
|
+
"status": 200,
|
|
7665
|
+
"params": [
|
|
7666
|
+
{
|
|
7667
|
+
"name": "id",
|
|
7668
|
+
"description": "The app's uuid, as returned by `POST /api/apps` or listed by `GET /api/apps`. A malformed id is `400 invalid_uuid`."
|
|
7669
|
+
},
|
|
7670
|
+
{
|
|
7671
|
+
"name": "v",
|
|
7672
|
+
"description": "The schema version number, as listed by `GET /api/apps/:id/collections/schema/versions`: a positive whole number of at most nine digits. Anything else is the same `404 not_found` as a version the app does not have."
|
|
7673
|
+
}
|
|
7674
|
+
],
|
|
7675
|
+
"query": null,
|
|
7676
|
+
"request": "collections-restore-request",
|
|
7677
|
+
"requestOptional": true,
|
|
7678
|
+
"response": "collections-restore-response",
|
|
7679
|
+
"errors": [
|
|
7680
|
+
"unauthorized",
|
|
7681
|
+
"token_expired",
|
|
7682
|
+
"token_revoked",
|
|
7683
|
+
"invalid_uuid",
|
|
7684
|
+
"not_found",
|
|
7685
|
+
"validation_error",
|
|
7686
|
+
"confirmation_required"
|
|
7687
|
+
],
|
|
7688
|
+
"transport": "http",
|
|
7689
|
+
"notes": "Send the `data` and `collections` of the preview together with its `token` as `confirm`; confirmation works as for a publish, including the `409 confirmation_required` answer with the current preview. Changes made since the restore point are reverted by new revisions, so they stay in the history and can be restored one by one. The restore is itself a version and can be undone by restoring the version before it. Every key of the body is optional, so a restore of the document alone needs no body. Audited as `collection_schema.restored`."
|
|
7690
|
+
},
|
|
7691
|
+
{
|
|
7692
|
+
"method": "POST",
|
|
7693
|
+
"path": "/api/apps/:id/collections/history/purge-preview",
|
|
7694
|
+
"section": "collections",
|
|
7695
|
+
"summary": "Computes what removing the history older than a date would remove.",
|
|
7696
|
+
"audience": "developer",
|
|
7697
|
+
"auth": "developer",
|
|
7698
|
+
"rateLimited": false,
|
|
7699
|
+
"ownerTier": true,
|
|
7700
|
+
"status": 200,
|
|
7701
|
+
"params": [
|
|
7702
|
+
{
|
|
7703
|
+
"name": "id",
|
|
7704
|
+
"description": "The app's uuid, as returned by `POST /api/apps` or listed by `GET /api/apps`. A malformed id is `400 invalid_uuid`."
|
|
7705
|
+
}
|
|
7706
|
+
],
|
|
7707
|
+
"query": null,
|
|
7708
|
+
"request": "collections-purge-request",
|
|
7709
|
+
"response": "collections-purge-preview",
|
|
7710
|
+
"errors": [
|
|
7711
|
+
"unauthorized",
|
|
7712
|
+
"token_expired",
|
|
7713
|
+
"token_revoked",
|
|
7714
|
+
"tier_required",
|
|
7715
|
+
"support_forbidden",
|
|
7716
|
+
"invalid_uuid",
|
|
7717
|
+
"not_found",
|
|
7718
|
+
"validation_error"
|
|
7719
|
+
],
|
|
7720
|
+
"transport": "http",
|
|
7721
|
+
"notes": "**Owner tier**: an organization owner, not a developer and not an app user. A developer is answered `403 tier_required`. The body is the one the purge takes; this call never removes anything. It counts the revisions older than `before` and their size, and names the schema versions whose records could no longer be put back: those whose records could be put back today and could not afterwards, judged like `restore_with_data` of the version list, and for the purge of one collection only the versions whose restore touches it. `before` must be in the past (`400 validation_error`, field `before`, rule `not_in_past`), and a date that would remove nothing is refused as well (rule `nothing_to_purge`). A support session is answered `403 support_forbidden`. Current values of records are never touched. Purging history is not offered through MCP."
|
|
7722
|
+
},
|
|
7723
|
+
{
|
|
7724
|
+
"method": "POST",
|
|
7725
|
+
"path": "/api/apps/:id/collections/history/purge",
|
|
7726
|
+
"section": "collections",
|
|
7727
|
+
"summary": "Removes the history older than a date, for one collection or the whole app.",
|
|
7728
|
+
"audience": "developer",
|
|
7729
|
+
"auth": "developer",
|
|
7730
|
+
"rateLimited": false,
|
|
7731
|
+
"ownerTier": true,
|
|
7732
|
+
"status": 200,
|
|
7733
|
+
"params": [
|
|
7734
|
+
{
|
|
7735
|
+
"name": "id",
|
|
7736
|
+
"description": "The app's uuid, as returned by `POST /api/apps` or listed by `GET /api/apps`. A malformed id is `400 invalid_uuid`."
|
|
7737
|
+
}
|
|
7738
|
+
],
|
|
7739
|
+
"query": null,
|
|
7740
|
+
"request": "collections-purge-request",
|
|
7741
|
+
"response": "collections-purge-response",
|
|
7742
|
+
"errors": [
|
|
7743
|
+
"unauthorized",
|
|
7744
|
+
"token_expired",
|
|
7745
|
+
"token_revoked",
|
|
7746
|
+
"tier_required",
|
|
7747
|
+
"support_forbidden",
|
|
7748
|
+
"invalid_uuid",
|
|
7749
|
+
"not_found",
|
|
7750
|
+
"validation_error",
|
|
7751
|
+
"confirmation_required"
|
|
7752
|
+
],
|
|
7753
|
+
"transport": "http",
|
|
7754
|
+
"notes": "**Owner tier.** Always confirmed: the `token` of the preview goes in `confirm`, and an outdated one is `409 confirmation_required` with the current preview. The purge is audited as `collection_history.purged` and recorded for good with the collection, independent of how long the audit log is kept: the history of every affected record starts with a note saying who removed what, which the history answers as `purged`. The refusals of the preview apply (`not_in_past`, `nothing_to_purge`), and a support session is answered `403 support_forbidden`."
|
|
7755
|
+
},
|
|
7756
|
+
{
|
|
7757
|
+
"method": "GET",
|
|
7758
|
+
"path": "/api/apps/:id/collections/:c/records",
|
|
7759
|
+
"section": "collections",
|
|
7760
|
+
"summary": "Lists the records of a collection, filtered, searched and sorted.",
|
|
7761
|
+
"audience": "developer",
|
|
7762
|
+
"auth": "developer",
|
|
7763
|
+
"rateLimited": false,
|
|
7764
|
+
"ownerTier": false,
|
|
7765
|
+
"status": 200,
|
|
7766
|
+
"params": [
|
|
7767
|
+
{
|
|
7768
|
+
"name": "id",
|
|
7769
|
+
"description": "The app's uuid, as returned by `POST /api/apps` or listed by `GET /api/apps`. A malformed id is `400 invalid_uuid`."
|
|
7770
|
+
},
|
|
7771
|
+
{
|
|
7772
|
+
"name": "c",
|
|
7773
|
+
"description": "The collection's key, as listed by `GET /api/apps/:id/collections`. The records of a collection whose key is `schema` or `history` are reached the same way."
|
|
7774
|
+
}
|
|
7775
|
+
],
|
|
7776
|
+
"query": "collection-record-list-query",
|
|
7777
|
+
"request": null,
|
|
7778
|
+
"response": "collection-record-list-response",
|
|
7779
|
+
"errors": [
|
|
7780
|
+
"unauthorized",
|
|
7781
|
+
"token_expired",
|
|
7782
|
+
"token_revoked",
|
|
7783
|
+
"invalid_uuid",
|
|
7784
|
+
"not_found",
|
|
7785
|
+
"collection_not_found",
|
|
7786
|
+
"validation_error",
|
|
7787
|
+
"robot_not_attached"
|
|
7788
|
+
],
|
|
7789
|
+
"transport": "http",
|
|
7790
|
+
"notes": "A developer has every right, so here `404 collection_not_found` only means that the published schema has no collection with that key. App users and server keys use `/api/client/collections`, where `access` in the schema decides what each may do with a collection's records. Records of a collection that belongs to robots are those of robots the app has attached; a detached robot's records are kept and hidden until it is attached again. \n\n`filter` is JSON text, `sort` takes up to three fields and breaks ties by `id`, `limit` is at most 500, and `next_cursor` is `null` on the last page. `robot=<id>` finds the record of one robot in a collection with one record per robot. `deleted=true` lists deleted records instead, newest deletion first, each with `deleted_at` and `deleted_by`, which a live record does not have. A filter that breaks the grammar, an unknown field or a cursor that does not belong to this query is `400 validation_error` naming the path. \n\n**A page can be cut short.** A page of records ends at 4 MiB of stored record values (for the list of deleted records, of the revisions that deleted them), so it can hold fewer than `limit` records while more follow. It always holds at least one record when there is one, `next_cursor` continues after the last record it holds, and a list of ordinary size is never cut; only `next_cursor: null` says the list is at its end. `total` is not affected, and the records `expand` embeds are not counted."
|
|
7791
|
+
},
|
|
7792
|
+
{
|
|
7793
|
+
"method": "POST",
|
|
7794
|
+
"path": "/api/apps/:id/collections/:c/records",
|
|
7795
|
+
"section": "collections",
|
|
7796
|
+
"summary": "Creates a record.",
|
|
7797
|
+
"audience": "developer",
|
|
7798
|
+
"auth": "developer",
|
|
7799
|
+
"rateLimited": false,
|
|
7800
|
+
"ownerTier": false,
|
|
7801
|
+
"status": 201,
|
|
7802
|
+
"params": [
|
|
7803
|
+
{
|
|
7804
|
+
"name": "id",
|
|
7805
|
+
"description": "The app's uuid, as returned by `POST /api/apps` or listed by `GET /api/apps`. A malformed id is `400 invalid_uuid`."
|
|
7806
|
+
},
|
|
7807
|
+
{
|
|
7808
|
+
"name": "c",
|
|
7809
|
+
"description": "The collection's key, as listed by `GET /api/apps/:id/collections`. The records of a collection whose key is `schema` or `history` are reached the same way."
|
|
7810
|
+
}
|
|
7811
|
+
],
|
|
7812
|
+
"query": null,
|
|
7813
|
+
"request": "collection-record-write",
|
|
7814
|
+
"response": "collection-record",
|
|
7815
|
+
"errors": [
|
|
7816
|
+
"unauthorized",
|
|
7817
|
+
"token_expired",
|
|
7818
|
+
"token_revoked",
|
|
7819
|
+
"invalid_uuid",
|
|
7820
|
+
"not_found",
|
|
7821
|
+
"collection_not_found",
|
|
7822
|
+
"validation_error",
|
|
7823
|
+
"required_missing",
|
|
7824
|
+
"reference_invalid",
|
|
7825
|
+
"robot_not_attached",
|
|
7826
|
+
"plan_limit",
|
|
7827
|
+
"rate_limited"
|
|
7828
|
+
],
|
|
7829
|
+
"transport": "http",
|
|
7830
|
+
"notes": "`values` holds the fields by key; defaults fill the fields left out. A collection that belongs to robots needs the `robot_id` of a robot the app has attached (`400 robot_not_attached`). A collection with one record per robot never creates or deletes records through the API: they come with the robots, and the attempt is `400 validation_error` with `rule: one_per_robot_is_automatic`. A required field with no value is `400 required_missing`, a reference that does not hold is `400 reference_invalid`, a value taken by another record of a unique field is `400 validation_error` with `rule: unique`. The values of a record may be 1,048,576 bytes as JSON; more is `400 validation_error` (field `values`, rule `record_too_large`), and so is a request body of more than 2 MiB, so a record at the cap is sent in a body a little over 1 MiB. Over the plan's record or byte limit the answer is `409 plan_limit`. \n\nWrites are limited to 600 a minute for the app and 120 for one caller; above that the answer is `429 rate_limited` with `retry_after_ms` in the details and a `Retry-After` header in seconds. Audited as `collection_record.created`."
|
|
7831
|
+
},
|
|
7832
|
+
{
|
|
7833
|
+
"method": "GET",
|
|
7834
|
+
"path": "/api/apps/:id/collections/:c/records/:rid",
|
|
7835
|
+
"section": "collections",
|
|
7836
|
+
"summary": "Reads one record.",
|
|
7837
|
+
"audience": "developer",
|
|
7838
|
+
"auth": "developer",
|
|
7839
|
+
"rateLimited": false,
|
|
7840
|
+
"ownerTier": false,
|
|
7841
|
+
"status": 200,
|
|
7842
|
+
"params": [
|
|
7843
|
+
{
|
|
7844
|
+
"name": "id",
|
|
7845
|
+
"description": "The app's uuid, as returned by `POST /api/apps` or listed by `GET /api/apps`. A malformed id is `400 invalid_uuid`."
|
|
7846
|
+
},
|
|
7847
|
+
{
|
|
7848
|
+
"name": "c",
|
|
7849
|
+
"description": "The collection's key, as listed by `GET /api/apps/:id/collections`. The records of a collection whose key is `schema` or `history` are reached the same way."
|
|
7850
|
+
},
|
|
7851
|
+
{
|
|
7852
|
+
"name": "rid",
|
|
7853
|
+
"description": "The record's uuid: the `id` of a record that a create or a list returned. A malformed id is `400 invalid_uuid`."
|
|
7854
|
+
}
|
|
7855
|
+
],
|
|
7856
|
+
"query": "collection-record-get-query",
|
|
7857
|
+
"request": null,
|
|
7858
|
+
"response": "collection-record",
|
|
7859
|
+
"errors": [
|
|
7860
|
+
"unauthorized",
|
|
7861
|
+
"token_expired",
|
|
7862
|
+
"token_revoked",
|
|
7863
|
+
"invalid_uuid",
|
|
7864
|
+
"not_found",
|
|
7865
|
+
"collection_not_found",
|
|
7866
|
+
"validation_error"
|
|
7867
|
+
],
|
|
7868
|
+
"transport": "http",
|
|
7869
|
+
"notes": "A record that is deleted, of another collection or of a robot the app has not attached reads exactly like one that never existed: `404 not_found`. Deleted records are found with `deleted=true` on the list. `expand` works as on the list: a reference field named in it holds the referenced record instead of its id, one hop deep; a name that is not a reference field is `400 validation_error`."
|
|
7870
|
+
},
|
|
7871
|
+
{
|
|
7872
|
+
"method": "PATCH",
|
|
7873
|
+
"path": "/api/apps/:id/collections/:c/records/:rid",
|
|
7874
|
+
"section": "collections",
|
|
7875
|
+
"summary": "Changes some fields of a record.",
|
|
7876
|
+
"audience": "developer",
|
|
7877
|
+
"auth": "developer",
|
|
7878
|
+
"rateLimited": false,
|
|
7879
|
+
"ownerTier": false,
|
|
7880
|
+
"status": 200,
|
|
7881
|
+
"params": [
|
|
7882
|
+
{
|
|
7883
|
+
"name": "id",
|
|
7884
|
+
"description": "The app's uuid, as returned by `POST /api/apps` or listed by `GET /api/apps`. A malformed id is `400 invalid_uuid`."
|
|
7885
|
+
},
|
|
7886
|
+
{
|
|
7887
|
+
"name": "c",
|
|
7888
|
+
"description": "The collection's key, as listed by `GET /api/apps/:id/collections`. The records of a collection whose key is `schema` or `history` are reached the same way."
|
|
7889
|
+
},
|
|
7890
|
+
{
|
|
7891
|
+
"name": "rid",
|
|
7892
|
+
"description": "The record's uuid: the `id` of a record that a create or a list returned. A malformed id is `400 invalid_uuid`."
|
|
7893
|
+
}
|
|
7894
|
+
],
|
|
7895
|
+
"query": null,
|
|
7896
|
+
"request": "collection-record-write",
|
|
7897
|
+
"response": "collection-record",
|
|
7898
|
+
"errors": [
|
|
7899
|
+
"unauthorized",
|
|
7900
|
+
"token_expired",
|
|
7901
|
+
"token_revoked",
|
|
7902
|
+
"invalid_uuid",
|
|
7903
|
+
"not_found",
|
|
7904
|
+
"collection_not_found",
|
|
7905
|
+
"validation_error",
|
|
7906
|
+
"required_missing",
|
|
7907
|
+
"reference_invalid",
|
|
7908
|
+
"record_changed",
|
|
7909
|
+
"plan_limit",
|
|
7910
|
+
"rate_limited"
|
|
7911
|
+
],
|
|
7912
|
+
"transport": "http",
|
|
7913
|
+
"notes": "Only the fields sent change; `null` clears a field. With `expected_revision`, a record that has moved on is `409 record_changed` with its current `revision` in the details, and nothing is changed. Clearing a required field is `400 required_missing`; a record whose required fields were emptied by a schema change can still be updated in its other fields. The `robot_id` of a record never changes: sending it is `400 validation_error`. The values of a record may be 1,048,576 bytes as JSON; more is `400 validation_error` (field `values`, rule `record_too_large`), and so is a request body of more than 2 MiB, so a record at the cap is sent in a body a little over 1 MiB. An update that makes the record bigger can be refused with `409 plan_limit`; one that makes it smaller never is. Audited as `collection_record.updated`."
|
|
7914
|
+
},
|
|
7915
|
+
{
|
|
7916
|
+
"method": "DELETE",
|
|
7917
|
+
"path": "/api/apps/:id/collections/:c/records/:rid",
|
|
7918
|
+
"section": "collections",
|
|
7919
|
+
"summary": "Deletes a record.",
|
|
7920
|
+
"audience": "developer",
|
|
7921
|
+
"auth": "developer",
|
|
7922
|
+
"rateLimited": false,
|
|
7923
|
+
"ownerTier": false,
|
|
7924
|
+
"status": 204,
|
|
7925
|
+
"params": [
|
|
7926
|
+
{
|
|
7927
|
+
"name": "id",
|
|
7928
|
+
"description": "The app's uuid, as returned by `POST /api/apps` or listed by `GET /api/apps`. A malformed id is `400 invalid_uuid`."
|
|
7929
|
+
},
|
|
7930
|
+
{
|
|
7931
|
+
"name": "c",
|
|
7932
|
+
"description": "The collection's key, as listed by `GET /api/apps/:id/collections`. The records of a collection whose key is `schema` or `history` are reached the same way."
|
|
7933
|
+
},
|
|
7934
|
+
{
|
|
7935
|
+
"name": "rid",
|
|
7936
|
+
"description": "The record's uuid: the `id` of a record that a create or a list returned. A malformed id is `400 invalid_uuid`."
|
|
7937
|
+
}
|
|
7938
|
+
],
|
|
7939
|
+
"query": null,
|
|
7940
|
+
"request": null,
|
|
7941
|
+
"response": null,
|
|
7942
|
+
"errors": [
|
|
7943
|
+
"unauthorized",
|
|
7944
|
+
"token_expired",
|
|
7945
|
+
"token_revoked",
|
|
7946
|
+
"invalid_uuid",
|
|
7947
|
+
"not_found",
|
|
7948
|
+
"collection_not_found",
|
|
7949
|
+
"validation_error",
|
|
7950
|
+
"record_referenced",
|
|
7951
|
+
"rate_limited"
|
|
7952
|
+
],
|
|
7953
|
+
"transport": "http",
|
|
7954
|
+
"notes": "A record that other records point at through a reference with `on_delete: prevent` is not deleted: `409 record_referenced`, with the collections that point at it, among those the caller may read, and how many records each has, never their ids or values. With `on_delete: clear` those references are cleared, each as a revision. The record stays in the history, with all its values, and can be restored. A collection with one record per robot refuses a delete with `400 validation_error`. Audited as `collection_record.deleted`."
|
|
7955
|
+
},
|
|
7956
|
+
{
|
|
7957
|
+
"method": "GET",
|
|
7958
|
+
"path": "/api/apps/:id/collections/:c/records/:rid/history",
|
|
7959
|
+
"section": "collections",
|
|
7960
|
+
"summary": "Reads a record's history, newest first.",
|
|
7961
|
+
"audience": "developer",
|
|
7962
|
+
"auth": "developer",
|
|
7963
|
+
"rateLimited": false,
|
|
7964
|
+
"ownerTier": false,
|
|
7965
|
+
"status": 200,
|
|
7966
|
+
"params": [
|
|
7967
|
+
{
|
|
7968
|
+
"name": "id",
|
|
7969
|
+
"description": "The app's uuid, as returned by `POST /api/apps` or listed by `GET /api/apps`. A malformed id is `400 invalid_uuid`."
|
|
7970
|
+
},
|
|
7971
|
+
{
|
|
7972
|
+
"name": "c",
|
|
7973
|
+
"description": "The collection's key, as listed by `GET /api/apps/:id/collections`. The records of a collection whose key is `schema` or `history` are reached the same way."
|
|
7974
|
+
},
|
|
7975
|
+
{
|
|
7976
|
+
"name": "rid",
|
|
7977
|
+
"description": "The record's uuid: the `id` of a record that a create or a list returned. A malformed id is `400 invalid_uuid`."
|
|
7978
|
+
}
|
|
7979
|
+
],
|
|
7980
|
+
"query": "collection-record-history-query",
|
|
7981
|
+
"request": null,
|
|
7982
|
+
"response": "collection-record-history-response",
|
|
7983
|
+
"errors": [
|
|
7984
|
+
"unauthorized",
|
|
7985
|
+
"token_expired",
|
|
7986
|
+
"token_revoked",
|
|
7987
|
+
"invalid_uuid",
|
|
7988
|
+
"not_found",
|
|
7989
|
+
"collection_not_found",
|
|
7990
|
+
"validation_error"
|
|
7991
|
+
],
|
|
7992
|
+
"transport": "http",
|
|
7993
|
+
"notes": "Each revision names the operation, the actor, the time, the reason when the change was not an ordinary write (`schema v5`, `import`, `restore v4`) and the fields it changed with their old and new value; a `delete` revision carries the whole record. The history also answers for a deleted record. `purged` is set when an organization owner removed the older part of it. Page with `before_seq`. Reads are not audited. \n\nA page of revisions ends at 4 MiB of stored revisions, since the changes of a revision keep the old and the new value and a `delete` the whole record. It always holds at least one revision, `next_before_seq` names the last revision the page holds, and a history of ordinary size is never cut."
|
|
7994
|
+
},
|
|
7995
|
+
{
|
|
7996
|
+
"method": "POST",
|
|
7997
|
+
"path": "/api/apps/:id/collections/:c/records/:rid/restore",
|
|
7998
|
+
"section": "collections",
|
|
7999
|
+
"summary": "Puts a record back to an earlier revision, or brings a deleted record back.",
|
|
8000
|
+
"audience": "developer",
|
|
8001
|
+
"auth": "developer",
|
|
8002
|
+
"rateLimited": false,
|
|
8003
|
+
"ownerTier": false,
|
|
8004
|
+
"status": 200,
|
|
8005
|
+
"params": [
|
|
8006
|
+
{
|
|
8007
|
+
"name": "id",
|
|
8008
|
+
"description": "The app's uuid, as returned by `POST /api/apps` or listed by `GET /api/apps`. A malformed id is `400 invalid_uuid`."
|
|
8009
|
+
},
|
|
8010
|
+
{
|
|
8011
|
+
"name": "c",
|
|
8012
|
+
"description": "The collection's key, as listed by `GET /api/apps/:id/collections`. The records of a collection whose key is `schema` or `history` are reached the same way."
|
|
8013
|
+
},
|
|
8014
|
+
{
|
|
8015
|
+
"name": "rid",
|
|
8016
|
+
"description": "The record's uuid: the `id` of a record that a create or a list returned. A malformed id is `400 invalid_uuid`."
|
|
8017
|
+
}
|
|
8018
|
+
],
|
|
8019
|
+
"query": null,
|
|
8020
|
+
"request": "collection-record-restore-request",
|
|
8021
|
+
"requestOptional": true,
|
|
8022
|
+
"response": "collection-record",
|
|
8023
|
+
"errors": [
|
|
8024
|
+
"unauthorized",
|
|
8025
|
+
"token_expired",
|
|
8026
|
+
"token_revoked",
|
|
8027
|
+
"invalid_uuid",
|
|
8028
|
+
"not_found",
|
|
8029
|
+
"collection_not_found",
|
|
8030
|
+
"validation_error",
|
|
8031
|
+
"plan_limit",
|
|
8032
|
+
"rate_limited"
|
|
8033
|
+
],
|
|
8034
|
+
"transport": "http",
|
|
8035
|
+
"notes": "With `seq`, the record gets the values it had after that revision; without it, a deleted record comes back as it was deleted, with its id. Fields that the schema no longer has and values that no longer validate are dropped, and a value that is now taken by another record of a unique field is refused with `400 validation_error`. The restore is a new revision (`op: restore`), never a rewrite of the history. Audited as `collection_record.restored`."
|
|
8036
|
+
},
|
|
8037
|
+
{
|
|
8038
|
+
"method": "POST",
|
|
8039
|
+
"path": "/api/apps/:id/collections/:c/import/preview",
|
|
8040
|
+
"section": "collections",
|
|
8041
|
+
"summary": "Checks a file of records against a collection and answers what importing it would do.",
|
|
8042
|
+
"audience": "developer",
|
|
8043
|
+
"auth": "developer",
|
|
8044
|
+
"rateLimited": false,
|
|
8045
|
+
"ownerTier": false,
|
|
8046
|
+
"status": 200,
|
|
8047
|
+
"params": [
|
|
8048
|
+
{
|
|
8049
|
+
"name": "id",
|
|
8050
|
+
"description": "The app's uuid, as returned by `POST /api/apps` or listed by `GET /api/apps`. A malformed id is `400 invalid_uuid`."
|
|
8051
|
+
},
|
|
8052
|
+
{
|
|
8053
|
+
"name": "c",
|
|
8054
|
+
"description": "The collection's key, as listed by `GET /api/apps/:id/collections`. The records of a collection whose key is `schema` or `history` are reached the same way."
|
|
8055
|
+
}
|
|
8056
|
+
],
|
|
8057
|
+
"query": null,
|
|
8058
|
+
"request": "collection-import-request",
|
|
8059
|
+
"response": "collection-import-preview",
|
|
8060
|
+
"errors": [
|
|
8061
|
+
"unauthorized",
|
|
8062
|
+
"token_expired",
|
|
8063
|
+
"token_revoked",
|
|
8064
|
+
"invalid_uuid",
|
|
8065
|
+
"not_found",
|
|
8066
|
+
"collection_not_found",
|
|
8067
|
+
"validation_error",
|
|
8068
|
+
"robot_not_attached",
|
|
8069
|
+
"rate_limited"
|
|
8070
|
+
],
|
|
8071
|
+
"transport": "http",
|
|
8072
|
+
"notes": "CSV (UTF-8, a header row, RFC 4180; a `json` field as JSON text) or a JSON array of objects, at most 10 MB and 50,000 rows; more is `400 validation_error`. Nothing is written. `counts` says how many records would be unchanged, new, updated and deleted. Every problem is listed with its row, column, value and reason, up to 1,000 of them; one invalid row, a reference that cannot be resolved, a plan limit that would be exceeded or a deletion that a `prevent` reference blocks fails the whole import. `token` is `null` while there are errors. In `mirror` mode, `mirror_scope: collection` means every record not in the file would be deleted: show it prominently. A `confirm` sent to this route is ignored. A blank cell is no value: the field's default on a new record, a cleared field on an existing one. A multiple `select` is a JSON list or comma-separated values, and a `json` field is JSON text. A column named after a system field is left out unless it is mapped, and the apostrophe that an export puts in front of a cell that looks like a formula is taken off. \n\nThe request body is at most 21,048,576 bytes (twice the 10,000,000 characters of a file, since a file inside a JSON string can double in size on the way, plus 1 MiB); a larger one is `400 validation_error`, field `content`, rule `too_large`. A request without a bearer token is `401` before its body is read. An app runs one import at a time, preview or confirmation, and the cloud three at once; the next is `429 rate_limited` with `retry_after_ms: 5000`. A large file can take a while in each of its two requests. The cloud sets no request timeout of its own, so a reverse proxy in front of it must not cut these routes short."
|
|
8073
|
+
},
|
|
8074
|
+
{
|
|
8075
|
+
"method": "POST",
|
|
8076
|
+
"path": "/api/apps/:id/collections/:c/import",
|
|
8077
|
+
"section": "collections",
|
|
8078
|
+
"summary": "Imports a file of records, all or nothing, once the preview has been confirmed.",
|
|
8079
|
+
"audience": "developer",
|
|
8080
|
+
"auth": "developer",
|
|
8081
|
+
"rateLimited": false,
|
|
8082
|
+
"ownerTier": false,
|
|
8083
|
+
"status": 200,
|
|
8084
|
+
"params": [
|
|
8085
|
+
{
|
|
8086
|
+
"name": "id",
|
|
8087
|
+
"description": "The app's uuid, as returned by `POST /api/apps` or listed by `GET /api/apps`. A malformed id is `400 invalid_uuid`."
|
|
8088
|
+
},
|
|
8089
|
+
{
|
|
8090
|
+
"name": "c",
|
|
8091
|
+
"description": "The collection's key, as listed by `GET /api/apps/:id/collections`. The records of a collection whose key is `schema` or `history` are reached the same way."
|
|
8092
|
+
}
|
|
8093
|
+
],
|
|
8094
|
+
"query": null,
|
|
8095
|
+
"request": "collection-import-request",
|
|
8096
|
+
"response": "collection-import-result",
|
|
8097
|
+
"errors": [
|
|
8098
|
+
"unauthorized",
|
|
8099
|
+
"token_expired",
|
|
8100
|
+
"token_revoked",
|
|
8101
|
+
"invalid_uuid",
|
|
8102
|
+
"not_found",
|
|
8103
|
+
"collection_not_found",
|
|
8104
|
+
"validation_error",
|
|
8105
|
+
"robot_not_attached",
|
|
8106
|
+
"confirmation_required",
|
|
8107
|
+
"plan_limit",
|
|
8108
|
+
"rate_limited"
|
|
8109
|
+
],
|
|
8110
|
+
"transport": "http",
|
|
8111
|
+
"notes": "The same body as the preview, with the preview's `token` as `confirm`. **Without `confirm` nothing is imported and the answer is `200` with the preview**, the body of the preview route and not an import result. With a token that is not the one of the current preview, because the data moved on or it belongs to another import, nothing is imported and the answer is `409 confirmation_required` with the current preview in `details.preview`. A file with errors is never imported: its preview, with `token: null`, comes back whatever `confirm` says. The token stands for the file and its settings, the counts, the records the import would match with their revisions and the ones a mirror would delete. It is not single-use, so a keyless import confirmed twice creates its rows twice: look at the collection before repeating a confirmation whose answer was lost. A confirmed import runs in one transaction: either every row is written, with revisions whose reason is `import`, or none is. It counts as one write for the rate limit however many rows it has, and is audited once as `collection_import.completed`. Records the import adds can take the organization over its plan's limit: `409 plan_limit`. On a single-organization instance whose licence has lapsed (read-only administration) it is `423 instance_read_only`; the preview is not. \n\nThe request body is at most 21,048,576 bytes (twice the 10,000,000 characters of a file, since a file inside a JSON string can double in size on the way, plus 1 MiB); a larger one is `400 validation_error`, field `content`, rule `too_large`. A request without a bearer token is `401` before its body is read. An app runs one import at a time, preview or confirmation, and the cloud three at once; the next is `429 rate_limited` with `retry_after_ms: 5000`. A large file can take a while in each of its two requests. The cloud sets no request timeout of its own, so a reverse proxy in front of it must not cut these routes short."
|
|
8112
|
+
},
|
|
8113
|
+
{
|
|
8114
|
+
"method": "GET",
|
|
8115
|
+
"path": "/api/apps/:id/collections/:c/export",
|
|
8116
|
+
"section": "collections",
|
|
8117
|
+
"summary": "Downloads the records of a collection as a CSV or JSON file.",
|
|
8118
|
+
"audience": "developer",
|
|
8119
|
+
"auth": "developer",
|
|
8120
|
+
"rateLimited": false,
|
|
8121
|
+
"ownerTier": false,
|
|
8122
|
+
"status": 200,
|
|
8123
|
+
"params": [
|
|
8124
|
+
{
|
|
8125
|
+
"name": "id",
|
|
8126
|
+
"description": "The app's uuid, as returned by `POST /api/apps` or listed by `GET /api/apps`. A malformed id is `400 invalid_uuid`."
|
|
8127
|
+
},
|
|
8128
|
+
{
|
|
8129
|
+
"name": "c",
|
|
8130
|
+
"description": "The collection's key, as listed by `GET /api/apps/:id/collections`. The records of a collection whose key is `schema` or `history` are reached the same way."
|
|
8131
|
+
}
|
|
8132
|
+
],
|
|
8133
|
+
"query": "collection-export-query",
|
|
8134
|
+
"request": null,
|
|
8135
|
+
"response": null,
|
|
8136
|
+
"contentType": "text/csv",
|
|
8137
|
+
"errors": [
|
|
8138
|
+
"unauthorized",
|
|
8139
|
+
"token_expired",
|
|
8140
|
+
"token_revoked",
|
|
8141
|
+
"invalid_uuid",
|
|
8142
|
+
"not_found",
|
|
8143
|
+
"collection_not_found",
|
|
8144
|
+
"validation_error",
|
|
8145
|
+
"robot_not_attached"
|
|
8146
|
+
],
|
|
8147
|
+
"transport": "http",
|
|
8148
|
+
"notes": "Answers `text/csv; charset=utf-8` as an attachment, or, with `format=json`, an attachment of `application/json`: an array of objects. Either way there is no response schema. The filter, search and sort are those of the record list, so the file holds what the list showed. The columns are `robot` (the robot's name) first in a collection that belongs to robots, then the fields, then with `system=true` `robot_id` (robot-bound collections), `id`, `created_at`, `created_by`, `updated_at`, `updated_by` and `revision`, where `created_by` and `updated_by` are the actors' labels. `references` writes reference fields as ids, or as a unique field of the target, so that the file can be imported again; a reference field whose target has no such unique field is `400 validation_error` (field `references`, rule `not_unique`). A cell that could be read as a formula gets an apostrophe in front, which an import takes off again. Reads and exports are not audited."
|
|
8149
|
+
},
|
|
8150
|
+
{
|
|
8151
|
+
"method": "GET",
|
|
8152
|
+
"path": "/api/client/collections",
|
|
8153
|
+
"section": "collections",
|
|
8154
|
+
"summary": "Lists the collections the caller may read, with their fields and what the caller may do with them.",
|
|
8155
|
+
"audience": "client",
|
|
8156
|
+
"auth": "developer_or_client",
|
|
8157
|
+
"rateLimited": false,
|
|
8158
|
+
"ownerTier": false,
|
|
8159
|
+
"status": 200,
|
|
8160
|
+
"params": [],
|
|
8161
|
+
"query": null,
|
|
8162
|
+
"request": null,
|
|
8163
|
+
"response": "collection-definitions-response",
|
|
8164
|
+
"errors": [
|
|
8165
|
+
"unauthorized",
|
|
8166
|
+
"token_expired",
|
|
8167
|
+
"token_revoked",
|
|
8168
|
+
"forbidden"
|
|
8169
|
+
],
|
|
8170
|
+
"transport": "http",
|
|
8171
|
+
"notes": "Everything an app needs to draw a form: for each readable collection its fields, its display template and `can`, what this caller may do with its records. A collection the caller cannot read is absent. The caller is an app user or a server key of the app; **a developer's bearer is answered `403 forbidden`**, because developers use `/api/apps/:id/collections`. \n\n**Who may do what.** Developers and the app's server keys do everything with records. The schema, its versions and its restore are for developers only, and purging old history is for an organization owner alone. An app user's rights come from `access` in the published schema, per collection: `read`, `create`, `update` and `delete` each name roles, and `update` and `delete` can also say `{ all, own }`, where `own` compares `created_by` with the caller. A collection, or an action, that `access` does not mention is allowed to nobody. In a collection that belongs to robots a caller reaches only the records of robots the app has attached and the caller's role reaches. The history of a record is readable, and its revisions restorable, by whoever may update it; a deleted record is brought back with the right to create. \n\n**`404 collection_not_found` or `403 forbidden`.** A caller who has none of `read`, `create`, `update` and `delete` on a collection is answered `404 collection_not_found`, exactly as for a key the schema does not have, so a collection they may not touch cannot be found out by asking. A caller who has some right on it, but not the one the request needs, is answered `403 forbidden`."
|
|
8172
|
+
},
|
|
8173
|
+
{
|
|
8174
|
+
"method": "GET",
|
|
8175
|
+
"path": "/api/client/collections/:c/records",
|
|
8176
|
+
"section": "collections",
|
|
8177
|
+
"summary": "Lists the records of a collection the caller may read, filtered, searched and sorted.",
|
|
8178
|
+
"audience": "client",
|
|
8179
|
+
"auth": "developer_or_client",
|
|
8180
|
+
"rateLimited": false,
|
|
8181
|
+
"ownerTier": false,
|
|
8182
|
+
"status": 200,
|
|
8183
|
+
"params": [
|
|
8184
|
+
{
|
|
8185
|
+
"name": "c",
|
|
8186
|
+
"description": "The collection's key, as listed by `GET /api/client/collections`."
|
|
8187
|
+
}
|
|
8188
|
+
],
|
|
8189
|
+
"query": "collection-record-list-query",
|
|
8190
|
+
"request": null,
|
|
8191
|
+
"response": "collection-record-list-response",
|
|
8192
|
+
"errors": [
|
|
8193
|
+
"unauthorized",
|
|
8194
|
+
"token_expired",
|
|
8195
|
+
"token_revoked",
|
|
8196
|
+
"forbidden",
|
|
8197
|
+
"collection_not_found",
|
|
8198
|
+
"validation_error",
|
|
8199
|
+
"robot_not_attached"
|
|
8200
|
+
],
|
|
8201
|
+
"transport": "http",
|
|
8202
|
+
"notes": "The twin of `GET /api/apps/:id/collections/:c/records`, for the app the bearer belongs to. **`404 collection_not_found` or `403 forbidden`.** A caller who has none of `read`, `create`, `update` and `delete` on a collection is answered `404 collection_not_found`, exactly as for a key the schema does not have, so a collection they may not touch cannot be found out by asking. A caller who has some right on it, but not the one the request needs, is answered `403 forbidden`. Records of a collection that belongs to robots are those of robots the app has attached and the caller's role reaches; asking for another robot is `400 robot_not_attached`. With `expand`, a referenced record is embedded only when the caller may read its collection; otherwise the field keeps the id. `deleted=true` needs the right to create, and lists each record with `deleted_at` and `deleted_by`. \n\n**A page can be cut short.** A page of records ends at 4 MiB of stored record values (for the list of deleted records, of the revisions that deleted them), so it can hold fewer than `limit` records while more follow. It always holds at least one record when there is one, `next_cursor` continues after the last record it holds, and a list of ordinary size is never cut; only `next_cursor: null` says the list is at its end. `total` is not affected, and the records `expand` embeds are not counted. \n\nA developer's bearer is answered `403 forbidden` (\"Developers use /api/apps/:id/collections.\")."
|
|
8203
|
+
},
|
|
8204
|
+
{
|
|
8205
|
+
"method": "POST",
|
|
8206
|
+
"path": "/api/client/collections/:c/records",
|
|
8207
|
+
"section": "collections",
|
|
8208
|
+
"summary": "Creates a record in a collection the caller may create in.",
|
|
8209
|
+
"audience": "client",
|
|
8210
|
+
"auth": "developer_or_client",
|
|
8211
|
+
"rateLimited": false,
|
|
8212
|
+
"ownerTier": false,
|
|
8213
|
+
"status": 201,
|
|
8214
|
+
"params": [
|
|
8215
|
+
{
|
|
8216
|
+
"name": "c",
|
|
8217
|
+
"description": "The collection's key, as listed by `GET /api/client/collections`."
|
|
8218
|
+
}
|
|
8219
|
+
],
|
|
8220
|
+
"query": null,
|
|
8221
|
+
"request": "collection-record-write",
|
|
8222
|
+
"response": "collection-record",
|
|
8223
|
+
"errors": [
|
|
8224
|
+
"unauthorized",
|
|
8225
|
+
"token_expired",
|
|
8226
|
+
"token_revoked",
|
|
8227
|
+
"forbidden",
|
|
8228
|
+
"collection_not_found",
|
|
8229
|
+
"validation_error",
|
|
8230
|
+
"required_missing",
|
|
8231
|
+
"reference_invalid",
|
|
8232
|
+
"robot_not_attached",
|
|
8233
|
+
"plan_limit",
|
|
8234
|
+
"rate_limited"
|
|
8235
|
+
],
|
|
8236
|
+
"transport": "http",
|
|
8237
|
+
"notes": "The twin of `POST /api/apps/:id/collections/:c/records`, with the same rules and limits. The caller needs the right to create in `access`. An app user who sets a reference must be allowed to read the target collection, otherwise `400 reference_invalid` with the reason `not_readable`. The record's `created_by` is the caller; it is what `own` compares later. The values of a record may be 1,048,576 bytes as JSON; more is `400 validation_error` (field `values`, rule `record_too_large`), and so is a request body of more than 2 MiB, so a record at the cap is sent in a body a little over 1 MiB. \n\nA developer's bearer is answered `403 forbidden` (\"Developers use /api/apps/:id/collections.\")."
|
|
8238
|
+
},
|
|
8239
|
+
{
|
|
8240
|
+
"method": "GET",
|
|
8241
|
+
"path": "/api/client/collections/:c/records/:rid",
|
|
8242
|
+
"section": "collections",
|
|
8243
|
+
"summary": "Reads one record the caller may read.",
|
|
8244
|
+
"audience": "client",
|
|
8245
|
+
"auth": "developer_or_client",
|
|
8246
|
+
"rateLimited": false,
|
|
8247
|
+
"ownerTier": false,
|
|
8248
|
+
"status": 200,
|
|
8249
|
+
"params": [
|
|
8250
|
+
{
|
|
8251
|
+
"name": "c",
|
|
8252
|
+
"description": "The collection's key, as listed by `GET /api/client/collections`."
|
|
8253
|
+
},
|
|
8254
|
+
{
|
|
8255
|
+
"name": "rid",
|
|
8256
|
+
"description": "The record's uuid: the `id` of a record that a create or a list returned. A malformed id is `400 invalid_uuid`."
|
|
8257
|
+
}
|
|
8258
|
+
],
|
|
8259
|
+
"query": "collection-record-get-query",
|
|
8260
|
+
"request": null,
|
|
8261
|
+
"response": "collection-record",
|
|
8262
|
+
"errors": [
|
|
8263
|
+
"unauthorized",
|
|
8264
|
+
"token_expired",
|
|
8265
|
+
"token_revoked",
|
|
8266
|
+
"forbidden",
|
|
8267
|
+
"invalid_uuid",
|
|
8268
|
+
"not_found",
|
|
8269
|
+
"collection_not_found",
|
|
8270
|
+
"validation_error"
|
|
8271
|
+
],
|
|
8272
|
+
"transport": "http",
|
|
8273
|
+
"notes": "A record of a robot the caller does not reach reads exactly like one that does not exist: `404 not_found`. `expand` works as on the list: a referenced record is embedded only when the caller may read its collection, otherwise the field keeps the id; a name that is not a reference field is `400 validation_error`. A developer's bearer is answered `403 forbidden` (\"Developers use /api/apps/:id/collections.\")."
|
|
8274
|
+
},
|
|
8275
|
+
{
|
|
8276
|
+
"method": "PATCH",
|
|
8277
|
+
"path": "/api/client/collections/:c/records/:rid",
|
|
8278
|
+
"section": "collections",
|
|
8279
|
+
"summary": "Changes some fields of a record the caller may update.",
|
|
8280
|
+
"audience": "client",
|
|
8281
|
+
"auth": "developer_or_client",
|
|
8282
|
+
"rateLimited": false,
|
|
8283
|
+
"ownerTier": false,
|
|
8284
|
+
"status": 200,
|
|
8285
|
+
"params": [
|
|
8286
|
+
{
|
|
8287
|
+
"name": "c",
|
|
8288
|
+
"description": "The collection's key, as listed by `GET /api/client/collections`."
|
|
8289
|
+
},
|
|
8290
|
+
{
|
|
8291
|
+
"name": "rid",
|
|
8292
|
+
"description": "The record's uuid: the `id` of a record that a create or a list returned. A malformed id is `400 invalid_uuid`."
|
|
8293
|
+
}
|
|
8294
|
+
],
|
|
8295
|
+
"query": null,
|
|
8296
|
+
"request": "collection-record-write",
|
|
8297
|
+
"response": "collection-record",
|
|
8298
|
+
"errors": [
|
|
8299
|
+
"unauthorized",
|
|
8300
|
+
"token_expired",
|
|
8301
|
+
"token_revoked",
|
|
8302
|
+
"forbidden",
|
|
8303
|
+
"invalid_uuid",
|
|
8304
|
+
"not_found",
|
|
8305
|
+
"collection_not_found",
|
|
8306
|
+
"validation_error",
|
|
8307
|
+
"required_missing",
|
|
8308
|
+
"reference_invalid",
|
|
8309
|
+
"record_changed",
|
|
8310
|
+
"plan_limit",
|
|
8311
|
+
"rate_limited"
|
|
8312
|
+
],
|
|
8313
|
+
"transport": "http",
|
|
8314
|
+
"notes": "The twin of `PATCH /api/apps/:id/collections/:c/records/:rid`. Where `access` allows `update` for `own` records only, a record created by someone else is `403 forbidden` for this caller. The values of a record may be 1,048,576 bytes as JSON; more is `400 validation_error` (field `values`, rule `record_too_large`), and so is a request body of more than 2 MiB, so a record at the cap is sent in a body a little over 1 MiB. A developer's bearer is answered `403 forbidden` (\"Developers use /api/apps/:id/collections.\")."
|
|
8315
|
+
},
|
|
8316
|
+
{
|
|
8317
|
+
"method": "DELETE",
|
|
8318
|
+
"path": "/api/client/collections/:c/records/:rid",
|
|
8319
|
+
"section": "collections",
|
|
8320
|
+
"summary": "Deletes a record the caller may delete.",
|
|
8321
|
+
"audience": "client",
|
|
8322
|
+
"auth": "developer_or_client",
|
|
8323
|
+
"rateLimited": false,
|
|
8324
|
+
"ownerTier": false,
|
|
8325
|
+
"status": 204,
|
|
8326
|
+
"params": [
|
|
8327
|
+
{
|
|
8328
|
+
"name": "c",
|
|
8329
|
+
"description": "The collection's key, as listed by `GET /api/client/collections`."
|
|
8330
|
+
},
|
|
8331
|
+
{
|
|
8332
|
+
"name": "rid",
|
|
8333
|
+
"description": "The record's uuid: the `id` of a record that a create or a list returned. A malformed id is `400 invalid_uuid`."
|
|
8334
|
+
}
|
|
8335
|
+
],
|
|
8336
|
+
"query": null,
|
|
8337
|
+
"request": null,
|
|
8338
|
+
"response": null,
|
|
8339
|
+
"errors": [
|
|
8340
|
+
"unauthorized",
|
|
8341
|
+
"token_expired",
|
|
8342
|
+
"token_revoked",
|
|
8343
|
+
"forbidden",
|
|
8344
|
+
"invalid_uuid",
|
|
8345
|
+
"not_found",
|
|
8346
|
+
"collection_not_found",
|
|
8347
|
+
"validation_error",
|
|
8348
|
+
"record_referenced",
|
|
8349
|
+
"rate_limited"
|
|
8350
|
+
],
|
|
8351
|
+
"transport": "http",
|
|
8352
|
+
"notes": "The twin of `DELETE /api/apps/:id/collections/:c/records/:rid`. `409 record_referenced` carries counts only, and names only collections the caller may read, so a caller learns nothing about records in collections they may not read. A developer's bearer is answered `403 forbidden` (\"Developers use /api/apps/:id/collections.\")."
|
|
8353
|
+
},
|
|
8354
|
+
{
|
|
8355
|
+
"method": "GET",
|
|
8356
|
+
"path": "/api/client/collections/:c/records/:rid/history",
|
|
8357
|
+
"section": "collections",
|
|
8358
|
+
"summary": "Reads the history of a record the caller may update.",
|
|
8359
|
+
"audience": "client",
|
|
8360
|
+
"auth": "developer_or_client",
|
|
8361
|
+
"rateLimited": false,
|
|
8362
|
+
"ownerTier": false,
|
|
8363
|
+
"status": 200,
|
|
8364
|
+
"params": [
|
|
8365
|
+
{
|
|
8366
|
+
"name": "c",
|
|
8367
|
+
"description": "The collection's key, as listed by `GET /api/client/collections`."
|
|
8368
|
+
},
|
|
8369
|
+
{
|
|
8370
|
+
"name": "rid",
|
|
8371
|
+
"description": "The record's uuid: the `id` of a record that a create or a list returned. A malformed id is `400 invalid_uuid`."
|
|
8372
|
+
}
|
|
8373
|
+
],
|
|
8374
|
+
"query": "collection-record-history-query",
|
|
8375
|
+
"request": null,
|
|
8376
|
+
"response": "collection-record-history-response",
|
|
8377
|
+
"errors": [
|
|
8378
|
+
"unauthorized",
|
|
8379
|
+
"token_expired",
|
|
8380
|
+
"token_revoked",
|
|
8381
|
+
"forbidden",
|
|
8382
|
+
"invalid_uuid",
|
|
8383
|
+
"not_found",
|
|
8384
|
+
"collection_not_found",
|
|
8385
|
+
"validation_error"
|
|
8386
|
+
],
|
|
8387
|
+
"transport": "http",
|
|
8388
|
+
"notes": "Whoever may update a record may read its history; the right to read alone is not enough. With `own`, that is the records the caller created. A page of revisions ends at 4 MiB of stored revisions, since the changes of a revision keep the old and the new value and a `delete` the whole record. It always holds at least one revision, `next_before_seq` names the last revision the page holds, and a history of ordinary size is never cut. A developer's bearer is answered `403 forbidden` (\"Developers use /api/apps/:id/collections.\")."
|
|
8389
|
+
},
|
|
8390
|
+
{
|
|
8391
|
+
"method": "POST",
|
|
8392
|
+
"path": "/api/client/collections/:c/records/:rid/restore",
|
|
8393
|
+
"section": "collections",
|
|
8394
|
+
"summary": "Puts a record back to an earlier revision, or brings a deleted record back.",
|
|
8395
|
+
"audience": "client",
|
|
8396
|
+
"auth": "developer_or_client",
|
|
8397
|
+
"rateLimited": false,
|
|
8398
|
+
"ownerTier": false,
|
|
8399
|
+
"status": 200,
|
|
8400
|
+
"params": [
|
|
8401
|
+
{
|
|
8402
|
+
"name": "c",
|
|
8403
|
+
"description": "The collection's key, as listed by `GET /api/client/collections`."
|
|
8404
|
+
},
|
|
8405
|
+
{
|
|
8406
|
+
"name": "rid",
|
|
8407
|
+
"description": "The record's uuid: the `id` of a record that a create or a list returned. A malformed id is `400 invalid_uuid`."
|
|
8408
|
+
}
|
|
8409
|
+
],
|
|
8410
|
+
"query": null,
|
|
8411
|
+
"request": "collection-record-restore-request",
|
|
8412
|
+
"requestOptional": true,
|
|
8413
|
+
"response": "collection-record",
|
|
8414
|
+
"errors": [
|
|
8415
|
+
"unauthorized",
|
|
8416
|
+
"token_expired",
|
|
8417
|
+
"token_revoked",
|
|
8418
|
+
"forbidden",
|
|
8419
|
+
"invalid_uuid",
|
|
8420
|
+
"not_found",
|
|
8421
|
+
"collection_not_found",
|
|
8422
|
+
"validation_error",
|
|
8423
|
+
"plan_limit",
|
|
8424
|
+
"rate_limited"
|
|
8425
|
+
],
|
|
8426
|
+
"transport": "http",
|
|
8427
|
+
"notes": "The twin of `POST /api/apps/:id/collections/:c/records/:rid/restore`. Restoring a revision of a live record needs the right to update it; bringing a deleted record back needs the right to create. Every key of the body is optional. A developer's bearer is answered `403 forbidden` (\"Developers use /api/apps/:id/collections.\")."
|
|
8428
|
+
},
|
|
8429
|
+
{
|
|
8430
|
+
"method": "POST",
|
|
8431
|
+
"path": "/api/client/collections/:c/import/preview",
|
|
8432
|
+
"section": "collections",
|
|
8433
|
+
"summary": "Checks a file of records against a collection and answers what importing it would do.",
|
|
8434
|
+
"audience": "client",
|
|
8435
|
+
"auth": "developer_or_client",
|
|
8436
|
+
"rateLimited": false,
|
|
8437
|
+
"ownerTier": false,
|
|
8438
|
+
"status": 200,
|
|
8439
|
+
"params": [
|
|
8440
|
+
{
|
|
8441
|
+
"name": "c",
|
|
8442
|
+
"description": "The collection's key, as listed by `GET /api/client/collections`."
|
|
8443
|
+
}
|
|
8444
|
+
],
|
|
8445
|
+
"query": null,
|
|
8446
|
+
"request": "collection-import-request",
|
|
8447
|
+
"response": "collection-import-preview",
|
|
8448
|
+
"errors": [
|
|
8449
|
+
"unauthorized",
|
|
8450
|
+
"token_expired",
|
|
8451
|
+
"token_revoked",
|
|
8452
|
+
"forbidden",
|
|
8453
|
+
"collection_not_found",
|
|
8454
|
+
"validation_error",
|
|
8455
|
+
"robot_not_attached",
|
|
8456
|
+
"rate_limited"
|
|
8457
|
+
],
|
|
8458
|
+
"transport": "http",
|
|
8459
|
+
"notes": "The twin of `POST /api/apps/:id/collections/:c/import/preview`. **A server key only**: import and export are for developers and for the app's server keys, so an app user is answered `403 forbidden` for any collection key, one that does not exist included, before the collection is looked at. A developer's bearer is answered `403 forbidden` (\"Developers use /api/apps/:id/collections.\"). \n\nA blank cell is no value: the field's default on a new record, a cleared field on an existing one. A multiple `select` is a JSON list or comma-separated values, and a `json` field is JSON text. A column named after a system field is left out unless it is mapped, and the apostrophe that an export puts in front of a cell that looks like a formula is taken off. \n\nThe request body is at most 21,048,576 bytes (twice the 10,000,000 characters of a file, since a file inside a JSON string can double in size on the way, plus 1 MiB); a larger one is `400 validation_error`, field `content`, rule `too_large`. A request without a bearer token is `401` before its body is read. An app runs one import at a time, preview or confirmation, and the cloud three at once; the next is `429 rate_limited` with `retry_after_ms: 5000`. A large file can take a while in each of its two requests. The cloud sets no request timeout of its own, so a reverse proxy in front of it must not cut these routes short."
|
|
8460
|
+
},
|
|
8461
|
+
{
|
|
8462
|
+
"method": "POST",
|
|
8463
|
+
"path": "/api/client/collections/:c/import",
|
|
8464
|
+
"section": "collections",
|
|
8465
|
+
"summary": "Imports a file of records, all or nothing, once the preview has been confirmed.",
|
|
8466
|
+
"audience": "client",
|
|
8467
|
+
"auth": "developer_or_client",
|
|
8468
|
+
"rateLimited": false,
|
|
8469
|
+
"ownerTier": false,
|
|
8470
|
+
"status": 200,
|
|
8471
|
+
"params": [
|
|
8472
|
+
{
|
|
8473
|
+
"name": "c",
|
|
8474
|
+
"description": "The collection's key, as listed by `GET /api/client/collections`."
|
|
8475
|
+
}
|
|
8476
|
+
],
|
|
8477
|
+
"query": null,
|
|
8478
|
+
"request": "collection-import-request",
|
|
8479
|
+
"response": "collection-import-result",
|
|
8480
|
+
"errors": [
|
|
8481
|
+
"unauthorized",
|
|
8482
|
+
"token_expired",
|
|
8483
|
+
"token_revoked",
|
|
8484
|
+
"forbidden",
|
|
8485
|
+
"collection_not_found",
|
|
8486
|
+
"validation_error",
|
|
8487
|
+
"robot_not_attached",
|
|
8488
|
+
"confirmation_required",
|
|
8489
|
+
"plan_limit",
|
|
8490
|
+
"rate_limited"
|
|
8491
|
+
],
|
|
8492
|
+
"transport": "http",
|
|
8493
|
+
"notes": "The twin of `POST /api/apps/:id/collections/:c/import`, with the same two-step confirmation: without `confirm` the answer is `200` with the preview and nothing is imported, and the token is not single-use. **A server key only**; an app user is answered `403 forbidden` for any collection key, one that does not exist included, before the collection is looked at. On a single-organization instance whose licence has lapsed (read-only administration) it is `423 instance_read_only`, as the developer import is; the preview, single record writes and reads stay allowed. A developer's bearer is answered `403 forbidden` (\"Developers use /api/apps/:id/collections.\"). \n\nThe request body is at most 21,048,576 bytes (twice the 10,000,000 characters of a file, since a file inside a JSON string can double in size on the way, plus 1 MiB); a larger one is `400 validation_error`, field `content`, rule `too_large`. A request without a bearer token is `401` before its body is read. An app runs one import at a time, preview or confirmation, and the cloud three at once; the next is `429 rate_limited` with `retry_after_ms: 5000`. A large file can take a while in each of its two requests. The cloud sets no request timeout of its own, so a reverse proxy in front of it must not cut these routes short."
|
|
8494
|
+
},
|
|
8495
|
+
{
|
|
8496
|
+
"method": "GET",
|
|
8497
|
+
"path": "/api/client/collections/:c/export",
|
|
8498
|
+
"section": "collections",
|
|
8499
|
+
"summary": "Downloads the records of a collection as a CSV or JSON file.",
|
|
8500
|
+
"audience": "client",
|
|
8501
|
+
"auth": "developer_or_client",
|
|
8502
|
+
"rateLimited": false,
|
|
8503
|
+
"ownerTier": false,
|
|
8504
|
+
"status": 200,
|
|
8505
|
+
"params": [
|
|
8506
|
+
{
|
|
8507
|
+
"name": "c",
|
|
8508
|
+
"description": "The collection's key, as listed by `GET /api/client/collections`."
|
|
8509
|
+
}
|
|
8510
|
+
],
|
|
8511
|
+
"query": "collection-export-query",
|
|
8512
|
+
"request": null,
|
|
8513
|
+
"response": null,
|
|
8514
|
+
"contentType": "text/csv",
|
|
8515
|
+
"errors": [
|
|
8516
|
+
"unauthorized",
|
|
8517
|
+
"token_expired",
|
|
8518
|
+
"token_revoked",
|
|
8519
|
+
"forbidden",
|
|
8520
|
+
"collection_not_found",
|
|
8521
|
+
"validation_error",
|
|
8522
|
+
"robot_not_attached"
|
|
8523
|
+
],
|
|
8524
|
+
"transport": "http",
|
|
8525
|
+
"notes": "The twin of `GET /api/apps/:id/collections/:c/export`: `text/csv; charset=utf-8` as an attachment, or JSON when `format=json`. **A server key only**; an app user is answered `403 forbidden` for any collection key, one that does not exist included, before the collection is looked at. A server key exports the records of the robots the app has attached. A developer's bearer is answered `403 forbidden` (\"Developers use /api/apps/:id/collections.\")."
|
|
8526
|
+
},
|
|
7406
8527
|
{
|
|
7407
8528
|
"method": "GET",
|
|
7408
8529
|
"path": "/bridge",
|
|
@@ -7427,7 +8548,7 @@
|
|
|
7427
8548
|
"method": "GET",
|
|
7428
8549
|
"path": "/realtime",
|
|
7429
8550
|
"section": "transports",
|
|
7430
|
-
"summary": "The client WebSocket: subscriptions on datapoints (the built-in bridge state included), jobs and
|
|
8551
|
+
"summary": "The client WebSocket: subscriptions on datapoints (the built-in bridge state included), jobs, cameras and app collections, plus full command parity with REST.",
|
|
7431
8552
|
"audience": "client",
|
|
7432
8553
|
"auth": "none",
|
|
7433
8554
|
"rateLimited": false,
|
|
@@ -7442,7 +8563,7 @@
|
|
|
7442
8563
|
"rate_limited"
|
|
7443
8564
|
],
|
|
7444
8565
|
"transport": "websocket",
|
|
7445
|
-
"notes": "Authentication happens in the first frame, not on the upgrade. The frame types are the `realtime` schemas."
|
|
8566
|
+
"notes": "Authentication happens in the first frame, not on the upgrade. The frame types are the `realtime` schemas. \n\n**App collections.** `collection_subscribe` and `collection_unsubscribe` open and close a subscription to the records of one collection; `collection_subscribed` says that an accepted subscription is registered; `collection_event` carries `created`, `updated`, `deleted`, `removed` and `entered` with the whole record; `collection_subscribe_error` refuses a subscribe or ends a running subscription; `collections_schema_published` tells every socket with a subscription of the app that a version is in force. There is no snapshot: subscribe, wait for `collection_subscribed`, then list, and no change can fall between the list and the events. A developer connection names the app in `app_id`. A socket holds at most 50 collection subscriptions. A frame of more than 16,384 bytes closes the socket with 1009, and a socket that falls too far behind (more than 8 MiB in its send buffer, or more than 2,000 collection changes waiting to be delivered, as a bulk import into a big collection causes) is closed with 1013, \"try again later\": the client reconnects, subscribes, waits for `collection_subscribed` and lists again."
|
|
7446
8567
|
}
|
|
7447
8568
|
]
|
|
7448
8569
|
}
|