Contractor organization groups

Groups are a subset of contractor organization categories. For example, electrical, cleaning, and maintenance could be groups under the facilities category. They are used to organize your organizations and make it easier to report on them and create triggers.

Use the API to retrieve your groups list or add, update or delete a group.

Learn more about contractor organization groups in the OnLocation Help Center.

List contractor organization groups

Returns a list of contractor organization groups.

Responses
200

List of contractor organization groups

400

Invalid Input

403

Access denied to this resource

500

Internal server error

get/sp/org/group
Request samples
curl -i -X GET \
  https://api.whosonlocation.com/v1/sp/org/group
Response samples
[
  • {
    }
]

Create a contractor organization group

Creates a new contractor organization group with the provided details.

Request
Request Body schema: application/json

Information used to create a new contractor organization group

category_id
integer <int32>

Contractor organization category ID

name
string <string>

Name of the contractor organization group

Responses
201

Created resource

400

Invalid input

403

Access denied to this resource

500

Internal server error

post/sp/org/group
Request samples
application/json
{
  • "category_id": 1,
  • "name": "Drivers"
}
Response samples
{
  • "category_id": 1,
  • "name": "Drivers"
}

Retrieve a contractor organization group

Retrieves a contractor organization group by its ID.

Request
path Parameters
id
required
integer

ID of the contractor organization group to retrieve

Responses
200

Contractor organization group found

403

Access denied to this resource

404

Contractor organization group not found

500

Internal server error

get/sp/org/group/{id}
Request samples
curl -i -X GET \
  https://api.whosonlocation.com/v1/sp/org/group/:id
Response samples
{
  • "id": 1,
  • "name": "Drivers",
  • "category_id": 1,
  • "created": "2023-05-12 09:30:00"
}

Update a contractor organization group

Updates the details of a contractor organization group.

Request
path Parameters
id
required
integer <int32>

ID of the contractor organization group to update

Request Body schema: application/json

Information used to update the contractor organization group record

name
string <string>

Name of the contractor organization group

Responses
200

Updated resource

400

Invalid Input

403

Access denied to this resource

404

Contractor organization group not found

500

Internal server error

put/sp/org/group/{id}
Request samples
application/json
{
  • "name": "Drivers"
}
Response samples
{
  • "id": 1,
  • "name": "Drivers",
  • "category_id": 1,
  • "created": "2023-05-12 09:30:00"
}

Delete a contractor organization group

Deletes a contractor organization group by its ID.

Request
path Parameters
id
required
integer

ID of the contractor organization group to delete

Responses
204

Contractor organization group deleted successfully

403

Access denied to this resource

404

Contractor organization group not found

409

Not deleted as contractor organizations found attached to the group

500

Internal server error

delete/sp/org/group/{id}
Request samples
curl -i -X DELETE \
  https://api.whosonlocation.com/v1/sp/org/group/:id