SmaCH
SmaCH API

Artworks: the monitored works, their packaging, checklist and configuration


Get an artwork by reference

GET
https://api.smach.science
/artworks/{reference}

Get an artwork by reference › path Parameters

reference
​string · minLength: 1 · required

Get an artwork by reference › Headers

X-Organization
​string

The organization alias the request applies to, not its display name.

Optional for an account belonging to a single organization, which is resolved from the token. Required beyond that, since no default is defensible. A super-admin may name any organization, or none, which reads across all of them.

Get an artwork by reference › Responses

Unknown reference

Artwork - the monitored work, its packaging, checklist and base configuration
reference
​string · minLength: 1 · pattern: ^[a-zA-Z0-9][a-zA-Z0… · required

Business key, unique within the organization, URL-safe

name
​string · minLength: 1 · required
description
​string · minLength: 1 · required
​Configuration · required

Monitoring configuration (captor thresholds and logger parameters). Inherited: artwork, then monitoring, then datalogger

id
​string · uuid · readOnly

Storage identifier

tags
​string[]

Free tags, used to group and filter

status
​string · enum

Lifecycle status. standby and monitoring are set by the monitoring lifecycle, never by a request

Enum values:
draft
ready
standby
monitoring
archived
cancelled
Default: draft
summary
​string
creator
​string
creation
​string

Date or period of creation, free text

picture
​string

Picture URL

medium
​string
​Size

Dimensions (mm)

weight
​integer · int64

Weight (grams)

​object
inclosure
​string

Identity of the inclosure, the static protection

crate
​string

Identity of the crate, the transport protection

​ChecklistItem[]
created
​string · date-time
updated
​string · date-time

Update an artwork

PUT
https://api.smach.science
/artworks/{reference}

Replaces the artwork whole. The reference cannot change, and a body without a status keeps the stored one. standby and monitoring follow the monitoring of the artwork: a request neither sets them nor leaves them.

Update an artwork › path Parameters

reference
​string · minLength: 1 · required

Update an artwork › Headers

X-Organization
​string

The organization alias the request applies to, not its display name.

Optional for an account belonging to a single organization, which is resolved from the token. Required beyond that, since no default is defensible. A super-admin may name any organization, or none, which reads across all of them.

Update an artwork › Request Body

Artwork - the monitored work, its packaging, checklist and base configuration
reference
​string · minLength: 1 · pattern: ^[a-zA-Z0-9][a-zA-Z0… · required

Business key, unique within the organization, URL-safe

name
​string · minLength: 1 · required
description
​string · minLength: 1 · required
​Configuration · required

Monitoring configuration (captor thresholds and logger parameters). Inherited: artwork, then monitoring, then datalogger

id
​string · uuid · readOnly

Storage identifier

tags
​string[]

Free tags, used to group and filter

status
​string · enum

Lifecycle status. standby and monitoring are set by the monitoring lifecycle, never by a request

Enum values:
draft
ready
standby
monitoring
archived
cancelled
Default: draft
summary
​string
creator
​string
creation
​string

Date or period of creation, free text

picture
​string

Picture URL

medium
​string
​Size

Dimensions (mm)

weight
​integer · int64

Weight (grams)

​object
inclosure
​string

Identity of the inclosure, the static protection

crate
​string

Identity of the crate, the transport protection

​ChecklistItem[]
created
​string · date-time
updated
​string · date-time

Update an artwork › Responses

Invalid body, packaging, or a reference that differs

Artwork - the monitored work, its packaging, checklist and base configuration
reference
​string · minLength: 1 · pattern: ^[a-zA-Z0-9][a-zA-Z0… · required

Business key, unique within the organization, URL-safe

name
​string · minLength: 1 · required
description
​string · minLength: 1 · required
​Configuration · required

Monitoring configuration (captor thresholds and logger parameters). Inherited: artwork, then monitoring, then datalogger

id
​string · uuid · readOnly

Storage identifier

tags
​string[]

Free tags, used to group and filter

status
​string · enum

Lifecycle status. standby and monitoring are set by the monitoring lifecycle, never by a request

Enum values:
draft
ready
standby
monitoring
archived
cancelled
Default: draft
summary
​string
creator
​string
creation
​string

Date or period of creation, free text

picture
​string

Picture URL

medium
​string
​Size

Dimensions (mm)

weight
​integer · int64

Weight (grams)

​object
inclosure
​string

Identity of the inclosure, the static protection

crate
​string

Identity of the crate, the transport protection

​ChecklistItem[]
created
​string · date-time
updated
​string · date-time

Delete an artwork and its history

DELETE
https://api.smach.science
/artworks/{reference}

Removes the artwork with its monitorings and their events. Archiving, a status, is the ordinary way to retire an artwork; deletion is for a confirmed purge.

Delete an artwork and its history › path Parameters

reference
​string · minLength: 1 · required

Delete an artwork and its history › Headers

X-Organization
​string

The organization alias the request applies to, not its display name.

Optional for an account belonging to a single organization, which is resolved from the token. Required beyond that, since no default is defensible. A super-admin may name any organization, or none, which reads across all of them.

Delete an artwork and its history › Responses

Deleted

No data returned

List artworks

GET
https://api.smach.science
/artworks

Follow the Link header to page through the collection rather than building page URLs. The search parameter matches the name, the reference, the summary and the description, anywhere in the field. Sortable on name, reference, status, created, updated; newest first by default.

List artworks › query Parameters

page
​integer · int32 · min: 0

0-indexed page number

Default: 0
size
​integer · int32 · min: 1 · max: 200

Page size

Default: 50
search
​string

Free-text search. The fields it matches are documented per endpoint.

sort
​string

Sort field, prefixed with '-' for descending (e.g. -createdAt), composed with commas. The sortable fields are documented per endpoint.

status
​string[]

Keep only artworks in one of these statuses

Enum values:
draft
ready
standby
monitoring
archived
cancelled
tags
​string[]

Keep only artworks carrying at least one of these tags

packaging
​string

Keep only artworks using this packaging, as inclosure or as crate

List artworks › Headers

X-Organization
​string

The organization alias the request applies to, not its display name.

Optional for an account belonging to a single organization, which is resolved from the token. Required beyond that, since no default is defensible. A super-admin may name any organization, or none, which reads across all of them.

List artworks › Responses

200

A page of results

Artwork - the monitored work, its packaging, checklist and base configuration
reference
​string · minLength: 1 · pattern: ^[a-zA-Z0-9][a-zA-Z0… · required

Business key, unique within the organization, URL-safe

name
​string · minLength: 1 · required
description
​string · minLength: 1 · required
​Configuration · required

Monitoring configuration (captor thresholds and logger parameters). Inherited: artwork, then monitoring, then datalogger

id
​string · uuid · readOnly

Storage identifier

tags
​string[]

Free tags, used to group and filter

status
​string · enum

Lifecycle status. standby and monitoring are set by the monitoring lifecycle, never by a request

Enum values:
draft
ready
standby
monitoring
archived
cancelled
Default: draft
summary
​string
creator
​string
creation
​string

Date or period of creation, free text

picture
​string

Picture URL

medium
​string
​Size

Dimensions (mm)

weight
​integer · int64

Weight (grams)

​object
inclosure
​string

Identity of the inclosure, the static protection

crate
​string

Identity of the crate, the transport protection

​ChecklistItem[]
created
​string · date-time
updated
​string · date-time

Create an artwork

POST
https://api.smach.science
/artworks

Created as draft, or as ready when the body says so. The inclosure and the crate, when given, must be packaging of that kind held by the inventory.

Create an artwork › Headers

X-Organization
​string

The organization alias the request applies to, not its display name.

Optional for an account belonging to a single organization, which is resolved from the token. Required beyond that, since no default is defensible. A super-admin may name any organization, or none, which reads across all of them.

Create an artwork › Request Body

Artwork - the monitored work, its packaging, checklist and base configuration
reference
​string · minLength: 1 · pattern: ^[a-zA-Z0-9][a-zA-Z0… · required

Business key, unique within the organization, URL-safe

name
​string · minLength: 1 · required
description
​string · minLength: 1 · required
​Configuration · required

Monitoring configuration (captor thresholds and logger parameters). Inherited: artwork, then monitoring, then datalogger

id
​string · uuid · readOnly

Storage identifier

tags
​string[]

Free tags, used to group and filter

status
​string · enum

Lifecycle status. standby and monitoring are set by the monitoring lifecycle, never by a request

Enum values:
draft
ready
standby
monitoring
archived
cancelled
Default: draft
summary
​string
creator
​string
creation
​string

Date or period of creation, free text

picture
​string

Picture URL

medium
​string
​Size

Dimensions (mm)

weight
​integer · int64

Weight (grams)

​object
inclosure
​string

Identity of the inclosure, the static protection

crate
​string

Identity of the crate, the transport protection

​ChecklistItem[]
created
​string · date-time
updated
​string · date-time

Create an artwork › Responses

Created

Artwork - the monitored work, its packaging, checklist and base configuration
reference
​string · minLength: 1 · pattern: ^[a-zA-Z0-9][a-zA-Z0… · required

Business key, unique within the organization, URL-safe

name
​string · minLength: 1 · required
description
​string · minLength: 1 · required
​Configuration · required

Monitoring configuration (captor thresholds and logger parameters). Inherited: artwork, then monitoring, then datalogger

id
​string · uuid · readOnly

Storage identifier

tags
​string[]

Free tags, used to group and filter

status
​string · enum

Lifecycle status. standby and monitoring are set by the monitoring lifecycle, never by a request

Enum values:
draft
ready
standby
monitoring
archived
cancelled
Default: draft
summary
​string
creator
​string
creation
​string

Date or period of creation, free text

picture
​string

Picture URL

medium
​string
​Size

Dimensions (mm)

weight
​integer · int64

Weight (grams)

​object
inclosure
​string

Identity of the inclosure, the static protection

crate
​string

Identity of the crate, the transport protection

​ChecklistItem[]
created
​string · date-time
updated
​string · date-time

List the tags in use

GET
https://api.smach.science
/artworks/tags

Every tag carried by at least one artwork, once, in alphabetical order.

List the tags in use › Headers

X-Organization
​string

The organization alias the request applies to, not its display name.

Optional for an account belonging to a single organization, which is resolved from the token. Required beyond that, since no default is defensible. A super-admin may name any organization, or none, which reads across all of them.

List the tags in use › Responses

200

OK

Tags in use
values
​string[]

Count artworks matching the filters

GET
https://api.smach.science
/artworks/count

Answers a business question; paging is driven by the list endpoint's Link header. The filters have the same meaning as on the list endpoint.

Count artworks matching the filters › query Parameters

search
​string
status
​string[]
Enum values:
draft
ready
standby
monitoring
archived
cancelled
tags
​string[]
packaging
​string

Count artworks matching the filters › Headers

X-Organization
​string

The organization alias the request applies to, not its display name.

Optional for an account belonging to a single organization, which is resolved from the token. Required beyond that, since no default is defensible. A super-admin may name any organization, or none, which reads across all of them.

Count artworks matching the filters › Responses

200

OK

Number of resources matching the filters
count
​integer · int64