# Understanding Instant JSON attachments and schemas

<!-- Common header for Instant JSON Schema articles -->

## Types

This section explains how to use type declarations in Instant JSON records.

The optional keys are specified as follows:

```js

{ optionalKey?: value; }

```

To reduce payload size, omit optional keys when their values are undefined.

## Attachments

Attachments were added to support syncing annotation attachments across different devices. The keys in `attachments` are the calculated SHA-256 hashes of the attachment or the `pdfObjectId` of the attachment. The binary of the attachment is Base64 encoded:

### JSON

```json

// Example of the Instant JSON schema of an attachments payload with one attachment:
{
	"attachments": {
		"9e51e601bb7469be642f0b0d60bbb98aeb631353839ab3bc5a25797dbb74622f": {
			"binary": "iVBORw0KGgoAAAANSUhEUgAAAAEAAAABCAYAAAAfFcSJAAAAC0lEQVQYlWNgAAIAAAUAAdafFs0AAAAASUVORK5CYII=",
			"contentType": "image/png"
    	}
	}
}

```

### JAVASCRIPT

```js

declare type Attachments = {
  [string]: {
    binary: string
  }
};

```

For more information on the annotations Instant JSON schema, refer to the [JSON format schema — annotations](https://www.nutrient.io/../annotations/) guide.
---

## Related pages

- [Understanding Instant JSON action types](/guides/web/json/schema/actions.md)
- [Sync PDF form field values using Instant JSON](/guides/web/json/schema/form-field-values.md)
- [Streamline document discussions with Instant Comments](/guides/web/json/schema/comments.md)
- [Create and manage PDF bookmarks with Instant JSON](/guides/web/json/schema/bookmarks.md)
- [Effective guidelines for PDF form field types](/guides/web/json/schema/form-fields.md)
- [Instant JSON format for PDF annotations explained](/guides/web/json/schema/annotations.md)

