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 job 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 job01-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
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
updatedAtDateTimeWhen this job was last modified"2021-03-24 17:26:46.983Z"

Enums​

JobState​

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

REST Endpoints​

GET /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 Request​

GET https://api.kojo.tech/jobs?limit=10&offset=20

Example Response​

[
{
"code": "01-300",
"createdAt": "2021-03-24 17:26:46.983Z",
"defaultLocation": null,
"defaultTaxCodeId": "cl478y6iq45873i4xc4ldfwir",
"id": "ckmnpybisiy5x08abky4g2d1f",
"name": "Salesforce Tower 32nd Floor",
"startDate": null,
"state": "OPEN",
"updatedAt": "2021-03-24 17:26:46.983Z"
},
{
"code": "01-301",
"createdAt": "2021-03-24 17:26:46.983Z",
"defaultLocation": "cl478y6iq45873i4xc4ldfwir",
"defaultTaxCodeId": null,
"id": "ckmnpybi7ag5x08abky4g2d1f",
"name": "Chase Center NE",
"startDate": null,
"state": "OPEN",
"updatedAt": "2021-03-24 17:26:46.983Z"
}
]

POST /jobs​

Creates a new job.

Parameters​

NameTypeDescriptionExample
codestringA unique human-readable code to represent this job01-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 Request​

POST https://api.kojo.tech/jobs
{
"code": "01-300",
"name": "Salesforce Tower 32nd Floor"
}

Example Response​

{
"code": "01-300",
"createdAt": "2021-03-24 17:26:46.983Z",
"defaultLocationId": "cl478y6gc44873i4x52s5w1tu",
"defaultTaxCodeId": "cl478y6j045973i4xd4yx5ads",
"id": "ckmnpybisiy5x08abky4g2d1f",
"name": "Salesforce Tower 32nd Floor",
"startDate": null,
"state": "OPEN",
"updatedAt": "2021-03-24 17:26:46.983Z"
}

POST /jobs/batch​

Creates or Updates jobs in batches.

warning

Batch endpoints will accept at most 1000 elements per request.

Parameters​

NameTypeDescription
inputsUpsertJobsInput[]A list of at most 1000 jobs for upsert
Upsert Jobs Input​
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 Request​

POST https://api.kojo.tech/jobs/batch
{
"inputs": [
{
"code": "01-300",
"name": "Salesforce Tower 32nd Floor"
},
{
"code": "01-301",
"name": "Oracle Tower"
}
]
}

Example Response​

[
{
"code": "01-300",
"id": "ckmnpybisiy5x08abky4g2d1f",
"name": "Salesforce Tower 32nd Floor",
"startDate": null,
"state": "OPEN",
"createdAt": "2021-03-24 17:26:46.983Z",
"updatedAt": "2021-03-24 17:26:46.983Z"
},
{
"code": "01-301",
"id": "ckmnpybisiy5x08abky4g2d1a",
"name": "Oracle Tower",
"startDate": null,
"state": "OPEN",
"createdAt": "2021-03-24 17:26:46.983Z",
"updatedAt": "2021-03-24 17:26:46.983Z"
}
]

GET /jobs/:idOrCode​

Read a single job by ID or code.

Parameters​

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

Response​

A single Job object.

Example Request​

GET https://api.kojo.tech/jobs/01-300

Example Response​

{
"code": "01-300",
"createdAt": "2021-03-24 17:26:46.983Z",
"defaultLocationId": null,
"defaultTaxCodeId": "cl478y6iq45873i4xc4ldfwir",
"id": "ckmnpybisiy5x08abky4g2d1f",
"name": "Salesforce Tower 32nd Floor",
"startDate": null,
"state": "OPEN",
"updatedAt": "2021-03-24 17:26:46.983Z"
}

PATCH /jobs/:idOrCode​

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 Request​

PATCH /jobs/01-300
{
"name": "Salesforce Tower 32nd Floor"
}

Example Response​

{
"code": "01-300",
"createdAt": "2021-03-24 17:26:46.983Z",
"defaultLocationId": null,
"defaultTaxCodeId": "cl478y6iq45873i4xc4ldfwir",
"id": "ckmnpybisiy5x08abky4g2d1f",
"name": "Salesforce Tower 32nd Floor",
"startDate": null,
"state": "OPEN",
"updatedAt": "2021-03-24 17:26:46.983Z"
}

GET /jobs/:idOrCode/locations​

Read locations on a specific job.

Parameters​

See Location pagination parameters

Response​

A list of Location objects.

Example Request​

GET https://api.kojo.tech/jobs/01-100/locations?limit=10

Example Response​

[
{
"addressLine1": "415 Mission St",
"addressLine2": null,
"city": "San Francisco",
"createdAt": "2021-03-24 17:26:46.983Z",
"directions": "Approach from the east on Howard St, turn right at \"Deliveries\" sign.",
"id": "ckmnpybixiy5y0817spfhmj78",
"latitude": null,
"longitude": null,
"name": "Salesforce Tower Rear Entrance",
"phone": null,
"type": "Jobsite",
"updatedAt": "2021-03-24 17:26:46.983Z",
"zipcode": "94105"
}
]

POST /jobs/:idOrCode/locations​

Add a location to a specific job.

Parameters​

NameTypeDescriptionExample
locationIdIDThe ID of the location to add to the job"ckmnpybisiy5x08abky4g2d1f"
shouldSetAsDefaultbooleanSet true if the location should be configured as the default location for the job.true

Response​

The updated Job object.

Example Request​

POST https://api.kojo.tech/jobs/01-300/locations?locationId=ckmnpybisiy5x08abky4g2d1f&shouldSetAsDefault=true

Example Response​

{
"code": "01-300",
"createdAt": "2021-03-24 17:26:46.983Z",
"defaultLocationId": "cl478y6gc44873i4x52s5w1tu",
"defaultTaxCodeId": "cl478y6j045973i4xd4yx5ads",
"id": "ckmnpybisiy5x08abky4g2d1f",
"name": "Salesforce Tower 32nd Floor",
"startDate": null,
"state": "OPEN",
"updatedAt": "2021-03-24 17:26:46.983Z"
}

DELETE /jobs/:idOrCode/locations​

Remove a location from a specific job. If the deleted location is the default location for the job, the default location will be automatically set to a different location on the job.

Parameters​

NameTypeDescriptionExample
locationIdIDThe ID of the location to remove from the job"ckmnpybisiy5x08abky4g2d1f"

Response​

The updated Job object.

Example Request​

DELETE https://api.kojo.tech/jobs/01-300/locations?locationId=ckmnpybisiy5x08abky4g2d1f

Example Response​

{
"code": "01-300",
"createdAt": "2021-03-24 17:26:46.983Z",
"defaultLocationId": "cl478y6gc44873i4x52s5w1tu",
"defaultTaxCodeId": "cl478y6j045973i4xd4yx5ads",
"id": "ckmnpybisiy5x08abky4g2d1f",
"name": "Salesforce Tower 32nd Floor",
"startDate": null,
"state": "OPEN",
"updatedAt": "2021-03-24 17:26:46.983Z"
}

GET /jobs/:idOrCode/phases​

Read the phases associated with a job.

Parameters​

See Phase pagination parameters.

Response​

A list of Phase objects.

Example Request​

GET https://api.kojo.tech/jobs/01-300/phases?limit=10

Example Response​

[
{
"code": "L",
"createdAt": "2021-03-24 17:26:46.983Z",
"description": "Lighting",
"id": "ckmnpybixiy5y0817spfhmj78",
"updatedAt": "2021-03-24 17:26:46.983Z"
}
]

POST /jobs/:idOrCode/phases​

Creates a job phase. Exactly the same as POST /job-phases except that the jobCode or jobId parameter is taken from the URL.

GET /jobs/:jobIdOrCode/phases/:idOrCode​

Gets a single job phase. Exactly the same as GET /job-phases/:idOrCode except that the id, code, jobCode, and/or jobId parameters are taken from the URL as appropriate.

PATCH /jobs/:jobIdOrCode/phases/:idOrCode​

Updates a job phase. Exactly the same as PATCH /job-phases/:idOrCode except that the id, code, jobCode, and/or jobId parameters are taken from the URL as appropriate.

GET /jobs/:idOrCode/users​

Get users associated with a job.

Parameters​

See User pagination parameters

Response​

A list of User objects.

Example Request​

GET https://api.kojo.tech/jobs/ckmnpybisiy5x08abky4g2d1f/users?limit=10

Example Response​

[
{
"activated": true,
"admin": false,
"createdAt": "2021-03-24 17:26:46.983Z",
"email": "foreman.bob@usekojo.com",
"id": "ckmnpybixiy5y0817spfhmj78",
"name": "Foreman Bob",
"phone": "415-867-5309",
"role": "Field",
"updatedAt": "2021-03-24 17:26:46.983Z"
}
]

POST /jobs/:idOrCode/users​

Add a user to a specific job.

Parameters​

NameTypeDescriptionExample
userIdIDThe ID of the user to add to the job"ckmnpybisiy5x08abky4g2d1f"

Response​

The updated Job object.

Example Request​

POST https://api.kojo.tech/jobs/01-300/users?userId=ckmnpybisiy5x08abky4g2d1f

Example Response​

{
"code": "01-300",
"createdAt": "2021-03-24 17:26:46.983Z",
"defaultLocationId": "cl478y6gc44873i4x52s5w1tu",
"defaultTaxCodeId": "cl478y6j045973i4xd4yx5ads",
"id": "ckmnpybisiy5x08abky4g2d1f",
"name": "Salesforce Tower 32nd Floor",
"startDate": null,
"state": "OPEN",
"updatedAt": "2021-03-24 17:26:46.983Z"
}

DELETE /jobs/:idOrCode/users​

Remove a user from a specific job.

Parameters​

NameTypeDescriptionExample
userIdIDThe ID of the user to remove from the job"ckmnpybisiy5x08abky4g2d1f"

Response​

The updated Job object.

Example Request​

DELETE https://api.kojo.tech/jobs/01-300/users?userId=ckmnpybisiy5x08abky4g2d1f

Example Response​

{
"code": "01-300",
"createdAt": "2021-03-24 17:26:46.983Z",
"defaultLocationId": "cl478y6gc44873i4x52s5w1tu",
"defaultTaxCodeId": "cl478y6j045973i4xd4yx5ads",
"id": "ckmnpybisiy5x08abky4g2d1f",
"name": "Salesforce Tower 32nd Floor",
"startDate": null,
"state": "OPEN",
"updatedAt": "2021-03-24 17:26:46.983Z"
}

GET /jobs/:idOrCode/nextPurchaseOrderNumber​

Gets the next purchase order number that will be generated for that job.

Example Request​

GET https://api.kojo.tech/jobs/01-300/nextPurchaseOrderNumber

Example Response​

{
"nextPurchaseOrderNumber": 12
}

POST /jobs/:idOrCode/nextPurchaseOrderNumber​

Sets the next purchase order number to be used when a new purchase order is created. 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.

Parameters​

NameTypeDescriptionExample
nextCounterIntegerThe next purchase order number10

Response​

The updated Job object.

Example Request​

POST https://api.kojo.tech/jobs/12412427/nextPurchaseOrderNumber
{
"nextCounter": 25
}

Example Response​

{
"code": "12412427",
"createdAt": "2023-12-01T00:47:19.148Z",
"defaultLocationId": null,
"defaultTaxCodeId": null,
"id": "clplwnip7019r8ohueet287tv",
"name": "SFMTA 3rd Street Rail",
"startDate": null,
"state": "OPEN",
"updatedAt": "2023-12-01T00:47:19.148Z",
"hasPhaseCodes": false,
"nextPurchaseOrderCounter": 12
}