Entity Tags


An Entity Tag is a way to add different categories for an Entity to improve searchability, and to add access restrictions.

If you see references to "Layers" in documentation, that is a legacy term for Tags.

Data model

Below is a basic data model for a Tag record.

When further documentation refers to ITag or just a Tag record, you can reference this data model.

interface ITag {
    // ID of the Tag.
    // To create a new Tag, don't specify the ID.
    ID: number;
    // Human readable name of the Tag.
    Name: string;
    // Description of the Tag.
    Description?: string;
    // If tag access (and tagged Entity access) should be restricted.
    // When a Tag is restricted a user must have the "Layer_<tag_id>" permission to view the Tag/Entity.
    IsAccessRestricted?: boolean;
    // Colour of the tag to use when styling Entities or displaying a Tag icon.
    Color?: string;
    // Parent tag ID.
    // Purely for organizational purposes.
    "Parent.Layer.ID"?: number;
}

Entity Tag requests.

Below are the basic requests for managing Tag records.


Get Tags

Response
interface IResponse {
    Items: ITag[];
}
Javascript example

Get Tag by ID

Response
// Response is the Tag record directly.
// See the 'Data model' section for the structure.
Javascript example

Get Tags by IDs

Request body
interface IRequest {
    "layerIds": number[];
}
Response
interface IResponse {
    Items: ITag[];
}

Create / Update Tag

Response
// Response is the Tag record directly.
// See the 'Data model' section for the structure.

Delete Tag

Javascript example

Assigning Tags

To update an Entity's Tags you update its Bruce/Layer.ID field. It is an array of Tag IDs.

{
    "Bruce": {
        "Layer.ID": [1, 2, 3]
    }
}

You can use our typical Create/Update Entity requests to update this value. See Entities.

Additionally, we have DataLab actions for adding/removing and setting Tags for Entities based on a query. See DataLab actions.