# images.replaceSource

> Replace the image source while preserving identity and placement.



- Member path: `doc.images.replaceSource(…)`
- Mutates document: yes
- Idempotency: `non-idempotent`
- Supports tracked mode: yes
- Supports dry run: yes

## Expected result

Returns an ImagesMutationResult with the updated image address.

## Input schema

```json
{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$defs": {},
  "type": "object",
  "properties": {
    "imageId": {
      "type": "string"
    },
    "src": {
      "type": "string"
    },
    "resetSize": {
      "type": "boolean"
    }
  },
  "additionalProperties": false,
  "required": [
    "imageId",
    "src"
  ]
}
```

## Output schema

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

## Pre-apply throws

- `TARGET_NOT_FOUND`
- `AMBIGUOUS_TARGET`
- `INVALID_TARGET`
- `CAPABILITY_UNAVAILABLE`
- `INVALID_INPUT`

## Non-applied receipt codes

- `NO_OP`

