# clipboard.parse

> Parse and sanitize a ClipboardPayload into a deterministic v2 clipboard insert plan with diagnostics. Does not mutate the document.



- Member path: `doc.clipboard.parse(…)`
- Mutates document: no
- Idempotency: `idempotent`
- Supports tracked mode: no
- Supports dry run: no

## Expected result

Returns a ClipboardParseResult with a ClipboardInsertPlan or a named fail-closed reason.

## Input schema

```json
{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$defs": {},
  "type": "object",
  "properties": {
    "source": {
      "type": "string"
    },
    "items": {
      "type": "array",
      "items": {
        "type": "object",
        "properties": {
          "type": {
            "type": "string"
          },
          "kind": {
            "enum": [
              "string",
              "bytes"
            ]
          },
          "data": {},
          "name": {
            "type": "string"
          }
        },
        "additionalProperties": false,
        "required": [
          "type",
          "kind",
          "data"
        ]
      }
    }
  },
  "additionalProperties": false,
  "required": [
    "items"
  ]
}
```

## Output schema

```json
{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$defs": {},
  "type": "object",
  "properties": {
    "success": {
      "type": "boolean"
    },
    "plan": {
      "type": "object"
    },
    "diagnostics": {
      "type": "array"
    },
    "failure": {
      "type": "object"
    }
  },
  "additionalProperties": false
}
```

## Pre-apply throws

- None

## Non-applied receipt codes

- `INVALID_INPUT`
- `INVALID_PAYLOAD`
- `EMPTY_FRAGMENT`
- `CAPABILITY_UNSUPPORTED`
- `INVALID_FRAGMENT`
- `CAPABILITY_UNAVAILABLE`

