Get Retention Policy
GET /obp/v7.0.0/management/banks/BANK_ID/retention-policies/RETENTION_POLICY_ID
OBPv7.0.0-getRetentionPolicy Roles: CanGetRetentionPolicies(per bank),CanManageRetentionPolicy(per bank) Data-RetentionAPI
One retention policy of a space.
A retention policy says how long one kind of resource of a space stays live, and what happens to it then.
BANK_ID is the space: a bank's id, or SYS for the system space. The Role is checked at that BANK_ID.
Periods are configuration, set here per space, never in code.
resource_type: one of dynamic_entity_record, file, chat_message, chat_room, customer, consent.entity_name: the dynamic entity, fordynamic_entity_recordonly. It must exist in the space.date_basis: what the period is counted from.createdorupdatedfor dynamic entity records, chat messages and customers; or, for dynamic entity records,field:<name>, the ISO 8601 date in that field of the record.createdfor files.created,updatedorlast_activity(the last message, or creation when there was none) for chat rooms.created,updatedorexpires(the expiry of the Consent's token; the default) for consents. Defaults tocreatedotherwise.condition: optional,{"field": "status", "value": "CLOSED"}. Only resources whose field has this value (compared as text) are governed. For a dynamic entity record the field is one of the record's own; for the other types it is a field of the resource's JSON copy, such asmedia_type,message_type,customer_typeorstatus.retain_days: how long a resource stays live after its trigger date. At leastretention.minimum_retain_days(1825 days, five years, by default).action:archive(move it out of the live tables into the retention archive, readable only with CanGetRetentionArchive, then delete it afterarchive_days),delete(final), or, for customers only,anonymise(clear the personal fields and delete the attributes, addresses, dependants, tax residences and links to Users, keeping the customer id so that references stay valid). Archiving is not an undo: nothing is ever restored from the archive.archive_days: required forarchive, not allowed otherwise.cascade: files attached to a disposed resource go with it (a dynamic entity record's files are attached with the entity name as record type; a customer's withcustomer). A file still attached to another record stays. Default false: the attachments go, the files stay.requires_approval: an execution waits as pending until a second, different user approves it.enabled: whether the retention scheduler runs the policy. Default true. A run can always be started by hand.
Every disposal is written to the disposal register. Resources on legal hold are skipped by every run.
A run that would archive is refused unless retention.archive.enabled is true, and one that would delete
or anonymise unless retention.delete.enabled is true. See RETENTION_PLAN.md.
User Authentication is Required. The User must be logged in. The Application must also be authenticated.
URL Parameters:
BANK_ID: gh.29.uk
RETENTION_POLICY_ID: RETENTION_POLICY_ID
JSON response body fields (19)
- action
- action
- bank_id
- gh.29.uk
- cascade
- cascade
- created_at
- created_at
- created_by_user_id
- date_basis
- date_basis
- description
- Description of the object. Maximum length is 2000. It can be any characters here.
- enabled
- false
- field
- name
- ACCOUNT_MANAGEMENT_FEE
- requires_approval
- requires_approval
- resource_type
- resource_type
- retain_days
- retain_days
- retention_policy_id
- retention_policy_id
- updated_at
- updated_at
- value
- 5987953
- archive_days
- archive_days
- condition
- condition
- entity_name
- EXAMPLE COMPANY LTD
Example success response
{
"retention_policy_id": "6a1f0e2c-3b8d-4c5e-9f7a-1d2e3f4a5b6c",
"bank_id": "SYS",
"name": "Close applications after two years",
"description": "Applications are kept for two years after they were last changed, then archived for five more.",
"resource_type": "dynamic_entity_record",
"entity_name": "application",
"date_basis": "updated",
"condition": {
"field": "status",
"value": "CLOSED"
},
"retain_days": 2555,
"archive_days": 1825,
"action": "archive",
"cascade": true,
"requires_approval": true,
"enabled": true,
"created_by_user_id": "9ca9a7e4-6d02-40e3-a129-0b2bf89de9b1",
"created_at": "2026-01-01T00:00:00Z",
"updated_at": "2026-01-01T00:00:00Z"
}Possible errors (5)
- OBP-30001: Bank not found. Please specify a valid value for BANK_ID.
- OBP-20001: User not logged in. Authentication is required!
- OBP-20006: User is missing one or more roles:
- OBP-30609: Retention policy not found in this space. Please specify a valid value for RETENTION_POLICY_ID.
- OBP-50000: Unknown Error.