Check a configuration bundle without applying it
const url = 'https://api.sloose.com/orgs/org_9f3c/config/bundle/dry-run?connector=con_8f2a';const options = { method: 'POST', headers: { 'If-Match': '"7"', Authorization: 'Bearer <token>', 'Content-Type': 'application/json' }, body: '{"bundleVersion":1,"org":{"dateFormat":"DMY","expressionContext":"example","aiSamples":"allow"},"registry":{"version":1,"modules":[{"seedMappings":"example","key":"example","apiName":"example","label":"example","singular":"example","singularLabel":"example","color":"example","defaultEnabled":true,"uniqueFields":["example"],"defaultDuplicateCheck":{"searchField":"example","searchMethod":"example","expression":"example"},"excludedFields":["example"],"child":{"of":"example","via":"example","parentNeedsRows":true,"pointer":"example","maxRows":"off","layouts":{"additionalProperty":{"name":"example","maxRows":"off","required":["example"]}},"defaultLayout":"example"},"stockEffect":{"field":"example","label":"example","direction":"up"}}],"expressionContext":"example","apiDelayMs":1,"systemExcludedFields":["example"],"dateFormat":"DMY","timezone":"example"},"fields":{"additionalProperty":[{"apiName":"example","description":"example","format":"example","examples":["example"],"aliases":["example"],"excludeFromAi":true,"derived":true,"defaultMapping":{"mode":"column","source":"example","staticValue":"example","staticPickedIn":{"connection":"example","module":"example","id":"example","name":"example"},"transform":"example","skip":true,"searchField":"example","searchMethod":"example","searchExpression":"example","patch":{"when":["pending"],"overwrite":"always"},"files":{"sheet":"example","holds":"name","separator":"example"},"key":true,"keyMethod":"example","keyExpression":"example","onNone":"empty","onSeveral":"ask"},"excluded":true,"requiredForImports":"waivable","writtenAs":"upper","mustBe":{"rule":"example","says":"example"}}]},"libraries":[{"manifest":{"namespace":"example","version":"example","scope":"global","description":"example","functions":[{"name":"example","description":"example","params":[{"name":"example","type":"example","optional":true,"description":"example"}],"returns":"example","examples":[{"call":"example","result":"example"}],"tags":["example"]}]},"source":"example"}],"templates":[{"name":"example","description":"example","config":{"additionalProperty":"example"}}],"projects":[{"name":"example","description":"example","config":{"additionalProperty":"example"}}]}'};
try { const response = await fetch(url, options); const data = await response.json(); console.log(data);} catch (error) { console.error(error);}curl --request POST \ --url 'https://api.sloose.com/orgs/org_9f3c/config/bundle/dry-run?connector=con_8f2a' \ --header 'Authorization: Bearer <token>' \ --header 'Content-Type: application/json' \ --header 'If-Match: "7"' \ --data '{ "bundleVersion": 1, "org": { "dateFormat": "DMY", "expressionContext": "example", "aiSamples": "allow" }, "registry": { "version": 1, "modules": [ { "seedMappings": "example", "key": "example", "apiName": "example", "label": "example", "singular": "example", "singularLabel": "example", "color": "example", "defaultEnabled": true, "uniqueFields": [ "example" ], "defaultDuplicateCheck": { "searchField": "example", "searchMethod": "example", "expression": "example" }, "excludedFields": [ "example" ], "child": { "of": "example", "via": "example", "parentNeedsRows": true, "pointer": "example", "maxRows": "off", "layouts": { "additionalProperty": { "name": "example", "maxRows": "off", "required": [ "example" ] } }, "defaultLayout": "example" }, "stockEffect": { "field": "example", "label": "example", "direction": "up" } } ], "expressionContext": "example", "apiDelayMs": 1, "systemExcludedFields": [ "example" ], "dateFormat": "DMY", "timezone": "example" }, "fields": { "additionalProperty": [ { "apiName": "example", "description": "example", "format": "example", "examples": [ "example" ], "aliases": [ "example" ], "excludeFromAi": true, "derived": true, "defaultMapping": { "mode": "column", "source": "example", "staticValue": "example", "staticPickedIn": { "connection": "example", "module": "example", "id": "example", "name": "example" }, "transform": "example", "skip": true, "searchField": "example", "searchMethod": "example", "searchExpression": "example", "patch": { "when": [ "pending" ], "overwrite": "always" }, "files": { "sheet": "example", "holds": "name", "separator": "example" }, "key": true, "keyMethod": "example", "keyExpression": "example", "onNone": "empty", "onSeveral": "ask" }, "excluded": true, "requiredForImports": "waivable", "writtenAs": "upper", "mustBe": { "rule": "example", "says": "example" } } ] }, "libraries": [ { "manifest": { "namespace": "example", "version": "example", "scope": "global", "description": "example", "functions": [ { "name": "example", "description": "example", "params": [ { "name": "example", "type": "example", "optional": true, "description": "example" } ], "returns": "example", "examples": [ { "call": "example", "result": "example" } ], "tags": [ "example" ] } ] }, "source": "example" } ], "templates": [ { "name": "example", "description": "example", "config": { "additionalProperty": "example" } } ], "projects": [ { "name": "example", "description": "example", "config": { "additionalProperty": "example" } } ] }'Checks a bundle exactly as POST …/config/bundle would apply it and writes nothing: every refusal the push makes before it writes (the connection named, the plan, If-Match, the libraries compiling and loading, the registry, the annotations, every template) is made here, in the same words, and the warnings the push would give are answered. No version moves, no row changes and no change is recorded. This is what sloose push --dry-run sends.
A separate route, not a flag on the push, so a client talking to a server that does not have it is refused (404) rather than having its dry run applied.
What it cannot say is what another writer does between this answer and a real push, which a push checks again as it goes (PUSH_OVERTAKEN); If-Match is checked again after the checks, so a write that landed during them is reported REGISTRY_CONFLICT as the push would.
Authorizations
Section titled “Authorizations”Parameters
Section titled “Parameters”Path Parameters
Section titled “Path Parameters”The organisation id the session was issued for. A token for one organisation can never read another.
Example
org_9f3cThe organisation id the session was issued for. A token for one organisation can never read another.
Query Parameters
Section titled “Query Parameters”The connection this is about, by id: one of the organisation’s, or your own. REQUIRED: absent or empty is 400 CONNECTION_REQUIRED, listing the connections this bearer may name, because nothing picks one for a request that does not say (design §14.8). Any other — another organisation’s, or another person’s — is 404 CONNECTION_NOT_FOUND.
Example
con_8f2aThe connection this is about, by id: one of the organisation’s, or your own. REQUIRED: absent or empty is 400 CONNECTION_REQUIRED, listing the connections this bearer may name, because nothing picks one for a request that does not say (design §14.8). Any other — another organisation’s, or another person’s — is 404 CONNECTION_NOT_FOUND.
Header Parameters
Section titled “Header Parameters”The registryVersion the bundle was made against, as "7" or 7; a weak tag (W/"7") is refused. Sent, the dry run is refused with 409 (code: REGISTRY_CONFLICT, the current version in the body) when the organisation has moved since — as the push would be — checked before the checks and again after them. A dry run only validates the precondition: it writes nothing, makes no version and answers no registryVersion. Omitted, or *, there is no condition. A value that is neither is 400 (code: BAD_IF_MATCH).
Example
"7"The registryVersion the bundle was made against, as "7" or 7; a weak tag (W/"7") is refused. Sent, the dry run is refused with 409 (code: REGISTRY_CONFLICT, the current version in the body) when the organisation has moved since — as the push would be — checked before the checks and again after them. A dry run only validates the precondition: it writes nothing, makes no version and answers no registryVersion. Omitted, or *, there is no condition. A value that is neither is 400 (code: BAD_IF_MATCH).
Request Bodyrequired
Section titled “Request Bodyrequired”object
object
object
object
seedMappings is no longer a module setting: a mapping a new import starts from belongs to the field it is about. Set defaultMapping on the field annotation — PATCH /orgs/{org}/config/fields/{module}/{apiName}, or fields/<module>.json in a configuration repository. Values already stored were moved by migration 0035.
One record as the CRM names it in words (“Sales Order”), which sentences say; singular is the identifier expressions use (“SalesOrder”). Read-only: discovery takes it from the CRM, so a pushed value is ignored. Absent until a discovery has read it, when a reader says singular.
object
object
The organisation’s IANA timezone, which helpers.today() answers in. Read-only: it is taken from the CRM at sign-in, so a pushed value is ignored.
object
object
object
object
object
object
object
object
object
object
object
object
object
object
Deprecated: the older name of templates, read as templates. A bundle may send one or the other, not both.
object
object
Responses
Section titled “Responses”The bundle would be accepted: what it holds, and the warnings a push would give. Nothing was written.
object
object
What a push would store or leave alone and have something to say about, as the push says it (libraries/<name>: …, templates/<name>: …) — present only when there is something.
Example
{ "ok": true, "dryRun": true}The request — its body or its query — did not match the schema (issues carries the Zod issue list), or: The request named no connection (code: CONNECTION_REQUIRED, with connections: the ones this bearer may name). Nothing picks one for a request that does not say (design §14.8).
The error envelope every non-2xx answer uses.
object
Human-readable explanation.
Machine-readable reason. Absent on a few legacy 400s.
Examplegenerated
{ "error": "example", "code": "example"}No bearer, or one that no longer resolves: a session that is unknown or expired (code: AUTH_REQUIRED), or an API token that was revoked or expired (TOKEN_REVOKED, TOKEN_EXPIRED), whose organisation is gone (ORG_NOT_FOUND) or whose member or user row is (MEMBERSHIP_GONE).
The error envelope every non-2xx answer uses.
object
Human-readable explanation.
Machine-readable reason. Absent on a few legacy 400s.
Examplegenerated
{ "error": "example", "code": "example"}The plan cannot share templates (code: FEATURE_SHARED_TEMPLATES) or publish helper libraries (code: FEATURE_HELPER_LIBRARIES, for a bundle carrying any), the role is too low, or the organisation is closed (code: ORG_CLOSED). Like every route behind a session: a session signed in but in no organisation is refused code: NO_ORG, a banned person code: BANNED, and a closed organisation code: ORG_CLOSED.
object
Examplegenerated
{ "error": "example", "code": "example"}?connector= names a connection this person may not use: another organisation’s, or another person’s (code: CONNECTION_NOT_FOUND).
The error envelope every non-2xx answer uses.
object
Human-readable explanation.
Machine-readable reason. Absent on a few legacy 400s.
Examplegenerated
{ "error": "example", "code": "example"}Or a bound on what an organisation’s libraries hold is met, the same on every plan (holding says where it stands with the caps, proposed what this would have brought it to): LIBRARY_LIMIT — it would hold more than 20 libraries; LIBRARIES_TOO_LARGE — its libraries would come to more than 1 MB of source; LIBRARY_HISTORY_FULL — the versions it keeps would come to more than 25 MB; LIBRARY_PUBLISH_RATE — more than 50 versions in 24 hours, counted from the first of them. A publish that changes nothing makes no version and meets none of them, as the push would be refused before it wrote anything. The organisation’s configuration has changed since the version in If-Match (code: REGISTRY_CONFLICT, the current version in the body) — before the checks or while they ran.
object
object
The library that met the bound. Null where a push of several was refused in its own transaction and which of them met it cannot be told.
The organisation as it stands: what the list shows.
object
Libraries the organisation holds.
UTF-8 bytes of source across its libraries as they currently are.
UTF-8 bytes of source across every version it keeps. Removing a library removes its versions.
Versions published in the last 24 hours, across its libraries.
When the oldest of those leaves the 24 hours, so another may be published where the day’s cap is met. Null with none.
The most of each, the same on every plan.
object
What the publish, or the whole push it is part of, would have brought the organisation to: the figure that is past its bound.
object
Example
{ "code": "REGISTRY_CONFLICT"}The push would be refused for what the bundle holds: a module or field this organisation does not have (UNKNOWN_MODULES, UNKNOWN_FIELDS), a case a field’s kind does not take (WRITTEN_AS_NOT_FOR_KIND), a Must be rule that reaches past the value (INVALID_RULE), a key the registry gives that another module holds (KEY_CLASH), a registry or template that does not read (INVALID_REGISTRY, INVALID_TEMPLATE), a default match rule or a template’s key that looks in a field the destination cannot match by (UNMATCHABLE_FIELD, each named in rules), or a helper library that cannot be published (GLOBAL_LIBRARY, DUPLICATE_LIBRARY, RESERVED_NAMESPACE, LIBRARY_DOES_NOT_LOAD).
object
UNKNOWN_MODULES only: the template that names a module none holds.
UNKNOWN_MODULES, UNKNOWN_FIELDS: what no one holds.
WRITTEN_AS_NOT_FOR_KIND: each field given a case its kind does not take. INVALID_RULE: each field given a Must be rule that reaches past the value, and why.
object
The field’s kind, as discovery last read it.
The cases this kind takes: none for a website, lower for an email.
object
What the rule reaches that it may not, in words.
UNMATCHABLE_FIELD only: each default match rule or template key that looks in a field the destination does not take with the method it asks, and why.
object
In words: the field cannot be matched with this method, and why.
Example
{ "fields": [ { "writtenAs": "upper", "takes": [ "upper" ] } ]}A helper library in the bundle could not be checked: the sandbox did not answer (code: SANDBOX_UNAVAILABLE). Nothing was written. Or the restore switch is on (code: MAINTENANCE): every route but /health and /robots.txt is refused before anything is read, with Retry-After (the operator’s ADMIN_TOKEN alone is let through to POST /staff/people/{id}/delete, and to nothing else).
Headers
Section titled “Headers”Seconds until asking again is worth it (300 while the switch is on).