Skip to main content
POST
/
routines
/
v1
/
rs
/
training
Create a training routine
curl --request POST \
  --url https://z52mnqg347.execute-api.eu-west-3.amazonaws.com/main/routines/v1/rs/training \
  --header 'Authorization: Bearer <token>' \
  --header 'content-type: <content-type>' \
  --header 'x-session-token: <x-session-token>' \
  --data '
{
  "ruleIds": [
    1,
    2,
    3
  ],
  "userIds": [
    1,
    2,
    3
  ],
  "name": "Monthly Maintenance",
  "autoCreateEnabled": true,
  "assignedCompanyContactId": 1,
  "contractId": 1,
  "description": "This routine involves monthly maintenance checks for all equipment."
}
'
{
  "id": 1,
  "name": "Monthly Maintenance",
  "description": "This routine involves monthly maintenance checks for all equipment.",
  "type": 2,
  "autoCreateEnabled": true,
  "assignedCompanyContactId": 1,
  "assignedUserId": 1,
  "contractId": 1,
  "archivedAt": "2024-12-01T12:34:56.000Z",
  "updatedAt": "2024-12-05T14:56:23.000Z",
  "createdAt": "2024-01-15T08:45:00.000Z"
}

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 training routine

ruleIds
integer[]
required

List of rule IDs to associate with the profile.

Minimum array length: 1

Unique identifier of the rule.

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

Unique identifiers of the users.

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

assignedCompanyContactId
integer | null
required

Unique identifier of the company contact assigned to the routine.

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

1

contractId
integer | null
required

Unique identifier of the contract associated with the routine.

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

1

description
string | null

Description of the routine.

Maximum string length: 2500
Example:

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

Response

201 - application/json

Training routine created successfully

id
integer
required

Unique identifier of the routine.

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

1

name
string
required

Name of the routine.

Maximum string length: 250
Example:

"Monthly Maintenance"

description
string | null
required

Description of the routine.

Maximum string length: 2500
Example:

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

type
number
required

Type of the routine (1: training, 2: training).

Example:

2

autoCreateEnabled
boolean
required

Whether the routine automatically creates interventions.

Example:

true

assignedCompanyContactId
integer | null
required

Unique identifier of the company contact assigned to the routine.

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

1

assignedUserId
integer | null
required

Unique identifier of the user assigned to the routine.

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

1

contractId
integer | null
required

Unique identifier of the contract associated with the routine.

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

1

archivedAt
required

Date and time when the routine was archived.

Pattern: ^(?:(?:\d\d[2468][048]|\d\d[13579][26]|\d\d0[48]|[02468][048]00|[13579][26]00)-02-29|\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\d|30)|(?:02)-(?:0[1-9]|1\d|2[0-8])))T(?:(?:[01]\d|2[0-3]):[0-5]\d(?::[0-5]\d(?:\.\d+)?)?(?:Z))$
Example:

"2024-12-01T12:34:56.000Z"

updatedAt
required

Date of the last update of the anomaly.

Pattern: ^(?:(?:\d\d[2468][048]|\d\d[13579][26]|\d\d0[48]|[02468][048]00|[13579][26]00)-02-29|\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\d|30)|(?:02)-(?:0[1-9]|1\d|2[0-8])))T(?:(?:[01]\d|2[0-3]):[0-5]\d(?::[0-5]\d(?:\.\d+)?)?(?:Z))$
Example:

"2024-12-05T14:56:23.000Z"

createdAt
required

Date of anomaly creation.

Pattern: ^(?:(?:\d\d[2468][048]|\d\d[13579][26]|\d\d0[48]|[02468][048]00|[13579][26]00)-02-29|\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\d|30)|(?:02)-(?:0[1-9]|1\d|2[0-8])))T(?:(?:[01]\d|2[0-3]):[0-5]\d(?::[0-5]\d(?:\.\d+)?)?(?:Z))$
Example:

"2024-01-15T08:45:00.000Z"