Add a Fact

You can add a new fact using the POST method on the facts endpoint. You need a token with write privileges, otherwise a 401 or 403 will be sent back.

Fact Format

A new fact must contain a set of aspects and a list of its key aspects, as well as its value and, if numeric, a Decimals or Precision attribute.

POST http://host.28.io/v1/_queries/public/api/facts?token=c3049752-4d35-43da-82a2-f89f1b06f7a4
{
  KeyAspects: [ "xbrl:Concept", "xbrl:Entity", "xbrl:Unit", "xbrl:Period" ],
  Aspects: {
    "xbrl:Concept" : "foo:bar",
    "xbrl:Period" : "2015-12-31",
    "xbrl:Entity" : $eid,
    "xbrl:Unit" : "foo:bar",
    "xbrl28:Archive" : $id
  },
  Value: 2,
  Decimals: 0
}

The archive must exist, and the concept must exist within this archive. otherwise an error is thrown.

Adding new facts and versioning

When a new fact is added, and a fact with the same values for its key aspects already exists, the old fact is kept. On the logical level, this is an update. However, users can still go back in time to view the old fact using the xbrl28:TransactionTime aspect. New facts automatically get assigned a transaction time set to the time they were added to the cell store.

Deleting facts

Facts can be deleted by adding a fact with the same key aspect values and a missing Value field. This will logically delete the fact, although it still remains available through the versioning system for auditing purposing.

Further reference

The reference for the REST API including the JSound schema for the input is documented here