Entity historic data
Entity historic records are time-stamped snapshots of an Entity's data. You can assign a set of your attributes to be tied to one of your date-time attributes, and the system will automatically create a new historic record each time the date-time attribute changes.
You can have multiple date-time attributes that create different historic records for different sets of attributes.
We call these date-times "Historic keys", and attributes that change "Historic attributes".
You can flag an attribute as tied to a historic key by setting the HistoricKey property on the attribute in the Entity Type's Data Schema.
See below a preview of the Data Schema definition that you can find more information about in the Entity Type Data Schema documentation.
Once set, updating Entities in that Entity Type will check for valid date-time values in that key and create/update historic records based on the changes.
If you update an Entity with no valid date-time, then the default attribute values are updated within the 'normal' Entity record.
These default values are returned when querying an Entity without a timestamp, or when no historic records are found for the timestamp provided.
Note that there is a default limit of 1,000 historic records per Entity ID unless an upgraded limit is discussed.To request for historic data, simply use the "HistoricPoint=an_iso_8601_date_time" query parameter during Entity or DataLab requests.
The latest historic record to that point in time will be returned. Records in the future will not be returned.
Note that historic records are applied to found Entity records after the filtering and sorting is done.Returned records will have additional metadata on what historic records were overlaid on the Entity record.
Below is a preview of how an Entity's data structure is extended to include historic metadata.
Work with records directly
Overlaying a point in time answers what an Entity looked like then. To work with the records themselves, reading a series or writing one, use the endpoints below.
A record is shaped like the Entity it belongs to. Your attribute values sit at the root of its Entity object and platform managed values sit under that object's Bruce key, exactly as they do on a live Entity. The same shape is returned by a read, accepted by a write, and accepted by a delete, so a record can be moved between them without translation.
Together, Entity.ID, AttrKey and DateTime are what identify a record. That is all a delete needs, and it is why a record read back can be handed straight to one.
Get records
There are three ways to read, differing only in how the Entities are named. Use the body form when the list of Entity IDs is long enough to be awkward in a url.
Get historic records for one Entity
Get historic records for many Entities
Get historic records with a request body
Update records
Writing a record directly is how you add history the platform did not capture itself, such as a backfill from another system.
The date-time attribute named by AttrKey should also appear in the recorded values, since that attribute is what the record is keyed on.
A record that cannot be written does not fail the request. It is named in Warning and the remaining records still land, so check that rather than assuming every record was accepted.
Note that there is a default limit of 1,000 historic records per Entity ID unless an upgraded limit is discussed. Past that, the oldest records are dropped.
Update historic records for one Entity
Update historic records for many Entities
Delete records
A delete either names the records to remove or describes them with a filter. Both endpoints take both forms, and Items wins when a request carries both.
Naming the records takes them in the shape a read returns, so records you just listed can be handed straight back. Only the identifying fields are read, and anything else on the object is ignored.
Filtering uses the same fields a read accepts. Outside a Scenario, AttrKey and both ends of the range are all required. That is deliberate: it is what stops an unbounded delete. Matching no records is not an error.
Delete historic records for one Entity
Delete historic records for many Entities
Doing this in Python
The Python library wraps all of the above behind one namespace, including paging, so there is no need to pick between these endpoints yourself. See the Python Entity requests documentation.