Alle endepunkter krever autentisering — se Autentisering. Basis-URL-er står under API.

Asset Resource

/assets/v2/asset

GETGet assets filtered by location, batch and/or category.

The filters are optional and can be combined. Categories and locations are referenced by orgadmin category id (Long); pass repeated query params for multi-select (?categoryIds=42&categoryIds=87). Subtree expansion is the frontend's job — pass the full id list (see docs/V2_API_GUIDE.md §5). Assets can be exported as csv ('Accept' header 'application/octet-stream') or pdf ('Accept' header 'application/pdf'), where the pdf export will be QR codes for the assets' tags

Parametre

NavnITypeBeskrivelse
batchIdqueryinteger (int64)
categoryIdsqueryliste av integer (int64)
formatqueryPdfFormat
locationCategoryIdsqueryliste av integer (int64)
searchquerystring
statesqueryliste av AssetState
X-auth-ownerheaderstring
pageOffsetqueryinteger (int32)
pageSizequeryinteger (int32)

Svar

StatusInnhold
200application/json — liste av AssetBasicDto
application/pdf — StreamingOutput
text/csv — StreamingOutput
401–
403–
POSTCreate a new asset

Parametre

NavnITypeBeskrivelse
X-auth-ownerheaderstring

Forespørselskropp *

Svar

StatusInnhold
200application/json — AssetDto
400–
401–
403–
PATCHUpdate categoryIds and/or locationCategoryId on multiple assets identified by id. categoryIds, if present, replaces the existing set on each asset.

Parametre

NavnITypeBeskrivelse
X-auth-ownerheaderstring

Forespørselskropp *

Svar

StatusInnhold
204–
401–
403–
DELETEDelete multiple assets identified by id. Atomic: if any id is missing or belongs to another tenant, no assets are deleted.

Parametre

NavnITypeBeskrivelse
ids *queryliste av integer (int64)
X-auth-ownerheaderstring

Svar

StatusInnhold
204–
401–
403–

/assets/v2/asset/groups

GETGroup assets by category, location or state after applying the same filters as GET /asset.

Returns a flat list of { id, state, count } entries, keyed by whichever of `id` and `state` `by` selects — the other is null. For `by=category` and `by=location`, `id` is the categoryId or locationCategoryId; for `by=state` the key is the AssetState name. Buckets with no matching assets are omitted, as is the unassigned (null) location bucket. `by=state` does keep its null bucket: every asset has exactly one state, so those buckets sum to the total matching count, and only do so with the stateless assets among them. Backend is hierarchy-blind — frontend rolls counts up against the taxonomy tree. For `by=category`, an asset tagged with N categories contributes 1 to each of those N buckets, so the sum of counts may exceed the total matching asset count.

Parametre

NavnITypeBeskrivelse
batchIdqueryinteger (int64)
by *queryAssetGroupBy
categoryIdsqueryliste av integer (int64)
locationCategoryIdsqueryliste av integer (int64)
searchquerystring
statesqueryliste av AssetState
X-auth-ownerheaderstring

Svar

StatusInnhold
200application/json — liste av AssetGroupDto
401–
403–

/assets/v2/asset/import

POSTImport a csv file to update existing assets

Parametre

NavnITypeBeskrivelse
X-auth-ownerheaderstring

Forespørselskropp *

  • multipart/form-data — object

Svar

StatusInnhold
204–
401–
403–

/assets/v2/asset/stats

GETGet asset statistics for the current organization

Parametre

NavnITypeBeskrivelse
X-auth-ownerheaderstring

Svar

StatusInnhold
200application/json — AssetStatisticsDto
401–
403–

/assets/v2/asset/{id}

GETGet an asset by id

Parametre

NavnITypeBeskrivelse
id *pathinteger (int64)
X-auth-ownerheaderstring

Svar

StatusInnhold
200application/json — AssetDto
401–
403–
PATCHUpdate an existing asset. Only fields that are included in the message body are updated. Fields that are to be removed must be included in the 'deleteFields' list

Parametre

NavnITypeBeskrivelse
id *pathinteger (int64)
X-auth-ownerheaderstring

Forespørselskropp *

Svar

StatusInnhold
200application/json — AssetDto
401–
403–
DELETEDelete an asset by id

Parametre

NavnITypeBeskrivelse
id *pathinteger (int64)
X-auth-ownerheaderstring

Svar

StatusInnhold
204–
401–
403–

/assets/v2/asset/{id}/documents

POSTUpload a document to an asset. The file is processed inline: for images, EXIF rotation is applied, the original is scaled to fit within 2048x2048 if larger, and 100x100 + 200x200 JPEG thumbnails are generated. Only JPEG and PNG images are accepted; other formats are rejected with 400. Every image upload is privacy-gated by the iris classifier — blocked images (e.g. containing faces) return 422 with body 'image_blocked:<reason>'. Gating is best-effort: if the classifier sidecar is unreachable or unconfigured the upload proceeds ungated (failures are logged). When classify=true the classifier also applies category, description, and color suggestions to empty asset fields. Accept-Language (nb/nn/no → Norwegian, else English) selects the language of the description suggestion. Returns the updated AssetDto with the new document attached. When 'includeNextHint'=true the response carries response header 'X-next-tag-hint' — the encoded tag for the current tag's id + 1. Pure arithmetic on the tag id, no DB lookup. The hint may resolve to a tag the caller cannot access (different org, deleted, already activated); the frontend is expected to attempt GET /tag/{hint} and fall back to its own discovery on 404. When 'requireProvisioned'=true the call short-circuits with 400 ('error-message: asset_not_provisioned') if the asset's current state is anything other than PROVISIONED. The spec-012 register flow sends this to defend against a race where a stale UI cache lets the operator POST to an already-COMMISSIONED asset.

Parametre

NavnITypeBeskrivelse
id *pathinteger (int64)
Accept-Languageheaderstring
X-auth-ownerheaderstring

Forespørselskropp *

  • multipart/form-data — object

Svar

StatusInnhold
200application/json — AssetDto
401–
403–

/assets/v2/asset/{id}/documents/{documentId}

DELETERemove a document from an asset. If the document is not referenced by any other asset, its S3 objects (original and thumbnails) and the document row are also deleted.

Parametre

NavnITypeBeskrivelse
documentId *pathinteger (int64)
id *pathinteger (int64)
X-auth-ownerheaderstring

Svar

StatusInnhold
204–
401–
403–

/assets/v2/asset/{id}/documents/{documentId}/replace

POSTReplace the bytes of an existing document. Reuses the existing S3 key, so any links that referenced the old document continue to work. Image documents re-run thumbnail generation but classification is not re-run.

Parametre

NavnITypeBeskrivelse
documentId *pathinteger (int64)
id *pathinteger (int64)
X-auth-ownerheaderstring

Forespørselskropp *

  • multipart/form-data — object

Svar

StatusInnhold
200application/json — DocumentDto
401–
403–

/assets/v2/asset/{id}/events

POSTRecord a manual event against an asset

Adds a user-authored event (e.g. a completed service, control round or note) to the asset's activity log. Read it back via GET /event?type=ASSET&id={id}. The kind is one of AssetEventType; specifics belong in the free-text note. Optional documentIds must already be attached to this asset (POST /asset/{id}/documents). Requires write:assets; allowed cross-tenant wherever the asset is visible to the caller.

Parametre

NavnITypeBeskrivelse
id *pathinteger (int64)
X-auth-ownerheaderstring

Forespørselskropp *

Svar

StatusInnhold
200application/json — EventDto
400–
401–
403–

Batch Resource

/assets/v2/batch

GETGet all batches. The 'states' and 'types' query params must be a comma separated list of the corresponding enum.

Returns a set of all batches

Parametre

NavnITypeBeskrivelse
statesquerystring
tagquerystring
typesquerystring
X-auth-ownerheaderstring

Svar

StatusInnhold
200application/json — liste av BatchDto
401–
403–
POSTCreate a new batch of existing assets, or create a given number of new assets as well

If 'numberOfNewAssets' is set, type is set to ASSET_CREATION and 'assetIds' is ignored

Parametre

NavnITypeBeskrivelse
X-auth-ownerheaderstring

Forespørselskropp *

Svar

StatusInnhold
200application/json — BatchDto
400–
401–
403–

/assets/v2/batch/tags

GETGenerate Qr Codes

Parametre

NavnITypeBeskrivelse
nqueryinteger (int32)

Svar

StatusInnhold
200text/csv — StreamingOutput
401–
403–

/assets/v2/batch/{id}

GETGet a batch by id or guid

Parametre

NavnITypeBeskrivelse
id *pathstring
X-auth-ownerheaderstring

Svar

StatusInnhold
200application/json — BatchDto
401–
403–
POSTUpdate all assets within a given batch. Only fields that are included in the message body are updated

Parametre

NavnITypeBeskrivelse
id *pathinteger (int64)
X-auth-ownerheaderstring

Forespørselskropp *

Svar

StatusInnhold
204–
400–
401–
403–
PATCHUpdate an existing batch. Only fields that are included in the message body are updated. Fields that are to be removed must be included in the 'deleteFields' list

Parametre

NavnITypeBeskrivelse
id *pathinteger (int64)
X-auth-ownerheaderstring

Forespørselskropp *

Svar

StatusInnhold
200application/json — BatchDto
401–
403–

Config Resource

/assets/v2/config/asset/states

GETAsset States

Svar

StatusInnhold
200application/json — liste av AssetState

/assets/v2/config/batch/states

GETBatch States

Svar

StatusInnhold
200application/json — liste av BatchState

/assets/v2/config/batch/types

GETBatch Types

Svar

StatusInnhold
200application/json — liste av BatchType

/assets/v2/config/external

GETExternal Ids

Svar

StatusInnhold
200application/json — liste av ExternalIdDto
401–
403–

/assets/v2/config/pdf

GETPdf Formats

Svar

StatusInnhold
200application/json — liste av PdfFormat

/assets/v2/config/pdf/empty

GETGet Empty Pdf

Svar

StatusInnhold
200application/pdf — StreamingOutput

/assets/v2/config/user/{id}

GETUser Preferences

Parametre

NavnITypeBeskrivelse
id *pathstring

Svar

StatusInnhold
200application/json — UserPreferencesDto
401–
403–
POSTUpdate User Preference

Parametre

NavnITypeBeskrivelse
id *pathstring

Forespørselskropp *

Svar

StatusInnhold
201–
400–
401–
403–

/assets/v2/config/warranty/period

GETWarranty Period

Svar

StatusInnhold
200application/json — liste av WarrantyPeriod
401–
403–

Deviation Resource

/assets/v2/deviation

GETGet all deviations, optionally filtered.

The 'states' query param is a comma separated list of DeviationState (OPEN, CLOSED); 'batchGuid' filters on the originating batch (e.g. a control round); 'assetId' on the anchoring asset.

Parametre

NavnITypeBeskrivelse
assetIdqueryinteger (int64)
batchGuidquerystring
statesquerystring
X-auth-ownerheaderstring

Svar

StatusInnhold
200application/json — liste av DeviationDto
401–
403–
POSTCreate a deviation (created OPEN)

A follow-up record for a fault found on an asset. Anchored on the asset ('assetId'); 'batchGuid' optionally references the batch (e.g. control round) it was found in. Creator and timestamp are server-derived. Optional documentIds must already be attached to the asset. Audited via the event log (GET /event?type=DEVIATION&id={id}).

Parametre

NavnITypeBeskrivelse
X-auth-ownerheaderstring

Forespørselskropp *

Svar

StatusInnhold
200application/json — DeviationDto
400–
401–
403–

/assets/v2/deviation/{id}

GETGet a deviation by id

Parametre

NavnITypeBeskrivelse
id *pathinteger (int64)
X-auth-ownerheaderstring

Svar

StatusInnhold
200application/json — DeviationDto
401–
403–
PATCHUpdate a deviation's follow-up fields (only while OPEN)

Enrichment of correctiveAction, dueDate and responsible. A CLOSED deviation is immutable and rejects updates with 400.

Parametre

NavnITypeBeskrivelse
id *pathinteger (int64)
X-auth-ownerheaderstring

Forespørselskropp *

Svar

StatusInnhold
200application/json — DeviationDto
401–
403–

/assets/v2/deviation/{id}/close

POSTClose a deviation

Records the closing user id and timestamp as the auditable signature; the deviation is immutable afterwards. Closing an already CLOSED deviation is rejected with 400.

Parametre

NavnITypeBeskrivelse
id *pathinteger (int64)
X-auth-ownerheaderstring

Forespørselskropp *

Svar

StatusInnhold
200application/json — DeviationDto
400–
401–
403–

Event Resource

/assets/v2/event

GETReturn all events, filtered by type (optional) or type and id (also optional)

Parametre

NavnITypeBeskrivelse
actionqueryEventAction
idqueryinteger (int64)
pageOffsetqueryinteger (int32)
pageSizequeryinteger (int32)
typequeryEventType
X-auth-ownerheaderstring

Svar

StatusInnhold
200application/json — liste av EventDto
401–
403–

Site Admin Asset Resource

/assets/v2/site/statistics

GETGet Statistics

Svar

StatusInnhold
200application/json — liste av AssetStatisticsDto
401–
403–

Tag Resource

/assets/v2/tag/{tag}

GETReturn information about the asset associated with the tag. For non-owners, only public information is returned. If tag/id is from an external system, set the name of that system in the `externalSystem` query param.

Parametre

NavnITypeBeskrivelse
tag *pathstring
externalSystemquerystring
Accept-Languageheaderstring

Svar

StatusInnhold
200application/json — AssetDto
text/html

Warranty Resource

/assets/v2/warranty

POSTAdds a warranty on an asset. Either assetId or batchId must be set

Parametre

NavnITypeBeskrivelse
X-auth-ownerheaderstring

Forespørselskropp *

Svar

StatusInnhold
204–
400–
401–
403–

Skjemaer

AssetBasicDto

FeltTypeBeskrivelse
categoryIdsliste av integer (int64)
idinteger (int64)
locationCategoryIdinteger (int64)
namestring
stateAssetStateÉn av: PROVISIONED, COMMISSIONED, STORED, SERVICE, TRANSPORT, DISCARDED
tagstring
thumbnailsliste av DocumentDto
warrantyExpirationLocalDateTime

AssetDto

FeltTypeBeskrivelse
batchesliste av BatchDto
categoryIdsliste av integer (int64)
descriptionstring
documentsliste av DocumentDto
externalIdsliste av ExternalIdDto
idinteger (int64)
locationCategoryIdinteger (int64)
name *string
ownerOwnerDto
propertiesmap av string
publicDppboolean
stateAssetStateÉn av: PROVISIONED, COMMISSIONED, STORED, SERVICE, TRANSPORT, DISCARDED
tagstring
thumbnailsliste av DocumentDto
warrantyWarrantyDto

AssetEventResult

Én av: OK, DEVIATION

AssetEventType

Én av: INSPECTION, MAINTENANCE, REPAIR, INCIDENT, NOTE

AssetGroupBy

Én av: CATEGORY, LOCATION, STATE

AssetGroupDto

FeltTypeBeskrivelse
countinteger (int64)
idinteger (int64)
statestring

AssetMultiEditDto

FeltTypeBeskrivelse
assetIds *liste av integer (int64)
categoryIdsliste av integer (int64)
deleteFieldsliste av string
deleteFieldsSupportedboolean
locationCategoryIdinteger (int64)
notMixingSetAndClearboolean
publicDppboolean
recipientOrgIdstring
stateAssetStateÉn av: PROVISIONED, COMMISSIONED, STORED, SERVICE, TRANSPORT, DISCARDED
stateNotProvisionedboolean
transferboolean
transferExclusiveboolean

AssetState

Én av: PROVISIONED, COMMISSIONED, STORED, SERVICE, TRANSPORT, DISCARDED

AssetStatisticsDto

FeltTypeBeskrivelse
activeAssetCountinteger (int64)
eventCountinteger (int64)
eventsPerMonth *map av integer (int64)
newAssetsPerMonth *map av integer (int64)
organizationId *string
organizationNamestring

BatchDto

FeltTypeBeskrivelse
categoryIdsliste av integer (int64)
countinteger (int64)
descriptionstring
guidstring
idinteger (int64)
namestring
ownerOwnerDto
propertiesmap av string
stateBatchStateÉn av: PLANNED, IN_PROGRESS, COMPLETED, CANCELLED
tagstring
timestampLocalDateTime
typeBatchTypeÉn av: ASSET_CREATION, REGISTRATION, TRANSPORT, SERVICE, COUNT, CONTROL_ROUND, OTHER

BatchMultiEditDto

FeltTypeBeskrivelse
categoryIdsliste av integer (int64)
deleteFieldsliste av string
deleteFieldsSupportedboolean
locationCategoryIdinteger (int64)
notMixingSetAndClearboolean
stateAssetStateÉn av: PROVISIONED, COMMISSIONED, STORED, SERVICE, TRANSPORT, DISCARDED
stateNotProvisionedboolean
validboolean

BatchState

Én av: PLANNED, IN_PROGRESS, COMPLETED, CANCELLED

BatchType

Én av: ASSET_CREATION, REGISTRATION, TRANSPORT, SERVICE, COUNT, CONTROL_ROUND, OTHER

CloseDeviationDto

FeltTypeBeskrivelse
notestring

ConsecutiveAssetsDto

FeltTypeBeskrivelse
assetId *integer (int64)
countinteger (int32)

CreateAssetDto

FeltTypeBeskrivelse
batchesliste av integer (int64)
categoryIdsliste av integer (int64)
descriptionstring
externalIdsliste av ExternalIdDto
locationCategoryIdinteger (int64)
namestring
propertiesmap av string
publicDppboolean

CreateAssetEventDto

FeltTypeBeskrivelse
batchGuidstring
documentIdsliste av integer (int64)
manualType *AssetEventTypeÉn av: INSPECTION, MAINTENANCE, REPAIR, INCIDENT, NOTE
notestring
resultAssetEventResultÉn av: OK, DEVIATION

CreateBatchDto

FeltTypeBeskrivelse
assetIdsliste av integer (int64)
categoryIdsliste av integer (int64)
consecutiveAssetIdsConsecutiveAssetsDto
descriptionstring
guidstring
initialCountinteger (int64)
locationCategoryIdinteger (int64)
namestring
numberOfNewAssetsinteger (int32)
propertiesmap av string
stateBatchStateÉn av: PLANNED, IN_PROGRESS, COMPLETED, CANCELLED
typeBatchTypeÉn av: ASSET_CREATION, REGISTRATION, TRANSPORT, SERVICE, COUNT, CONTROL_ROUND, OTHER

CreateDeviationDto

FeltTypeBeskrivelse
assetId *integer (int64)
batchGuidstring
description *string
documentIdsliste av integer (int64)

DeviationDto

FeltTypeBeskrivelse
assetIdinteger (int64)
assetNamestring
batchGuidstring
batchNamestring
closeNotestring
closedAtLocalDateTime
closedBystring
correctiveActionstring
createdAtLocalDateTime
createdBystring
descriptionstring
documentIdsliste av integer (int64)
dueDateLocalDate
idinteger (int64)
responsiblestring
stateDeviationStateÉn av: OPEN, CLOSED

DeviationState

Én av: OPEN, CLOSED

DocumentDto

FeltTypeBeskrivelse
documentTypeDocumentTypeÉn av: IMAGE, DOCUMENT, LINK, OTHER
idinteger (int64)
urlstring

DocumentType

Én av: IMAGE, DOCUMENT, LINK, OTHER

EventAction

Én av: CREATE, ACTIVATE, UPDATE, APPROVE, START, COMPLETE, WARRANTY, SERVICE, DELETE, REQUEST, TRANSFER, MANUAL

EventDto

FeltTypeBeskrivelse
actionEventActionÉn av: CREATE, ACTIVATE, UPDATE, APPROVE, START, COMPLETE, WARRANTY, SERVICE, DELETE, REQUEST, TRANSFER, MANUAL
idinteger (int64)
propertiesmap av string
timestampLocalDateTime
typeEventTypeÉn av: ASSET, BATCH, ORDER, LOCATION, USER, DEVIATION
userstring

EventType

Én av: ASSET, BATCH, ORDER, LOCATION, USER, DEVIATION

ExternalIdDto

FeltTypeBeskrivelse
id *string
systemName *string
urlStringFormatstring

GrantWarrantyDto

FeltTypeBeskrivelse
assetIdinteger (int64)
batchIdinteger (int64)
durationWarrantyPeriodÉn av: THREE_YEARS

Language

Én av: ENGLISH, NORWEGIAN

LocalDate

string (date)

LocalDateTime

string (date-time)

OwnerDto

FeltTypeBeskrivelse
idstring
namestring

PdfFormat

Én av: A4_3X8_66MM, A4_3X8_70MM, A4_2X5_80MM, STRIP_1X1_40MM, A4_5X8_30MM, A4_5X8_30MM_CLEAN

StreamingOutput

object

UpdateAssetDto

FeltTypeBeskrivelse
addBatchesliste av integer (int64)
batchesliste av integer (int64)
batchesUnambiguousboolean
categoryIdsliste av integer (int64)
deleteFieldsliste av string
descriptionstring
documentIdsliste av integer (int64)
externalIdsliste av ExternalIdDto
locationCategoryIdinteger (int64)
namestring
propertiesmap av string
publicDppboolean
stateAssetStateÉn av: PROVISIONED, COMMISSIONED, STORED, SERVICE, TRANSPORT, DISCARDED
stateNotProvisionedboolean

UpdateBatchDto

FeltTypeBeskrivelse
assetIdsliste av integer (int64)
categoryIdsliste av integer (int64)
countinteger (int64)
deleteFieldsliste av string
descriptionstring
guidstring
locationCategoryIdinteger (int64)
namestring
stateBatchStateÉn av: PLANNED, IN_PROGRESS, COMPLETED, CANCELLED
typeBatchTypeÉn av: ASSET_CREATION, REGISTRATION, TRANSPORT, SERVICE, COUNT, CONTROL_ROUND, OTHER

UpdateDeviationDto

FeltTypeBeskrivelse
correctiveActionstring
dueDateLocalDate
responsiblestring

UserPreferencesDto

FeltTypeBeskrivelse
languageLanguageÉn av: ENGLISH, NORWEGIAN

WarrantyDto

FeltTypeBeskrivelse
expirationLocalDateTime
grantedLocalDateTime
grantedByOrganizationstring
grantedByUserIdstring
idinteger (int64)

WarrantyPeriod

Én av: THREE_YEARS