Skip to main content

Jobs

Jobs in Kojo are the top level organization for construction, service or maintenance projects that your company is working on. In some external systems they may also be called "Projects" (Procore, PlanGrid). Other systems may have "Work Orders" (COINS) or "Service Jobs" (Sage) or use a "type" field to indicate special project types, but Kojo does not make such a distinction. These concepts should map directly to Jobs in Kojo.

important

If your system uses "sub-jobs" to classify phases, the Phase entity in Kojo should be used.

Schema​

Job​

NameTypeDescriptionExample
idIDThe unique job ID"ckmnpybisiy5x08abky4g2d1f"
codestringA unique human-readable code to represent this job"01-300"
createdAtDateTimeWhen this job was created"2021-03-24 17:26:46.983Z"
defaultLocationLocation?The default location for orders associated with this jobSee Location docs
defaultTaxCodeTaxCode?The default tax code to use for orders associated with this jobSee TaxCode docs
locationsLocation[]The locations associated with this jobSee Location docs
namestringThe job name"Salesforce Tower 32nd Floor"
phasesPhase[]The phases of this jobSee Phase docs
costCategoriesCostCategory[]The cost categories of this jobSee CostCategory docs
startDateDateTime?When this job was started"2021-03-24 17:26:46.983Z"
stateJobStateThe current state of the jobOPEN
usersUser[]The users tied to this jobSee User docs
updatedAtDateTimeWhen this job was last modified"2021-03-24 17:26:46.983Z"
nextPurchaseOrderCounterNumberNext purchase order number100
isWorkOrderbooleanis job a work ordertrue

Enums​

JobState​

ValueDescription
OPENThe job is currently active.
CLOSEDThe job has been closed or cancelled

Queries​

job​

Read a single job. You must specify either the job ID or the job code.

Parameters​

NameDescriptionExample
idThe ID of the job to fetch"ckmnpybisiy5x08abky4g2d1f"
codeThe code of the job to fetch"01-300"

Response​

A single Job object.

Example Query​

query {
job(code: "01-300") {
code
id
name
}
}

Example Response​

{
"code": "01-300",
"id": "ckmnpybisiy5x08abky4g2d1f",
"name": "Salesforce Tower 32nd Floor"
}

jobs​

Read all jobs, with pagination.

Parameters​

Accepts all standard pagination parameters.

Allowed orderBy fields: code, createdAt, id, name, startDate, updatedAt.

Allowed filter fields: code, createdAt, id, name, startDate, state, updatedAt.

Response​

A list of Job objects.

Example Query​

query {
jobs(limit: 10, orderBy: code) {
code
id
name
}
}

Example Response​

[
{
"code": "01-300",
"id": "ckmnpybisiy5x08abky4g2d1f",
"name": "Salesforce Tower 32nd Floor"
},
{
"code": "01-301",
"id": "ckmnpybi7ag5x08abky4g2d1f",
"name": "Kojo Center NE"
}
]

Mutations​

addLocationToJob​

Adds a Location to a job.

Parameters​

NameTypeDescriptionExample
jobIdIDThe job ID."ckmnpybisiy5x08abky4g2d1f"
locationIdIDThe location ID."ckb91ih6801ny0733cq3xncft"

Response​

Returns the Job to which the location was added.

Example Mutation​

mutation {
addLocationToJob(
jobId: "ckmnpybisiy5x08abky4g2d1f"
locationId: "ckb91ih6801ny0733cq3xncft"
) {
id
}
}

Example Response​

{
"id": "ckmnpybisiy5x08abky4g2d1f"
}

removeLocationFromJob​

Removes a Location from a job. Either the job id or job code must be provided to uniquely identify which job to remove the location from.

Parameters​

NameTypeDescriptionExample
jobIdIDThe job ID."ckmnpybisiy5x08abky4g2d1f"
jobCodeStringThe job code."01-301"
locationIdIDThe location ID."ckb91ih6801ny0733cq3xncft"

Response​

Returns the Job to which the location was removed.

Example Mutation​

mutation {
removeLocationFromJob(
jobId: "ckmnpybisiy5x08abky4g2d1f"
locationId: "ckb91ih6801ny0733cq3xncft"
) {
id
}
}

Example Response​

{
"id": "ckmnpybisiy5x08abky4g2d1f"
}

addUserToJob​

Adds a User to a job.

Parameters​

NameTypeDescriptionExample
jobIdIDThe job ID."ckmnpybisiy5x08abky4g2d1f"
userIdIDThe user ID."ckb91ih6801ny0733cq3xncft"

Response​

Returns the Job to which the user was added.

Example Mutation​

mutation {
addUserToJob(
jobId: "ckmnpybisiy5x08abky4g2d1f"
userId: "ckb91ih6801ny0733cq3xncft"
)
}

Example Response​

{
"code": "01-300",
"id": "ckmnpybisiy5x08abky4g2d1f",
"name": "Salesforce Tower 32nd Floor"
}

removeUserFromJob​

Removes a User from a job.

Parameters​

NameTypeDescriptionExample
jobIdIDThe job ID."ckmnpybisiy5x08abky4g2d1f"
userIdIDThe user ID."ckb91ih6801ny0733cq3xncft"

Response​

Returns the Job from which the user was removed.

Example Mutation​

mutation {
removeUserFromJob(
jobId: "ckmnpybisiy5x08abky4g2d1f"
userId: "ckb91ih6801ny0733cq3xncft"
) {
code
id
name
}
}

Example Response​

{
"code": "01-300",
"id": "ckmnpybisiy5x08abky4g2d1f",
"name": "Salesforce Tower 32nd Floor"
}

createJob​

Creates a new job.

Parameters​

NameTypeDescriptionExample
codestringA unique human-readable code to represent this job"01-300"
defaultLocationIdIDThe id of default location for orders associated with this job"ckmnpybisiy5x08abky4g2d1f"
defaultTaxCodeIdIDThe id of the default tax code to use for orders associated with this job"ckmnpybisiy5x08abky4g2d1f"
namestringThe job name"Salesforce Tower 32nd Floor"
startDateDateTime?When this job was started"2021-03-24 17:26:46.983Z"
stateJobStateThe current state of the jobOPEN

Response​

The created Job.

Example Mutation​

mutation {
createJob(
code: "01-300"
name: "Salesforce Tower 32nd Floor"
state: OPEN
) {
code
id
name
}
}

Example Response​

{
"code": "01-300",
"id": "ckmnpybisiy5x08abky4g2d1f",
"name": "Salesforce Tower 32nd Floor"
}

updateJob​

Updates a job. You must specify either the job ID or the job code.

Parameters​

NameTypeDescriptionExample
idIDThe ID of the job to update."ckmnpybisiy5x08abky4g2d1f"
codestringThe code of the job to update. If both id and code are provided, the job's code will be updated to this value."01-100"
defaultLocationIdIDThe id of default location for orders associated with this job"ckmnpybisiy5x08abky4g2d1f"
defaultTaxCodeIdIDThe id of the default tax code to use for orders associated with this job"ckmnpybisiy5x08abky4g2d1f"
namestring?The job name"Salesforce Tower 32nd Floor"
stateJobState?The current state of the jobOPEN
startDateDateTime?When this job was started"2021-03-24 17:26:46.983Z"

Response​

The updated Job.

Example Mutation​

mutation {
updateJob(
id: "ckmnpybisiy5x08abky4g2d1f"
name: "Salesforce Tower 32nd Floor"
state: OPEN
) {
code
id
name
}
}

Example Response​

{
"code": "01-300",
"id": "ckmnpybisiy5x08abky4g2d1f",
"name": "Salesforce Tower 32nd Floor"
}

upsertJobs​

Creates or Updates multiple jobs.

Parameters​

NameTypeDescriptionExample
codestringThe code of the job to update."01-100"
namestringThe job name"Salesforce Tower 32nd Floor"
defaultLocationIdID?The id of default location for orders associated with this job"ckmnpybisiy5x08abky4g2d1f"
defaultTaxCodeIdID?The id of the default tax code to use for orders associated with this job"ckmnpybisiy5x08abky4g2d1f"
stateJobState?The current state of the jobOPEN
startDateDateTime?When this job was started"2021-03-24 17:26:46.983Z"

Response​

A list of Jobs.

Example Mutation​

mutation {
upsertJobs(
inputs: [
{
id: "ckmnpybisiy5x08abky4g2d1f"
name: "Salesforce Tower 32nd Floor"
state: OPEN
}
]
) {
code
id
name
}
}

Example Response​

[
{
"code": "01-300",
"id": "ckmnpybisiy5x08abky4g2d1f",
"name": "Salesforce Tower 32nd Floor"
}
]

updatePurchaseOrderJobNextCounter​

Updates the counter for purchase order number generation. Only works if purchase order number generation is set up on a Job basis. Example: If the current PO number for a job (123) is 100, setting nextCounter to 500 will result in the next Purchase Order to start counting from 500.

important

This feature needs to be enabled by customer support request.

caution

If the counter value is already in use, the system will keep incrementing by 1 until a free slot is found.

Example Mutation​

mutation {
updatePurchaseOrderJobNextCounter(jobId: "clplwnip7019r8ohueet287tv", nextCounter: 10){
id
name
nextPurchaseOrderCounter
}
}

Example Response​

{
"data": {
"updatePurchaseOrderJobNextCounter": {
"id": "clplwnip7019r8ohueet287tv",
"name": "SFMTA 3rd Street Rail",
"nextPurchaseOrderCounter": 10
}
}
}