Skip to main content
GET
/
profiles-rules
/
v1
/
rs
List profile rules for the profile
curl --request GET \
  --url https://z52mnqg347.execute-api.eu-west-3.amazonaws.com/main/profiles-rules/v1/rs \
  --header 'Authorization: Bearer <token>' \
  --header 'x-session-token: <x-session-token>'
{
  "data": [
    {
      "id": 1,
      "ruleId": 99,
      "profileId": 42,
      "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
      },
      "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,
        "establishmentCategories": [
          1,
          2,
          3
        ],
        "establishmentClassifications": [
          "ERP",
          "IGH",
          "HAB"
        ],
        "establishmentTypes": [
          "J",
          "P",
          "EF"
        ],
        "archivedAt": "2024-12-10T10:00:00.000Z",
        "createdAt": "2024-01-15T08:45:00.000Z"
      },
      "contract": {
        "id": 1,
        "name": "Service Agreement",
        "archivedAt": "2024-12-01T12:34:56.000Z",
        "company": {
          "id": 1,
          "name": "Company Name"
        }
      },
      "nextIntervention": {
        "id": 1,
        "status": 1,
        "scheduledStart": "2024-12-01T12:34:56.000Z",
        "scheduledEnd": "2024-12-05T14:56:23.000Z"
      },
      "lastIntervention": {
        "id": 1,
        "scheduledStart": "2024-12-01T12:34:56.000Z",
        "scheduledEnd": "2024-12-05T14:56:23.000Z"
      },
      "routine": {
        "id": 1,
        "name": "Monthly Maintenance",
        "autoCreateEnabled": true,
        "assignedTo": {
          "type": 123,
          "id": 1,
          "name": "John Doe",
          "email": "test@mail.com"
        }
      },
      "profile": {
        "id": 1,
        "userId": "a13f2277-4009-458b-93c6-bc77f447281b",
        "firstName": "John",
        "lastName": "Doe",
        "email": "test@mail.com",
        "phone": "0123456789",
        "img": "https://www.example.com/image.jpg",
        "isActive": true,
        "lang": "fr",
        "updatedAt": "2024-12-01T12:34:56.000Z",
        "createdAt": "2023-01-01T08:00:00.000Z"
      }
    }
  ],
  "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

  • "rule": Get the rules with specific fields

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

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

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

  • "profile": Get the profile information

Available options:
actions-info,
rule,
contract,
last-next-intervention,
routine,
profile
whereProfileIds
integer[]

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

whereCreatedAt
string

Filter by createdAt date

Example:

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

whereDueAt
string

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

whereProfileFirstName
string

Filter by profile first name

Example:

"string"

whereProfileLastName
string

Filter by profile last name

Example:

"string"

whereProfileEmail
string

Filter by profile email

Example:

"string"

whereText
string

Filter by profile first name, last name, or email

Example:

"string"

whereProfileOrganizationRole
number

Filter by profile role in organizations.roles

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]
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 profile rules

data
object[]
required
totalCount
integer

Total count of items.

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

100

pagination
object

Pagination information.