Creates a new entity in the account.
https://help.tago.io/portal/en/kb/articles/entities#Creating_an_Entity Creating an Entity
If receive an error "Authorization Denied", check policy Entity / Create in Access Management.
const result = await Resources.entities.create({
name: "Temperature Sensors",
schema: {
temperature: { action: "create", type: "float", required: true } }
});
console.log(result); // { id: 'entity-id-123' }
Permanently removes an entity from the account.
https://help.tago.io/portal/en/kb/articles/entities#Managing_fields Managing Fields
Delete data records in a entity using the profile token and entity ID.
See the example to understand how to use this method properly to have full control on what to delete.
https://help.tago.io/portal/en/kb/articles/entities#Managing_the_data_in_your_Entity Managing the data in your Entity
Removes a field from the entity schema.
https://help.tago.io/portal/en/kb/articles/entities#Managing_fields Managing Fields
Removes an index from the entity schema.
https://help.tago.io/portal/en/kb/articles/entities#Indexing_fields_to_improve_searching_and_sorting Indexing fields to improve searching and sorting
Updates an existing entity's properties.
https://help.tago.io/portal/en/kb/articles/entities#Managing_fields Managing Fields
Updates existing data records in an entity.
The updatedData
can be a single data record or an array of records to be updated,
each of the records must have the id
of the record and the fields to be updated.
https://help.tago.io/portal/en/kb/articles/entities#Managing_the_data_in_your_Entity Managing the data in your Entity
Modifies the entity schema by adding new fields or managing indexes.
https://help.tago.io/portal/en/kb/articles/entities#Indexing_fields_to_improve_searching_and_sorting Indexing fields to improve searching and sorting
If receive an error "Authorization Denied", check policy Entity / Edit in Access Management.
const result = await Resources.entities.editSchemaIndex("entity-id-123", {
schema: { unit: { action: "create", type: "float", required: false } },
index: { temp_idx: { action: "create", fields: ["temperature"] } }
});
console.log(result); // { message: 'Entity Successfully Updated' }
Removes all data records from an entity while preserving its structure and configuration.
https://help.tago.io/portal/en/kb/articles/entities#Managing_the_data_in_your_Entity Managing the data in your Entity
Retrieves data records stored in a specific entity with optional filtering parameters.
Optional
queryParams: EntityDataQueryOptional
options: { paramsSerializer?: any }https://help.tago.io/portal/en/kb/articles/entities#Managing_the_data_in_your_Entity Managing the data in your Entity
If receive an error "Authorization Denied", check policy Entity / Access in Access Management.
const result = await Resources.entities.getEntityData("entity-id-123", { amount: 10, orderBy: "created_at,desc" });
console.log(result); // [ { id: 'record-id-123', created_at: 2025-01-22T13:45:30.913Z, ... }, ... ]
// Filtering by a specific field
const result = await Resources.entities.getEntityData("entity-id-123", {
filter: { temperature: "30" },
index: "temp_idx",
amount: 9999,
});
console.log(result); // [ { id: 'record-id-123', created_at: 2025-01-22T13:45:30.913Z, ... }, ... ]
Retrieves detailed information about a specific entity.
Retrieves a paginated list of all entities from the account with filtering and sorting options.
Optional
queryObj: EntityQueryOptional
options: { paramsSerializer?: any }Renames a field in the entity schema.
https://help.tago.io/portal/en/kb/articles/entities#Managing_fields Managing Fields
Sends new data records to an entity.
The data
can be a single data record or an array of records to be sent.
https://help.tago.io/portal/en/kb/articles/entities#Managing_the_data_in_your_Entity Managing the data in your Entity
Updates a field's configuration in the entity schema.
https://help.tago.io/portal/en/kb/articles/entities#Managing_fields Managing Fields
Gets the total amount of data records stored in the entity.