Sites
List Sites
Section titled “List Sites”Retrieves a paginated list of sites.
Endpoint: GET /sites
Authentication: Required (API Key)
Query Parameters
Section titled “Query Parameters”| Parameter | Type | Required | Description |
|---|---|---|---|
id |
integer[] | No | Filter sites by one or more site IDs. |
_page |
integer | No | Page number (positive integer, defaults to 1) |
_pageSize |
integer | No | Number of items per page (positive integer, max varies by configuration) |
_sortBy |
string | No | Sort order. Format: +field for ascending or -field for descending. |
Response Format
Section titled “Response Format”Returns a paginated response with the following structure:
{ "data": [ { "id": "integer", "company_id": "integer", "name": "string" } ], "pagination": { "page": "integer", "pageSize": "integer", "rowCount": "integer", "pageCount": "integer" }}Response Fields
Section titled “Response Fields”- id: Integer ID of the site
- company_id: Integer ID of the company that owns the site
- name: Name of the site
Example Requests
Section titled “Example Requests”List all sites:
curl -X GET "https://api.sitemark.com/sites?_page=1&_pageSize=25" \ -H "Authorization: ApiKey your-api-key-here"Filter by single site ID:
curl -X GET "https://api.sitemark.com/sites?id=1234&_page=1&_pageSize=25" \ -H "Authorization: ApiKey your-api-key-here"Filter by multiple site IDs (without brackets):
curl -X GET "https://api.sitemark.com/sites?id=1234&id=1235&_page=1&_pageSize=25" \ -H "Authorization: ApiKey your-api-key-here"Filter by multiple site IDs (with brackets):
curl -X GET "https://api.sitemark.com/sites?id[]=1234&id[]=1235&_page=1&_pageSize=25" \ -H "Authorization: ApiKey your-api-key-here"Example Response
Section titled “Example Response”{ "data": [ { "id": 1234, "company_id": 5678, "name": "Downtown Construction Site" }, { "id": 1235, "company_id": 5678, "name": "Industrial Park Development" } ], "pagination": { "page": 1, "pageSize": 25, "rowCount": 2, "pageCount": 1 }}Error Responses
Section titled “Error Responses”| Status Code | Description |
|---|---|
| 401 | Unauthorized - Invalid or missing API key |
| 400 | Bad Request - Invalid query parameters |
| 500 | Internal Server Error |