Layer feature relationships
List Layer Feature Relationships
Section titled “List Layer Feature Relationships”Retrieves the relationships whose source is one of the given layer features: for example, the parent a component is an electrical subcomponent of, or the component model a component belongs to.
A relationship points from a source layer feature (layer_feature_id) to a related layer feature (related_layer_feature_id). This endpoint filters on the source only; it does not return relationships in which a requested layer feature is the related end.
Endpoint: GET /layerFeatureRelationships
Authentication: Required (API Key)
Query Parameters
Section titled “Query Parameters”| Parameter | Type | Required | Description |
|---|---|---|---|
layer_feature_id |
integer[] | Yes | Return the relationships out of one or more layer features (the id field of List Layer Features). At least one, at most 200 distinct ids; a repeated id counts once. |
_page |
integer | No | Page number (positive integer, defaults to 1) |
_pageSize |
integer | No | Number of relationships per page (positive integer, defaults to 10, max 10,000; a larger value is reduced to 10,000) |
_sortBy |
string | No | Sort order. One of +updated_at, -updated_at, +id, -id; repeat the parameter for tie-breaks. Default: +updated_at then +id. Relationships that are still tied are always ordered by id ascending. |
No other parameters are accepted: an unknown parameter (for example type) is rejected with 400.
Note: in a URL a literal + decodes to a space, so an ascending _sortBy must be percent-encoded as %2B (_sortBy=%2Bid), or simply omitted since +updated_at is the default.
Relationship Types
Section titled “Relationship Types”The type of a relationship says how the two layer features are related. A relationship always points from the child, the instance or the follow-up (layer_feature_id) to the parent, the model or the cause (related_layer_feature_id).
| Type | Source layer feature (layer_feature_id) |
Related layer feature (related_layer_feature_id) |
|---|---|---|
IS_ELECTRICAL_SUBCOMPONENT_OF |
A component, for example a string | The component one level up in the electrical hierarchy, for example a combiner box |
IS_MECHANICAL_SUBCOMPONENT_OF |
A component | The component one level up in the mechanical hierarchy |
IS_COMPONENT_OF_MODEL |
A component, for example a solar panel | Its component model, a layer feature in a component model dataset |
IMPLEMENTS |
- | Used between datasets; see Dataset relationships |
IS_SUBFORM_OF |
A ticket created from a subform | The ticket whose submission created it |
IS_TRIGGERED_BY |
A follow-up ticket, or a ticket made for an issue | The layer feature whose pass/fail check failed and created the ticket, or the issue |
A layer feature is the source of at most one relationship of each type. Many layer features can point to the same related layer feature. Because only the source can be requested, a parent cannot be used to find its children. For example, requesting a ticket returns the component that triggered it, but requesting a component does not return its tickets.
Response Format
Section titled “Response Format”Returns a paginated response with the following structure:
{ "data": [ { "id": "integer", "layer_feature_id": "integer", "related_layer_feature_id": "integer", "type": "string", "created_at": "timestamp", "updated_at": "timestamp" } ], "pagination": { "rowCount": "integer", "pageCount": "integer", "page": "integer", "pageSize": "integer" }}Response Fields
Section titled “Response Fields”- id: Integer ID of the relationship
- layer_feature_id: Integer ID of the source layer feature, one of the requested ids
- related_layer_feature_id: Integer ID of the layer feature the relationship points to
- type: One of the relationship types listed above
- created_at: ISO 8601 timestamp of when the relationship was created
- updated_at: ISO 8601 timestamp of when the relationship was last changed
- pagination: The standard pagination object.
rowCountcounts only the relationships you are allowed to see.
Ordering: by default relationships are returned by updated_at ascending, then by id ascending for relationships that share a timestamp. If a relationship is created, changed or deleted while you page through the results, rows can shift between pages, so a page walk may skip a row or return it twice.
Permissions
Section titled “Permissions”A relationship is returned only when your API key can read both its source and its related layer feature. A relationship whose related layer feature you cannot read is left out of the response and out of rowCount, even when you can read its source.
A requested layer_feature_id that does not exist, or that your API key cannot read, is dropped silently: it yields no rows and never causes a 403 or 404.
Find the Component a Follow-up Ticket Was Created For
Section titled “Find the Component a Follow-up Ticket Was Created For”When a pass/fail check on a component fails, Sitemark can create a follow-up ticket. The ticket is the source of an IS_TRIGGERED_BY relationship that points to the component.
- List the tickets with List Layer Features, filtered by the
dataset_idof the ticket dataset. - Request the relationships out of those tickets:
GET /layerFeatureRelationships?layer_feature_id[]=<ticket id>&layer_feature_id[]=<ticket id>, at most 200 tickets per request. - Keep the relationships whose
typeisIS_TRIGGERED_BY. Theirrelated_layer_feature_idis the component, another layer feature with a pass/fail check, or an issue.
Things to know:
- Follow-up tickets and tickets made for an issue have this relationship. A ticket created by hand on a component returns no
IS_TRIGGERED_BYrelationship. - A ticket made for an issue points to the issue, and its parent is the component it is about. To tell it apart from a follow-up, read the related layer feature: for an issue, its
semantic_typeisISSUES. - The response does not say which pass/fail check failed.
- If your API key cannot read the component, the relationship is left out, as described under Permissions.
Example Requests
Section titled “Example Requests”List the relationships out of a single layer feature:
curl -X GET "https://api.sitemark.com/layerFeatureRelationships?layer_feature_id=123" \ -H "Authorization: ApiKey your-api-key-here"List the relationships out of several layer features (with brackets):
curl -X GET "https://api.sitemark.com/layerFeatureRelationships?layer_feature_id[]=123&layer_feature_id[]=456" \ -H "Authorization: ApiKey your-api-key-here"Most recently changed first, second page:
curl -X GET "https://api.sitemark.com/layerFeatureRelationships?layer_feature_id=123&_sortBy=-updated_at&_page=2&_pageSize=100" \ -H "Authorization: ApiKey your-api-key-here"Example Response
Section titled “Example Response”{ "data": [ { "id": 9001, "layer_feature_id": 123, "related_layer_feature_id": 456, "type": "IS_ELECTRICAL_SUBCOMPONENT_OF", "created_at": "2026-01-15T09:12:44.000Z", "updated_at": "2026-01-15T09:12:44.000Z" }, { "id": 9002, "layer_feature_id": 123, "related_layer_feature_id": 789, "type": "IS_COMPONENT_OF_MODEL", "created_at": "2026-01-16T14:03:10.000Z", "updated_at": "2026-02-02T08:30:00.000Z" } ], "pagination": { "rowCount": 2, "pageCount": 1, "page": 1, "pageSize": 10 }}Error Responses
Section titled “Error Responses”| Status Code | Description |
|---|---|
| 401 | Unauthorized - Invalid or missing API key |
| 400 | Bad Request - Missing layer_feature_id, more than 200 distinct ids, an id that is not an integer, a _sortBy outside the 4 values, or an unsupported parameter |
| 429 | Too Many Requests - A rate limit was exceeded |
| 500 | Internal Server Error |