Skip to main content
GET
/
users-rules
/
v1
/
rs
List user rules for the user
curl --request GET \
  --url https://z52mnqg347.execute-api.eu-west-3.amazonaws.com/main/users-rules/v1/rs \
  --header 'Authorization: Bearer <token>' \
  --header 'x-session-token: <x-session-token>'
{
  "data": [
    {
      "id": 1,
      "ruleId": 42,
      "userId": 10,
      "status": 2,
      "contractId": 8,
      "routineId": 5,
      "dueAt": "2025-03-15T09:00:00.000Z",
      "archivedAt": "2024-12-10T10:00:00.000Z",
      "updatedAt": "2024-12-09T14:23:00.000Z",
      "createdAt": "2024-01-15T08:45:00.000Z",
      "routine": {
        "id": 1,
        "name": "Monthly Maintenance",
        "autoCreateEnabled": true,
        "assignedTo": {
          "type": 123,
          "id": 1,
          "name": "John Doe",
          "email": "test@mail.com"
        }
      },
      "contract": {
        "id": 1,
        "name": "Service Agreement",
        "archivedAt": "2024-12-01T12:34:56.000Z",
        "company": {
          "id": 1,
          "name": "Company Name"
        }
      },
      "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",
        "attendanceStatus": "present",
        "attendanceProof": {
          "id": 1,
          "name": "document.pdf",
          "presignedUrl": "https://example.com/presigned-url"
        }
      },
      "actions": {
        "canBeDeleted": 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": ">="
          }
        ],
        "companyTypes": [
          1
        ],
        "archivedAt": "2024-12-10T10:00:00.000Z",
        "createdAt": "2024-01-15T08:45:00.000Z",
        "userScopes": [
          {
            "id": 1,
            "professions": [
              {
                "id": 1,
                "name": "Urgent"
              }
            ],
            "diplomaTitles": [
              {
                "id": 1,
                "name": "Urgent"
              }
            ]
          }
        ]
      },
      "user": {
        "id": 1,
        "firstName": "John",
        "lastName": "Doe",
        "email": "test@mail.com",
        "phone": "0123456789",
        "deletedAt": "2024-12-15T10:00:00.000Z",
        "createdAt": "2024-01-15T08:45:00.000Z",
        "profession": {
          "name": "Urgent",
          "id": 1
        },
        "diplomas": [
          {
            "id": 1,
            "title": "Urgent"
          }
        ]
      }
    }
  ],
  "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:

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

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

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

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

  • "rule": Get the rules with specific fields

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

  • "user": Get the user information

  • "user-organization": Get the organization information of the user

Available options:
routine,
contract,
last-next-intervention,
actions-info,
rule,
rule-user-scopes,
user,
user-organization
whereUserIds
integer[]

Filter by user 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"

whereIsDeleted
boolean

Filter by deleted status

Example:

true

whereDeletedAt
string

Filter by deletedAt date

Example:

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

whereUserName
string

Filter by user name

Example:

"string"

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]
whereRuleCompanyType
integer[]

Filter by company type

Required range: -9007199254740991 <= x <= 9007199254740991
Example:
[1, 2, 3]
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 user rules

data
object[]
required
totalCount
integer

Total count of items.

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

100

pagination
object

Pagination information.