API Reference

Sites API

Create and manage customer sites for security system installations

Overview

The Sites API allows you to create, retrieve, update, and delete customer sites. Sites represent physical locations where security systems are installed and monitored.

Prerequisites

Before creating a site, ensure you have connected a dealer using the Dealers API. Sites are always associated with a dealer account.

Endpoints

Create a Site

Create a new site for a dealer.

Endpoint: POST /partner/v1/dealers/{dealerId}/sites

Authentication: OAuth 2.0 Client Credentials Grant

Request

Path Parameters:

  • dealerId (string, required): The dealer ID from CHeKT

Headers:

  • Authorization: Bearer {access_token}
  • x-partner-trace-id (optional): UUID for request tracking

Body:

{
  "external_site_id": "1234567890",
  "name": "Gangnam Headquarters",
  "monitoring_station_id": 12345,
  "account_number": "1234567890",
  "address1": "123 Teheran-ro, Gangnam-gu, Seoul",
  "address2": "7th Floor, Suite 701",
  "timezone": "Asia/Seoul"
}

Parameters:

  • external_site_id (string, required): Unique identifier assigned by your system
  • name (string, required): Name of the site or branch (e.g., Main Office, Branch A)
  • timezone (string, required): IANA timezone ID (e.g., Asia/Seoul, America/New_York)
  • monitoring_station_id (number, optional): CHeKT monitoring station ID
  • account_number (string, optional): Account number from your system
  • address1 (string, optional): Primary address (street address or location)
  • address2 (string, optional): Additional address details such as floor or suite

Response (201 Created)

{
  "site_id": 1,
  "external_site_id": "1234567890",
  "name": "Gangnam Headquarters",
  "external_monitoring_station_id": "12345",
  "monitoring_station_id": 12345,
  "account_number": "1234567890",
  "address1": "123 Teheran-ro, Gangnam-gu, Seoul",
  "address2": "7th Floor, Suite 701",
  "timezone": "Asia/Seoul",
  "is_activated": 0,
  "created_at": "2025-01-01T00:00:00.000Z"
}

Response Fields:

  • site_id (number): Unique identifier assigned by CHeKT
  • external_site_id (string): Your system's site identifier
  • name (string): Site name
  • external_monitoring_station_id (string): Monitoring station ID from your system
  • monitoring_station_id (number): CHeKT monitoring station ID
  • account_number (string): Account number
  • address1 (string): Primary address
  • address2 (string): Additional address details
  • timezone (string): IANA timezone ID
  • is_activated (number): Site activation status (0: inactive, 1: active)
  • created_at (string): Creation timestamp (ISO format)

List All Sites

Retrieve all sites for a specific dealer.

Endpoint: GET /partner/v1/dealers/{dealerId}/sites

Authentication: OAuth 2.0 Client Credentials Grant

Request

Path Parameters:

  • dealerId (string, required): The dealer ID from CHeKT

Headers:

  • Authorization: Bearer {access_token}
  • x-partner-trace-id (optional): UUID for request tracking

Query Parameters: (All optional)

  • fields: Comma-separated column names to retrieve
  • filter: Filter by column values (format: column,value,operator)
  • sort: Column to sort by
  • dir: Sort direction (asc or desc)
  • limit: Maximum number of results
  • offset: Starting position

Response (200 OK)

[
  {
    "site_id": 1,
    "external_site_id": "1234567890",
    "name": "Gangnam Headquarters",
    "external_monitoring_station_id": "12345",
    "monitoring_station_id": 12345,
    "account_number": "1234567890",
    "address1": "123 Teheran-ro, Gangnam-gu, Seoul",
    "address2": "7th Floor, Suite 701",
    "timezone": "Asia/Seoul",
    "is_activated": 1,
    "created_at": "2025-01-01T00:00:00.000Z"
  }
]

Get a Specific Site

Retrieve detailed information about a single site.

Endpoint: GET /partner/v1/dealers/{dealerId}/sites/{siteId}

Authentication: OAuth 2.0 Client Credentials Grant

Request

Path Parameters:

  • dealerId (string, required): The dealer ID from CHeKT
  • siteId (string, required): The site ID from CHeKT

Headers:

  • Authorization: Bearer {access_token}
  • x-partner-trace-id (optional): UUID for request tracking

Response (200 OK)

{
  "site_id": 1,
  "external_site_id": "1234567890",
  "name": "Gangnam Headquarters",
  "external_monitoring_station_id": "12345",
  "monitoring_station_id": 12345,
  "account_number": "1234567890",
  "address1": "123 Teheran-ro, Gangnam-gu, Seoul",
  "address2": "7th Floor, Suite 701",
  "timezone": "Asia/Seoul",
  "is_activated": 1,
  "has_physical_bridge": true,
  "created_at": "2025-01-01T00:00:00.000Z"
}

Additional Fields:

  • has_physical_bridge (boolean): Whether the site has one or more physical bridges

Update a Site

Update site information such as name, address, or monitoring station.

Endpoint: PUT /partner/v1/dealers/{dealerId}/sites/{siteId}

Authentication: OAuth 2.0 Client Credentials Grant

Request

Path Parameters:

  • dealerId (string, required): The dealer ID from CHeKT
  • siteId (string, required): The site ID from CHeKT

Headers:

  • Authorization: Bearer {access_token}
  • x-partner-trace-id (optional): UUID for request tracking

Body:

{
  "external_site_id": "1234567890",
  "name": "Gangnam HQ - Updated",
  "monitoring_station_id": 12345,
  "account_number": "9876543210",
  "address1": "456 New Street",
  "address2": "8th Floor",
  "timezone": "Asia/Seoul"
}

Parameters: (All optional)

  • external_site_id (string): Updated external site ID
  • name (string): Updated site name
  • monitoring_station_id (number): Updated monitoring station ID
  • account_number (string): Updated account number
  • address1 (string): Updated primary address
  • address2 (string): Updated additional address
  • timezone (string): Updated timezone

Response (200 OK)

{
  "site_id": 1,
  "external_site_id": "1234567890",
  "name": "Gangnam HQ - Updated",
  "external_monitoring_station_id": "12345",
  "monitoring_station_id": 12345,
  "account_number": "9876543210",
  "address1": "456 New Street",
  "address2": "8th Floor",
  "timezone": "Asia/Seoul",
  "is_activated": 1,
  "created_at": "2025-01-01T00:00:00.000Z"
}

Delete a Site

Permanently delete a site from the system.

Endpoint: DELETE /partner/v1/dealers/{dealerId}/sites/{siteId}

Authentication: OAuth 2.0 Client Credentials Grant

Deleting a site is permanent and cannot be undone. Ensure you have backed up any necessary data before deletion.

Request

Path Parameters:

  • dealerId (string, required): The dealer ID from CHeKT
  • siteId (string, required): The site ID from CHeKT

Headers:

  • Authorization: Bearer {access_token}
  • x-partner-trace-id (optional): UUID for request tracking

Response (204 No Content)

No response body. HTTP status 204 indicates successful deletion.

Update Site Activation Status

Change the activation status of a site (activate or deactivate).

Endpoint: PATCH /partner/v1/dealers/{dealerId}/sites/{siteId}/activation-status

Authentication: OAuth 2.0 Client Credentials Grant

Request

Path Parameters:

  • dealerId (string, required): The dealer ID from CHeKT
  • siteId (string, required): The site ID from CHeKT

Headers:

  • Authorization: Bearer {access_token}
  • x-partner-trace-id (optional): UUID for request tracking

Response (200 OK)

{
  "site_id": 1,
  "external_site_id": "1234567890",
  "name": "Gangnam Headquarters",
  "external_monitoring_station_id": "12345",
  "monitoring_station_id": 12345,
  "account_number": "1234567890",
  "address1": "123 Teheran-ro, Gangnam-gu, Seoul",
  "address2": "7th Floor, Suite 701",
  "timezone": "Asia/Seoul",
  "is_activated": 1,
  "created_at": "2025-01-01T00:00:00.000Z"
}

Error Responses

Status CodeDescriptionSolution
400Bad Request - Invalid input or parametersCheck your request payload format
401Unauthorized - Invalid or expired tokenRefresh your access token
403Forbidden - Access deniedVerify your permissions
404Not Found - Site or dealer does not existCheck the site and dealer IDs

Code Examples

cURL

# Create a site
curl -X POST https://api.chekt.com/partner/v1/dealers/12345/sites \
  -H "Content-Type: application/json" \
  -H "Authorization: Bearer YOUR_ACCESS_TOKEN" \
  -H "x-partner-trace-id: 550e8400-e29b-41d4-a716-123456789000" \
  -d '{
    "external_site_id": "1234567890",
    "name": "Gangnam Headquarters",
    "timezone": "Asia/Seoul"
  }'

# Get all sites
curl -X GET https://api.chekt.com/partner/v1/dealers/12345/sites \
  -H "Authorization: Bearer YOUR_ACCESS_TOKEN" \
  -H "x-partner-trace-id: 550e8400-e29b-41d4-a716-123456789000"

# Update a site
curl -X PUT https://api.chekt.com/partner/v1/dealers/12345/sites/1 \
  -H "Content-Type: application/json" \
  -H "Authorization: Bearer YOUR_ACCESS_TOKEN" \
  -H "x-partner-trace-id: 550e8400-e29b-41d4-a716-123456789000" \
  -d '{
    "name": "Updated Site Name"
  }'

# Delete a site
curl -X DELETE https://api.chekt.com/partner/v1/dealers/12345/sites/1 \
  -H "Authorization: Bearer YOUR_ACCESS_TOKEN" \
  -H "x-partner-trace-id: 550e8400-e29b-41d4-a716-123456789000"

JavaScript

// Create a site
const response = await fetch("https://api.chekt.com/partner/v1/dealers/12345/sites", {
  method: "POST",
  headers: {
    "Content-Type": "application/json",
    "Authorization": `Bearer ${accessToken}`,
    "x-partner-trace-id": "550e8400-e29b-41d4-a716-123456789000"
  },
  body: JSON.stringify({
    external_site_id: "1234567890",
    name: "Gangnam Headquarters",
    timezone: "Asia/Seoul"
  })
});

const site = await response.json();
console.log("Created site:", site);

Python

import requests

# Create a site
response = requests.post(
    "https://api.chekt.com/partner/v1/dealers/12345/sites",
    headers={
        "Content-Type": "application/json",
        "Authorization": f"Bearer {access_token}",
        "x-partner-trace-id": "550e8400-e29b-41d4-a716-123456789000"
    },
    json={
        "external_site_id": "1234567890",
        "name": "Gangnam Headquarters",
        "timezone": "Asia/Seoul"
    }
)

site = response.json()
print("Created site:", site)

Best Practices

  • Always validate timezone format (IANA timezone IDs)
  • Store site_id for future device and contact associations
  • Use external_site_id to maintain consistency with your system
  • Handle activation status changes carefully
  • Implement proper error handling for site deletion

Next Steps

Next Steps