Contractor insurance policies

Insurance management in OnLocation is used to manage contractor organizations' insurance policies. Use the API to retrieve a list of all insurance policies, add new ones, and update or delete existing policies.

Learn more about insurances in the OnLocation Help Center.

List all insurance policies

Returns a list of all contractor insurance policy records.

A comma separated list of tag:value search parameters, a colon separator performs an exact match and a percent separator performs a starts-with search.

Request
query Parameters
q
string <string>

Filter by any contractor insurance value

Example: q=name:ACME
order
string <string>

Specifies an element to order by. Order by any element returned, prefix with a - to reverse order.

Example: order=-org_id
limit
integer <int32>

Limits the amount of records to return

Example: limit=10
header Parameters
If-Modified-Since
string <int32>

A UTC timestamp (yyyy-mm-ddThh:mm:ss). Only entities created or modified since this timestamp will be returned e.g. 2009-11-12T00:00:00

Responses
200

List of contractor insurance records

403

Access denied to this resource

404

Resource not found

500

Internal server error

get/sp/insurance
Request samples
curl -i -X GET \
  'https://api.whosonlocation.com/v1/sp/insurance?q=string&order=string&limit=0' \
  -H 'If-Modified-Since: string'
Response samples
[
  • {
    }
]

Create an insurance policy

Add a new contractor insurance policy.

Request
Request Body schema: application/json

The contractor insurance record to add to an organization:

org_id
integer <int32>
type
string <string>
name
string <string>
reference
string <string>
value
string <string>
start
string <date>
expires
string <date>
Responses
201

Resource created

403

Access denied to this resource

500

Internal server error

post/sp/insurance
Request samples
application/json
{
  • "org_id": 4587,
  • "type": "other",
  • "name": "Policy Underwriter",
  • "reference": "Ref002",
  • "value": "6000",
  • "start": "2021-11-30",
  • "expires": "2022-11-29"
}
Response samples
{
  • "id": 140,
  • "created": "2021-11-29T08:10:09+13:00",
  • "modified": "2022-11-29T08:10:09+13:00",
  • "org_id": 4587,
  • "org_name": "Example Organisation Name",
  • "type": "other",
  • "name": "Policy Underwriter",
  • "reference": "Ref002",
  • "value": "6000",
  • "start": "2021-11-30",
  • "expires": "2022-11-29",
  • "status": "Active",
  • "tags": [
    ],
  • "documents": []
}

Retrieve an insurance policy

Retrieves a single contractor insurance record, filtering with the provided ID.

Request
path Parameters
id
required
integer <int32>

ID of the contractor insurance record to retrieve

Example: id=140
Responses
200

Policy returned

403

Access denied to resource.

404

Resource not found

500

Internal server error

get/sp/insurance/{id}
Request samples
curl -i -X GET \
  https://api.whosonlocation.com/v1/sp/insurance/:id
Response samples
{
  • "id": 140,
  • "created": "2021-11-29T08:10:09+13:00",
  • "modified": "2022-11-29T08:10:09+13:00",
  • "org_id": 4587,
  • "org_name": "Example Organisation Name",
  • "type": "other",
  • "name": "Policy Underwriter",
  • "reference": "Ref002",
  • "value": "6000",
  • "start": "2021-11-30",
  • "expires": "2022-11-29",
  • "status": "Active",
  • "tags": [
    ],
  • "documents": []
}

Update an insurance policy

Updates a contractor insurance policy using the provided ID.

Request
path Parameters
id
required
integer <int32>

ID of the contractor insurance record to update

Example: id=140
Request Body schema: application/json

Information used to create the insurance policy record:

org_id
integer <int32>
type
string <string>
name
string <string>
reference
string <string>
value
string <string>
start
string <date>
expires
string <date>
Responses
200

Updated policy

403

Access denied to this resource

500

Internal server error

put/sp/insurance/{id}
Request samples
application/json
{
  • "org_id": 4587,
  • "type": "other",
  • "name": "Policy Underwriter",
  • "reference": "Ref002",
  • "value": "6000",
  • "start": "2021-11-30",
  • "expires": "2022-11-29"
}
Response samples
{
  • "id": 140,
  • "created": "2021-11-29T08:10:09+13:00",
  • "modified": "2022-11-29T08:10:09+13:00",
  • "org_id": 4587,
  • "org_name": "Example Organisation Name",
  • "type": "other",
  • "name": "Policy Underwriter",
  • "reference": "Ref002",
  • "value": "6000",
  • "start": "2021-11-30",
  • "expires": "2022-11-29",
  • "status": "Active",
  • "tags": [
    ],
  • "documents": []
}

Delete an insurance policy

Deletes a contractor insurance policy based on the provided ID.

Request
path Parameters
id
required
integer <int32>

ID of the contractor insurance record to delete

Responses
204

Policy deleted

403

Access denied to resource

404

Resource not found

500

Internal server error

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