---
title: "Create a job constraint"
method: POST
path: "/v1/jobs/{jobId}/constraints"
tags: ["Jobs"]
---

# Create a job constraint

`POST /v1/jobs/{jobId}/constraints`

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

## Path parameters

- `jobId` integer, required

## Headers

- `Customer-Id` integer, required

## Request body

- CreateJobConstraintModel — Represents a model that holds information about creating a job constraint
  - `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>
  - `constraintAt` string, date-time, nullable — The date and time associated with the job constraint
  - `entityId` integer, 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

## Response `201`

Created

- PostResponseInt64 — Represents a response for a POST request, containing the ID of the newly created record
  - `id` integer — Identifier of the newly created record

## Other responses

- `400` — Bad Request
- `403` — Forbidden
- `422` — Unprocessable Content
- `500` — Internal Server Error

---

[API](https://skmtc.net/bigchange/apis/bigchange-dx.md) · [All operations](https://skmtc.net/bigchange/apis/bigchange-dx/llms.txt) · [OpenAPI document](https://skmtc-service-staging.skmtc.workers.dev/v1/apis/bigchange/bigchange-dx/revisions/916e669fc527/schema)
