Skip to main content
POST
/
anomalies
/
v2
/
rs
/
observations
Create an observation
curl --request POST \
  --url https://z52mnqg347.execute-api.eu-west-3.amazonaws.com/main/anomalies/v2/rs/observations \
  --header 'Authorization: Bearer <token>' \
  --header 'content-type: <content-type>' \
  --header 'x-session-token: <x-session-token>' \
  --data '
{
  "title": "Anomaly title",
  "description": "Anomaly description",
  "risk": 1,
  "technicalInstallationId": 1,
  "siteId": 1,
  "location": {
    "room": "Room 1",
    "floor": "Floor 1"
  },
  "observedAt": "2024-12-01T12:34:56.000Z",
  "dueAt": "2024-12-01T12:34:56.000Z"
}
'
{
  "data": {
    "id": 1,
    "type": 1,
    "status": 0,
    "title": "Anomaly title",
    "description": "Anomaly description",
    "risk": 1,
    "siteId": 1,
    "technicalInstallationId": 1,
    "equipmentId": 1,
    "reportedByUserId": 1,
    "positionId": 1,
    "resolvedComment": "Anomaly resolved",
    "reporter": "John Doe",
    "resolvedByUserId": 1,
    "alreadyReported": false,
    "sortOrder": 1,
    "anomalyNumber": "A-12345",
    "pageNumber": 12,
    "reportId": 1,
    "comment": "Anomaly comment",
    "resolutionDelay": "P7D",
    "location": "1st Floor, Room 101",
    "dueAt": "2024-12-01T12:34:56.000Z",
    "observedAt": "2024-12-01T12:34:56.000Z",
    "resolvedAt": "2024-12-01T12:34:56.000Z",
    "deletedAt": "2024-01-15T08:45:00.000Z",
    "archivedAt": "2024-01-15T08:45:00.000Z",
    "updatedAt": "2024-12-05T14:56:23.000Z",
    "createdAt": "2024-01-15T08:45:00.000Z"
  }
}

Authorizations

Authorization
string
header
required

Bearer authentication header of the form Bearer <token>, where <token> is your auth token.

Headers

content-type
string
required

Content type, must be "application/json".

Allowed value: "application/json"
x-session-token
string
required

Session token used for authenticating the request.

Example:

"eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJ1c2VySWQiOiIxMjM0NTY3ODkwIiwic2Vzc2lvbklkIjoiYWJjZGVmMTIzNDU2IiwiaWF0IjoxNjA1MDk3ODk5LCJleHAiOjE2MDUxODQyOTl9.4XRQ1iXDyvEj5LgPZHbmTmzOZs98M3YPOzgf3MhxjaI"

Body

application/json

Details required to create an observation

title
string
required

Anomaly title.

Maximum string length: 250
Example:

"Anomaly title"

description
string
required

Anomaly description.

Maximum string length: 2500
Example:

"Anomaly description"

risk
enum<number>
required

Anomaly risk.

Available options:
0,
1,
2,
3
Example:

1

technicalInstallationId
integer
required

Identifier of the associated technical installation.

Required range: -9007199254740991 <= x <= 9007199254740991
Example:

1

siteId
integer
required

Identifier of the associated site.

Required range: -9007199254740991 <= x <= 9007199254740991
Example:

1

location
object
observedAt

Date of resolution of the anomaly.

Pattern: ^(?:(?:\d\d[2468][048]|\d\d[13579][26]|\d\d0[48]|[02468][048]00|[13579][26]00)-02-29|\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\d|30)|(?:02)-(?:0[1-9]|1\d|2[0-8])))T(?:(?:[01]\d|2[0-3]):[0-5]\d(?::[0-5]\d(?:\.\d+)?)?(?:Z))$
Example:

"2024-12-01T12:34:56.000Z"

dueAt

Anomaly dueAt.

Pattern: ^(?:(?:\d\d[2468][048]|\d\d[13579][26]|\d\d0[48]|[02468][048]00|[13579][26]00)-02-29|\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\d|30)|(?:02)-(?:0[1-9]|1\d|2[0-8])))T(?:(?:[01]\d|2[0-3]):[0-5]\d(?::[0-5]\d(?:\.\d+)?)?(?:Z))$
Example:

"2024-12-01T12:34:56.000Z"

Response

201 - application/json

The anomalies have been created

data
object
required