Create site

This endpoint is used to create a site to organize the devices based on location.

Leave Feedback

URL

POST https://{api-url}/api/v2/tenants/{tenantId}/sites

Sample URLs

https://{api-url}/api/v2/tenants/client_93/sites

Parameters

FieldData TypeDescription
nameStringSite name.
descriptionString(Optional) Summary of the site.
addressString(Optional) Site address.
cityString(Optional) Site city.
stateString(Optional) Site state.
countryString(Optional) Site country.
zipString(Optional) Zip code.
phoneNumberString(Optional) Site phone number for communication.
phoneExtensionString(Optional) Site phone extension number.
parentid
  1. id
  2. name
String(Optional) Parent site. Required if creating a sub-site under a parent site:
  1. Parent site id
  2. Parent site name
primaryContact
  1. id
  2. loginName
String(Optional) Primary contact user information:
  1. User id
  2. User login name
resourcesid
  • id
String(Optional) ID of the resource stored in a site.
Example: b1d9536e-fa0c-459f-becf-97541bfebd48
filterCriteria
  1. matchType
  2. rules
    1. key
    2. value
    3. operator
    4. resourceType
String(Optional) Filter resources to add them to the sites.
  1. Match All or ANY of the rules to filter the resources.
    Example: ALL
  2. Filter resources with the below rules:
    1. Attribute name
    2. Attribute value of the resource
    3. Matching parameter.Supported operators: Contains, Not Contains, Equals, Not Equals, Starts with, Ends with, Regex, Is.For Is, "value" must be "TRUE" or "FALSE" and "key" must be "Agent Installed"
      Example: Contains
    4. Resource type. Example: DEVICE, LOAD BALANCER

Sample request

{
	"name": "SJ-North_EAST",
	"parent": {
		"id": "4",
		"name": "SJ-East"
	},
	"description": "Resources in north east zone",
	"address": "5th Avenue, Park street",
	"state": "California",
	"city": "San Jose",
	"country": "USA",
	"zip": "94088",
	"primaryContact": {
		"id": "USR0000000014",
		"loginName": "InsLab@organization.com"
	},
	"phoneNumber": "406-232-1234",
	"phoneExtension": "1",
	"resources": [{
			"id": "ad0a218d-7512-435c-9b58-614470ee8658"
		},
		{
			"id": "b7001583-db6a-4c7c-b4df-ab1ba6505d60"
		}
	],
	"filterCriteria": {
		"matchType": "ANY",
		"rules": [{
				"key": "Name",
				"operator": "Contains",
				"value": "SJ",
				"resourceType": "DEVICE"
			},
			{
				"key": "Name",
				"operator": "Regex",
				"value": "VM",
				"resourceType": "LOAD_BALANCER"
			},
			{
				"key": "Agent Installed",
				"operator": "Is",
				"value": "TRUE",
				"resourceType": "DEVICE"
			}
		]
	}
}

Sample response

{
	"id": 31,
	"name": "SJ-North_EAST",
	"parent": {
		"id": 4,
		"name": "SJ-East",
		"description": "Resources in east zone",
		"address": "Parkway"
	},
	"description": "Resources in north east zone",
	"address": "5th Avenue, Park street",
	"city": "San Jose",
	"state": "california",
	"country": "USA",
	"zip": "94088",
	"phoneNumber": "406-232-1234",
	"phoneExtension": "1",
	"primaryContact": {
		"id": "USR0000000014",
		"loginName": "InsLab@organization.com",
		"lastName": "Lab",
		"firstName": "Ins",
		"email": "john.smith@gamil.com",
		"phoneNumber": "406-625-1234"
	},
	"resources": [{
			"id": "b7001583-db6a-4c7c-b4df-ab1ba6505d60",
			"name": "DESKTOP-V5DV65M",
			"ipAddress": "192.168.56.1",
			"type": "DEVICE"
		},
		{
			"id": "19a49e09-da18-4d91-92b7-01d6858ec2cf",
			"name": "Windows",
			"ipAddress": "10.0.4.15",
			"type": "DEVICE"
		},
		{
			"id": "ad0a218d-7512-435c-9b58-614470ee8658",
			"name": "WORK-PC",
			"ipAddress": "192.168.126.1",
			"type": "DEVICE"
		}
	],
	"filterCriteria": {
		"id": 70,
		"matchType": "ANY",
		"rules": [{
				"id": 223,
				"key": "Name",
				"operator": "Contains",
				"value": "SJ",
				"resourceType": "DEVICE"
			},
			{
				"id": 224,
				"key": "Name",
				"operator": "Regex",
				"value": ".*VM.*",
				"resourceType": "LOAD_BALANCER"
			},
			{
				"id": 225,
				"key": "Agent Installed",
				"operator": "Is",
				"value": "TRUE",
				"resourceType": "DEVICE"
			}
		]
	}
}