Skip to main content
Alpha: Document API is currently alpha and subject to breaking changes.

Summary

Set anchor behavior options for a floating image.
  • Operation ID: images.setAnchorOptions
  • API member path: editor.doc.images.setAnchorOptions(...)
  • Mutates document: yes
  • Idempotency: conditional
  • Supports tracked mode: no
  • Supports dry run: yes
  • Deterministic target resolution: yes

Expected result

Returns an ImagesMutationResult.

Input fields

FieldTypeRequiredDescription
imageIdstringyes
optionsobjectyes
options.allowOverlapbooleanno
options.behindDocbooleanno
options.layoutInCellbooleanno
options.lockAnchorbooleanno
options.simplePosbooleanno

Example request

{
  "imageId": "example",
  "options": {
    "allowOverlap": true,
    "behindDoc": true
  }
}

Output fields

FieldTypeRequiredDescription
failureobjectno
imageobjectno
successbooleanno

Example response

{
  "image": {},
  "success": true
}

Pre-apply throws

  • TARGET_NOT_FOUND
  • AMBIGUOUS_TARGET
  • INVALID_TARGET
  • CAPABILITY_UNAVAILABLE

Non-applied failure codes

  • NO_OP

Raw schemas

{
  "additionalProperties": false,
  "properties": {
    "imageId": {
      "type": "string"
    },
    "options": {
      "additionalProperties": false,
      "properties": {
        "allowOverlap": {
          "type": "boolean"
        },
        "behindDoc": {
          "type": "boolean"
        },
        "layoutInCell": {
          "type": "boolean"
        },
        "lockAnchor": {
          "type": "boolean"
        },
        "simplePos": {
          "type": "boolean"
        }
      },
      "type": "object"
    }
  },
  "required": [
    "imageId",
    "options"
  ],
  "type": "object"
}
{
  "additionalProperties": false,
  "properties": {
    "failure": {
      "type": "object"
    },
    "image": {
      "type": "object"
    },
    "success": {
      "type": "boolean"
    }
  },
  "type": "object"
}
{
  "additionalProperties": false,
  "properties": {
    "image": {
      "type": "object"
    },
    "success": {
      "const": true
    }
  },
  "required": [
    "success",
    "image"
  ],
  "type": "object"
}
{
  "additionalProperties": false,
  "properties": {
    "failure": {
      "additionalProperties": false,
      "properties": {
        "code": {
          "type": "string"
        },
        "message": {
          "type": "string"
        }
      },
      "required": [
        "code",
        "message"
      ],
      "type": "object"
    },
    "success": {
      "const": false
    }
  },
  "required": [
    "success",
    "failure"
  ],
  "type": "object"
}