Update job

Update an existing job or sub-job by its unique ID.

PUT /jobs/v1/jobs/{jobId}

Restrictions

🚧

Important

You cannot update a parent job that has sub-jobs. Update the sub-jobs individually instead.

  • Cannot change a sub-job's parent (parentId cannot be modified)
  • Title must be unique

Path Parameters

ParameterTypeRequiredDescription
jobIdstringYesThe unique identifier of the job or sub-job

Request Body (Parent Job)

FieldTypeRequiredDescription
titlestringYesJob title (max 128 characters)
codestringNoJob code identifier
descriptionstringNoJob description
colorstringNoHex color code
gpsobjectNoLocation data
assignobjectYesAssignment settings
instanceIdsarrayNoUpdate assigned scheduler/time clock IDs
customFieldsarrayNoCustom field values

Request Body (Sub-Job)

FieldTypeRequiredDescription
parentIdstringYesID of the parent job (cannot be changed)
titlestringYesSub-job title
codestringNoSub-job code
useParentDatabooleanYesWhether to inherit from parent
descriptionstringConditionalRequired if useParentData is false
gpsobjectConditionalRequired if useParentData is false
assignobjectConditionalRequired if useParentData is false
customFieldsarrayNoCustom field values

Example: Update Parent Job

Request

{
  "title": "Updated Job Title",
  "code": "UPD-001",
  "description": "Updated description",
  "color": "#3968BB",
  "gps": {
    "address": "456 New Address, City",
    "longitude": -77.12,
    "latitude": 38.98
  },
  "assign": {
    "type": "both",
    "userIds": [],
    "groupIds": [1123124, 1234456]
  }
}

Response

{
  "requestId": "abc123-def456",
  "data": {
    "job": {
      "jobId": "9fdebf1f-0c69-4914-89d2-8f86c3e5f47d",
      "title": "Updated Job Title",
      "code": "UPD-001",
      "color": "#3968BB",
      "description": "Updated description",
      "gps": {
        "address": "456 New Address, City",
        "longitude": -77.12,
        "latitude": 38.98
      },
      "isDeleted": false,
      "assign": {
        "type": "both",
        "userIds": [],
        "groupIds": ["1123124", "1234456"]
      },
      "useParentData": false,
      "parentId": null,
      "subJobs": [],
      "instanceIds": [6833518],
      "customFields": []
    }
  }
}

Example: Update Sub-Job

When updating a sub-job, you must include the parentId and useParentData fields.

Request (inheriting from parent)

{
  "parentId": "19cc77e2-0aab-4578-a79c-0d8160671a34",
  "title": "Updated Sub-Job Title",
  "code": "SUB-UPD",
  "useParentData": true
}

Request (with custom settings)

{
  "parentId": "19cc77e2-0aab-4578-a79c-0d8160671a34",
  "title": "Updated Sub-Job Title",
  "code": "SUB-UPD",
  "useParentData": false,
  "description": "Custom description for sub-job",
  "assign": {
    "type": "both",
    "userIds": [7031021],
    "groupIds": []
  }
}

Error Responses

StatusErrorDescription
400This API does not support updating a job with sub-jobsUpdate sub-jobs individually
400Cannot update sub-job parentparentId cannot be changed
400Invalid instance idsinstanceIds don't exist
400Job name already existsTitle must be unique
400assign must be defined when use_parent_data is falseMissing required field
404Job not foundjobId doesn't exist

Update Job API reference


What’s Next