# Definitions and instances

Definitions contain source, schemas, abstract binding requirements and behavior.
Instances contain tenant configuration, concrete resources, credentials and state.
Never put an instance id, binding value or secret in definition XML.

The integration id is a dotted lowercase identifier. version is a semantic version;
sdk-version is the SDK major.minor contract. These identities are fixed for a draft.
Published versions are immutable. Create a new version to change behavior.

Author a definition as a complete XML document. Saving and exporting preserve
its exact text, including comments, whitespace and CDATA. Use the integration
root shown in Getting started; it does not need a format attribute.

writeOnly, format="password" and x-input-type="password" mark credentials as
secrets. Local references, anchors and composed schemas retain those markings.
A nested credential hides its complete top-level configuration value from reads.
Defaults, examples and unused definitions do not mark unrelated keys as secrets.
Instance reads expose whether a credential is set, without returning its value.
Secret setters also accept keys marked by patternProperties or additionalProperties,
even when they were not supplied before. Their values remain hidden on reads.

```xml
<integration id="com.example.invalid-installation" version="1.0.0" sdk-version="2.0">
  <resources><resource id="erp" type="protocol/http" secret="installation-value"/></resources>
</integration>
```

This document fails: secret is an unknown attribute. Supply secrets through the
instance configuration, declared by the configuration schema.

Export XML exports the current editor buffer, including unsaved changes. Reload
asks before discarding edits. A failed or conflicting save preserves your text.
Published definitions are read only. New version copies the XML into a draft;
change its root version before saving.