How do I create entities under a custom data model?

Prev Next

You can create entities under (that is, in the context of) a custom data model (CDM) in order to enforce the requirements of that model.

Note: You can continue creating entities outside the context of a CDM if you wish. Providing they meet the requirements, you can induct them later.

If an entity is updated such that it no longer meets the requirements, LUSID updates the membership status. You can manually remove invalid entities from the CDM.

Call an API such as UpsertInstruments API and supply the dataModelScope and dataModelCode of the CDM to use as query parameters in the URL, for example:

curl -X POST "https://<your-domain>.lusid.com/api/api/instruments?dataModelScope=CDMs&dataModelCode=Equities"
   -H "Authorization: Bearer <your-API-access-token>"
   -H "Content-Type: application/json"
   -d '{"upsert-request-1": {
    "name": "BP $0.25 LDN",
    ...
  }
}'

We strongly recommend checking the failed object in the response for entities that did not meet the requirements:

{
  "values": {},
  "staged": {},
  "failed": {
    "upsert-request-1": {
      "id": "upsert-request-1",
      "type": "CustomDataModelValidationFailure",
      "detail": "Mandatory Custom Data Model Identifier 'Instrument/default/Figi' was not provided",
      "errorDetails": []
    }
  },
  ...
}

Navigate to the dashboard for the entity type of interest, for example Data Management > Instruments, and select a CDM:

Make sure the breadcrumb trail identifies the correct CDM (highlighted below) and click the Create instrument button:

Note that the first Instruments item in the breadcrumb trail above represents standard instruments created outside the context of a model, with no restrictions on identifiers and properties.

Complete the Create instrument dialog in the normal way. Note the M icon before the name depicts identifiers and properties controlled by the CDM, and the * after it signifies that values are mandatory:

Coming soon