> For the complete documentation index, see [llms.txt](https://docs.globalalerting.com/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.globalalerting.com/web-api/facilities.md).

# Facilities

## GET /V2/{tenantVarCode}/facilities

> Returns facilities for the tenant.

```json
{"openapi":"3.0.4","info":{"title":"GAP REST API Documentation V2","version":"v2"},"tags":[{"name":"Facilities"}],"paths":{"/V2/{tenantVarCode}/facilities":{"get":{"tags":["Facilities"],"summary":"Returns facilities for the tenant.","parameters":[{"name":"tenantVarCode","in":"path","description":"Tenant Var Code","required":true,"schema":{"type":"string"}},{"name":"subtenants","in":"query","description":"If true, result includes users from subtenants","schema":{"type":"boolean","default":false}}],"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"type":"array","items":{"$ref":"#/components/schemas/Facility"}}},"application/json;IEEE754Compatible=false":{"schema":{"type":"array","items":{"$ref":"#/components/schemas/Facility"}}},"application/json;IEEE754Compatible=true":{"schema":{"type":"array","items":{"$ref":"#/components/schemas/Facility"}}},"application/xml":{"schema":{"type":"array","items":{"$ref":"#/components/schemas/Facility"}}},"text/plain":{"schema":{"type":"array","items":{"$ref":"#/components/schemas/Facility"}}},"application/octet-stream":{"schema":{"type":"array","items":{"$ref":"#/components/schemas/Facility"}}},"text/json":{"schema":{"type":"array","items":{"$ref":"#/components/schemas/Facility"}}},"text/xml":{"schema":{"type":"array","items":{"$ref":"#/components/schemas/Facility"}}},"text/csv":{"schema":{"type":"array","items":{"$ref":"#/components/schemas/Facility"}}}}}}}}},"components":{"schemas":{"Facility":{"type":"object","properties":{"TenantCode":{"type":"string","description":"Tenant Var Code","nullable":true},"FacilityId":{"type":"string","description":"A unique identifier of the facility","nullable":true},"FriendlyName":{"type":"string","description":"Facility friendly name","nullable":true},"Description":{"type":"string","description":"Facility description","nullable":true},"KeyContacts":{"type":"array","items":{"type":"string"},"description":"Array of email addresses that have to be users from the same tenant","nullable":true},"Latitude":{"type":"number","description":"Facility latitude","format":"double","nullable":true},"Longitude":{"type":"number","description":"Facility longitude","format":"double","nullable":true},"Address":{"type":"string","description":"Facility address","nullable":true},"City":{"type":"string","description":"Facility city","nullable":true},"State":{"type":"string","description":"Faciliti state","nullable":true},"Country":{"type":"string","description":"Facility country","nullable":true},"PostalCode":{"type":"string","description":"Facility postal code","nullable":true},"PrimaryPhone":{"type":"string","description":"Primary phone number in international format (starting with '+' and country code)","nullable":true},"SecondaryPhone":{"type":"string","description":"Secondary phone number in international format (starting with '+' and country code)","nullable":true},"MapIcon":{"type":"string","description":"Map icon, one of the following values: fa-building, fa-building-wheat, fa-building-user, fa-building-shield, fa-building-lock, \r\nfa-building-flag, fa-building-columns, fa-car-building, fa-house-building, fa-house, fa-city, fa-shop, fa-store,\r\nfa-school, fa-hotel, fa-place-of-worship, fa-hospital, fa-warehouse, fa-industry, fa-warehouse-full, fa-tree-city, fa-apartment,\r\nfa-fort, fa-container-storage, fa-tower-observation, fa-tent, fa-oil-well, fa-garage, fa-farm, fa-castle, fa-cabin, fa-user, fa-location-arrow","nullable":true},"MarkerColor":{"type":"string","description":"Marker color, one of the following values: blue, purple, dark-purple, dark-blue, dark-green,\r\nlight-orange, yellow, light-green, light-blue, pink, gray, dark-gray","nullable":true}},"additionalProperties":false}}}}
```

## POST /V2/{tenantVarCode}/facilities

> Creates a new facility.

```json
{"openapi":"3.0.4","info":{"title":"GAP REST API Documentation V2","version":"v2"},"tags":[{"name":"Facilities"}],"paths":{"/V2/{tenantVarCode}/facilities":{"post":{"tags":["Facilities"],"summary":"Creates a new facility.","parameters":[{"name":"tenantVarCode","in":"path","description":"Tenant Var Code","required":true,"schema":{"type":"string"}}],"requestBody":{"description":"Facility","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Facility"}},"application/json;IEEE754Compatible=false":{"schema":{"$ref":"#/components/schemas/Facility"}},"application/json;IEEE754Compatible=true":{"schema":{"$ref":"#/components/schemas/Facility"}},"application/xml":{"schema":{"$ref":"#/components/schemas/Facility"}},"text/plain":{"schema":{"$ref":"#/components/schemas/Facility"}},"application/json-patch+json":{"schema":{"$ref":"#/components/schemas/Facility"}},"text/json":{"schema":{"$ref":"#/components/schemas/Facility"}},"application/*+json":{"schema":{"$ref":"#/components/schemas/Facility"}},"text/xml":{"schema":{"$ref":"#/components/schemas/Facility"}},"application/*+xml":{"schema":{"$ref":"#/components/schemas/Facility"}}}},"responses":{"200":{"description":"OK"}}}}},"components":{"schemas":{"Facility":{"type":"object","properties":{"TenantCode":{"type":"string","description":"Tenant Var Code","nullable":true},"FacilityId":{"type":"string","description":"A unique identifier of the facility","nullable":true},"FriendlyName":{"type":"string","description":"Facility friendly name","nullable":true},"Description":{"type":"string","description":"Facility description","nullable":true},"KeyContacts":{"type":"array","items":{"type":"string"},"description":"Array of email addresses that have to be users from the same tenant","nullable":true},"Latitude":{"type":"number","description":"Facility latitude","format":"double","nullable":true},"Longitude":{"type":"number","description":"Facility longitude","format":"double","nullable":true},"Address":{"type":"string","description":"Facility address","nullable":true},"City":{"type":"string","description":"Facility city","nullable":true},"State":{"type":"string","description":"Faciliti state","nullable":true},"Country":{"type":"string","description":"Facility country","nullable":true},"PostalCode":{"type":"string","description":"Facility postal code","nullable":true},"PrimaryPhone":{"type":"string","description":"Primary phone number in international format (starting with '+' and country code)","nullable":true},"SecondaryPhone":{"type":"string","description":"Secondary phone number in international format (starting with '+' and country code)","nullable":true},"MapIcon":{"type":"string","description":"Map icon, one of the following values: fa-building, fa-building-wheat, fa-building-user, fa-building-shield, fa-building-lock, \r\nfa-building-flag, fa-building-columns, fa-car-building, fa-house-building, fa-house, fa-city, fa-shop, fa-store,\r\nfa-school, fa-hotel, fa-place-of-worship, fa-hospital, fa-warehouse, fa-industry, fa-warehouse-full, fa-tree-city, fa-apartment,\r\nfa-fort, fa-container-storage, fa-tower-observation, fa-tent, fa-oil-well, fa-garage, fa-farm, fa-castle, fa-cabin, fa-user, fa-location-arrow","nullable":true},"MarkerColor":{"type":"string","description":"Marker color, one of the following values: blue, purple, dark-purple, dark-blue, dark-green,\r\nlight-orange, yellow, light-green, light-blue, pink, gray, dark-gray","nullable":true}},"additionalProperties":false}}}}
```

## GET /V2/{tenantVarCode}/facilities/{facilityId}

> Returns single facility.

```json
{"openapi":"3.0.4","info":{"title":"GAP REST API Documentation V2","version":"v2"},"tags":[{"name":"Facilities"}],"paths":{"/V2/{tenantVarCode}/facilities/{facilityId}":{"get":{"tags":["Facilities"],"summary":"Returns single facility.","parameters":[{"name":"tenantVarCode","in":"path","description":"Tenant Var Code","required":true,"schema":{"type":"string"}},{"name":"facilityId","in":"path","description":"Facility Id","required":true,"schema":{"type":"string"}}],"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Facility"}},"application/json;IEEE754Compatible=false":{"schema":{"$ref":"#/components/schemas/Facility"}},"application/json;IEEE754Compatible=true":{"schema":{"$ref":"#/components/schemas/Facility"}},"application/xml":{"schema":{"$ref":"#/components/schemas/Facility"}},"text/plain":{"schema":{"$ref":"#/components/schemas/Facility"}},"application/octet-stream":{"schema":{"$ref":"#/components/schemas/Facility"}},"text/json":{"schema":{"$ref":"#/components/schemas/Facility"}},"text/xml":{"schema":{"$ref":"#/components/schemas/Facility"}}}}}}}},"components":{"schemas":{"Facility":{"type":"object","properties":{"TenantCode":{"type":"string","description":"Tenant Var Code","nullable":true},"FacilityId":{"type":"string","description":"A unique identifier of the facility","nullable":true},"FriendlyName":{"type":"string","description":"Facility friendly name","nullable":true},"Description":{"type":"string","description":"Facility description","nullable":true},"KeyContacts":{"type":"array","items":{"type":"string"},"description":"Array of email addresses that have to be users from the same tenant","nullable":true},"Latitude":{"type":"number","description":"Facility latitude","format":"double","nullable":true},"Longitude":{"type":"number","description":"Facility longitude","format":"double","nullable":true},"Address":{"type":"string","description":"Facility address","nullable":true},"City":{"type":"string","description":"Facility city","nullable":true},"State":{"type":"string","description":"Faciliti state","nullable":true},"Country":{"type":"string","description":"Facility country","nullable":true},"PostalCode":{"type":"string","description":"Facility postal code","nullable":true},"PrimaryPhone":{"type":"string","description":"Primary phone number in international format (starting with '+' and country code)","nullable":true},"SecondaryPhone":{"type":"string","description":"Secondary phone number in international format (starting with '+' and country code)","nullable":true},"MapIcon":{"type":"string","description":"Map icon, one of the following values: fa-building, fa-building-wheat, fa-building-user, fa-building-shield, fa-building-lock, \r\nfa-building-flag, fa-building-columns, fa-car-building, fa-house-building, fa-house, fa-city, fa-shop, fa-store,\r\nfa-school, fa-hotel, fa-place-of-worship, fa-hospital, fa-warehouse, fa-industry, fa-warehouse-full, fa-tree-city, fa-apartment,\r\nfa-fort, fa-container-storage, fa-tower-observation, fa-tent, fa-oil-well, fa-garage, fa-farm, fa-castle, fa-cabin, fa-user, fa-location-arrow","nullable":true},"MarkerColor":{"type":"string","description":"Marker color, one of the following values: blue, purple, dark-purple, dark-blue, dark-green,\r\nlight-orange, yellow, light-green, light-blue, pink, gray, dark-gray","nullable":true}},"additionalProperties":false}}}}
```

## PUT /V2/{tenantVarCode}/facilities/{facilityId}

> Updates facility.

```json
{"openapi":"3.0.4","info":{"title":"GAP REST API Documentation V2","version":"v2"},"tags":[{"name":"Facilities"}],"paths":{"/V2/{tenantVarCode}/facilities/{facilityId}":{"put":{"tags":["Facilities"],"summary":"Updates facility.","parameters":[{"name":"tenantVarCode","in":"path","description":"Tenant Var Code","required":true,"schema":{"type":"string"}},{"name":"facilityId","in":"path","description":"Facility Id","required":true,"schema":{"type":"string"}}],"requestBody":{"description":"Facility","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Facility"}},"application/json;IEEE754Compatible=false":{"schema":{"$ref":"#/components/schemas/Facility"}},"application/json;IEEE754Compatible=true":{"schema":{"$ref":"#/components/schemas/Facility"}},"application/xml":{"schema":{"$ref":"#/components/schemas/Facility"}},"text/plain":{"schema":{"$ref":"#/components/schemas/Facility"}},"application/json-patch+json":{"schema":{"$ref":"#/components/schemas/Facility"}},"text/json":{"schema":{"$ref":"#/components/schemas/Facility"}},"application/*+json":{"schema":{"$ref":"#/components/schemas/Facility"}},"text/xml":{"schema":{"$ref":"#/components/schemas/Facility"}},"application/*+xml":{"schema":{"$ref":"#/components/schemas/Facility"}}}},"responses":{"200":{"description":"OK"}}}}},"components":{"schemas":{"Facility":{"type":"object","properties":{"TenantCode":{"type":"string","description":"Tenant Var Code","nullable":true},"FacilityId":{"type":"string","description":"A unique identifier of the facility","nullable":true},"FriendlyName":{"type":"string","description":"Facility friendly name","nullable":true},"Description":{"type":"string","description":"Facility description","nullable":true},"KeyContacts":{"type":"array","items":{"type":"string"},"description":"Array of email addresses that have to be users from the same tenant","nullable":true},"Latitude":{"type":"number","description":"Facility latitude","format":"double","nullable":true},"Longitude":{"type":"number","description":"Facility longitude","format":"double","nullable":true},"Address":{"type":"string","description":"Facility address","nullable":true},"City":{"type":"string","description":"Facility city","nullable":true},"State":{"type":"string","description":"Faciliti state","nullable":true},"Country":{"type":"string","description":"Facility country","nullable":true},"PostalCode":{"type":"string","description":"Facility postal code","nullable":true},"PrimaryPhone":{"type":"string","description":"Primary phone number in international format (starting with '+' and country code)","nullable":true},"SecondaryPhone":{"type":"string","description":"Secondary phone number in international format (starting with '+' and country code)","nullable":true},"MapIcon":{"type":"string","description":"Map icon, one of the following values: fa-building, fa-building-wheat, fa-building-user, fa-building-shield, fa-building-lock, \r\nfa-building-flag, fa-building-columns, fa-car-building, fa-house-building, fa-house, fa-city, fa-shop, fa-store,\r\nfa-school, fa-hotel, fa-place-of-worship, fa-hospital, fa-warehouse, fa-industry, fa-warehouse-full, fa-tree-city, fa-apartment,\r\nfa-fort, fa-container-storage, fa-tower-observation, fa-tent, fa-oil-well, fa-garage, fa-farm, fa-castle, fa-cabin, fa-user, fa-location-arrow","nullable":true},"MarkerColor":{"type":"string","description":"Marker color, one of the following values: blue, purple, dark-purple, dark-blue, dark-green,\r\nlight-orange, yellow, light-green, light-blue, pink, gray, dark-gray","nullable":true}},"additionalProperties":false}}}}
```

## DELETE /V2/{tenantVarCode}/facilities/{facilityId}

> Deletes a facility.

```json
{"openapi":"3.0.4","info":{"title":"GAP REST API Documentation V2","version":"v2"},"tags":[{"name":"Facilities"}],"paths":{"/V2/{tenantVarCode}/facilities/{facilityId}":{"delete":{"tags":["Facilities"],"summary":"Deletes a facility.","parameters":[{"name":"tenantVarCode","in":"path","description":"Tenant Var Code","required":true,"schema":{"type":"string"}},{"name":"facilityId","in":"path","description":"Facility Id","required":true,"schema":{"type":"string"}}],"responses":{"200":{"description":"OK"}}}}}}
```
