My-Dynamic-Entities
My Dynamic Entities are user-scoped endpoints that are automatically generated when you create a Dynamic Entity with hasPersonalEntity set to true (which is the default).
How it works:
- Create a Dynamic Entity definition (System or Bank Level) with hasPersonalEntity = true
- OBP automatically generates both regular CRUD endpoints AND 'my' endpoints
- The 'my' endpoints only return data created by the authenticated user
Example workflow:
Step 1: Create a Dynamic Entity definition
POST /management/system-dynamic-entities
{
"hasPersonalEntity": true,
"CustomerPreferences": {
"description": "User preferences",
"required": ["theme"],
"properties": {
"theme": {"type": "string"},
"language": {"type": "string"}
}
}
}
Step 2: Use the auto-generated 'my' endpoints:
- POST /my/CustomerPreferences - Create my preference
- GET /my/CustomerPreferences - Get all my preferences
- GET /my/CustomerPreferences/ID - Get one of my preferences
- PUT /my/CustomerPreferences/ID - Update my preference
- DELETE /my/CustomerPreferences/ID - Delete my preference
For bank-level entities:
- POST /banks/BANK_ID/my/CustomerPreferences
- GET /banks/BANK_ID/my/CustomerPreferences
- GET /banks/BANK_ID/my/CustomerPreferences/ID
- PUT /banks/BANK_ID/my/CustomerPreferences/ID
- DELETE /banks/BANK_ID/my/CustomerPreferences/ID
Key differences:
- Regular endpoints (e.g., /CustomerPreferences): Access ALL entities (requires roles)
- My endpoints (e.g., /my/CustomerPreferences): Access only your own entities (user-scoped)
Note: If hasPersonalEntity is set to false, no 'my' endpoints are generated.
Management endpoints for Dynamic Entity definitions (available from v4.0.0):
- GET /my/dynamic-entities - Get all Dynamic Entity definitions I created
- PUT /my/dynamic-entities/DYNAMIC_ENTITY_ID - Update a definition I created
Discovery endpoint (available from v6.0.0):
- GET /personal-dynamic-entities/available - Discover all Dynamic Entities that support personal data storage
This endpoint allows regular users (without admin roles) to discover which dynamic entities they can interact with for storing personal data via the /my/ENTITY_NAME endpoints. No special roles required - just needs to be logged in.
Response format for GET /my/dynamic-entities and GET /personal-dynamic-entities/available:
v6.0.0 format (recommended):
The v6.0.0 response uses snake_case field names and an explicit entity_name field:
{
"dynamic_entities": [
{
"dynamic_entity_id": "abc-123-def",
"entity_name": "CustomerPreferences",
"user_id": "user-456",
"bank_id": null,
"has_personal_entity": true,
"definition": {
"description": "User preferences",
"required": ["theme"],
"properties": {
"theme": {"type": "string"},
"language": {"type": "string"}
}
}
}
]
}
v4.0.0 format (legacy):
The v4.0.0 response uses camelCase field names and the entity name is a dynamic key (not a fixed property name):
{
"dynamic_entities": [
{
"CustomerPreferences": {
"description": "User preferences",
"required": ["theme"],
"properties": {
"theme": {"type": "string"},
"language": {"type": "string"}
}
},
"dynamicEntityId": "abc-123-def",
"userId": "user-456",
"hasPersonalEntity": true,
"bankId": null
}
]
}
To extract the entity name from the v4.0.0 format programmatically, find the key that is NOT one of the standard properties: dynamicEntityId, userId, hasPersonalEntity, bankId.
Required roles:
- CanCreateDynamicEntityDefinition - To create dynamic entities. Granted at
SYSit covers the system space; granted at a bank's id it covers that bank.
For general information about Dynamic Entities, see here