Skip to main content
GET
/
sites-rules
/
v1
/
rs
List site rules for the site
curl --request GET \
  --url https://z52mnqg347.execute-api.eu-west-3.amazonaws.com/main/sites-rules/v1/rs \
  --header 'Authorization: Bearer <token>' \
  --header 'x-session-token: <x-session-token>'
{
  "data": [
    {
      "id": 1,
      "ruleId": 99,
      "siteId": 42,
      "status": 2,
      "contractId": 123,
      "routineId": 456,
      "dueAt": "2024-12-01T12:34:56.000Z",
      "archivedAt": "2024-12-01T12:34:56.000Z",
      "updatedAt": "2024-12-01T12:34:56.000Z",
      "createdAt": "2024-12-01T12:34:56.000Z",
      "actions": {
        "canBeDeleted": true
      },
      "upcomingInterventionStatus": 1,
      "nextIntervention": {
        "id": 1,
        "status": 2,
        "scheduledStart": "2024-12-01T12:34:56.000Z",
        "scheduledEnd": "2024-12-05T14:56:23.000Z"
      },
      "lastIntervention": {
        "id": 1,
        "status": 2,
        "scheduledStart": "2024-12-01T12:34:56.000Z",
        "scheduledEnd": "2024-12-05T14:56:23.000Z",
        "trainingProof": {
          "name": "document.pdf",
          "presignedUrl": "https://example.com/presigned-url"
        }
      },
      "contract": {
        "id": 1,
        "name": "Service Agreement",
        "archivedAt": "2024-12-01T12:34:56.000Z",
        "company": {
          "id": 1,
          "name": "Company Name"
        }
      },
      "routine": {
        "id": 1,
        "name": "Monthly Maintenance",
        "autoCreateEnabled": true,
        "assignedTo": {
          "type": 123,
          "id": 1,
          "name": "John Doe",
          "email": "test@mail.com"
        }
      },
      "siteIds": [
        1
      ],
      "sites": [
        {
          "id": 1,
          "name": "Main site",
          "isEstablishment": true
        }
      ],
      "report": {
        "id": 1,
        "name": "Document Name",
        "interventionId": 1,
        "anomalyStats": {
          "unreviewed": 5,
          "pending": 3,
          "resolved": 10
        },
        "count": 123
      },
      "site": {
        "id": 1,
        "name": "Main site",
        "types": [
          1,
          1
        ],
        "isEstablishment": true,
        "establishmentId": 10,
        "serialNumber": "123456",
        "archivedAt": "2024-12-10T10:00:00.000Z",
        "createdAt": "2024-01-15T08:45:00.000Z",
        "establishment": {
          "id": 1,
          "address": "123 Main Street",
          "zipCode": 75001,
          "city": "Paris",
          "country": "France",
          "classifications": [
            0,
            2
          ],
          "isGroupment": true
        }
      },
      "rule": {
        "id": 1,
        "name": "Annual Safety Check",
        "description": "This rule requires an annual safety check for all installations.",
        "type": 1,
        "sourceType": 1,
        "links": [
          {
            "name": "Rule Details",
            "url": "https://example.com/rule-details"
          }
        ],
        "rrule": "FREQ=YEARLY;BYMONTH=12;BYMONTHDAY=1",
        "workflowType": 1,
        "complianceType": 1,
        "siteScopes": [
          {
            "categories": [
              1
            ],
            "classifications": [
              "ERP"
            ],
            "types": [
              "J"
            ],
            "privateCapacity": 100,
            "privateCapacityOperator": ">="
          }
        ],
        "establishmentCategories": [
          1,
          2,
          3
        ],
        "establishmentClassifications": [
          "ERP",
          "IGH",
          "HAB"
        ],
        "establishmentTypes": [
          "J",
          "P",
          "EF"
        ],
        "companyTypes": [
          1
        ],
        "archivedAt": "2024-12-10T10:00:00.000Z",
        "createdAt": "2024-01-15T08:45:00.000Z",
        "technicalInstallations": [
          {
            "id": 1,
            "name": "establishment_informations.installation_ascenseurs",
            "presignedUrl": "https://example.com/presigned-url"
          }
        ],
        "scopes": [
          {
            "id": 1,
            "specificationValues": [
              {
                "id": 1,
                "value": "Annual Safety Check",
                "definition": "Annual Safety Check"
              }
            ],
            "name": "Example Name"
          }
        ]
      }
    }
  ],
  "totalCount": 100,
  "pagination": {
    "page": 1,
    "pageSize": 50
  }
}

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"

Query Parameters

extend
enum<string>[]

Extend options:

  • "actions-info": Give information about actions that can be done on the rule

  • "last-next-intervention": Get the last and next intervention for a rule in a site

  • "contract": Get the contract details for a site rule

  • "routine": Get the routine details for a site rule

  • "aggregate-site-rule": Get aggregated information about site rules

  • "report": Get the upcoming Report and / or the last intervention details for a site rule

  • "site": Get the site information

  • "site-establishment": Get the establishment information of the site

  • "rule": Get the rules with specific fields

  • "rule-technical-installations": Get information about technical installations linked to the rule

  • "rule-scopes": [deprecated] (use rule-equipment-scopes instead)Get information about scopes linked to the rule

  • "rule-scopes-partial": [deprecated] (use rule-equipment-scopes instead)Get information about scopes linked to the rule

  • "rule-equipment-scopes": [deprecated] (use rule-equipment-scopes instead)Get information about scopes linked to the rule

Available options:
actions-info,
last-next-intervention,
contract,
routine,
aggregate-site-rule,
report,
site,
site-establishment,
rule,
rule-technical-installations,
rule-scopes,
rule-scopes-partial,
rule-equipment-scopes
whereSiteIds
integer[]

Filter by site IDs

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

Filter by rule IDs

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

Filter by routine IDs

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

Filter by routine name

Example:

"string"

whereContractIds
integer[]

Filter by contract IDs

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

Filter by contract name

Example:

"string"

whereDueAt
string

Filter by dueAt date

Example:

"2021-01-01T00:00:00.000Z"

whereCreatedAt
string

Filter by createdAt date

Example:

"2021-01-01T00:00:00.000Z"

whereIsArchived
boolean

Filter by archived status

Example:

true

whereArchivedAt
string

Filter by archivedAt date

Example:

"2021-01-01T00:00:00.000Z"

whereSiteName
string

Filter by site name

Example:

"string"

whereSiteSerialNumber
string

Filter by site serial number

Example:

"string"

whereSiteTypes
integer[]

Filter by site type

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

Filter by establishment status

Example:

true

whereRuleName
string

Filter by rule name

Example:

"string"

whereRuleDescription
string

Filter by rule description

Example:

"string"

whereRuleType
integer[]

Filter by rule type

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

Filter by rule source type

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

Filter by rule recurrence rule

Example:

"string"

whereRuleWorkflowType
integer[]

Filter by workflow type

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

Filter by compliance type

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

Filter by establishment categories

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

Filter by establishment classifications

Example:
["string1", "string2", "string3"]
whereRuleEstablishmentTypes
string[]

Filter by establishment types

Example:
["string1", "string2", "string3"]
whereRuleCompanyType
integer[]

Filter by company type

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

Filter by technical installation ID

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

1

whereEquipmentId
integer

Filter by equipment ID

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

1

orderBy
object[]
includeCount
boolean
default:false

Include total count in response.

Example:

true

page
integer
default:1

Page number.

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

1

pageSize
integer
default:50

Page size.

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

50

findId
integer

Get the page where the item with this id is located.

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

1

subPageSize
integer
default:10

Sub page size for grouping items.

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

10

Response

200 - application/json

List site rules

data
object[]
required
totalCount
integer

Total count of items.

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

100

pagination
object

Pagination information.