Skip to content

Check a configuration bundle without applying it

POST
/orgs/{org}/config/bundle/dry-run
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", "color": "example", "defaultEnabled": true, "uniqueFields": [ "example" ], "defaultDuplicateCheck": { "searchField": "example", "searchMethod": "example", "expression": "example" }, "excludedFields": [ "example" ] } ], "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", "transform": "example", "skip": true, "searchField": "example", "searchMethod": "example", "searchExpression": "example", "patch": { "when": [ "pending" ], "overwrite": "always" }, "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.

org
required

The org id the session was issued for. A token for one org can never read another.

string
Example
org_9f3c

The org id the session was issued for. A token for one org can never read another.

connector

The connection this is about, by id: one of the org’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 org’s, or another person’s — is 404 CONNECTION_NOT_FOUND.

string
Example
con_8f2a

The connection this is about, by id: one of the org’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 org’s, or another person’s — is 404 CONNECTION_NOT_FOUND.

If-Match

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 org 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).

string
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 org 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).

Media typeapplication/json
object
bundleVersion
required
number
Allowed values: 1
org
object
dateFormat
string
Allowed values: DMY MDY YMD
expressionContext
string
/^[A-Za-z_$][\w$]*$/
aiSamples
string
Allowed values: allow masked deny
registry
required
object
version
integer
modules
required
Array<object>
object
seedMappings

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.

key
required
string
/^[a-z][a-z0-9_]*$/
apiName
required
string
>= 1 characters
label
required
string
>= 1 characters
singular
required
string
/^[A-Za-z_$][\w$]*$/
color
string
defaultEnabled
boolean
uniqueFields
Array<string>
defaultDuplicateCheck
object
searchField
string
searchMethod
string
expression
string
excludedFields
Array<string>
expressionContext
string
/^[A-Za-z_$][\w$]*$/
apiDelayMs
integer
<= 60000
systemExcludedFields
Array<string>
dateFormat
string
Allowed values: DMY MDY YMD
timezone

The org’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.

string
<= 64 characters
fields
object
key
additional properties
Array<object>
object
apiName
required
string
>= 1 characters
description
string
format
string
examples
Array<string>
aliases
Array<string>
excludeFromAi
boolean
derived
boolean
defaultMapping
object
mode
string
Allowed values: column static expression search skip
source
string | null
staticValue
string | null
transform
string | null
skip
boolean
searchField
string | null
searchMethod
string | null
searchExpression
string | null
patch
object
when
Array<string>
Allowed values: pending created updated exists skipped filtered guarded dryrun error blocked
overwrite
string
Allowed values: always if-absent
key
boolean
keyMethod
string | null
keyExpression
string | null
onNone
string | null
Allowed values: empty skip ask
onSeveral
string | null
Allowed values: ask first skip empty
excluded
boolean
requiredForImports
Any of:
boolean
writtenAs
string
Allowed values: upper lower title
mustBe
object
rule
required
string
>= 1 characters <= 500 characters
says
required
string
>= 1 characters <= 200 characters
libraries
Array<object>
object
manifest
required
object
namespace
required
string
/^[a-z][a-z0-9_]*$/
version
required
string
/^\d+\.\d+\.\d+$/
scope
required
string
Allowed values: global org
description
string
functions
required
Array<object>
object
name
required
string
/^[A-Za-z_$][\w$]*$/
description
required
string
params
required
Array<object>
object
name
required
string
type
required
string
optional
boolean
description
string
returns
required
string
examples
Array<object>
object
call
required
string
result
string
tags
Array<string>
source
required
string
templates
Array<object>
object
name
required
string
>= 1 characters <= 200 characters
description
string
<= 2000 characters
config
required
object
key
additional properties
projects

Deprecated: the older name of templates, read as templates. A bundle may send one or the other, not both.

Array<object>
object
name
required
string
>= 1 characters <= 200 characters
description
string
<= 2000 characters
config
required
object
key
additional properties

The bundle would be accepted: what it holds, and the warnings a push would give. Nothing was written.

Media typeapplication/json
object
ok
required
boolean
dryRun
required
boolean
wouldWrite
required
object
modules
required
number
annotations
required
number
libraries
required
number
templates
required
number
warnings

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.

Array<string>
key
additional properties
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).

Media typeapplication/json

The error envelope every non-2xx answer uses.

object
error
required

Human-readable explanation.

string
code

Machine-readable reason. Absent on a few legacy 400s.

string
key
additional properties
Examplegenerated
{
"error": "example",
"code": "example"
}

No bearer, or one that is expired, revoked or no longer resolves to a member.

Media typeapplication/json

The error envelope every non-2xx answer uses.

object
error
required

Human-readable explanation.

string
code

Machine-readable reason. Absent on a few legacy 400s.

string
key
additional properties
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 org is closed (code: ORG_CLOSED).

Media typeapplication/json
object
error
required
string
code
required
string
key
additional properties
Examplegenerated
{
"error": "example",
"code": "example"
}

?connector= names a connection this person may not use: another org’s, or another person’s (code: CONNECTION_NOT_FOUND).

Media typeapplication/json

The error envelope every non-2xx answer uses.

object
error
required

Human-readable explanation.

string
code

Machine-readable reason. Absent on a few legacy 400s.

string
key
additional properties
Examplegenerated
{
"error": "example",
"code": "example"
}

The org’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.

Media typeapplication/json
object
error
required
string
code
required
string
Allowed values: REGISTRY_CONFLICT
registryVersion
required
number
key
additional properties
Example
{
"code": "REGISTRY_CONFLICT"
}

The push would be refused for what the bundle holds: a module or field this org 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), or a helper library that cannot be published (GLOBAL_LIBRARY, DUPLICATE_LIBRARY, RESERVED_NAMESPACE, LIBRARY_DOES_NOT_LOAD).

Media typeapplication/json
object
error
required
string
code
required
string
template

UNKNOWN_MODULES only: the template that names a module none holds.

string
missing

UNKNOWN_MODULES, UNKNOWN_FIELDS: what no one holds.

Array<string>
fields

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.

Array
Any of:
object
module
required
string
apiName
required
string
kind
required

The field’s kind, as discovery last read it.

string
writtenAs
required
string
Allowed values: upper lower title
takes
required

The cases this kind takes: none for a website, lower for an email.

Array<string>
Allowed values: upper lower title
key
additional properties
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.

Media typeapplication/json

The error envelope every non-2xx answer uses.

object
error
required

Human-readable explanation.

string
code

Machine-readable reason. Absent on a few legacy 400s.

string
key
additional properties
Examplegenerated
{
"error": "example",
"code": "example"
}

Report a problem with this page