Skip to main content
PATCH
/
sites
/
v2
/
rs
/
{siteId}
Update site informations
curl --request PATCH \
  --url https://z52mnqg347.execute-api.eu-west-3.amazonaws.com/main/sites/v2/rs/{siteId} \
  --header 'Authorization: Bearer <token>' \
  --header 'content-type: <content-type>' \
  --header 'x-session-token: <x-session-token>' \
  --data '
{
  "name": "Main site",
  "serialNumber": "123456",
  "types": [
    1,
    1
  ],
  "classifications": [
    "ERT",
    "ERP"
  ],
  "tagIds": [
    1,
    2,
    3
  ]
}
'
{
  "id": 1,
  "name": "Main site",
  "types": [
    1,
    1
  ],
  "classifications": [
    "ERT",
    "ERP"
  ],
  "isEstablishment": true,
  "serialNumber": "123456",
  "sortOrder": 1,
  "establishmentId": 10,
  "archivedAt": "2024-12-10T10:00:00.000Z",
  "updatedAt": "2024-12-09T14:23:00.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"

Path Parameters

siteId
integer
required

Unique identifier of the site.

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

1

Body

application/json

Details required to update a site

name
string

Name of the site.

Maximum string length: 250
Example:

"Main site"

serialNumber
string

Serial number of the site.

Maximum string length: 10
Example:

"123456"

types
enum<number>[]

Types associated with the site (N, P, M, etc.).

Available options:
0,
1,
2,
3,
4,
5,
6,
7,
8,
9,
10,
11,
12,
13,
14,
15,
16,
17,
18,
19
Example:
[1, 1]
classifications
string[]

Classifications associated with the site (ERT, ERP, etc.).

Maximum string length: 50
Example:
["ERT", "ERP"]
tagIds
integer[]

Unique identifiers of the associated tags.

Required range: -9007199254740991 <= x <= 9007199254740991
Example:
[1, 2, 3]

Response

200 - application/json

The site was successfully updated

id
integer
required

Unique identifier of the site.

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

1

name
string
required

Name of the site.

Maximum string length: 250
Example:

"Main site"

types
enum<number>[]
required

Types associated with the site (N, P, M, etc.).

Available options:
0,
1,
2,
3,
4,
5,
6,
7,
8,
9,
10,
11,
12,
13,
14,
15,
16,
17,
18,
19
Example:
[1, 1]
classifications
string[]
required

Classifications associated with the site (ERT, ERP, etc.).

Maximum string length: 50
Example:
["ERT", "ERP"]
isEstablishment
boolean
required

Indicates whether the site is an establishment.

Example:

true

serialNumber
string
required

Serial number of the site.

Maximum string length: 10
Example:

"123456"

sortOrder
integer
required

Sort order of the site for display purposes.

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

1

establishmentId
integer
required

Identifier of the establishment associated with the site.

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

10

archivedAt
required

Date when the site was archived.

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-10T10:00:00.000Z"

updatedAt
required

Date of the site update.

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-09T14:23:00.000Z"

createdAt
required

Date of site creation.

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-01-15T08:45:00.000Z"