Jobs

Create a job constraint

Create a new job constraint. (required scope jobs:write)

post/v1/jobs/{jobId}/constraints

Path parameters

jobIdinteger required

The unique identifier of the job

Headers

Customer-Idinteger required

The customer identifier

Request body

type'jobMustStartAfter' | 'jobMustStartBefore' | 'jobMustCompleteBefore' | 'jobResource' | 'jobResourceGroup' | 'jobVehicle' | 'jobVehicleGroup' | 'jobMustStartInAvailableHours' | 'jobMustCompleteInAvailableHours' | 'jobRequiresResourceSkill' | 'jobRequiresVehicleAttribute' required

Enum of restriction rules that can be applied to a constraint<p>Possible values:</p><ul><li><b>jobMustStartAfter</b>: Job must start after a specified time</li><li><b>jobMustStartBefore</b>: Job must start before a specified time</li><li><b>jobMustCompleteBefore</b>: Job must complete before a specified time</li><li><b>jobResource</b>: Job resource</li><li><b>jobResourceGroup</b>: Job resource group</li><li><b>jobVehicle</b>: Job vehicle</li><li><b>jobVehicleGroup</b>: Job vehicle group</li><li><b>jobMustStartInAvailableHours</b>: Job must start within the available hours of the resource</li><li><b>jobMustCompleteInAvailableHours</b>: Job must complete within the available hours of the resource</li><li><b>jobRequiresResourceSkill</b>: Job requires a resource with the specified skill</li><li><b>jobRequiresVehicleAttribute</b>: Job requires a vehicle with the specified attribute</li></ul>

constraintAtstring date-time nullable

The date and time associated with the job constraint

entityIdinteger nullable

The unique identifier of the entity associated with the constraint. Required when Type is JobResource, JobResourceGroup, JobVehicle, JobVehicleGroup, JobRequiresResourceSkill, or JobRequiresVehicleAttribute. Must not be provided when Type is not JobResource, JobResourceGroup, JobVehicle, JobVehicleGroup, JobRequiresResourceSkill, or JobRequiresVehicleAttribute

Example request

{
  "type": "jobMustStartAfter",
  "constraintAt": "2024-07-01T09:00:00.0000000+00:00",
  "entityId": 12345
}

Response

Created

idinteger

Identifier of the newly created record