noark5_update_entity
Update fields on a Noark 5 archive entity with merge PATCH, preserving server-side unchanged values. Move entities to a new parent by adding _links.
Instructions
Update one or more fields on an entity using merge PATCH.
Accepts a JSON object mapping field names to new values. Multiple fields can be updated in a single call. Only the specified fields are sent; unchanged fields are preserved server-side (RFC 7396 merge semantics).
NOTE: This does NOT work for [0..] or [1..] sub-resources like 'forfatter' or 'noekkelord', which are modelled as separate entities by the API service. Use noark5_create_secondary_entity instead to add those.
Examples:
Update single field: '{"tittel": "New Title"}'
Update multiple fields: '{"tittel": "New", "beskrivelse": "Description"}'
Structured field: '{"dokumenttype": {"kode": "U"}}'
To move an entity to a new parent, include '_links' in changes. First find the parent link's rel key using noark5_list_parents or noark5_entity_links. Examples:
Move registrering to another mappe: '{"_links": {"https://rel.arkivverket.no/noark5/v5/api/arkivstruktur/mappe/": {"href": ""}}}'
Move mappe to another arkivdel: '{"_links": {"https://rel.arkivverket.no/noark5/v5/api/arkivstruktur/arkivdel/": {"href": ""}}}'
Args: entity_url: The self-href URL of the entity to update. changes: JSON object mapping field names to new values (e.g., '{"tittel": "New"}').
Returns details of the updated entity.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| changes | No | {} | |
| entity_url | Yes |
Output Schema
| Name | Required | Description | Default |
|---|---|---|---|
| result | Yes |