Skip to main content
PATCH
/
establishments
/
v2
/
rs
/
{establishmentId}
Update establishment with validation
curl --request PATCH \
  --url https://z52mnqg347.execute-api.eu-west-3.amazonaws.com/main/establishments/v2/rs/{establishmentId} \
  --header 'Authorization: Bearer <token>' \
  --header 'Content-Type: <content-type>' \
  --header 'X-Session-Token: <x-session-token>' \
  --data '
{
  "name": "Main site",
  "types": [
    1,
    1
  ],
  "serialNumber": "123456",
  "tagIds": [
    1,
    2,
    3
  ],
  "city": "Paris",
  "category": 3,
  "zipCode": 75001,
  "address": "123 Main Street",
  "pinCode": 1234,
  "pinCodeEnabled": false,
  "accessInstructions": "Enter through the back door.",
  "classifications": [
    0,
    2
  ],
  "country": "France",
  "totalSurfaceArea": 1500,
  "publicCapacity": 300,
  "privateCapacity": 50
}
'
{
  "data": {
    "id": 1,
    "image": {
      "size": 2048,
      "name": "commission-signature.jpg",
      "mimeType": "image/jpeg"
    },
    "address": "123 Main Street",
    "city": "Paris",
    "zipCode": 75001,
    "country": "France",
    "classifications": [
      0,
      2
    ],
    "category": 3,
    "isGroupment": true,
    "totalSurfaceArea": 1500,
    "publicCapacity": 300,
    "privateCapacity": 50,
    "organizationId": 10,
    "establishmentSiteId": 5,
    "pinCode": 1234,
    "pinCodeEnabled": false,
    "accessInstructions": "Enter through the back door.",
    "metadata": {
      "leafletDispatched": true
    },
    "updatedAt": "2024-12-01T12:34:56.000Z",
    "createdAt": "2023-01-01T08:00:00.000Z",
    "counters": {
      "reportIntervention": 5,
      "reportCommission": 2,
      "anomalyObservation": 1
    },
    "img": "https://example.com/image.jpg"
  }
}

Authorizations

Authorization
string
header
required

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

Headers

X-Session-Token
string
required

Session token used for authenticating the request.

Example:

"eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJ1c2VySWQiOiIxMjM0NTY3ODkwIiwic2Vzc2lvbklkIjoiYWJjZGVmMTIzNDU2IiwiaWF0IjoxNjA1MDk3ODk5LCJleHAiOjE2MDUxODQyOTl9.4XRQ1iXDyvEj5LgPZHbmTmzOZs98M3YPOzgf3MhxjaI"

Content-Type
enum<string>
required

Content type, must be "application/json".

Available options:
application/json

Path Parameters

establishmentId
integer
required

Unique identifier of the establishment.

Example:

1

Body

application/json

Details required to update an establishment

name
string

Name of the site.

Maximum string length: 250
Example:

"Main site"

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]
serialNumber
string

Serial number of the site.

Maximum string length: 10
Example:

"123456"

tagIds
integer[]

Unique identifiers of the associated tags.

Example:
[1, 2, 3]
city
string | null

City where the establishment is located.

Maximum string length: 100
Example:

"Paris"

category
enum<number> | null

Category of the establishment (if ERP), between 1 and 5.

Available options:
1,
2,
3,
4,
5,
Example:

3

zipCode
integer | null

Postal code of the establishment.

Example:

75001

address
string | null

Address of the establishment.

Maximum string length: 100
Example:

"123 Main Street"

pinCode
integer | null

PIN code for accessing the establishment.

Example:

1234

pinCodeEnabled
boolean | null

Indicates if the PIN code is enabled for access.

Example:

false

accessInstructions
string | null

Instructions for accessing the establishment.

Maximum string length: 100
Example:

"Enter through the back door."

classifications
enum<number>[] | null

Classifications of the establishment (e.g., ERP, IGH).

Available options:
0,
1,
2,
3
Example:
[0, 2]
country
string | null

Country where the establishment is located.

Maximum string length: 100
Example:

"France"

totalSurfaceArea
integer | null

Total surface area of the establishment in square meters.

Example:

1500

publicCapacity
integer | null

Maximum public capacity of the establishment.

Example:

300

privateCapacity
integer | null

Maximum private capacity of the establishment.

Example:

50

Response

200 - application/json

The establishment was successfully updated

data
object
required