Skip to main content
POST
/
routines
/
v1
/
rs
/
preventive
Create a preventive routine
curl --request POST \
  --url https://z52mnqg347.execute-api.eu-west-3.amazonaws.com/main/routines/v1/rs/preventive \
  --header 'Authorization: Bearer <token>' \
  --header 'content-type: <content-type>' \
  --header 'x-session-token: <x-session-token>' \
  --data '
{
  "name": "Monthly Maintenance",
  "autoCreateEnabled": true,
  "siteRuleIds": [
    1,
    2,
    3
  ],
  "description": "This routine involves monthly maintenance checks for all equipment.",
  "autoAttachEnabled": false,
  "assignedCompanyContactId": 1,
  "assignedUserId": 1,
  "contractId": 1
}
'
{
  "data": {
    "id": 1,
    "name": "Monthly Maintenance",
    "description": "This routine involves monthly maintenance checks for all equipment.",
    "type": 1,
    "autoCreateEnabled": true,
    "assignedCompanyContactId": 1,
    "assignedUserId": 1,
    "contractId": 1,
    "archivedAt": "2024-12-01T12:34:56.000Z",
    "updatedAt": "2024-12-01T12:34:56.000Z",
    "createdAt": "2024-12-01T12:34:56.000Z",
    "rrule": "FREQ=MONTHLY;INTERVAL=1"
  }
}

Authorizations

Authorization
string
header
required

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

Headers

content-type
string
required

Content type, must be "application/json".

Allowed value: "application/json"
x-session-token
string
required

Session token used for authenticating the request.

Example:

"eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJ1c2VySWQiOiIxMjM0NTY3ODkwIiwic2Vzc2lvbklkIjoiYWJjZGVmMTIzNDU2IiwiaWF0IjoxNjA1MDk3ODk5LCJleHAiOjE2MDUxODQyOTl9.4XRQ1iXDyvEj5LgPZHbmTmzOZs98M3YPOzgf3MhxjaI"

Body

application/json

Details required to create a preventive routine

name
string
required

Name of the routine.

Maximum string length: 250
Example:

"Monthly Maintenance"

autoCreateEnabled
boolean
required

Whether the routine automatically creates interventions.

Example:

true

siteRuleIds
integer[]
required

List of site rule IDs to associate with the profile.

Minimum array length: 1
Required range: -9007199254740991 <= x <= 9007199254740991
Example:
[1, 2, 3]
description
string

Description of the routine.

Maximum string length: 2500
Example:

"This routine involves monthly maintenance checks for all equipment."

autoAttachEnabled
boolean

Whether the routine automatically attaches files to the interventions.

Example:

false

assignedCompanyContactId
integer

Unique identifier of the company contact assigned to the routine.

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

1

assignedUserId
integer

Unique identifier of the user assigned to the routine.

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

1

contractId
integer

Unique identifier of the contract associated with the routine.

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

1

Response

201 - application/json

Preventive routine created successfully

data
object
required