Managing custom data model membership

Prev Next

When you create a CDM for a supported entity type, every entity of that type in LUSID automatically acquires a status with respect to that CDM:

Entity status

CDM member?

Explanation

Valid

The entity meets the requirements of the CDM and has been inducted:

  • It meets the condition of the CDM if there is one, for example instrumentDefinition.instrumentType eq 'Equity'.

  • Only identifiers and properties specified by the CDM have been added to the entity, and values if required.

Candidate

The entity meets the requirements but has not yet been inducted.

Inadmissible

 

The entity does not meet the requirements and so cannot currently be inducted.

Invalid

The entity used to meet the requirements but no longer does; an identifier or property may have been removed, or the entity no longer meets the condition. For example, if the CDM has a condition of Properties[Instrument/Variables/MarketCapitalisation] gte 5000000 and the property value for a particular entity falls below this figure, then the entity is no longer valid.

NotApplicable

N/A

The entity has been deleted.

Discovering membership and status

Call an API such as GetInstrument or ListInstruments and specify the dataModelScope and dataModelCode of a CDM in the request.

In the response, examine the dataModelMembership object for each entity:

  • The membership object lists the CDM(s) of which the entity is a member.

  • The currentModel object reveals the status with respect to the CDM specified in the request. For anything other than Valid, a list of validationFailures is provided:

{
  "name": "Tesco",
  "identifiers": {
    "Figi": "BBG000BF46Y8",
    "LusidInstrumentId": "LUID_00003GOR",
    "ClientInternal": "Tesco"
  },
  "dataModelMembership": {
    "membership": [
      {
        "scope": "CDMInstrument",
        "code": "All",
        "displayName": "All instruments"
      },
      {
        "scope": "CDMInstrument",
        "code": "Equity",
        "displayName": "Equity instruments"
      }
    ],
    "currentModel": {
      "status": "Invalid",
      "scope": "CDMInstrument",
      "code": "Equity",
      "displayName": "Equity instruments",
      "validationFailures": [
        "Mandatory Custom Data Model Property 'Instrument/MandatoryProperties/ExchangeCode' was not provided"
      ]
    }
  },
  ...

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

Valid and invalid members are listed on the Data model members tab. Open the Candidates tab to examine candidates:

Coming soon

Inducting candidate entities into a CDM

If you have a hierarchy of CDMs, note that inducting a candidate into a child also inducts it into the parent.

You can induct entities of different types into different CDMs in the same call to the BatchAmend API, providing the entityType of each matches the entity type of the designated CDM.

You must specify the entityUniqueId for each entity to induct and an operation of Add, for example:

curl -X POST 'https://<your-domain>.lusid.com/api/api/datamodel/$batchamend'
  -H 'Content-Type: application/json-patch+json' 
  -H 'Authorization: Bearer <your-API-access-token>'
  -d '{
  "ephemeral-id-1": {
    "customDataModelId": {
      "scope": "CDMs",
      "code": "Equities"
    },
    "entityType": "Instrument",
    "entityUniqueId": "a56113de-104c-43f3-8d4c-c0cc41a40c23",
    "operation": "Add"
  },
  "ephemeral-id-1": {
    "customDataModelId": {
      "scope": "CDMs",
      "code": "Bonds"
    },
    "entityType": "Instrument",
    "entityUniqueId": "35ad555a-9876-bg56-a057-145geh657hd4",
    "operation": "Add"
  }
}'

To retrieve the entityUniqueId for an entity, use an API such as GetInstrument and examine the version object in the response, for example:

{
  "name": "Tesco",
  "identifiers": {
    "Figi": "BBG000BF46Y8",
    "LusidInstrumentId": "LUID_00003GOR",
    "ClientInternal": "Tesco"
  },
  "version": {
    "effectiveFrom": "0001-01-01T00:00:00.0000000+00:00",
    "asAtDate": "2025-11-28T14:32:03.6464390+00:00",
    "asAtCreated": "2025-11-28T13:39:14.4770740+00:00",
    "userIdCreated": "00u91lo2d7X42sdse2p7",
    "requestIdCreated": "2025112813-933a795a3fbd4a3eab4be54133ce8903",
    "reasonCreated": "",
    "asAtModified": "2025-11-28T14:10:57.8283660+00:00",
    "userIdModified": "00u91lo2d7X42sdse2p7",
    "requestIdModified": "2025112814-000dd6fc0cde42e990eb3b58acf8d007",
    "reasonModified": "",
    "asAtVersionNumber": 14,
    "entityUniqueId": "a56113de-104c-43f3-8d4c-c0cc41a40c23"
  },
  ...

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

Open the Candidates tab and select any number of candidate entities:

Right-click the icon (highlighted in yellow) and select Add to model:

You can examine newly-added entities on the adjacent Data model members tab.

Coming soon

Removing entities from a CDM

If you have a hierarchy of CDMs, note that removing an entity from a parent does not remove it from a child; you must explicitly remove it from both.

You can remove entities of different types from different CDMs in the same call to the BatchAmend API, providing the entityType of each matches the entity type of the designated CDM.

You must specify the entityUniqueId for each entity to remove and an operation of Remove, for example:

curl -X POST 'https://<your-domain>.lusid.com/api/api/datamodel/$batchamend'
  -H 'Content-Type: application/json-patch+json' 
  -H 'Authorization: Bearer <your-API-access-token>'
  -d '{
  "ephemeral-id-1": {
    "customDataModelId": {
      "scope": "CDMs",
      "code": "Equities"
    },
    "entityType": "Instrument",
    "entityUniqueId": "a56113de-104c-43f3-8d4c-c0cc41a40c23",
    "operation": "Remove"
  },
  "ephemeral-id-1": {
    "customDataModelId": {
      "scope": "CDMs",
      "code": "Bonds"
    },
    "entityType": "Instrument",
    "entityUniqueId": "35ad555a-9876-bg56-a057-145geh657hd4",
    "operation": "Remove"
  }
}'

To retrieve the entityUniqueId for an entity, use an API such as GetInstrument and examine the version object in the response, for example:

{
  "name": "Tesco",
  "identifiers": {
    "Figi": "BBG000BF46Y8",
    "LusidInstrumentId": "LUID_00003GOR",
    "ClientInternal": "Tesco"
  },
  "version": {
    "effectiveFrom": "0001-01-01T00:00:00.0000000+00:00",
    "asAtDate": "2025-11-28T14:32:03.6464390+00:00",
    "asAtCreated": "2025-11-28T13:39:14.4770740+00:00",
    "userIdCreated": "00u91lo2d7X42sdse2p7",
    "requestIdCreated": "2025112813-933a795a3fbd4a3eab4be54133ce8903",
    "reasonCreated": "",
    "asAtModified": "2025-11-28T14:10:57.8283660+00:00",
    "userIdModified": "00u91lo2d7X42sdse2p7",
    "requestIdModified": "2025112814-000dd6fc0cde42e990eb3b58acf8d007",
    "reasonModified": "",
    "asAtVersionNumber": 14,
    "entityUniqueId": "a56113de-104c-43f3-8d4c-c0cc41a40c23"
  },
  ...

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

Open the Data model members tab and select any number of entities:

Right-click the icon (highlighted in yellow) and select Remove from model:

Coming soon