Premises
Premises represent the physical locations that are being insured in a commercial risk profile. On this page, we'll dive into the different premises endpoints you can use to manage them programmatically.
The Premise object
Premise objects represent a single premise in a commercial risk profile. They contain the following properties and relationships:
Commercial-only Properties
These properties are available only for commercial risk profiles.- Name
loc
- Type
- int
- Filterable
- Sortable
- Description
The location number for the premise
- Name
description
- Type
- nullable string
- Filterable
- Sortable
- Description
The description of the premise
- Name
image
- Type
- nullable string
- Description
The URL of the premise's image, if uploaded via the Wunderite UI
Meta
- Name
created
- Type
- timestamp
- Filterable
- Sortable
- Description
An ISO-8601 timestamp (UTC) indicating when the premise was created
- Name
updated
- Type
- timestamp
- Filterable
- Sortable
- Description
An ISO-8601 timestamp (UTC) indicating when the premise was last updated
Commercial-only Relations
Learn more about including relations.- Name
address
- Type
- Address
- Filterable
- Sortable
- Name
attachments
- Type
- Attachment[]
- Name
attachments.uploader
- Type
- User
- Description
The user who uploaded the attachment
List all premises
This endpoint allows you to retrieve a paginated list of all premises in the corresponding commercial risk profile.
The address
relation is included by default.
Parameters
See the premise object for a list of all available filters and sorts.
Searchable
You can search for premise by providing a search query in the filter[search]
parameter.
The search query will be matched against a premise's location number, description, or address.
Request
curl -G https://app.wunderite.com/api/v1/risks/{risk}/data/premises \
-H "Authorization: Bearer {token}" \
-d filter[search]=Location \
-d per_page=50
Response
{ "data": [ { "object": "premise", "uuid": "aee2f644-9b1d-4481-8735-19827528da15", "data": { "loc": 1, "description": "Pied Piper", "image": null },
Create premises
This endpoint allows you to create new premises in the corresponding commercial risk profile.
At least one premise object must be provided in the request body.
You can also create an address in the same request if you provide the address
property.
Optional properties
See all available properties in the premise properties section.
- Name
loc
- Type
- nullable int
- Description
The premise's location number. When this property is not provided, or uses a
null
value, the premise will be assigned a number automatically.
- Name
address
- Type
- Address
- Description
An address object that should be created with the premise
Request
curl -X POST https://app.wunderite.com/api/v1/risks/{risk}/data/premises \
-H "Authorization: Bearer {token}" \
-H "Accept: application/json" \
-d '{
"data": [
{
"object": "premise",
"data": {
"description": "Industrial Park"
}
}
]
}'
Response
{ "data": [ { "object": "premise", "uuid": "4813cde2-d02c-423e-9647-bb7705b52c6a", "data": { "loc": 33, "description": "Industrial Park", "image": null },
Request with sub resources
curl -X POST https://app.wunderite.com/api/v1/risks/{risk}/data/premises?include=address \
-H "Authorization: Bearer {token}" \
-H "Accept: application/json" \
-d '{
"data": [
{
"object": "premise",
"data": {
"description": "Industrial Park",
"address": {
"object": "address",
"data": {
"street_number": "123",
"address1": "Main St",
"city": "Boston",
"state": "MA",
"zip": "02108"
}
}
}
}
]
}'
Response
{ "data": [ { "object": "premise", "uuid": "c0903578-bdac-43f4-b138-be3d6240be1c", "data": { "loc": 33, "description": "Industrial Park", "image": null },
Update premises
This endpoint allows you to perform bulk updates on premises.
At least one premise object must be provided in the request body. Each object must contain at least one property from the premise properties section.
You can also create or update an address in the same request if you provide the address
property with an Address object.
Properties that are not provided will not be updated.
To clear a property, provide a null
value.
Request
curl -X PATCH https://app.wunderite.com/api/v1/risks/{risk}/data \
-H "Authorization: Bearer {token}" \
-H "Accept: application/json" \
-d '{
"data": [
{
"object": "premise",
"uuid": "a27deef4-2f2a-47c1-a49b-37e52054e5f8",
"data": {
"loc": 2,
"description": "Data Center",
"image": null
}
}
]
}'
Response
{ "data": [ { "object": "premise", "uuid": "a27deef4-2f2a-47c1-a49b-37e52054e5f8", "data": { "loc": 2, "description": "Data Center", "image": null },
Request with sub resources
curl -X PATCH https://app.wunderite.com/api/v1/risks/{risk}/data \
-H "Authorization: Bearer {token}" \
-H "Accept: application/json" \
-d '{
"data": [
{
"object": "premise",
"uuid": "a27deef4-2f2a-47c1-a49b-37e52054e5f8",
"data": {
"loc": 2,
"description": "Data Center",
"image": null,
"address": {
"object": "address",
"data": {
"street_number": 123,
"address1": "Test Street",
"address2": null,
"city": "Boston",
"state": "MA",
"zip": "08077",
"county": "Suffolk",
"lat": 0,
"lng": 0
}
}
}
}
]
}'
Response
{ "data": [ { "object": "premise", "uuid": "a27deef4-2f2a-47c1-a49b-37e52054e5f8", "data": { "loc": 2, "description": "Data Center", "image": null, "address": {
Delete premises
This endpoint allows you to bulk delete risk data, including premises.
At least one premise object must be provided in the request body to delete the corresponding premise.
Deleting a premise will also delete any associated buildings, as well as remove the premise from any equipment or related workers compensation exposures.
Required properties
- Name
object
- Type
- string
- Description
The object type of the data to delete. Must be
premise
in this case.
- Name
uuid
- Type
- string
- Description
The UUID of the premise to delete
Request
curl -X DELETE https://app.wunderite.com/api/v1/risks/{risk}/data \
-H "Authorization: Bearer {token}" \
-H "Accept: application/json" \
-d '{
"data": [
{
"object": "premise",
"uuid": "a27deef4-2f2a-47c1-a49b-37e52054e5f8"
}
]
}'
Response
{
"data": [
{
"object": "premise",
"uuid": "a27deef4-2f2a-47c1-a49b-37e52054e5f8",
"profile_type": "commercial"
}
]
}