Skip to main content
GET
/
rules
/
v2
/
rs
List rules for the given site Ids
curl --request GET \
  --url https://z52mnqg347.execute-api.eu-west-3.amazonaws.com/main/rules/v2/rs \
  --header 'Authorization: Bearer <token>' \
  --header 'x-session-token: <x-session-token>'
{
  "data": [
    {
      "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",
      "rruleGap": 30,
      "workflowType": 1,
      "complianceType": 1,
      "siteScopes": [
        {
          "categories": [
            1
          ],
          "classifications": [
            "ERP"
          ],
          "types": [
            "J"
          ],
          "privateCapacity": 100,
          "privateCapacityOperator": ">="
        }
      ],
      "companyTypes": [
        1
      ],
      "archivedAt": "2024-12-10T10:00:00.000Z",
      "deletedAt": "2024-12-15T10:00:00.000Z",
      "updatedAt": "2024-12-09T14:23:00.000Z",
      "createdAt": "2024-01-15T08:45:00.000Z",
      "equipmentScopes": [
        {
          "id": 1,
          "name": "Example Name"
        }
      ],
      "userScopes": [
        {
          "id": 1,
          "professions": [
            {
              "id": 1,
              "name": "Urgent"
            }
          ],
          "diplomaTitles": [
            {
              "id": 1,
              "name": "Urgent"
            }
          ]
        }
      ],
      "technicalInstallations": [
        {
          "id": 1,
          "name": "establishment_informations.installation_ascenseurs",
          "presignedUrl": "https://example.com/presigned-url"
        }
      ],
      "stats": {
        "nbPastDue": 5,
        "nbFutureDue": 3,
        "nbAtRisk": 2
      },
      "nbSites": 5,
      "ruleSiteCount": 1,
      "ruleSites": [
        {
          "id": 1,
          "ruleId": 99,
          "siteId": 42,
          "site": {
            "id": 1,
            "name": "Main site",
            "serialNumber": "123456",
            "isEstablishment": true,
            "establishmentId": 1,
            "establishmentName": "Headquarters",
            "archivedAt": "2024-12-10T10:00:00.000Z"
          },
          "dueAt": "2024-12-01T12:34:56.000Z",
          "contractId": 123,
          "routineId": 456,
          "archivedAt": "2024-12-01T12:34:56.000Z",
          "updatedAt": "2024-12-01T12:34:56.000Z",
          "createdAt": "2024-12-01T12:34:56.000Z"
        }
      ],
      "siteIds": [
        1
      ],
      "actions": {
        "canBeUpdated": true,
        "canBeDeleted": true,
        "canBeRestored": true,
        "canBeAdded": true,
        "canBeRemoved": true,
        "hasWarningOnDelete": true
      }
    }
  ],
  "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"

x-sites
string

List of site IDs.

Example:

"['1', '2']"

Query Parameters

extend
enum<string>[]

Extend options:

  • "equipment-scopes": Get information about scopes linked to the rule

  • "user-scopes": Get information about scopes linked to the rule

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

  • "stats": Get information about rules statistics

  • "nb-sites": Number of sites associated with the rule

  • "site-rule": Get the site rules with specific fields

  • "site-ids": IDs of sites associated with the rule

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

Available options:
equipment-scopes,
user-scopes,
technical-installations,
stats,
nb-sites,
site-rule,
site-ids,
actions-info
whereLibrary
boolean

Filter by rule library

Example:

true

whereName
string

Filter by rule name

Example:

"string"

whereDescription
string

Filter by rule description

Example:

"string"

whereType
integer[]

Filter by rule type

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

Filter by rule source type

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

Filter by rule link

Example:

"string"

whereRrule
string

Filter by rule recurrence rule

Example:

"string"

whereWorkflowType
integer[]

Filter by workflow type

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

Filter by compliance type

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

Filter by establishment categories

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

Filter by establishment classifications

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

Filter by establishment types

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

Filter by establishment private capacity

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

1

whereCompanyTypes
integer[]

Filter by company types

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

Filter by createdAt date

Example:

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

whereUpdatedAt
string

Filter by updatedAt date

Example:

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

whereIsArchived
boolean

Filter by isArchived flag

Example:

true

whereArchivedAt
string

Filter by archivedAt date

Example:

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

whereIsDeleted
boolean

Filter by isDeleted flag

Example:

true

whereDeletedAt
string

Filter by deletedAt date

Example:

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

whereTechnicalInstallationIds
integer[]

Filter by technical installation ids

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

Filter by scope ids

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

Filter by site rule ids

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

Filter by specification value ids

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

Filter by technical installation name

Example:

"string"

whereText
string

Filter by global text in report

Example:

"string"

whereNotInOrganization
boolean

Filter by organization not in the list

Example:

true

whereNotInSite
integer

Filter by site not in the list

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

1

whereSiteIds
integer[]

Filter by site ids

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

Filter by routine id

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

1

whereNoOtherIT
boolean

Filter by not having other IT installations

Example:

true

whereInterventionId
integer

Filter by intervention id

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

1

whereReportId
integer

Filter by report id

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

1

whereContractId
integer

Filter by contract id

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

1

whereSelectableForInterventionId
object

Filter by Selectable Intervention ID

whereNotInRoutine
object

Filter rules that have at least one ruleSite not in any routine or in the specified routine

whereNotInRecurringRoutine
object

Filter rules that have at least one ruleSite not linked to a routine with autoCreateEnabled

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 of rules

data
object[]
required
totalCount
integer

Total count of items.

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

100

pagination
object

Pagination information.