30 days free. No credit card. Full access from the moment you connect your site.

Start free trial

GeoDirectory Update Listing

geodirectory/update-listing updates an existing listing. Only the keys you supply are changed.

Two of them do not behave the way “only supplied keys change” suggests.

At a glance

Abilitygeodirectory/update-listing
ToolsetGeoDirectory — toolset/geodirectory
GroupGeoDirectory › Listings
RequiresAcrossAI Pro, plus GeoDirectory active on the site
Capabilitymanage_options
SafetyWrites data
RepeatableIdempotent — running it twice leaves the same result
Ships inAcrossAI Pro 0.9.16 and later

Categories replace, and images are a trap

Sending post_category replaces the listing’s categories rather than adding to them. A listing in three categories, updated with one, is in one category afterwards.

Images are the sharper edge. GeoDirectory treats an empty images value as “delete every image” rather than “no change” — so a naive update that includes an empty images key wipes the gallery. clear_images exists to make that deliberate: without it, an empty value is refused.

They also do not round-trip. Images are written as strings and read as objects, so a geodirectory/get-listing response cannot be fed straight back into an update.

GeoDirectory fields are defined per site and per listing type. There is no fixed schema to know in advance, which is why geodirectory/list-listing-fields is the call before any listing write: it returns the accepted keys, and each row’s name — its htmlvar_name — is what you write under.

Omitting the listing type derives it from the listing itself, which is what you want on a multi-directory site — the alternative is defaulting to the site default and 404ing on anything else.

Idempotent.

Input

NameTypeRequiredWhat it is
idintegerYesListing post ID.
post_typestringNoDerived from the listing itself when omitted.
titlestringNoNew title.
contentstringNoNew description.
statusstringNoNew post status.
authorintegerNoNew owner. Needs edit_others_posts.
post_categoryarrayNoReplacement category term IDs. This replaces rather than adds.
post_tagsstringNoReplacement comma-separated tag names.
streetstringNoStreet address.
citystringNoCity.
regionstringNoRegion or state.
countrystringNoCountry.
zipstringNoPostal code.
latitudenumberNoLatitude.
longitudenumberNoLongitude.
clear_imagesbooleanNoSet true only to intentionally delete every image on the listing.
fieldsobjectNoCustom fields to change, keyed by htmlvar_name.

What comes back

NameTypeWhat it is
listingobjectThe listing after the write.
successbooleanWhether the call completed.
messagestringA one-line summary of what happened, suitable for showing a human.
error_codestringPresent only on failure — a stable machine-readable reason, such as a missing field, a wrong field type or an unmet confirmation.

Example

Ask your assistant:

Update the phone number on listing 812.

It resolves to one call:

{
  "ability": "geodirectory/update-listing",
  "parameters": {
    "id": 812,
    "fields": { "phone": "0117 496 0001" }
  }
}

Worth knowing

  • Categories replace. Include the ones you are keeping.
  • An empty images value means delete all — hence clear_images.
  • A get response cannot be fed back in; images read and write differently.
  • Idempotent.

Related abilities


Get the plugins:
AcrossAI Abilities Manager · AcrossAI MCP Manager

Browse the rest: Every ability, by category


Keep reading