Contractor organizations

A contractor organization is contracted to provide a service. Each organization has a profile in OnLocation that includes contact information, status, location access, insurance policies, and linked members.

Use the API to retrieve your contractor organization list, or add, update or delete an organization profile.

To manage which organizations a member belongs to, use the contractor membership endpoint.

Learn more about contractor organizations in the OnLocation Help Center.

List all organizations

Returns a list of all contractor organizations.

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 organization value. It is not possible to filter by customfield-elements at this point.

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

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

Example: order=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 organizations

403

Access denied to this resource

404

Resource not found

500

Internal server error

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

Create an organization

Create a new contractor organization.

Request
Request Body schema: application/json

Information to save to the database

name
string <string>
type
string
Enum: "Charitable organization" "Discretionary Trading Trust" "Government Agency" "Family Partnership" "Fixed Unit Trust" "Hospital" "Individual/Sole Trader" "Limited Liability Company" "Local Body Agency" "Other Trust" "Partnership" "Private Company" "Publicly Listed Company" "Sole Proprietorship | Sole Trader"
tradingas
string <string>
legalid
string <string>
legalid_type
string <string>
address
string <string>
country
string
Enum: "AF" "AL" "DZ" "AS" "AD" "AO" "AI" "AQ" "AG" "AR" "AM" "AW" "AU" "AT" "AZ" "BS" "BH" "BD" "BB" "BY" "BE" "BZ" "BJ" "BM" "BT" "BO" "BA" "BW" "BV" "BR" "IO" "BN" "BG" "BF" "BI" "KH" "CM" "CA" "CV" "KY" "CF" "TD" "CL" "CN" "CX" "CC" "CO" "KM" "CG" "CD" "CK" "CR" "CI" "HR" "CU" "CY" "CZ" "DK" "DJ" "DM" "DO" "TP" "EC" "EG" "SV" "GQ" "ER" "EE" "ET" "FK" "FO" "FJ" "FI" "FR" "GF" "PF" "TF" "GA" "GM" "GE" "DE" "GH" "GI" "GR" "GL" "GD" "GP" "GU" "GT" "GN" "GW" "GY" "HT" "HM" "VA" "HN" "HK" "HU" "IS" "IN" "ID" "IR" "IQ" "IE" "IL" "IT" "JM" "JP" "JO" "KZ" "KE" "KI" "KP" "KR" "KW" "KG" "LA" "LV" "LB" "LS" "LR" "LY" "LI" "LT" "LU" "MO" "MK" "MG" "MW" "MY" "MV" "ML" "MT" "MH" "MQ" "MR" "MU" "YT" "MX" "FM" "MD" "MC" "MN" "MS" "MA" "MZ" "MM" "NA" "NR" "NP" "NL" "AN" "NC" "NZ" "NI" "NE" "NG" "NU" "NF" "MP" "NO" "OM" "PK" "PW" "PA" "PG" "PY" "PE" "PH" "PN" "PL" "PT" "PR" "QA" "RE" "RO" "RU" "RW" "KN" "LC" "VC" "WS" "SM" "ST" "SA" "SN" "SC" "SL" "SG" "SK" "SI" "SB" "SO" "ZA" "GS" "ES" "LK" "SH" "PM" "SD" "SR" "SJ" "SZ" "SE" "CH" "SY" "TW" "TJ" "TZ" "TH" "TG" "TK" "TO" "TT" "TN" "TR" "TM" "TC" "TV" "UG" "UA" "AE" "GB" "US" "UM" "UY" "UZ" "VU" "VE" "VN" "VG" "VI" "WF" "EH" "YE" "ZM" "ZW"
email
string <string>
phone
string <string>
organization_owner
integer <int32>
status
string
Enum: "pending" "active" "on-hold" "inactive"
Array of objects (ContractorLocation)
object

This will return an object of custom fields set for contractor-organisations. The key of the custom field corresponds to the ID of the custom fields when using the Customfield endpoint

Responses
201

Organization created

403

Access denied to this resource

500

Internal server error

post/sp/org
Request samples
application/json
{
  • "name": "Contractor Organisation Name",
  • "type": "Charitable organization",
  • "tradingas": "Contractor Organisation Name",
  • "legalid": "lid005",
  • "legalid_type": "legal ID type",
  • "address": "2 Water Street, New York, NY, USA",
  • "country": "NZ",
  • "email": "sp.organisation@whosonlocation.com",
  • "phone": "+1 206 555 0123",
  • "organization_owner": 823431,
  • "status": "active",
  • "locations": [
    ],
  • "cf": {
    }
}
Response samples
application/json
{
  • "id": 4587,
  • "created": "2021-09-03T15:16:44+12:00",
  • "modified": "2021-11-29T09:51:00+13:00",
  • "name": "Contractor Organisation Name",
  • "setup_by": 653,
  • "type": "Charitable organization",
  • "tradingas": "Contractor Organisation Name",
  • "legalid": "lid005",
  • "legalid_type": "legal ID type",
  • "address": "2 Water Street, New York, NY, USA",
  • "country": "NZ",
  • "status": "active",
  • "email": "sp.organisation@whosonlocation.com",
  • "phone": "+1 206 555 0123",
  • "locations": [
    ],
  • "policies": 2,
  • "members": [
    ],
  • "organization_owner": 823431,
  • "logs": [
    ],
  • "customfields": {
    }
}

Retrieve an organization

Retrieves a single contractor organization, filtering with the provided ID.

Request
path Parameters
id
required
integer <int32>

ID of the contractor organization to retrieve

Responses
200

Organization returned

403

Access denied to resource

404

Resource not found

500

Internal server error

get/sp/org/{id}
Request samples
curl -i -X GET \
  https://api.whosonlocation.com/v1/sp/org/:id
Response samples
{
  • "id": 4587,
  • "created": "2021-09-03T15:16:44+12:00",
  • "modified": "2021-11-29T09:51:00+13:00",
  • "name": "Contractor Organisation Name",
  • "setup_by": 653,
  • "type": "Charitable organization",
  • "tradingas": "Contractor Organisation Name",
  • "legalid": "lid005",
  • "legalid_type": "legal ID type",
  • "address": "2 Water Street, New York, NY, USA",
  • "country": "NZ",
  • "status": "active",
  • "email": "sp.organisation@whosonlocation.com",
  • "phone": "+1 206 555 0123",
  • "locations": [
    ],
  • "policies": 2,
  • "members": [
    ],
  • "organization_owner": 823431,
  • "logs": [
    ],
  • "customfields": {
    }
}

Update an organization

Update a contractor organization using the provided ID.

Request
path Parameters
id
required
integer <int32>

ID of the contractor organization to update

Request Body schema: application/json
name
string <string>
type
string
Enum: "Charitable organization" "Discretionary Trading Trust" "Government Agency" "Family Partnership" "Fixed Unit Trust" "Hospital" "Individual/Sole Trader" "Limited Liability Company" "Local Body Agency" "Other Trust" "Partnership" "Private Company" "Publicly Listed Company" "Sole Proprietorship | Sole Trader"
tradingas
string <string>
legalid
string <string>
legalid_type
string <string>
address
string <string>
country
string
Enum: "AF" "AL" "DZ" "AS" "AD" "AO" "AI" "AQ" "AG" "AR" "AM" "AW" "AU" "AT" "AZ" "BS" "BH" "BD" "BB" "BY" "BE" "BZ" "BJ" "BM" "BT" "BO" "BA" "BW" "BV" "BR" "IO" "BN" "BG" "BF" "BI" "KH" "CM" "CA" "CV" "KY" "CF" "TD" "CL" "CN" "CX" "CC" "CO" "KM" "CG" "CD" "CK" "CR" "CI" "HR" "CU" "CY" "CZ" "DK" "DJ" "DM" "DO" "TP" "EC" "EG" "SV" "GQ" "ER" "EE" "ET" "FK" "FO" "FJ" "FI" "FR" "GF" "PF" "TF" "GA" "GM" "GE" "DE" "GH" "GI" "GR" "GL" "GD" "GP" "GU" "GT" "GN" "GW" "GY" "HT" "HM" "VA" "HN" "HK" "HU" "IS" "IN" "ID" "IR" "IQ" "IE" "IL" "IT" "JM" "JP" "JO" "KZ" "KE" "KI" "KP" "KR" "KW" "KG" "LA" "LV" "LB" "LS" "LR" "LY" "LI" "LT" "LU" "MO" "MK" "MG" "MW" "MY" "MV" "ML" "MT" "MH" "MQ" "MR" "MU" "YT" "MX" "FM" "MD" "MC" "MN" "MS" "MA" "MZ" "MM" "NA" "NR" "NP" "NL" "AN" "NC" "NZ" "NI" "NE" "NG" "NU" "NF" "MP" "NO" "OM" "PK" "PW" "PA" "PG" "PY" "PE" "PH" "PN" "PL" "PT" "PR" "QA" "RE" "RO" "RU" "RW" "KN" "LC" "VC" "WS" "SM" "ST" "SA" "SN" "SC" "SL" "SG" "SK" "SI" "SB" "SO" "ZA" "GS" "ES" "LK" "SH" "PM" "SD" "SR" "SJ" "SZ" "SE" "CH" "SY" "TW" "TJ" "TZ" "TH" "TG" "TK" "TO" "TT" "TN" "TR" "TM" "TC" "TV" "UG" "UA" "AE" "GB" "US" "UM" "UY" "UZ" "VU" "VE" "VN" "VG" "VI" "WF" "EH" "YE" "ZM" "ZW"
email
string <string>
phone
string <string>
organization_owner
integer <int32>
status
string
Enum: "pending" "active" "on-hold" "inactive"
Array of objects (ContractorLocation)
object

This will return an object of custom fields set for contractor-organisations. The key of the custom field corresponds to the ID of the custom fields when using the Customfield endpoint

Responses
204

Updated organization

403

Access denied to this resource

500

Internal server error

put/sp/org/{id}
Request samples
application/json
{
  • "name": "Contractor Organisation Name",
  • "type": "Charitable organization",
  • "tradingas": "Contractor Organisation Name",
  • "legalid": "lid005",
  • "legalid_type": "legal ID type",
  • "address": "2 Water Street, New York, NY, USA",
  • "country": "NZ",
  • "email": "sp.organisation@whosonlocation.com",
  • "phone": "+1 206 555 0123",
  • "organization_owner": 823431,
  • "status": "active",
  • "locations": [
    ],
  • "cf": {
    }
}

Delete an organization

Deletes the specified contractor organization

Request
path Parameters
id
required
integer <int32>

ID of the contractor organization to delete

Responses
204

Organization deleted

403

Access denied to resource

404

Resource not found

500

Internal server error

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