@fleetless/contracts 13.3.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 +304 -0
- package/artifacts/openapi.json +20156 -10513
- package/artifacts/routes.json +1429 -292
- package/artifacts/schema/access-warning.schema.json +51 -0
- package/artifacts/schema/action-config.schema.json +35 -0
- 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-access-response.schema.json +136 -0
- package/artifacts/schema/app-access.schema.json +80 -0
- package/artifacts/schema/app-deletion-summary.schema.json +15 -8
- package/artifacts/schema/app-invitation-list-response.schema.json +13 -6
- package/artifacts/schema/app-invitation.schema.json +5 -5
- package/artifacts/schema/app-list-response.schema.json +6 -6
- package/artifacts/schema/app-lock.schema.json +30 -0
- package/artifacts/schema/app-user-list-response.schema.json +13 -6
- package/artifacts/schema/app-user.schema.json +13 -6
- package/artifacts/schema/app.schema.json +6 -6
- package/artifacts/schema/asset-plan-limit-details.schema.json +3 -1
- package/artifacts/schema/auth-ok.schema.json +20 -6
- package/artifacts/schema/camera-list-response.schema.json +1 -1
- package/artifacts/schema/client-identity.schema.json +21 -6
- package/artifacts/schema/cloud-config.schema.json +359 -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 +359 -5
- package/artifacts/schema/config-version-response.schema.json +359 -5
- package/artifacts/schema/confirmation-required-details.schema.json +13 -0
- package/artifacts/schema/create-app-invitation-request.schema.json +4 -4
- package/artifacts/schema/create-app-user-request.schema.json +4 -4
- package/artifacts/schema/create-org-role-request.schema.json +33 -0
- package/artifacts/schema/dangling-reference.schema.json +130 -0
- package/artifacts/schema/datapoint-config.schema.json +35 -0
- package/artifacts/schema/datapoint-list-response.schema.json +2 -2
- package/artifacts/schema/effective-capability.schema.json +104 -0
- package/artifacts/schema/effective-rights-query.schema.json +19 -0
- package/artifacts/schema/effective-rights-response.schema.json +396 -0
- package/artifacts/schema/effective-robot-rights.schema.json +266 -0
- package/artifacts/schema/invoke-or-service-response.schema.json +1 -1
- package/artifacts/schema/invoke-response.schema.json +1 -1
- package/artifacts/schema/journal-intent-v2-body.schema.json +74 -0
- package/artifacts/schema/journal-intent-v2.schema.json +84 -0
- package/artifacts/schema/journal-replay-receipt-body.schema.json +1 -0
- package/artifacts/schema/journal-replay-receipt.schema.json +1 -0
- package/artifacts/schema/mcp-robot-datasheet.schema.json +2 -2
- 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 +206 -0
- package/artifacts/schema/org-role.schema.json +59 -0
- package/artifacts/schema/patch-app-user-request.schema.json +4 -4
- package/artifacts/schema/patch-org-role-request.schema.json +38 -0
- 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/publish-config-response.schema.json +48 -1
- package/artifacts/schema/publisher-config.schema.json +35 -0
- package/artifacts/schema/put-collections-draft-request.schema.json +16 -0
- package/artifacts/schema/put-role-defaults-request.schema.json +127 -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 +112 -0
- package/artifacts/schema/rename-slug-response.schema.json +4 -3
- package/artifacts/schema/required-missing-details.schema.json +19 -0
- package/artifacts/schema/robot-config-doc.schema.json +359 -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-cycle-details.schema.json +18 -0
- package/artifacts/schema/role-defaults-response.schema.json +59 -0
- package/artifacts/schema/role-rename-preview.schema.json +147 -0
- package/artifacts/schema/service-config.schema.json +35 -0
- package/artifacts/schema/slug-usage-response.schema.json +4 -3
- package/artifacts/schema/update-app-request.schema.json +0 -12
- package/dist/app-users.d.ts +11 -8
- package/dist/app-users.js +18 -10
- package/dist/apps.d.ts +258 -71
- package/dist/apps.js +215 -151
- package/dist/audit.d.ts +35 -5
- package/dist/audit.js +40 -2
- package/dist/billing.d.ts +10 -10
- package/dist/client-auth.d.ts +5 -2
- package/dist/client-auth.js +11 -3
- package/dist/client-robots.d.ts +1 -1
- package/dist/client-robots.js +1 -1
- 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/common.d.ts +1 -1
- package/dist/common.js +1 -1
- package/dist/config-issues.d.ts +1 -1
- package/dist/config-issues.js +1 -1
- package/dist/config.d.ts +78 -12
- package/dist/config.js +109 -15
- package/dist/errors.d.ts +63 -5
- package/dist/errors.js +152 -24
- package/dist/index.d.ts +40 -14
- package/dist/index.js +27 -7
- package/dist/journal-intents.d.ts +30 -0
- package/dist/journal-intents.js +3 -0
- package/dist/legal-acceptances.d.ts +2 -2
- package/dist/mcp.d.ts +5 -37
- package/dist/mcp.js +4 -14
- package/dist/org-roles.d.ts +186 -0
- package/dist/org-roles.js +199 -0
- package/dist/plans.d.ts +25 -7
- package/dist/plans.js +21 -1
- package/dist/protocol.d.ts +19 -1
- package/dist/realtime.d.ts +172 -3
- package/dist/realtime.js +164 -1
- package/dist/rest.d.ts +104 -53
- package/dist/rest.js +79 -55
- package/dist/rights.d.ts +197 -0
- package/dist/rights.js +396 -0
- package/dist/routes.d.ts +1 -1
- package/dist/routes.js +675 -150
- package/package.json +1 -1
- package/artifacts/schema/mcp-role-preview-response.schema.json +0 -134
- 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/schema/role-delete-query.schema.json +0 -13
- package/artifacts/schema/role-in-use-details.schema.json +0 -28
- package/artifacts/schema/role-list-response.schema.json +0 -48
- package/artifacts/schema/role-permissions.schema.json +0 -61
- package/artifacts/schema/role-rename-request.schema.json +0 -16
- package/artifacts/schema/role.schema.json +0 -35
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"
|
|
@@ -645,6 +649,160 @@
|
|
|
645
649
|
"transport": "http",
|
|
646
650
|
"notes": "The authenticated org is the only target. Null contacts explicitly clear earlier values. The write is atomic and audited; billing data is never an implicit source. Support sessions cannot write."
|
|
647
651
|
},
|
|
652
|
+
{
|
|
653
|
+
"method": "GET",
|
|
654
|
+
"path": "/api/org/roles",
|
|
655
|
+
"section": "org",
|
|
656
|
+
"summary": "Lists the organization's roles with how much depends on each, and the keys that are written somewhere but are no role.",
|
|
657
|
+
"audience": "developer",
|
|
658
|
+
"auth": "developer",
|
|
659
|
+
"rateLimited": false,
|
|
660
|
+
"ownerTier": false,
|
|
661
|
+
"status": 200,
|
|
662
|
+
"params": [],
|
|
663
|
+
"query": null,
|
|
664
|
+
"request": null,
|
|
665
|
+
"response": "org-role-list-response",
|
|
666
|
+
"errors": [
|
|
667
|
+
"unauthorized",
|
|
668
|
+
"token_expired",
|
|
669
|
+
"token_revoked"
|
|
670
|
+
],
|
|
671
|
+
"transport": "http",
|
|
672
|
+
"notes": "Roles belong to the organization and are shared by all its apps; console members hold none and are never filtered by them. Each role carries the number of app users that hold it, of invitations that carry it, of apps that use it as their default and of places in documents that name it. `dangling` lists the keys that are written somewhere and are no role, each with every place that writes it, so a deleted or misspelled key can be found. None of this is an error: a key that names no role grants nothing and is reported here."
|
|
673
|
+
},
|
|
674
|
+
{
|
|
675
|
+
"method": "POST",
|
|
676
|
+
"path": "/api/org/roles",
|
|
677
|
+
"section": "org",
|
|
678
|
+
"summary": "Creates an organization role.",
|
|
679
|
+
"audience": "developer",
|
|
680
|
+
"auth": "developer",
|
|
681
|
+
"rateLimited": false,
|
|
682
|
+
"ownerTier": false,
|
|
683
|
+
"status": 201,
|
|
684
|
+
"params": [],
|
|
685
|
+
"query": null,
|
|
686
|
+
"request": "create-org-role-request",
|
|
687
|
+
"response": "org-role",
|
|
688
|
+
"errors": [
|
|
689
|
+
"unauthorized",
|
|
690
|
+
"token_expired",
|
|
691
|
+
"token_revoked",
|
|
692
|
+
"validation_error",
|
|
693
|
+
"role_cycle",
|
|
694
|
+
"role_key_taken"
|
|
695
|
+
],
|
|
696
|
+
"transport": "http",
|
|
697
|
+
"notes": "An organization holds at most 50 roles; the next one is `400 validation_error`. A key in `inherits` that names no role is accepted and warns: inheritance through it grants nothing until a role with that key exists. A role that would inherit from itself, as `inherits` naming its own key does, is `400 role_cycle`. A key that another role has is `409 role_key_taken`."
|
|
698
|
+
},
|
|
699
|
+
{
|
|
700
|
+
"method": "PATCH",
|
|
701
|
+
"path": "/api/org/roles/:key",
|
|
702
|
+
"section": "org",
|
|
703
|
+
"summary": "Changes a role's name, its parents or its key.",
|
|
704
|
+
"audience": "developer",
|
|
705
|
+
"auth": "developer",
|
|
706
|
+
"rateLimited": false,
|
|
707
|
+
"ownerTier": false,
|
|
708
|
+
"status": 200,
|
|
709
|
+
"params": [
|
|
710
|
+
{
|
|
711
|
+
"name": "key",
|
|
712
|
+
"description": "The role's key, as listed by `GET /api/org/roles`; a key that names no role answers `404`."
|
|
713
|
+
}
|
|
714
|
+
],
|
|
715
|
+
"query": null,
|
|
716
|
+
"request": "patch-org-role-request",
|
|
717
|
+
"response": "org-role",
|
|
718
|
+
"errors": [
|
|
719
|
+
"unauthorized",
|
|
720
|
+
"token_expired",
|
|
721
|
+
"token_revoked",
|
|
722
|
+
"validation_error",
|
|
723
|
+
"not_found",
|
|
724
|
+
"role_cycle",
|
|
725
|
+
"role_key_taken",
|
|
726
|
+
"confirmation_required",
|
|
727
|
+
"rate_limited"
|
|
728
|
+
],
|
|
729
|
+
"transport": "http",
|
|
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`."
|
|
731
|
+
},
|
|
732
|
+
{
|
|
733
|
+
"method": "DELETE",
|
|
734
|
+
"path": "/api/org/roles/:key",
|
|
735
|
+
"section": "org",
|
|
736
|
+
"summary": "Deletes a role at once.",
|
|
737
|
+
"audience": "developer",
|
|
738
|
+
"auth": "developer",
|
|
739
|
+
"rateLimited": false,
|
|
740
|
+
"ownerTier": false,
|
|
741
|
+
"status": 204,
|
|
742
|
+
"params": [
|
|
743
|
+
{
|
|
744
|
+
"name": "key",
|
|
745
|
+
"description": "The role's key, as listed by `GET /api/org/roles`; a key that names no role answers `404`."
|
|
746
|
+
}
|
|
747
|
+
],
|
|
748
|
+
"query": null,
|
|
749
|
+
"request": null,
|
|
750
|
+
"response": null,
|
|
751
|
+
"errors": [
|
|
752
|
+
"unauthorized",
|
|
753
|
+
"token_expired",
|
|
754
|
+
"token_revoked",
|
|
755
|
+
"validation_error",
|
|
756
|
+
"not_found"
|
|
757
|
+
],
|
|
758
|
+
"transport": "http",
|
|
759
|
+
"notes": "Nothing is moved and nothing is refused for what depends on the role. App users that hold it keep their account and can sign in, with no rights from the role; everything that names the key turns into a warning and is listed under `dangling` of `GET /api/org/roles`. Live subscriptions that relied on the role are re-checked at once. Creating a role with the same key later makes the places that name it count again."
|
|
760
|
+
},
|
|
761
|
+
{
|
|
762
|
+
"method": "GET",
|
|
763
|
+
"path": "/api/org/roles/defaults",
|
|
764
|
+
"section": "org",
|
|
765
|
+
"summary": "Reads the organization's default roles for each kind of access.",
|
|
766
|
+
"audience": "developer",
|
|
767
|
+
"auth": "developer",
|
|
768
|
+
"rateLimited": false,
|
|
769
|
+
"ownerTier": false,
|
|
770
|
+
"status": 200,
|
|
771
|
+
"params": [],
|
|
772
|
+
"query": null,
|
|
773
|
+
"request": null,
|
|
774
|
+
"response": "role-defaults-response",
|
|
775
|
+
"errors": [
|
|
776
|
+
"unauthorized",
|
|
777
|
+
"token_expired",
|
|
778
|
+
"token_revoked"
|
|
779
|
+
],
|
|
780
|
+
"transport": "http",
|
|
781
|
+
"notes": "Every kind of access is present; an empty list means nobody holds it, not even the most senior role. A default applies where a robot's published `fleetless.yaml` names no role for the thing asked about. A new organization starts with `observe` for `read` and `assets`, and `operate` for `invoke`, `publish` and `job_history`."
|
|
782
|
+
},
|
|
783
|
+
{
|
|
784
|
+
"method": "PUT",
|
|
785
|
+
"path": "/api/org/roles/defaults",
|
|
786
|
+
"section": "org",
|
|
787
|
+
"summary": "Changes the organization's default roles for the named kinds of access.",
|
|
788
|
+
"audience": "developer",
|
|
789
|
+
"auth": "developer",
|
|
790
|
+
"rateLimited": false,
|
|
791
|
+
"ownerTier": false,
|
|
792
|
+
"status": 200,
|
|
793
|
+
"params": [],
|
|
794
|
+
"query": null,
|
|
795
|
+
"request": "put-role-defaults-request",
|
|
796
|
+
"response": "role-defaults-response",
|
|
797
|
+
"errors": [
|
|
798
|
+
"unauthorized",
|
|
799
|
+
"token_expired",
|
|
800
|
+
"token_revoked",
|
|
801
|
+
"validation_error"
|
|
802
|
+
],
|
|
803
|
+
"transport": "http",
|
|
804
|
+
"notes": "Despite the verb, kinds that are not named keep their default; `null` or `[]` sets a kind to nobody. A key that names no role is accepted and warns, and grants nothing. Answers all the defaults as they stand afterwards. A default that narrows who holds a kind re-checks the live subscriptions it affects."
|
|
805
|
+
},
|
|
648
806
|
{
|
|
649
807
|
"method": "GET",
|
|
650
808
|
"path": "/api/audit",
|
|
@@ -715,7 +873,7 @@
|
|
|
715
873
|
"quota_exceeded"
|
|
716
874
|
],
|
|
717
875
|
"transport": "http",
|
|
718
|
-
"notes": "Every robot id is checked before anything is created, so a bad one never leaves a robotless app to clean up. The identifier `mcp` is reserved by the central MCP server and refused as a `validation_error`. An app belongs to the org and to nothing inside it: the group an app used to be created in, and the `409 target_state_conflict` that refused the Org Admins one, are both gone with the group model."
|
|
876
|
+
"notes": "Every robot id is checked before anything is created, so a bad one never leaves a robotless app to clean up. The identifier `mcp` is reserved by the central MCP server and refused as a `validation_error`. An app belongs to the org and to nothing inside it: the group an app used to be created in, and the `409 target_state_conflict` that refused the Org Admins one, are both gone with the group model. A new app has no default role: `default_role` is `null` until `PUT /api/apps/:id/access` sets one."
|
|
719
877
|
},
|
|
720
878
|
{
|
|
721
879
|
"method": "GET",
|
|
@@ -766,13 +924,13 @@
|
|
|
766
924
|
"not_found"
|
|
767
925
|
],
|
|
768
926
|
"transport": "http",
|
|
769
|
-
"notes": "An app belonging to another org reads exactly like one that does not exist — `404`, never a `403`."
|
|
927
|
+
"notes": "An app belonging to another org reads exactly like one that does not exist — `404`, never a `403`. `default_role` is the key as stored, or `null` when the app has none; a key that names no role is shown as it is, and `GET /api/apps/:id/access` warns about it."
|
|
770
928
|
},
|
|
771
929
|
{
|
|
772
930
|
"method": "PATCH",
|
|
773
931
|
"path": "/api/apps/:id",
|
|
774
932
|
"section": "apps",
|
|
775
|
-
"summary": "Changes an app's name
|
|
933
|
+
"summary": "Changes an app's name or its attached robots.",
|
|
776
934
|
"audience": "developer",
|
|
777
935
|
"auth": "developer",
|
|
778
936
|
"rateLimited": false,
|
|
@@ -796,7 +954,7 @@
|
|
|
796
954
|
"not_found"
|
|
797
955
|
],
|
|
798
956
|
"transport": "http",
|
|
799
|
-
"notes": "
|
|
957
|
+
"notes": "The default role is not set here: `PUT /api/apps/:id/access` replaces it together with the locks, and a body that names a default role, by id or by key, is `400 validation_error`. Changing the robot set closes every live subscription the app's users hold, since a robot they were using may no longer be reachable."
|
|
800
958
|
},
|
|
801
959
|
{
|
|
802
960
|
"method": "GET",
|
|
@@ -854,13 +1012,13 @@
|
|
|
854
1012
|
"not_found"
|
|
855
1013
|
],
|
|
856
1014
|
"transport": "http",
|
|
857
|
-
"notes": "An app outside the caller's org answers `404`, as an unknown id does. A full cascade — its users,
|
|
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`."
|
|
858
1016
|
},
|
|
859
1017
|
{
|
|
860
1018
|
"method": "POST",
|
|
861
|
-
"path": "/api/apps/:id/
|
|
1019
|
+
"path": "/api/apps/:id/server-keys",
|
|
862
1020
|
"section": "apps",
|
|
863
|
-
"summary": "
|
|
1021
|
+
"summary": "Mints a server key for the app and returns the raw secret once.",
|
|
864
1022
|
"audience": "developer",
|
|
865
1023
|
"auth": "developer",
|
|
866
1024
|
"rateLimited": false,
|
|
@@ -874,7 +1032,7 @@
|
|
|
874
1032
|
],
|
|
875
1033
|
"query": null,
|
|
876
1034
|
"request": null,
|
|
877
|
-
"response": "
|
|
1035
|
+
"response": "create-server-key-response",
|
|
878
1036
|
"errors": [
|
|
879
1037
|
"unauthorized",
|
|
880
1038
|
"token_expired",
|
|
@@ -884,13 +1042,13 @@
|
|
|
884
1042
|
"validation_error"
|
|
885
1043
|
],
|
|
886
1044
|
"transport": "http",
|
|
887
|
-
"notes": "The body is `{ \"name\": string }
|
|
1045
|
+
"notes": "A server key carries full app rights and outlives its creator's removal. The body is `{ \"name\": string }`, too trivial to be a contract shape. `key` is the only moment the raw secret exists outside the caller's hands — it is never in a listing, never in an audit event, and cannot be read back."
|
|
888
1046
|
},
|
|
889
1047
|
{
|
|
890
1048
|
"method": "GET",
|
|
891
|
-
"path": "/api/apps/:id/
|
|
1049
|
+
"path": "/api/apps/:id/server-keys",
|
|
892
1050
|
"section": "apps",
|
|
893
|
-
"summary": "Lists the app's
|
|
1051
|
+
"summary": "Lists the app's server keys as metadata, never the secrets.",
|
|
894
1052
|
"audience": "developer",
|
|
895
1053
|
"auth": "developer",
|
|
896
1054
|
"rateLimited": false,
|
|
@@ -904,7 +1062,7 @@
|
|
|
904
1062
|
],
|
|
905
1063
|
"query": null,
|
|
906
1064
|
"request": null,
|
|
907
|
-
"response": "
|
|
1065
|
+
"response": "server-key-list-response",
|
|
908
1066
|
"errors": [
|
|
909
1067
|
"unauthorized",
|
|
910
1068
|
"token_expired",
|
|
@@ -913,13 +1071,13 @@
|
|
|
913
1071
|
"not_found"
|
|
914
1072
|
],
|
|
915
1073
|
"transport": "http",
|
|
916
|
-
"notes": "Answers `{ \"
|
|
1074
|
+
"notes": "Answers `{ \"server_keys\": [serverKey, …] }`. `serverKey` names the five fields it carries rather than spreading the stored row — that is what keeps this listing from becoming a second place a credential leaves the cloud."
|
|
917
1075
|
},
|
|
918
1076
|
{
|
|
919
|
-
"method": "
|
|
920
|
-
"path": "/api/apps/:id/
|
|
1077
|
+
"method": "POST",
|
|
1078
|
+
"path": "/api/apps/:id/server-keys/:keyId/rotate",
|
|
921
1079
|
"section": "apps",
|
|
922
|
-
"summary": "Replaces a
|
|
1080
|
+
"summary": "Replaces a server key's secret in place and returns the new one once.",
|
|
923
1081
|
"audience": "developer",
|
|
924
1082
|
"auth": "developer",
|
|
925
1083
|
"rateLimited": false,
|
|
@@ -931,47 +1089,46 @@
|
|
|
931
1089
|
"description": "The app's uuid, as returned by `POST /api/apps` or listed by `GET /api/apps`."
|
|
932
1090
|
},
|
|
933
1091
|
{
|
|
934
|
-
"name": "
|
|
935
|
-
"description": "The
|
|
1092
|
+
"name": "keyId",
|
|
1093
|
+
"description": "The server key's uuid, from `GET /api/apps/:id/server-keys`; a key of another app answers `404`."
|
|
936
1094
|
}
|
|
937
1095
|
],
|
|
938
1096
|
"query": null,
|
|
939
|
-
"request":
|
|
940
|
-
"response": "
|
|
1097
|
+
"request": null,
|
|
1098
|
+
"response": "create-server-key-response",
|
|
941
1099
|
"errors": [
|
|
942
1100
|
"unauthorized",
|
|
943
1101
|
"token_expired",
|
|
944
1102
|
"token_revoked",
|
|
945
1103
|
"invalid_uuid",
|
|
946
|
-
"not_found"
|
|
947
|
-
"validation_error"
|
|
1104
|
+
"not_found"
|
|
948
1105
|
],
|
|
949
1106
|
"transport": "http",
|
|
950
|
-
"notes": "
|
|
1107
|
+
"notes": "The old secret is refused from this call on, and any `/realtime` socket that authenticated with it is closed — rotation is what a developer reaches for when a key has leaked, and the holder of that socket is exactly who they are rotating against."
|
|
951
1108
|
},
|
|
952
1109
|
{
|
|
953
|
-
"method": "
|
|
954
|
-
"path": "/api/apps/:id/
|
|
1110
|
+
"method": "DELETE",
|
|
1111
|
+
"path": "/api/apps/:id/server-keys/:keyId",
|
|
955
1112
|
"section": "apps",
|
|
956
|
-
"summary": "
|
|
1113
|
+
"summary": "Revokes a server key and closes every socket holding it.",
|
|
957
1114
|
"audience": "developer",
|
|
958
1115
|
"auth": "developer",
|
|
959
1116
|
"rateLimited": false,
|
|
960
1117
|
"ownerTier": false,
|
|
961
|
-
"status":
|
|
1118
|
+
"status": 204,
|
|
962
1119
|
"params": [
|
|
963
1120
|
{
|
|
964
1121
|
"name": "id",
|
|
965
1122
|
"description": "The app's uuid, as returned by `POST /api/apps` or listed by `GET /api/apps`."
|
|
966
1123
|
},
|
|
967
1124
|
{
|
|
968
|
-
"name": "
|
|
969
|
-
"description": "The
|
|
1125
|
+
"name": "keyId",
|
|
1126
|
+
"description": "The server key's uuid, from `GET /api/apps/:id/server-keys`; a key of another app answers `404`."
|
|
970
1127
|
}
|
|
971
1128
|
],
|
|
972
1129
|
"query": null,
|
|
973
1130
|
"request": null,
|
|
974
|
-
"response":
|
|
1131
|
+
"response": null,
|
|
975
1132
|
"errors": [
|
|
976
1133
|
"unauthorized",
|
|
977
1134
|
"token_expired",
|
|
@@ -979,13 +1136,14 @@
|
|
|
979
1136
|
"invalid_uuid",
|
|
980
1137
|
"not_found"
|
|
981
1138
|
],
|
|
982
|
-
"transport": "http"
|
|
1139
|
+
"transport": "http",
|
|
1140
|
+
"notes": "The key stops working at once. Minting, rotating and revoking all decide who may speak for the whole app."
|
|
983
1141
|
},
|
|
984
1142
|
{
|
|
985
1143
|
"method": "GET",
|
|
986
|
-
"path": "/api/apps/:id/
|
|
1144
|
+
"path": "/api/apps/:id/access",
|
|
987
1145
|
"section": "apps",
|
|
988
|
-
"summary": "
|
|
1146
|
+
"summary": "Reads what an app locks and which role its users get by default, with what is out of step in it.",
|
|
989
1147
|
"audience": "developer",
|
|
990
1148
|
"auth": "developer",
|
|
991
1149
|
"rateLimited": false,
|
|
@@ -995,15 +1153,11 @@
|
|
|
995
1153
|
{
|
|
996
1154
|
"name": "id",
|
|
997
1155
|
"description": "The app's uuid, as returned by `POST /api/apps` or listed by `GET /api/apps`."
|
|
998
|
-
},
|
|
999
|
-
{
|
|
1000
|
-
"name": "roleId",
|
|
1001
|
-
"description": "The role's uuid, from `GET /api/apps/:id/roles`; a role of another app answers `404`."
|
|
1002
1156
|
}
|
|
1003
1157
|
],
|
|
1004
1158
|
"query": null,
|
|
1005
1159
|
"request": null,
|
|
1006
|
-
"response": "
|
|
1160
|
+
"response": "app-access-response",
|
|
1007
1161
|
"errors": [
|
|
1008
1162
|
"unauthorized",
|
|
1009
1163
|
"token_expired",
|
|
@@ -1012,13 +1166,13 @@
|
|
|
1012
1166
|
"not_found"
|
|
1013
1167
|
],
|
|
1014
1168
|
"transport": "http",
|
|
1015
|
-
"notes": "
|
|
1169
|
+
"notes": "An app can only lock, never extend: roles decide who may use what, and a lock takes capabilities away from every user and server key of the app, whatever their role. `warnings` lists what the access names that does not exist as written, such as a default role that is no role or a lock on a slug the robot does not have. None of it is an error. `revision` identifies the access as it stands: send it back with the next `PUT` and a write composed from a stale read is refused."
|
|
1016
1170
|
},
|
|
1017
1171
|
{
|
|
1018
|
-
"method": "
|
|
1019
|
-
"path": "/api/apps/:id/
|
|
1172
|
+
"method": "PUT",
|
|
1173
|
+
"path": "/api/apps/:id/access",
|
|
1020
1174
|
"section": "apps",
|
|
1021
|
-
"summary": "
|
|
1175
|
+
"summary": "Replaces what an app locks and which role its users get by default.",
|
|
1022
1176
|
"audience": "developer",
|
|
1023
1177
|
"auth": "developer",
|
|
1024
1178
|
"rateLimited": false,
|
|
@@ -1028,73 +1182,63 @@
|
|
|
1028
1182
|
{
|
|
1029
1183
|
"name": "id",
|
|
1030
1184
|
"description": "The app's uuid, as returned by `POST /api/apps` or listed by `GET /api/apps`."
|
|
1031
|
-
},
|
|
1032
|
-
{
|
|
1033
|
-
"name": "roleId",
|
|
1034
|
-
"description": "The role's uuid, from `GET /api/apps/:id/roles`; a role of another app answers `404`."
|
|
1035
1185
|
}
|
|
1036
1186
|
],
|
|
1037
1187
|
"query": null,
|
|
1038
|
-
"request": "
|
|
1039
|
-
"response": "
|
|
1188
|
+
"request": "app-access",
|
|
1189
|
+
"response": "app-access-response",
|
|
1040
1190
|
"errors": [
|
|
1041
1191
|
"unauthorized",
|
|
1042
1192
|
"token_expired",
|
|
1043
1193
|
"token_revoked",
|
|
1044
1194
|
"invalid_uuid",
|
|
1045
|
-
"not_found",
|
|
1046
1195
|
"validation_error",
|
|
1047
|
-
"
|
|
1196
|
+
"not_found",
|
|
1197
|
+
"target_state_conflict"
|
|
1048
1198
|
],
|
|
1049
1199
|
"transport": "http",
|
|
1050
|
-
"notes": "
|
|
1200
|
+
"notes": "A full replacement: the body is exactly what the app has afterwards, so a lock that is not in it is lifted. A default role that is no role, a lock on a slug the robot does not have and a lock on a robot the app does not attach are accepted and come back as `warnings`. A change that can narrow rights re-checks the live subscriptions of the app's users at once. \n\n**Send the `revision` you read.** The access can change under a caller without a write of its own: a slug rename adds the new name to every lock that lists the old one, and detaching a robot drops its lock. A body composed before such a change would lift the lock it added, so a `revision` that is no longer the stored one is `409 target_state_conflict` naming `revision` (rule `stale`), and nothing is written, audited or announced; read the access again and compose the body anew. Left out, the body replaces whatever is stored, as before: the last writer wins. A `revision` that is not a revision is `400 validation_error`."
|
|
1051
1201
|
},
|
|
1052
1202
|
{
|
|
1053
|
-
"method": "
|
|
1054
|
-
"path": "/api/apps/:id/
|
|
1203
|
+
"method": "GET",
|
|
1204
|
+
"path": "/api/apps/:id/effective-rights",
|
|
1055
1205
|
"section": "apps",
|
|
1056
|
-
"summary": "
|
|
1206
|
+
"summary": "Shows what one role, or one app user, may use on each robot the app attaches.",
|
|
1057
1207
|
"audience": "developer",
|
|
1058
1208
|
"auth": "developer",
|
|
1059
1209
|
"rateLimited": false,
|
|
1060
1210
|
"ownerTier": false,
|
|
1061
|
-
"status":
|
|
1211
|
+
"status": 200,
|
|
1062
1212
|
"params": [
|
|
1063
1213
|
{
|
|
1064
1214
|
"name": "id",
|
|
1065
1215
|
"description": "The app's uuid, as returned by `POST /api/apps` or listed by `GET /api/apps`."
|
|
1066
|
-
},
|
|
1067
|
-
{
|
|
1068
|
-
"name": "roleId",
|
|
1069
|
-
"description": "The role's uuid, from `GET /api/apps/:id/roles`; a role of another app answers `404`."
|
|
1070
1216
|
}
|
|
1071
1217
|
],
|
|
1072
|
-
"query": "
|
|
1218
|
+
"query": "effective-rights-query",
|
|
1073
1219
|
"request": null,
|
|
1074
|
-
"response":
|
|
1220
|
+
"response": "effective-rights-response",
|
|
1075
1221
|
"errors": [
|
|
1076
1222
|
"unauthorized",
|
|
1077
1223
|
"token_expired",
|
|
1078
1224
|
"token_revoked",
|
|
1079
1225
|
"invalid_uuid",
|
|
1080
|
-
"not_found",
|
|
1081
1226
|
"validation_error",
|
|
1082
|
-
"
|
|
1083
|
-
"last_role"
|
|
1227
|
+
"not_found"
|
|
1084
1228
|
],
|
|
1085
1229
|
"transport": "http",
|
|
1086
|
-
"notes": "
|
|
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."
|
|
1087
1231
|
},
|
|
1088
1232
|
{
|
|
1089
|
-
"method": "
|
|
1090
|
-
"path": "/api/apps/:id/
|
|
1233
|
+
"method": "GET",
|
|
1234
|
+
"path": "/api/apps/:id/users",
|
|
1091
1235
|
"section": "apps",
|
|
1092
|
-
"summary": "
|
|
1236
|
+
"summary": "Lists the app's users — the developer's own customers, not the Fleetless team.",
|
|
1093
1237
|
"audience": "developer",
|
|
1094
1238
|
"auth": "developer",
|
|
1095
1239
|
"rateLimited": false,
|
|
1096
1240
|
"ownerTier": false,
|
|
1097
|
-
"status":
|
|
1241
|
+
"status": 200,
|
|
1098
1242
|
"params": [
|
|
1099
1243
|
{
|
|
1100
1244
|
"name": "id",
|
|
@@ -1103,28 +1247,27 @@
|
|
|
1103
1247
|
],
|
|
1104
1248
|
"query": null,
|
|
1105
1249
|
"request": null,
|
|
1106
|
-
"response": "
|
|
1250
|
+
"response": "app-user-list-response",
|
|
1107
1251
|
"errors": [
|
|
1108
1252
|
"unauthorized",
|
|
1109
1253
|
"token_expired",
|
|
1110
1254
|
"token_revoked",
|
|
1111
1255
|
"invalid_uuid",
|
|
1112
|
-
"not_found"
|
|
1113
|
-
"validation_error"
|
|
1256
|
+
"not_found"
|
|
1114
1257
|
],
|
|
1115
1258
|
"transport": "http",
|
|
1116
|
-
"notes": "A
|
|
1259
|
+
"notes": "Answers `{ \"users\": [appUser, …] }`. **A different identity space from `GET /api/org/users`**, and nothing joins the two: an app user belongs to exactly one app, their address is unique per app rather than globally, and the same address may exist as unrelated accounts in several apps of one org. No password hash, no token and no provider secret appears here — `appUser` names the fields it carries rather than spreading the stored row. An account that holds no role key lists with `role: null`; it reaches nothing until `PATCH /api/apps/:id/users/:userId` gives it one."
|
|
1117
1260
|
},
|
|
1118
1261
|
{
|
|
1119
|
-
"method": "
|
|
1120
|
-
"path": "/api/apps/:id/
|
|
1262
|
+
"method": "POST",
|
|
1263
|
+
"path": "/api/apps/:id/users",
|
|
1121
1264
|
"section": "apps",
|
|
1122
|
-
"summary": "
|
|
1265
|
+
"summary": "Creates an app user directly, without an invitation or a self-registration.",
|
|
1123
1266
|
"audience": "developer",
|
|
1124
1267
|
"auth": "developer",
|
|
1125
1268
|
"rateLimited": false,
|
|
1126
1269
|
"ownerTier": false,
|
|
1127
|
-
"status":
|
|
1270
|
+
"status": 201,
|
|
1128
1271
|
"params": [
|
|
1129
1272
|
{
|
|
1130
1273
|
"name": "id",
|
|
@@ -1132,23 +1275,27 @@
|
|
|
1132
1275
|
}
|
|
1133
1276
|
],
|
|
1134
1277
|
"query": null,
|
|
1135
|
-
"request":
|
|
1136
|
-
"response": "
|
|
1278
|
+
"request": "create-app-user-request",
|
|
1279
|
+
"response": "app-user",
|
|
1137
1280
|
"errors": [
|
|
1138
1281
|
"unauthorized",
|
|
1139
1282
|
"token_expired",
|
|
1140
1283
|
"token_revoked",
|
|
1141
1284
|
"invalid_uuid",
|
|
1142
|
-
"
|
|
1285
|
+
"validation_error",
|
|
1286
|
+
"not_found",
|
|
1287
|
+
"email_taken",
|
|
1288
|
+
"target_state_conflict",
|
|
1289
|
+
"quota_exceeded"
|
|
1143
1290
|
],
|
|
1144
1291
|
"transport": "http",
|
|
1145
|
-
"notes": "
|
|
1292
|
+
"notes": "The developer-authenticated door into the app's user table, and the one place `409 email_taken` is an honest answer about an app user: the caller is authenticated into this app already, so telling them the address is taken discloses nothing they could not read from the listing beside it. `POST /api/client/register` answers `202` to the same fact, because there the caller is a stranger. `404 not_found` is the app. The `role` is a key of the organization's roles: a malformed one is `400 validation_error`, and a well-formed one is stored as given even when it names no role, which grants nothing and shows up under `dangling` of `GET /api/org/roles`. **The password policy answers `400 validation_error`**, not a code of its own: the twelve-character minimum is the `password` field's schema rule, and every route that takes a password refuses a short one exactly the way it refuses any other malformed field. An account created here is `active` immediately: a developer entering somebody by hand has made the decision the verification mail automates, and its address counts as proven. `409 target_state_conflict` names `default_role` with rule `not_set` when `role` is absent and the app has no default role — there would be no role to give the user, so nothing is created. \n\n**`409 quota_exceeded` when the org holds as many app users as `max_end_users` allows**, counted across every app of the org — the same number `GET /api/org/quotas` reports as `usage.max_end_users`, since the same address in two apps is two accounts. `details` carries `{ quota, limit }`, as every count quota's refusal does. The check is at **creation** only: an existing user signs in, is patched and is deleted at the quota exactly as under it, because a protection limit that also froze the accounts already made would be an outage rather than a limit."
|
|
1146
1293
|
},
|
|
1147
1294
|
{
|
|
1148
|
-
"method": "
|
|
1149
|
-
"path": "/api/apps/:id/
|
|
1295
|
+
"method": "GET",
|
|
1296
|
+
"path": "/api/apps/:id/users/:userId",
|
|
1150
1297
|
"section": "apps",
|
|
1151
|
-
"summary": "
|
|
1298
|
+
"summary": "Reads one user of the app.",
|
|
1152
1299
|
"audience": "developer",
|
|
1153
1300
|
"auth": "developer",
|
|
1154
1301
|
"rateLimited": false,
|
|
@@ -1160,13 +1307,13 @@
|
|
|
1160
1307
|
"description": "The app's uuid, as returned by `POST /api/apps` or listed by `GET /api/apps`."
|
|
1161
1308
|
},
|
|
1162
1309
|
{
|
|
1163
|
-
"name": "
|
|
1164
|
-
"description": "The
|
|
1310
|
+
"name": "userId",
|
|
1311
|
+
"description": "The app user's uuid, from `GET /api/apps/:id/users`; a user of another app answers `404`."
|
|
1165
1312
|
}
|
|
1166
1313
|
],
|
|
1167
1314
|
"query": null,
|
|
1168
1315
|
"request": null,
|
|
1169
|
-
"response": "
|
|
1316
|
+
"response": "app-user",
|
|
1170
1317
|
"errors": [
|
|
1171
1318
|
"unauthorized",
|
|
1172
1319
|
"token_expired",
|
|
@@ -1175,60 +1322,66 @@
|
|
|
1175
1322
|
"not_found"
|
|
1176
1323
|
],
|
|
1177
1324
|
"transport": "http",
|
|
1178
|
-
"notes": "
|
|
1325
|
+
"notes": "A user of another app, or of another org, reads exactly like one that does not exist — `404`, never a `403`."
|
|
1179
1326
|
},
|
|
1180
1327
|
{
|
|
1181
|
-
"method": "
|
|
1182
|
-
"path": "/api/apps/:id/
|
|
1328
|
+
"method": "PATCH",
|
|
1329
|
+
"path": "/api/apps/:id/users/:userId",
|
|
1183
1330
|
"section": "apps",
|
|
1184
|
-
"summary": "
|
|
1331
|
+
"summary": "Changes an app user's display name, role or status.",
|
|
1185
1332
|
"audience": "developer",
|
|
1186
1333
|
"auth": "developer",
|
|
1187
1334
|
"rateLimited": false,
|
|
1188
1335
|
"ownerTier": false,
|
|
1189
|
-
"status":
|
|
1336
|
+
"status": 200,
|
|
1190
1337
|
"params": [
|
|
1191
1338
|
{
|
|
1192
1339
|
"name": "id",
|
|
1193
1340
|
"description": "The app's uuid, as returned by `POST /api/apps` or listed by `GET /api/apps`."
|
|
1194
1341
|
},
|
|
1195
1342
|
{
|
|
1196
|
-
"name": "
|
|
1197
|
-
"description": "The
|
|
1343
|
+
"name": "userId",
|
|
1344
|
+
"description": "The app user's uuid, from `GET /api/apps/:id/users`; a user of another app answers `404`."
|
|
1198
1345
|
}
|
|
1199
1346
|
],
|
|
1200
1347
|
"query": null,
|
|
1201
|
-
"request":
|
|
1202
|
-
"response":
|
|
1348
|
+
"request": "patch-app-user-request",
|
|
1349
|
+
"response": "app-user",
|
|
1203
1350
|
"errors": [
|
|
1204
1351
|
"unauthorized",
|
|
1205
1352
|
"token_expired",
|
|
1206
1353
|
"token_revoked",
|
|
1207
1354
|
"invalid_uuid",
|
|
1208
|
-
"
|
|
1355
|
+
"validation_error",
|
|
1356
|
+
"not_found",
|
|
1357
|
+
"target_state_conflict"
|
|
1209
1358
|
],
|
|
1210
1359
|
"transport": "http",
|
|
1211
|
-
"notes": "The
|
|
1360
|
+
"notes": "The address is immutable: it is half of what identifies the account within the app, and a rewrite would silently move every token and invitation addressed to the old one. Setting `status` to `blocked` ends every session the user holds and closes their live `/realtime` subscriptions — blocking somebody who keeps a working socket is not blocking them. Moving them back to `active` mints nothing; they log in again. \n\n**`active` is a way out of `blocked` and out of nothing else.** An account still `pending_verification` answers `409 target_state_conflict` naming `status` with rule `unverified`: activating it would let somebody who typed an address they do not own log in without ever spending the mailed token. Unblocking restores the status the account had — `active` for one whose address was proven, `pending_verification` for one blocked before it ever verified. A write that names the status the account already holds changes nothing and mints no event, so it does not end the sessions a re-sent form would otherwise have killed. A `role` is stored as given, as creation does: a malformed key is `400 validation_error`, one that names no role grants nothing, and the same key the user already holds changes nothing. A changed role is applied to the user's open subscriptions at once, and those the new role no longer allows end."
|
|
1212
1361
|
},
|
|
1213
1362
|
{
|
|
1214
|
-
"method": "
|
|
1215
|
-
"path": "/api/apps/:id/users",
|
|
1363
|
+
"method": "DELETE",
|
|
1364
|
+
"path": "/api/apps/:id/users/:userId",
|
|
1216
1365
|
"section": "apps",
|
|
1217
|
-
"summary": "
|
|
1366
|
+
"summary": "Deletes an app user and ends every session they hold.",
|
|
1218
1367
|
"audience": "developer",
|
|
1219
1368
|
"auth": "developer",
|
|
1220
1369
|
"rateLimited": false,
|
|
1221
1370
|
"ownerTier": false,
|
|
1222
|
-
"status":
|
|
1371
|
+
"status": 204,
|
|
1223
1372
|
"params": [
|
|
1224
1373
|
{
|
|
1225
1374
|
"name": "id",
|
|
1226
1375
|
"description": "The app's uuid, as returned by `POST /api/apps` or listed by `GET /api/apps`."
|
|
1376
|
+
},
|
|
1377
|
+
{
|
|
1378
|
+
"name": "userId",
|
|
1379
|
+
"description": "The app user's uuid, from `GET /api/apps/:id/users`; a user of another app answers `404`."
|
|
1227
1380
|
}
|
|
1228
1381
|
],
|
|
1229
1382
|
"query": null,
|
|
1230
1383
|
"request": null,
|
|
1231
|
-
"response":
|
|
1384
|
+
"response": null,
|
|
1232
1385
|
"errors": [
|
|
1233
1386
|
"unauthorized",
|
|
1234
1387
|
"token_expired",
|
|
@@ -1237,147 +1390,13 @@
|
|
|
1237
1390
|
"not_found"
|
|
1238
1391
|
],
|
|
1239
1392
|
"transport": "http",
|
|
1240
|
-
"notes": "
|
|
1393
|
+
"notes": "Sessions are revoked before the row goes, for the reason `DELETE /api/org/users/:id` states: a live user with a dead session is recoverable by retrying, a deleted user whose token still works is not. Outstanding invitations and unspent tokens for that address are expired with it — a link mailed before the deletion is a standing re-admission ticket. **Nothing outside this app is touched**: a Fleetless user sharing the address keeps their console account, and an account with the same address in a sibling app is a different person as far as this platform is concerned."
|
|
1241
1394
|
},
|
|
1242
1395
|
{
|
|
1243
1396
|
"method": "POST",
|
|
1244
|
-
"path": "/api/apps/:id/users",
|
|
1397
|
+
"path": "/api/apps/:id/users/:userId/reset-password",
|
|
1245
1398
|
"section": "apps",
|
|
1246
|
-
"summary": "
|
|
1247
|
-
"audience": "developer",
|
|
1248
|
-
"auth": "developer",
|
|
1249
|
-
"rateLimited": false,
|
|
1250
|
-
"ownerTier": false,
|
|
1251
|
-
"status": 201,
|
|
1252
|
-
"params": [
|
|
1253
|
-
{
|
|
1254
|
-
"name": "id",
|
|
1255
|
-
"description": "The app's uuid, as returned by `POST /api/apps` or listed by `GET /api/apps`."
|
|
1256
|
-
}
|
|
1257
|
-
],
|
|
1258
|
-
"query": null,
|
|
1259
|
-
"request": "create-app-user-request",
|
|
1260
|
-
"response": "app-user",
|
|
1261
|
-
"errors": [
|
|
1262
|
-
"unauthorized",
|
|
1263
|
-
"token_expired",
|
|
1264
|
-
"token_revoked",
|
|
1265
|
-
"invalid_uuid",
|
|
1266
|
-
"validation_error",
|
|
1267
|
-
"not_found",
|
|
1268
|
-
"email_taken",
|
|
1269
|
-
"target_state_conflict",
|
|
1270
|
-
"quota_exceeded"
|
|
1271
|
-
],
|
|
1272
|
-
"transport": "http",
|
|
1273
|
-
"notes": "The developer-authenticated door into the app's user table, and the one place `409 email_taken` is an honest answer about an app user: the caller is authenticated into this app already, so telling them the address is taken discloses nothing they could not read from the listing beside it. `POST /api/client/register` answers `202` to the same fact, because there the caller is a stranger. `404 not_found` is the app, or a `role_id` that is not a role of it — a role of another app is refused rather than stored, since a user holding one would carry rights nothing in this app can resolve. **The password policy answers `400 validation_error`**, not a code of its own: the twelve-character minimum is the `password` field's schema rule, and every route that takes a password refuses a short one exactly the way it refuses any other malformed field. An account created here is `active` immediately: a developer entering somebody by hand has made the decision the verification mail automates, and its address counts as proven. `409 target_state_conflict` names `default_role_id` when `role_id` is absent and the app has no default role, or its default names a role that no longer resolves — a user with no role holds rights nothing in this app can read, so nothing is created. \n\n**`409 quota_exceeded` when the org holds as many app users as `max_end_users` allows**, counted across every app of the org — the same number `GET /api/org/quotas` reports as `usage.max_end_users`, since the same address in two apps is two accounts. `details` carries `{ quota, limit }`, as every count quota's refusal does. The check is at **creation** only: an existing user signs in, is patched and is deleted at the quota exactly as under it, because a protection limit that also froze the accounts already made would be an outage rather than a limit."
|
|
1274
|
-
},
|
|
1275
|
-
{
|
|
1276
|
-
"method": "GET",
|
|
1277
|
-
"path": "/api/apps/:id/users/:userId",
|
|
1278
|
-
"section": "apps",
|
|
1279
|
-
"summary": "Reads one user of the app.",
|
|
1280
|
-
"audience": "developer",
|
|
1281
|
-
"auth": "developer",
|
|
1282
|
-
"rateLimited": false,
|
|
1283
|
-
"ownerTier": false,
|
|
1284
|
-
"status": 200,
|
|
1285
|
-
"params": [
|
|
1286
|
-
{
|
|
1287
|
-
"name": "id",
|
|
1288
|
-
"description": "The app's uuid, as returned by `POST /api/apps` or listed by `GET /api/apps`."
|
|
1289
|
-
},
|
|
1290
|
-
{
|
|
1291
|
-
"name": "userId",
|
|
1292
|
-
"description": "The app user's uuid, from `GET /api/apps/:id/users`; a user of another app answers `404`."
|
|
1293
|
-
}
|
|
1294
|
-
],
|
|
1295
|
-
"query": null,
|
|
1296
|
-
"request": null,
|
|
1297
|
-
"response": "app-user",
|
|
1298
|
-
"errors": [
|
|
1299
|
-
"unauthorized",
|
|
1300
|
-
"token_expired",
|
|
1301
|
-
"token_revoked",
|
|
1302
|
-
"invalid_uuid",
|
|
1303
|
-
"not_found"
|
|
1304
|
-
],
|
|
1305
|
-
"transport": "http",
|
|
1306
|
-
"notes": "A user of another app, or of another org, reads exactly like one that does not exist — `404`, never a `403`."
|
|
1307
|
-
},
|
|
1308
|
-
{
|
|
1309
|
-
"method": "PATCH",
|
|
1310
|
-
"path": "/api/apps/:id/users/:userId",
|
|
1311
|
-
"section": "apps",
|
|
1312
|
-
"summary": "Changes an app user's display name, role or status.",
|
|
1313
|
-
"audience": "developer",
|
|
1314
|
-
"auth": "developer",
|
|
1315
|
-
"rateLimited": false,
|
|
1316
|
-
"ownerTier": false,
|
|
1317
|
-
"status": 200,
|
|
1318
|
-
"params": [
|
|
1319
|
-
{
|
|
1320
|
-
"name": "id",
|
|
1321
|
-
"description": "The app's uuid, as returned by `POST /api/apps` or listed by `GET /api/apps`."
|
|
1322
|
-
},
|
|
1323
|
-
{
|
|
1324
|
-
"name": "userId",
|
|
1325
|
-
"description": "The app user's uuid, from `GET /api/apps/:id/users`; a user of another app answers `404`."
|
|
1326
|
-
}
|
|
1327
|
-
],
|
|
1328
|
-
"query": null,
|
|
1329
|
-
"request": "patch-app-user-request",
|
|
1330
|
-
"response": "app-user",
|
|
1331
|
-
"errors": [
|
|
1332
|
-
"unauthorized",
|
|
1333
|
-
"token_expired",
|
|
1334
|
-
"token_revoked",
|
|
1335
|
-
"invalid_uuid",
|
|
1336
|
-
"validation_error",
|
|
1337
|
-
"not_found",
|
|
1338
|
-
"target_state_conflict"
|
|
1339
|
-
],
|
|
1340
|
-
"transport": "http",
|
|
1341
|
-
"notes": "The address is immutable: it is half of what identifies the account within the app, and a rewrite would silently move every token and invitation addressed to the old one. Setting `status` to `blocked` ends every session the user holds and closes their live `/realtime` subscriptions — blocking somebody who keeps a working socket is not blocking them. Moving them back to `active` mints nothing; they log in again. \n\n**`active` is a way out of `blocked` and out of nothing else.** An account still `pending_verification` answers `409 target_state_conflict` naming `status` with rule `unverified`: activating it would let somebody who typed an address they do not own log in without ever spending the mailed token. Unblocking restores the status the account had — `active` for one whose address was proven, `pending_verification` for one blocked before it ever verified. A write that names the status the account already holds changes nothing and mints no event, so it does not end the sessions a re-sent form would otherwise have killed. A `role_id` naming a role of another app is `404 not_found`, the same refusal creation makes."
|
|
1342
|
-
},
|
|
1343
|
-
{
|
|
1344
|
-
"method": "DELETE",
|
|
1345
|
-
"path": "/api/apps/:id/users/:userId",
|
|
1346
|
-
"section": "apps",
|
|
1347
|
-
"summary": "Deletes an app user and ends every session they hold.",
|
|
1348
|
-
"audience": "developer",
|
|
1349
|
-
"auth": "developer",
|
|
1350
|
-
"rateLimited": false,
|
|
1351
|
-
"ownerTier": false,
|
|
1352
|
-
"status": 204,
|
|
1353
|
-
"params": [
|
|
1354
|
-
{
|
|
1355
|
-
"name": "id",
|
|
1356
|
-
"description": "The app's uuid, as returned by `POST /api/apps` or listed by `GET /api/apps`."
|
|
1357
|
-
},
|
|
1358
|
-
{
|
|
1359
|
-
"name": "userId",
|
|
1360
|
-
"description": "The app user's uuid, from `GET /api/apps/:id/users`; a user of another app answers `404`."
|
|
1361
|
-
}
|
|
1362
|
-
],
|
|
1363
|
-
"query": null,
|
|
1364
|
-
"request": null,
|
|
1365
|
-
"response": null,
|
|
1366
|
-
"errors": [
|
|
1367
|
-
"unauthorized",
|
|
1368
|
-
"token_expired",
|
|
1369
|
-
"token_revoked",
|
|
1370
|
-
"invalid_uuid",
|
|
1371
|
-
"not_found"
|
|
1372
|
-
],
|
|
1373
|
-
"transport": "http",
|
|
1374
|
-
"notes": "Sessions are revoked before the row goes, for the reason `DELETE /api/org/users/:id` states: a live user with a dead session is recoverable by retrying, a deleted user whose token still works is not. Outstanding invitations and unspent tokens for that address are expired with it — a link mailed before the deletion is a standing re-admission ticket. **Nothing outside this app is touched**: a Fleetless user sharing the address keeps their console account, and an account with the same address in a sibling app is a different person as far as this platform is concerned."
|
|
1375
|
-
},
|
|
1376
|
-
{
|
|
1377
|
-
"method": "POST",
|
|
1378
|
-
"path": "/api/apps/:id/users/:userId/reset-password",
|
|
1379
|
-
"section": "apps",
|
|
1380
|
-
"summary": "Mails an app user a password-reset link on the developer's behalf.",
|
|
1399
|
+
"summary": "Mails an app user a password-reset link on the developer's behalf.",
|
|
1381
1400
|
"audience": "developer",
|
|
1382
1401
|
"auth": "developer",
|
|
1383
1402
|
"rateLimited": false,
|
|
@@ -1538,7 +1557,7 @@
|
|
|
1538
1557
|
"not_found"
|
|
1539
1558
|
],
|
|
1540
1559
|
"transport": "http",
|
|
1541
|
-
"notes": "Answers `{ \"invitations\": [pendingAppInvitation, …] }` — pending only, since an accepted invitation is history rather than something to revoke. **No `accept_url`**, the rule the team listing already keeps: this list exists so a developer can see what is outstanding and withdraw it, and neither needs the token, while a list that carried it would turn every screenshot and browser-history entry of that page into a live credential for somebody else's account. `mail` is omitted too — it described what happened at creation time, and re-serving it invites a reader to take it as current."
|
|
1560
|
+
"notes": "Answers `{ \"invitations\": [pendingAppInvitation, …] }` — pending only, since an accepted invitation is history rather than something to revoke. **No `accept_url`**, the rule the team listing already keeps: this list exists so a developer can see what is outstanding and withdraw it, and neither needs the token, while a list that carried it would turn every screenshot and browser-history entry of that page into a live credential for somebody else's account. `mail` is omitted too — it described what happened at creation time, and re-serving it invites a reader to take it as current. An invitation that holds no role key and whose app has no default role lists with `role: null`; accepting or reissuing it is `409 target_state_conflict` naming `default_role`."
|
|
1542
1561
|
},
|
|
1543
1562
|
{
|
|
1544
1563
|
"method": "POST",
|
|
@@ -1571,7 +1590,7 @@
|
|
|
1571
1590
|
"rate_limited"
|
|
1572
1591
|
],
|
|
1573
1592
|
"transport": "http",
|
|
1574
|
-
"notes": "**An app user, not a team member.** `POST /api/org/invitations` is the other space and leads to the console; this link leads into the developer's own app. The role is resolved and stored now, so a later change to `
|
|
1593
|
+
"notes": "**An app user, not a team member.** `POST /api/org/invitations` is the other space and leads to the console; this link leads into the developer's own app. The role is resolved and stored now, so a later change to `default_role` does not re-aim a link already sent. An invitation **always bypasses `allowed_domains`**. \n\nThe answer carries `accept_url`: the app's `invite_url` with the token in it, or the Fleetless-hosted invitation page when the app has configured none — so mailing it is never refused for a missing URL. `409 target_state_conflict` names `default_role` with rule `not_set` when `role` is absent and the app has no default role: an invitation that names no role has nothing to hand its acceptor, so it is refused here rather than at the acceptance a week later. A `role` that names no role is accepted and grants nothing; a malformed key is `400 validation_error`. `409 email_taken` is an address the app already has as a user; `404 not_found` is the app. \n\nCreating shares the reissue route's ceiling of **five invitation mails a minute per app**, answering `429 rate_limited` with `retry_after_ms`: re-creating an invitation for one address replaces it and mails again, so a limit that bound only reissue would be a limit on the wrong door."
|
|
1575
1594
|
},
|
|
1576
1595
|
{
|
|
1577
1596
|
"method": "POST",
|
|
@@ -1602,10 +1621,11 @@
|
|
|
1602
1621
|
"token_revoked",
|
|
1603
1622
|
"invalid_uuid",
|
|
1604
1623
|
"not_found",
|
|
1624
|
+
"target_state_conflict",
|
|
1605
1625
|
"rate_limited"
|
|
1606
1626
|
],
|
|
1607
1627
|
"transport": "http",
|
|
1608
|
-
"notes": "The old link stops resolving the instant this returns: the row is found by token hash and the previous hash is gone. Two live links to one invitation would reopen the door the listing's missing `accept_url` closes. \n\n**The answer carries a new `id`.** The old row is revoked and a fresh one takes its place, so a caller holding the previous `id` gets `404` from its next revoke or reissue: re-read the listing after this call rather than keeping the id you sent. The seven days start again. \n\nLimited server-side to **five reissues a minute per app** — shared with `POST /api/apps/:id/invitations`, since both mint a link and mail it — answering `429 rate_limited` with `retry_after_ms`. A disabled button is a hint, this is the limit. An invitation that has already been accepted is not pending and answers `404`."
|
|
1628
|
+
"notes": "The old link stops resolving the instant this returns: the row is found by token hash and the previous hash is gone. Two live links to one invitation would reopen the door the listing's missing `accept_url` closes. \n\n**The answer carries a new `id`.** The old row is revoked and a fresh one takes its place, so a caller holding the previous `id` gets `404` from its next revoke or reissue: re-read the listing after this call rather than keeping the id you sent. The new invitation holds the same role, and the seven days start again. An invitation that holds no role key and whose app has no default role is refused with `409 target_state_conflict` naming `default_role` (rule `not_set`) before the old link is revoked: set the default role, or revoke it and invite again. \n\nLimited server-side to **five reissues a minute per app** — shared with `POST /api/apps/:id/invitations`, since both mint a link and mail it — answering `429 rate_limited` with `retry_after_ms`. A disabled button is a hint, this is the limit. An invitation that has already been accepted is not pending and answers `404`."
|
|
1609
1629
|
},
|
|
1610
1630
|
{
|
|
1611
1631
|
"method": "DELETE",
|
|
@@ -4121,7 +4141,7 @@
|
|
|
4121
4141
|
"forbidden"
|
|
4122
4142
|
],
|
|
4123
4143
|
"transport": "http",
|
|
4124
|
-
"notes": "JSON-RPC over MCP's Streamable HTTP, so neither the request nor the response is a shape contracts describes — exactly as `POST /mcp` is, and stateless for the same reason: a fresh transport per request, no session id, nothing surviving the call. **App users only.** The tools are this app's robots filtered by the caller's role, built by the same builder `GET /api/
|
|
4144
|
+
"notes": "JSON-RPC over MCP's Streamable HTTP, so neither the request nor the response is a shape contracts describes — exactly as `POST /mcp` is, and stateless for the same reason: a fresh transport per request, no session id, nothing surviving the call. **App users only.** The tools are this app's robots filtered by the caller's role, built by the same builder `GET /api/robots/:id/datasheet` answers, so the datasheet and the live catalog cannot drift. The console tool family belongs to the central endpoint and is offered here to nobody. \n\n**The bearer is verified inside the handler**, not by a route guard, for the two reasons the central endpoint gives — the identity comes from the token and the path names none of it, and the refusal has to carry a `WWW-Authenticate` challenge a guard shared with the REST surface does not send. The challenge names **this app's** protected-resource document (RFC 9728's `resource_metadata`), which is how an MCP client discovers the right authorization server from a bare `401`; pointing it at the central document would send every app's client to the wrong sign-in. \n\n**`404 not_found` covers an identifier no app carries AND an app whose `appAuthConfig.mcp_enabled` is off — one answer for both, the same one the two metadata documents and `register` give.** A separate `403 mcp_disabled` here would hand an anonymous caller a three-way oracle (`404` = no such app, `403` = the app exists with MCP off, `401` = the app exists and is live), which is exactly the distinction discovery collapses; there is no point collapsing it in one place and publishing it in another. The switch is re-read on every request rather than cached off the token, so a developer turning it off ends the sessions already running, and it is decided **before the bearer is looked at** — the reverse of the usual order, and deliberate: it is a fact about the path, an app identifier is public, and an absent server that answered `401` would send a client hunting a credential no credential can satisfy. `401 unauthorized` is a missing, unverifiable or expired bearer, an `aud` that is not this endpoint, or **a consent this person has since withdrawn from the client the token was minted for**: the access token names its client, and the standing consent is re-read here on every request exactly as the account is, so `DELETE /api/client/mcp/grants/:clientId` and its developer twin bite at the next call rather than when the token expires. `403 forbidden` is a token that verifies and is not this app's user: another app's session, a Fleetless user's central `mcp_session`, an account that is `blocked` or still `pending_verification`, or a foreign `Origin`."
|
|
4125
4145
|
},
|
|
4126
4146
|
{
|
|
4127
4147
|
"method": "GET",
|
|
@@ -4395,7 +4415,7 @@
|
|
|
4395
4415
|
"quota_exceeded"
|
|
4396
4416
|
],
|
|
4397
4417
|
"transport": "http",
|
|
4398
|
-
"notes": "**`202` and an empty body for every request policy allows** — a new address, one this app already knows and one it does not answer identically, in status, body and timing. An answer that depended on existence would be the account-enumeration oracle the whole client family is built to avoid. The account cannot log in until the mailed link is spent; `POST /api/client/verify-email` is what does that. \n\n**An address on an account still `pending_verification` is re-registered, not ignored.** The password and display name from this call replace what is stored, every outstanding verification link for the address stops working, and a fresh one is mailed. Otherwise whoever typed an address first would own the password of the account its real owner later verifies. An address on an `active` account changes nothing and sends nothing — that account has already been proven, and its way back in is `POST /api/client/password/reset`. Neither case is visible in the answer. \n\nThe refusals it *does* make are about policy or about what the caller typed, never about a person. `403 registration_closed` when the app has self-registration off and `403 domain_not_allowed` when the address is outside `allowed_domains`: both are the developer's own configuration, and a stranger learns the app's policy rather than who is in it. **A password under twelve characters is part of that `400 validation_error`** and not a code of its own — the minimum is the `password` field's schema rule, and the error names the field, which is what a form needs to mark it. The same `400` names `password` when one is missing while the app's password method is on, or sent while it is off: an email-code-only app registers people without one. `404 not_found` names an **app identifier no app carries**, and never an address: an app identifier is already public (it is in the MCP metadata path and in the developer's own URLs), while collapsing it into `registration_closed` sent a developer who mistyped their own identifier hunting a configuration bug that was not there. `409 target_state_conflict` when the app has no default role — there would be no role to give the person. An app with no `verify_url` is not refused: the mailed link points at the hosted confirmation page instead. \n\n**`409 quota_exceeded` when the org is at its `max_end_users` limit**, counted across every app of the org. It is the one refusal here that is answered **before the address is looked at** — and that ordering is the point rather than an implementation detail: a quota checked after the existence branch would answer `202` for an address the app already knows and `409` for one it does not, which is precisely the enumeration oracle every other line of this route exists to close. At the quota, every registration is refused identically, including one that would only have re-mailed a pending account's link."
|
|
4418
|
+
"notes": "**`202` and an empty body for every request policy allows** — a new address, one this app already knows and one it does not answer identically, in status, body and timing. An answer that depended on existence would be the account-enumeration oracle the whole client family is built to avoid. The account cannot log in until the mailed link is spent; `POST /api/client/verify-email` is what does that. \n\n**An address on an account still `pending_verification` is re-registered, not ignored.** The password and display name from this call replace what is stored, every outstanding verification link for the address stops working, and a fresh one is mailed. Otherwise whoever typed an address first would own the password of the account its real owner later verifies. An address on an `active` account changes nothing and sends nothing — that account has already been proven, and its way back in is `POST /api/client/password/reset`. Neither case is visible in the answer. \n\nThe refusals it *does* make are about policy or about what the caller typed, never about a person. `403 registration_closed` when the app has self-registration off and `403 domain_not_allowed` when the address is outside `allowed_domains`: both are the developer's own configuration, and a stranger learns the app's policy rather than who is in it. **A password under twelve characters is part of that `400 validation_error`** and not a code of its own — the minimum is the `password` field's schema rule, and the error names the field, which is what a form needs to mark it. The same `400` names `password` when one is missing while the app's password method is on, or sent while it is off: an email-code-only app registers people without one. `404 not_found` names an **app identifier no app carries**, and never an address: an app identifier is already public (it is in the MCP metadata path and in the developer's own URLs), while collapsing it into `registration_closed` sent a developer who mistyped their own identifier hunting a configuration bug that was not there. `409 target_state_conflict` naming `default_role` with rule `not_set` when the app has no default role — there would be no role to give the person. A default that names no role is not a refusal: the account holds the key and reaches nothing. An app with no `verify_url` is not refused: the mailed link points at the hosted confirmation page instead. \n\n**`409 quota_exceeded` when the org is at its `max_end_users` limit**, counted across every app of the org. It is the one refusal here that is answered **before the address is looked at** — and that ordering is the point rather than an implementation detail: a quota checked after the existence branch would answer `202` for an address the app already knows and `409` for one it does not, which is precisely the enumeration oracle every other line of this route exists to close. At the quota, every registration is refused identically, including one that would only have re-mailed a pending account's link."
|
|
4399
4419
|
},
|
|
4400
4420
|
{
|
|
4401
4421
|
"method": "POST",
|
|
@@ -4510,7 +4530,7 @@
|
|
|
4510
4530
|
"quota_exceeded"
|
|
4511
4531
|
],
|
|
4512
4532
|
"transport": "http",
|
|
4513
|
-
"notes": "**An app invitation, not a team one.** `POST /api/org/invitations/accept` is the other space and answers `204`; this one answers a session, because the person is landing in the developer's app and there is no second door for them to sign in through. The role is the one the invitation fixed at creation, so a later change to the app's default role does not re-aim a link already in somebody's inbox, and the invitation **bypasses `allowed_domains`** — a developer inviting somebody by hand has already made the decision the whitelist automates. The answer is a `clientSignInResult`: a `twoFactorChallenge` instead of tokens when the app requires two-factor. `password` is required while the app's password method is on and refused while it is off, both as `400 validation_error` naming the field. \n\n**One refusal for every token that does not work: `410 token_spent`** — unknown, expired past the seven days, revoked by the developer, or already accepted. There is one code because telling them apart would say whether a token ever existed, and because the one thing the holder of a dead link can do is ask the developer for a new one, whichever of the four it was. A chosen password under twelve characters is part of the `400 validation_error`, naming the `password` field. `409 email_taken` is an address this app has acquired since the invitation was written **as an account that is already in use** — the invitation stays outstanding rather than being spent, so the developer can revoke it or point the person at the login. An address that registered itself and is still `pending_verification` is not that state: accepting sets the password the invitee just chose, activates the account and gives it the invitation's role, because reading the invitation mail proves the address the verification link was waiting on. \n\n`409 target_state_conflict` names `
|
|
4533
|
+
"notes": "**An app invitation, not a team one.** `POST /api/org/invitations/accept` is the other space and answers `204`; this one answers a session, because the person is landing in the developer's app and there is no second door for them to sign in through. The role is the one the invitation fixed at creation, so a later change to the app's default role does not re-aim a link already in somebody's inbox, and the invitation **bypasses `allowed_domains`** — a developer inviting somebody by hand has already made the decision the whitelist automates. The answer is a `clientSignInResult`: a `twoFactorChallenge` instead of tokens when the app requires two-factor. `password` is required while the app's password method is on and refused while it is off, both as `400 validation_error` naming the field. \n\n**One refusal for every token that does not work: `410 token_spent`** — unknown, expired past the seven days, revoked by the developer, or already accepted. There is one code because telling them apart would say whether a token ever existed, and because the one thing the holder of a dead link can do is ask the developer for a new one, whichever of the four it was. A chosen password under twelve characters is part of the `400 validation_error`, naming the `password` field. `409 email_taken` is an address this app has acquired since the invitation was written **as an account that is already in use** — the invitation stays outstanding rather than being spent, so the developer can revoke it or point the person at the login. An address that registered itself and is still `pending_verification` is not that state: accepting sets the password the invitee just chose, activates the account and gives it the invitation's role, because reading the invitation mail proves the address the verification link was waiting on. \n\n`409 target_state_conflict` names `default_role` with rule `not_set` when the invitation holds no role key (it lists with `role: null`) and the app has no default role to fall back on: there is no access to hand the acceptor, and creating an account with none would be worse than saying so. A role deleted since the invitation was issued is no obstacle: the account is created holding the key and reaches nothing. \n\n**`409 quota_exceeded` when accepting would CREATE an account and the org is at its `max_end_users` limit**, counted across every app of the org. An invitation that names a row the developer already created, and one whose address is held by an unfinished self-registration, both finish an account that already counts — those are not refused, because the org is not one account larger afterwards. The token is not spent by the refusal: the developer can raise the limit, or delete somebody, and the same link still works."
|
|
4514
4534
|
},
|
|
4515
4535
|
{
|
|
4516
4536
|
"method": "POST",
|
|
@@ -4604,7 +4624,7 @@
|
|
|
4604
4624
|
"forbidden"
|
|
4605
4625
|
],
|
|
4606
4626
|
"transport": "http",
|
|
4607
|
-
"notes": "The one route that answers for all three caller kinds — a developer bearer, an app-user bearer and a server key — which is why the shape names each of `developer_id`, `app_user_id` and `server_key_id` and fills exactly one."
|
|
4627
|
+
"notes": "The one route that answers for all three caller kinds — a developer bearer, an app-user bearer and a server key — which is why the shape names each of `developer_id`, `app_user_id` and `server_key_id` and fills exactly one. `role` is the organization role an app user holds, as its key and display name; it is `null` for a developer and a server key, and for an app user whose key names no role (the role was deleted), who signs in and reaches nothing."
|
|
4608
4628
|
},
|
|
4609
4629
|
{
|
|
4610
4630
|
"method": "POST",
|
|
@@ -5127,7 +5147,7 @@
|
|
|
5127
5147
|
"not_found"
|
|
5128
5148
|
],
|
|
5129
5149
|
"transport": "http",
|
|
5130
|
-
"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."
|
|
5131
5151
|
},
|
|
5132
5152
|
{
|
|
5133
5153
|
"method": "DELETE",
|
|
@@ -5160,36 +5180,6 @@
|
|
|
5160
5180
|
"transport": "http",
|
|
5161
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\"."
|
|
5162
5182
|
},
|
|
5163
|
-
{
|
|
5164
|
-
"method": "PUT",
|
|
5165
|
-
"path": "/api/robots/:id/details",
|
|
5166
|
-
"section": "robots",
|
|
5167
|
-
"summary": "Replaces the developer-maintained details document shown alongside the robot.",
|
|
5168
|
-
"audience": "developer",
|
|
5169
|
-
"auth": "developer",
|
|
5170
|
-
"rateLimited": false,
|
|
5171
|
-
"ownerTier": false,
|
|
5172
|
-
"status": 200,
|
|
5173
|
-
"params": [
|
|
5174
|
-
{
|
|
5175
|
-
"name": "id",
|
|
5176
|
-
"description": "The robot's uuid, as returned by `POST /api/robots` or listed by `GET /api/robots`."
|
|
5177
|
-
}
|
|
5178
|
-
],
|
|
5179
|
-
"query": null,
|
|
5180
|
-
"request": "put-robot-details-request",
|
|
5181
|
-
"response": "put-robot-details-response",
|
|
5182
|
-
"errors": [
|
|
5183
|
-
"unauthorized",
|
|
5184
|
-
"token_expired",
|
|
5185
|
-
"token_revoked",
|
|
5186
|
-
"invalid_uuid",
|
|
5187
|
-
"not_found",
|
|
5188
|
-
"validation_error"
|
|
5189
|
-
],
|
|
5190
|
-
"transport": "http",
|
|
5191
|
-
"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."
|
|
5192
|
-
},
|
|
5193
5183
|
{
|
|
5194
5184
|
"method": "GET",
|
|
5195
5185
|
"path": "/api/robots/:id/datapoints",
|
|
@@ -5218,13 +5208,13 @@
|
|
|
5218
5208
|
"not_found"
|
|
5219
5209
|
],
|
|
5220
5210
|
"transport": "http",
|
|
5221
|
-
"notes": "A developer bearer sees the robot's whole list unfiltered; an end user
|
|
5211
|
+
"notes": "A developer bearer sees the robot's whole list unfiltered; an end user sees only the slugs their role grants, a server key every slug its app does not lock, and a robot their app does not attach answers `404` exactly as one that does not exist."
|
|
5222
5212
|
},
|
|
5223
5213
|
{
|
|
5224
5214
|
"method": "GET",
|
|
5225
5215
|
"path": "/api/robots/:id/exposures",
|
|
5226
5216
|
"section": "robots",
|
|
5227
|
-
"summary": "Lists every
|
|
5217
|
+
"summary": "Lists every exposed slug of a robot with its kind — the material an app picks its locks from.",
|
|
5228
5218
|
"audience": "developer",
|
|
5229
5219
|
"auth": "developer",
|
|
5230
5220
|
"rateLimited": false,
|
|
@@ -5247,7 +5237,7 @@
|
|
|
5247
5237
|
"not_found"
|
|
5248
5238
|
],
|
|
5249
5239
|
"transport": "http",
|
|
5250
|
-
"notes": "Developer-only: this is what a role
|
|
5240
|
+
"notes": "Developer-only: this is what a role could be required to use and an app could lock, which is a configuration fact rather than something an end user is entitled to enumerate."
|
|
5251
5241
|
},
|
|
5252
5242
|
{
|
|
5253
5243
|
"method": "GET",
|
|
@@ -5283,7 +5273,7 @@
|
|
|
5283
5273
|
"no_data"
|
|
5284
5274
|
],
|
|
5285
5275
|
"transport": "http",
|
|
5286
|
-
"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."
|
|
5287
5277
|
},
|
|
5288
5278
|
{
|
|
5289
5279
|
"method": "GET",
|
|
@@ -5336,7 +5326,7 @@
|
|
|
5336
5326
|
"not_found"
|
|
5337
5327
|
],
|
|
5338
5328
|
"transport": "http",
|
|
5339
|
-
"notes": "**The REST twin of the MCP action `robots.describe`**: one answer per robot — every datapoint, action, service, publisher and camera the role grants, each with its `input_schema` where it takes parameters, plus the two capabilities that gate whole features, `
|
|
5329
|
+
"notes": "**The REST twin of the MCP action `robots.describe`**: one answer per robot — every datapoint, action, service, publisher and camera the role grants, each with its `input_schema` where it takes parameters, plus the two capabilities that gate whole features, `job_history` and `assets`. A robot with nothing published answers an empty `exposures` list, never a refusal. A robot the caller does not reach — not attached to their app, or attached with a role that grants nothing on it — answers `404` exactly as one that does not exist. The app-user datapoint and camera listings under this prefix stay; this is the one read that also names actions, services, publishers and capabilities, which is what an app needs before it can draw a screen."
|
|
5340
5330
|
},
|
|
5341
5331
|
{
|
|
5342
5332
|
"method": "GET",
|
|
@@ -5428,7 +5418,7 @@
|
|
|
5428
5418
|
"draft_not_a_document"
|
|
5429
5419
|
],
|
|
5430
5420
|
"transport": "http",
|
|
5431
|
-
"notes": "A draft that is valid YAML but not a Fleetless configuration is `422 draft_not_a_document`, carrying every issue rather than the blocking subset — nothing about that text is publishable, so there is no subset to pick, and the warning naming the checks that could not run is part of reading the list correctly. A document with `severity: \"error\"` issues is `422 validation_error` with just those. The draft's own text travels into the version, so a restore later returns what the author wrote rather than a re-rendering of it."
|
|
5421
|
+
"notes": "A draft that is valid YAML but not a Fleetless configuration is `422 draft_not_a_document`, carrying every issue rather than the blocking subset — nothing about that text is publishable, so there is no subset to pick, and the warning naming the checks that could not run is part of reading the list correctly. A document with `severity: \"error\"` issues is `422 validation_error` with just those. The draft's own text travels into the version, so a restore later returns what the author wrote rather than a re-rendering of it. The answer carries `warnings`: every `warning` of the published document, role keys that name no role of the organization included. A warning never blocks a publish."
|
|
5432
5422
|
},
|
|
5433
5423
|
{
|
|
5434
5424
|
"method": "GET",
|
|
@@ -5529,7 +5519,7 @@
|
|
|
5529
5519
|
"method": "POST",
|
|
5530
5520
|
"path": "/api/robots/:id/config/rename-slug",
|
|
5531
5521
|
"section": "config",
|
|
5532
|
-
"summary": "Renames a slug in the draft and moves
|
|
5522
|
+
"summary": "Renames a slug in the draft and moves the app locks and the recorded history with the name.",
|
|
5533
5523
|
"audience": "developer",
|
|
5534
5524
|
"auth": "developer",
|
|
5535
5525
|
"rateLimited": false,
|
|
@@ -5556,10 +5546,11 @@
|
|
|
5556
5546
|
"reserved_slug",
|
|
5557
5547
|
"duplicate_slug",
|
|
5558
5548
|
"history_migrating",
|
|
5549
|
+
"target_state_conflict",
|
|
5559
5550
|
"internal_error"
|
|
5560
5551
|
],
|
|
5561
5552
|
"transport": "http",
|
|
5562
|
-
"notes": "One transaction: the draft document and every app
|
|
5553
|
+
"notes": "One transaction: the draft document and every app lock that lists the slug are rewritten, and the recorded history moves with the name without rewriting any stored sample, so a rename takes the same time however much history there is. Locks follow the rename: a lock that listed the old slug lists the new one as well, in every app of the organization, so a locked capability stays locked; the old name stays in the lock until the next `PUT /api/apps/:id/access`, and `rewritten_locks` counts the locks touched. A lock that would grow past the most slugs it can hold refuses the whole rename with `409 target_state_conflict` naming `to` (rule `lock_full`); nothing is written. Samples the robot still sends under the old slug until the next publish join the renamed history. The published configuration is immutable, so `requires_publish` says the rename is not live on the robot yet. A draft that is not a document is `409 draft_not_a_document` — the same word the usage preview uses for the same state. While the recorded history is being migrated the rename is refused with `409 history_migrating`; nothing is written, and the same request succeeds once the migration has finished."
|
|
5563
5554
|
},
|
|
5564
5555
|
{
|
|
5565
5556
|
"method": "GET",
|
|
@@ -5593,7 +5584,7 @@
|
|
|
5593
5584
|
"draft_not_a_document"
|
|
5594
5585
|
],
|
|
5595
5586
|
"transport": "http",
|
|
5596
|
-
"notes": "A draft that is valid YAML but not a Fleetless document is refused rather than answered with `alert_count: 0`: the two states are *this slug has no alerts* and *there is no document to ask*, and a zero cannot tell them apart — it would show a smaller blast radius than the rename actually has. The other three counts are real whatever the draft holds, and a partial answer to a preview whose whole purpose is to be complete is not worth the ambiguity."
|
|
5587
|
+
"notes": "A draft that is valid YAML but not a Fleetless document is refused rather than answered with `alert_count: 0`: the two states are *this slug has no alerts* and *there is no document to ask*, and a zero cannot tell them apart — it would show a smaller blast radius than the rename actually has. The other three counts are real whatever the draft holds, and a partial answer to a preview whose whole purpose is to be complete is not worth the ambiguity. `lock_count` counts the app locks the rename would extend with the new name."
|
|
5597
5588
|
},
|
|
5598
5589
|
{
|
|
5599
5590
|
"method": "GET",
|
|
@@ -5828,7 +5819,7 @@
|
|
|
5828
5819
|
"validation_error"
|
|
5829
5820
|
],
|
|
5830
5821
|
"transport": "http",
|
|
5831
|
-
"notes": "Needs the `
|
|
5822
|
+
"notes": "Needs the `job_history` capability, and **this route is what makes that switch mean something** — it was unkeepable while nothing durable recorded what had run. Two residuals worth stating rather than implying away. `history` is a syntactically valid slug, and a static segment matches before a parameter, so a robot with a service literally slugged `history` can no longer be **read** through `GET /api/robots/:id/jobs/:slug`; invoking, cancelling and the listing are unaffected. And a run row names its actor by email address, so an end user holding this capability learns which other people have been driving the machine. `robot_id` in the query is shared with the org-wide read; a *different* one here is refused rather than quietly answered about the robot in the path."
|
|
5832
5823
|
},
|
|
5833
5824
|
{
|
|
5834
5825
|
"method": "POST",
|
|
@@ -5868,7 +5859,7 @@
|
|
|
5868
5859
|
"internal_error"
|
|
5869
5860
|
],
|
|
5870
5861
|
"transport": "http",
|
|
5871
|
-
"notes": "**One route for both kinds**, because a path segment naming the kind would demand a fact
|
|
5862
|
+
"notes": "**One route for both kinds**, because a path segment naming the kind would demand a fact the rights model does not carry. An action answers `202` with an `invokeResponse` the moment the job exists; a service answers `200` with a `serviceCallResponse` once the result is in — two shapes, carried by one union (`invokeOrServiceResponse`) and told apart by whether `kind` or a bare `result` arrives. Parameters are checked **before** anything about the world (offline, busy): the same request must get the same verdict whether or not the robot happens to be reachable, or a developer testing against an offline robot never learns their parameters were wrong. A slug is `409 busy` while it holds a `running` job, an `unknown` one the robot has not accounted for yet, or an `external` goal someone else started; the refusal's `details.running` names that job, `state` and `origin` included. A service the robot reports as failed answers `502` carrying **the job's own error code**, which is an open set and not one of the codes above."
|
|
5872
5863
|
},
|
|
5873
5864
|
{
|
|
5874
5865
|
"method": "GET",
|
|
@@ -6529,7 +6520,7 @@
|
|
|
6529
6520
|
"token_revoked"
|
|
6530
6521
|
],
|
|
6531
6522
|
"transport": "http",
|
|
6532
|
-
"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`."
|
|
6533
6524
|
},
|
|
6534
6525
|
{
|
|
6535
6526
|
"method": "GET",
|
|
@@ -7387,6 +7378,1152 @@
|
|
|
7387
7378
|
"transport": "http",
|
|
7388
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."
|
|
7389
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
|
+
},
|
|
7390
8527
|
{
|
|
7391
8528
|
"method": "GET",
|
|
7392
8529
|
"path": "/bridge",
|
|
@@ -7411,7 +8548,7 @@
|
|
|
7411
8548
|
"method": "GET",
|
|
7412
8549
|
"path": "/realtime",
|
|
7413
8550
|
"section": "transports",
|
|
7414
|
-
"summary": "The client WebSocket: subscriptions on datapoints, jobs,
|
|
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.",
|
|
7415
8552
|
"audience": "client",
|
|
7416
8553
|
"auth": "none",
|
|
7417
8554
|
"rateLimited": false,
|
|
@@ -7426,7 +8563,7 @@
|
|
|
7426
8563
|
"rate_limited"
|
|
7427
8564
|
],
|
|
7428
8565
|
"transport": "websocket",
|
|
7429
|
-
"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."
|
|
7430
8567
|
}
|
|
7431
8568
|
]
|
|
7432
8569
|
}
|