PEP Management API
API endpoints for managing Politically Exposed Persons (PEP) lists, including CRUD operations, bulk uploads, and search functionality.
Base URL: /admin/aml/pep
Endpoints Summary
| Method | Endpoint | Description |
|---|---|---|
| GET | /admin/aml/pep | List PEPs (paginated) |
| POST | /admin/aml/pep | Create single PEP |
| POST | /admin/aml/pep/bulk | Bulk create PEPs |
| PUT | /admin/aml/pep/:pepId | Update PEP |
| DELETE | /admin/aml/pep/:pepId | Delete PEP |
| GET | /admin/aml/pep/search | Search PEPs |
| GET | /admin/aml/pep/stats | Get statistics |
List PEPs
GET /admin/aml/pep
Query Parameters:
| Parameter | Type | Default | Description |
|---|---|---|---|
status | string | - | active or inactive |
category | string | - | Filter by category |
page | number | 1 | Page number |
limit | number | 50 | Items per page |
search | string | - | Search in name, position, country |
Returns: Paginated list of PEP records
Create PEP
POST /admin/aml/pep
Creates a single PEP record and automatically matches against existing users.
Request Body:
| Field | Type | Required | Description |
|---|---|---|---|
name | string | Yes | Full name |
category | string | No | PEP category (see table below) |
position | string | No | Political position/title |
country | string | No | Country of political exposure |
source | string | No | Data source |
isActive | boolean | No | Active status (default: true) |
additionalInfo | object | No | Extra metadata |
Returns: Created PEP with matching results (users updated, alerts created)
Bulk Create PEPs
POST /admin/aml/pep/bulk
Uploads multiple PEP records at once with automatic user matching.
Request Body:
| Field | Type | Required | Description |
|---|---|---|---|
peps | array | Yes | Array of PEP objects |
Returns:
| Field | Description |
|---|---|
created | Number successfully created |
failed | Number failed |
errors | Error details for failures |
matching | User matching summary |
Update PEP
PUT /admin/aml/pep/:pepId
Updatable Fields: name, category, position, country, isActive, additionalInfo
Delete PEP
DELETE /admin/aml/pep/:pepId
Permanently deletes a PEP record.
Search PEPs
GET /admin/aml/pep/search?q={query}
Query Parameters:
| Parameter | Type | Description |
|---|---|---|
q | string | Search query (min 2 characters) |
Returns: Matching PEP records with count
Get Statistics
GET /admin/aml/pep/stats
Returns:
| Field | Description |
|---|---|
total | Total PEP records |
active | Active records |
inactive | Inactive records |
byCountry | Count by country |
byCategory | Count by category |
PEP Categories
| Category | Description |
|---|---|
Head of State | Presidents, Kings, Prime Ministers |
Government Official | Ministers, Secretaries, Directors |
Senior Politician | Parliament members, Party leaders |
Military Officer | High-ranking military personnel |
Judge | Supreme court judges, High court officials |
Central Bank Official | Central bank governors, Directors |
State Enterprise Executive | CEOs of state-owned enterprises |
Family Member | Close family of PEPs |
Close Associate | Known business/personal associates |
Unknown | Category not determined |
Auto-Matching Behavior
When a PEP is created or bulk uploaded:
- System searches all users for name matches
- Users with matches are flagged as potential PEPs
- Risk scores are updated accordingly
- AML alerts are automatically created
- Matching results are returned in the response
Error Responses
| Status | Error | Description |
|---|---|---|
| 404 | PEP not found | Invalid PEP ID |
| 409 | PEP with this name already exists | Duplicate entry |
| 400 | Name is required | Missing name field |
| 400 | Search query is required | Missing search query |