Skip to content

Import

Two endpoints read the people-owned tabs of the NRI data spreadsheet and write the values onto existing Umbraco records: content tags from Imports and members from Members. A third, media references, reads no sheet. See Overview for the shared configuration and status codes.

Signed-in administrators (the Administrators or nriAdmin group) run imports from the backoffice imports modal. It covers content tags, members, and media references:

  • Dry run first. Import is enabled only after a dry run that found at least one change, and a new dry run disables it again.
  • Import asks for confirmation before it saves.

Calling an endpoint directly needs a back-office bearer token.

?dryRun=true # default — reports what would change, writes nothing
?dryRun=false # actually saves

Both sheet imports default to a dry run, so saving is an explicit opt-in. Run the dry pass first, read the skipped and missing rows, fix the sheet, and only then import. Media references has no dry run.

Headers are matched loosely: everything that is not a letter or a digit is stripped, and case is ignored. So publication_date, Publication Date, and publicationdate all resolve to the same column. A different word does not: Umbraco Key is not key. If two headers resolve to the same name, the first one wins. Extra columns are ignored.

GET /umbraco/management/api/v1/imports/members?dryRun=true
POST /umbraco/management/api/v1/imports/members?dryRun=false&firstOnly=true

Reads range A:M of the Members tab and writes profile fields onto matching members.

All thirteen columns must be present: id, name, email, member_groups, address, member_type, workplace_phone, first_name, last_name, workplace, workplace_address, workplace_position, linked_in. Any missing one is a 400. The simplest way to get a correctly shaped header is to copy row 1 from the Umbraco: Members export tab.

Present is not the same as used. Only these are written back to Umbraco:

firstName, lastName, workplace, workplacePosition, workplacePhone, linkedIn, address, workplaceAddress.

A blank cell clears that field. Only members with a change are saved, in batches of 100 with Umbraco notifications suppressed. Rows whose id is not a GUID are skipped and counted only in the log.

Members are matched by id only. name labels missing members in the response; email, member_groups, and member_type must be in the header but are never read, and are not changed by the import. Renaming someone in the sheet, changing their email, or editing their groups there has no effect — do those in the back office.

The two address columns are handled differently, mirroring the export:

  • address is treated as a state. Two-letter codes are expanded (TX → Texas), then "<State>, USA" is geocoded and stored as a map value at zoom 7.
  • workplace_address is treated as a full US street address. It is normalised, geocoded, and stored as a map value at zoom 17 with street number, street, city, state, postal code, and coordinates.

Geocoding calls the Google Maps Geocoding API using GoogleMaps:GeocodingApiKey, GoogleMaps:ServerApiKey, or GoogleMaps:ApiKey, in that order. It mostly degrades rather than fails: with no key, an error status from Google, or no coordinates in the answer, the import logs a warning and falls back to parsing the address text itself — you still get a map value, but without coordinates, so the pin will be less accurate. Results are cached per run, so a hundred members in the same state cost one lookup. A network failure reaching Google is not caught: the request fails with a 500, and batches already saved stay saved.

?firstOnly=true

Processes only the first data row. Useful for confirming a real save works — credentials, geocoding, property aliases — before committing to the whole sheet.

The response is text/plain, not JSON. It starts with a summary — N members would be updated; M unchanged. on a dry run, N members updated; M unchanged. on a real one — then either No missing members. or Missing members: followed by one {id} / {name} line per member it could not find.

Rows read, rows skipped, and save batches go to the application log only; search for the line beginning Imported members from.

POST /umbraco/management/api/v1/imports/tags?dryRun=true
POST /umbraco/management/api/v1/imports/tags?dryRun=false

Reads range A:ZZ of the Imports tab and updates pages. Start from the content export: copy the rows you want to change into Imports, keeping the header row, and edit them there. Only rows on the tab are touched, so a handful of rows is fine.

Column Required Effect
key Yes The page’s GUID.
tags Yes Replaces the page’s tags. A blank cell clears them.
publicationDate, publicationYear, publicationYearEnd No A value sets it; a blank cell leaves it alone.
archived No TRUE archives the page, FALSE takes it out of the archive, a blank cell leaves it alone. Any casing works; anything else is reported as an invalid value and the row is skipped.

Headers match as described in Header matching. Optional columns are ignored for page types that lack the property. publicationDate is compared by day.

Tags are separated by commas, line breaks, or |, and by semicolons if the cell contains one. They are trimmed, de-duplicated and sorted, and a change in capitalization alone is ignored.

What happens to each row, as reported in the response’s rows list:

Status Cause
would-update / updated The row changes the page. Which you get depends on dryRun.
skipped Blank or non-GUID key; a key already used on an earlier row; a page in the recycle bin; a tags property with an unsupported editor; a variant page with no culture to publish.
invalid-value A date that cannot be read, a year that is not a whole number, or an archived value other than TRUE or FALSE. The row is skipped.
missing No page or media item has that key.
ignored-media The key belongs to a media item.
publish-failed Saving or publishing threw. Any pending values were still saved.

Rows that change nothing are not saved and do not appear as updates. A page whose type has no tags property is dropped without a report, and its other columns are not applied either.

The JSON response also carries counts: rowsRead, rowsSkipped, contentFound, contentChanged, contentUnchanged, contentPublished, mediaIgnored, entitiesMissing, tagsChanged, tagsUnchanged, optionalFieldsChanged, and publishFailed.

POST /umbraco/management/api/v1/imports/media-references

Reads no sheet. It compares the media each page actually uses with Umbraco’s related-media relations, and repairs the pages that disagree: it deletes stale relations and adds missing ones. It has no dry run — it changes relations as soon as it runs. The relations are what the media export’s referenced_by_content_count and the content export’s related_urls read.