Contents
On this page

Update Map - Plugixa Image Map

PUT /plugixa-image-map/v1/maps/{id}

Change a map’s title, status or document. PATCH does the same as PUT.

Any signed-in user with the plugixa_image_map_edit capability. Administrators have every Plugixa Image Map capability; see Roles and permissions.

Note. The fields are merged, the document is not. A field you leave out is kept, but a doc you send replaces the whole document: there is no way to change one hotspot on its own. Read the map with Get Map, change its doc and send all of it back.

Request

PUT https://your-site.example/wp-json/plugixa-image-map/v1/maps/12

Path parameters

Name Type Description
id integer The map’s id

Request body

Content type: application/json

Field Type Required Description
rev integer No The rev you read. If the map has been saved since, the update is refused with 409 instead of overwriting that save.
title string No When sent, must hold text: an empty title is refused. At most 255 characters.
status string No draft or published.
doc object No The whole new document, cleaned as described in Create Map.

Every save raises rev by one. Without rev, two saves arriving at the same moment still cannot overwrite each other, but a save based on a copy you read long ago goes through. Send rev whenever you can. A body with none of these fields changes nothing and answers 200 with the map as it is.

{
  "rev": 4,
  "title": "Ground floor (2026)",
  "status": "published"
}

Responses

200 OK. data is the map as saved.

{
  "success": true,
  "data": {
    "id": 12,
    "uid": "9b2f6c1e-4d7a-4f3b-9a51-2c8e7d0f6a13",
    "title": "Ground floor (2026)",
    "status": "published",
    "image_id": 58,
    "doc": {
      "schema": 1,
      "image": {
        "attachment_id": 58,
        "width": 1600,
        "height": 1000,
        "alt": "Ground floor plan"
      },
      "settings": {
        "general": {
          "responsive": true
        },
        "tooltips": {
          "enabled": true,
          "trigger": "hover",
          "sticky": false,
          "constrain": true,
          "animation": "fade"
        },
        "effects": {
          "pageload": "none"
        },
        "zoom": {
          "enabled": false,
          "max": 4.0,
          "buttons": true,
          "wheel": "ctrl",
          "fullscreen": false
        },
        "list": {
          "enabled": false,
          "position": "right",
          "search": true,
          "title": ""
        }
      },
      "objects": [
        {
          "id": "o_3f9a1c2e",
          "type": "spot",
          "name": "Reception",
          "geometry": {
            "x": 42.5,
            "y": 61.25,
            "w": 3.0
          },
          "style": {
            "default": {
              "fill": "#1976d2",
              "fill_opacity": 0.4,
              "stroke": "#ffffff",
              "stroke_opacity": 1.0,
              "stroke_width": 0.0,
              "radius": 4.0,
              "opacity": 1.0,
              "icon": "pin",
              "icon_color": "#ffffff",
              "shadow": false
            },
            "hover": []
          },
          "action": {
            "type": "none",
            "new_tab": false,
            "url": "",
            "event": ""
          },
          "tooltip": {
            "enabled": true,
            "position": "auto",
            "width": 260,
            "offset_x": 0.0,
            "offset_y": 0.0,
            "content": "<p>Reception desk, open 8:00 to 18:00.</p>"
          },
          "a11y": {
            "label": "Reception",
            "description": ""
          },
          "visible": true,
          "locked": false,
          "group": "",
          "ext": []
        }
      ],
      "groups": [],
      "ext": []
    },
    "doc_version": 1,
    "trusted_html": true,
    "object_count": 1,
    "rev": 5,
    "created_by": 1,
    "modified_by": 1,
    "created_at": "2026-11-12 09:30:00",
    "modified_at": "2026-11-12 11:40:00",
    "deleted_at": null,
    "doc_error": false,
    "image_url": "https://your-site.example/wp-content/uploads/2026/11/ground-floor.png",
    "shortcode": "[plugixa_image_map id=\"12\"]",
    "thumbnail_url": "https://your-site.example/wp-content/uploads/2026/11/ground-floor-150x150.png"
  },
  "meta": {
    "warnings": []
  }
}
Field Type Meaning
data.rev integer The new version number: send this one with your next update
data.modified_at string UTC datetime of this save
meta.warnings array What the cleaning changed or dropped, one { "path", "code" } per change. Empty when the document was taken as sent

409 Conflict. Somebody saved the map after you read it.

{
  "code": "plugixa_image_map_conflict",
  "message": "Somebody else changed this map while you were editing it. Reload to see their version before saving yours.",
  "data": {
    "status": 409,
    "expected": 4,
    "current": 5
  }
}
Field Type Meaning
data.expected integer The rev you sent
data.current integer The rev stored now

Read the map again, apply your change to that version, and send it with the new rev.

Errors

Status Code When
404 plugixa_image_map_not_found No map with that id, or the map is in the trash.
409 plugixa_image_map_conflict rev is not the current version.
422 plugixa_image_map_title_required title was sent but holds no text.
422 plugixa_image_map_invalid_status status is not draft or published.
422 plugixa_image_map_invalid_document doc is not a JSON object.
413 plugixa_image_map_too_large doc is over 2 MB as JSON.
422 plugixa_image_map_too_deep doc nests more than 12 levels.
422 plugixa_image_map_newer_document doc.schema is newer than this version of the plugin reads.
422 plugixa_image_map_too_many_objects More than 2,000 hotspots.
422 plugixa_image_map_too_many_points A polygon with more than 1,000 points.
422 plugixa_image_map_too_many_groups More than 500 groups.
422 plugixa_image_map_too_long A value is longer than its column holds (the title: 255 characters). data.field and data.max say which and how long.
500 plugixa_image_map_save_failed The database refused the write.

Plus the errors every endpoint can return.

Examples

curl -s -X PUT "https://your-site.example/wp-json/plugixa-image-map/v1/maps/12" \
  -u "admin:$WP_APP_PASSWORD" \
  -H "Content-Type: application/json" \
  -d '{"rev":4,"title":"Ground floor (2026)","status":"published"}'
<?php
$ch = curl_init('https://your-site.example/wp-json/plugixa-image-map/v1/maps/12');
curl_setopt_array($ch, [
    CURLOPT_CUSTOMREQUEST  => 'PUT',
    CURLOPT_RETURNTRANSFER => true,
    CURLOPT_USERPWD        => 'admin:' . getenv('WP_APP_PASSWORD'),
    CURLOPT_HTTPHEADER     => ['Content-Type: application/json'],
    CURLOPT_POSTFIELDS     => json_encode([
        'rev'    => 4,
        'title'  => 'Ground floor (2026)',
        'status' => 'published',
    ]),
]);
$response = json_decode(curl_exec($ch), true);
curl_close($ch);
const response = await fetch('https://your-site.example/wp-json/plugixa-image-map/v1/maps/12', {
  method: 'PUT',
  headers: {
    'Authorization': 'Basic ' + btoa(`admin:${process.env.WP_APP_PASSWORD}`),
    'Content-Type': 'application/json',
  },
  body: JSON.stringify({
    rev: 4,
    title: 'Ground floor (2026)',
    status: 'published',
  }),
});
const { data } = await response.json();

Quick Links

Share