Skip to main content
POST
/
companies
/
v2
/
rs
/
{companyId}
/
contracts
/
training
Create a training contract
curl --request POST \
  --url https://z52mnqg347.execute-api.eu-west-3.amazonaws.com/main/companies/v2/rs/{companyId}/contracts/training \
  --header 'Authorization: Bearer <token>' \
  --header 'Content-Type: <content-type>' \
  --header 'X-Session-Token: <x-session-token>' \
  --data '
{
  "name": "Service Agreement",
  "description": "Annual renewal pending approval.",
  "reference": "Service Agreement",
  "duration": 12,
  "startAt": "2024-01-15T09:30:00.000Z",
  "interventionCount": 5,
  "document": {
    "name": "example.jpg",
    "mimeType": "image/jpeg",
    "size": 1024
  },
  "profileRuleIds": [
    1,
    2,
    3
  ],
  "routineIds": [
    1,
    2,
    3
  ]
}
'
{
  "data": {
    "id": 1,
    "name": "Service Agreement",
    "status": 1,
    "description": "Annual renewal pending approval.",
    "companyId": 123,
    "archivedAt": "2024-12-01T12:34:56.000Z",
    "updatedAt": "2024-12-01T12:34:56.000Z",
    "createdAt": "2024-01-15T09:30:00.000Z"
  },
  "upload": {
    "presignedUrl": "https://bucket.s3.amazonaws.com/1",
    "file": "file.txt"
  }
}

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"

Content-Type
enum<string>
required

Content type, must be "application/json".

Available options:
application/json

Path Parameters

companyId
integer
required

Unique identifier of the company.

Example:

1

Body

application/json
name
string
required

Name of the contract.

Maximum string length: 250
Example:

"Service Agreement"

description
string
required

Additional notes or description about the contract.

Maximum string length: 2500
Example:

"Annual renewal pending approval."

reference
string
required

Reference number of the contract document.

Maximum string length: 250
Example:

"Service Agreement"

duration
integer | null
required

Duration of the contract in a human-readable format.

Required range: x <= 200
Example:

12

startAt
required

Start date and time of the contract.

Example:

"2024-01-15T09:30:00.000Z"

interventionCount
integer | null
required

Number of interventions associated with the contract.

Example:

5

document
object
required
profileRuleIds
integer[]
required

Unique identifiers of the profile rules.

Example:
[1, 2, 3]
routineIds
integer[]
required

Unique identifiers of the routines.

Example:
[1, 2, 3]

Response

201 - application/json

Contract created

data
object
required
upload
object
required