# API Source: https://docs.ldgr.app/analytics_endpoints Access Ledger Analytics, our state-of-the-art insurance data science models and data structures, via convenient API endpoints. ## API keys To access our API endpoints, first email `analytics@ledgerinvesting.com`. On receipt of your email, we will send you an invite link to sign up to our platform where you can create and manage API keys. ## Base endpoint The base URL for all these endpoints is: ```console Base endpoint theme={null} https://ldgr.app/analytics ``` ## Authentication and access Triangles and models are only accessible by users within the same organization. Users cannot access objects from other organizations, but all users within the same organization can access the same objects. ## Companion Python package For ease of use, we have a companion [LedgerAnalytics Python package](https://ledger-investing-ledger-analytics.readthedocs-hosted.com/en/latest/) and associated documentation. The latter contains more technical details about modeling configuration and rationale. ## Triangle endpoints ### List all triangles | Name | Method | Description | | ----------- | ------ | ----------------------------------------------------------------------------------------------------------------------------------------- | | `/triangle` | `GET` | List all triangles a user can access within their organization. Returns all relevant data for triangles, including name and internal ids. | ### Create or update a triangle | Name | Method | Description | | ----------- | ------ | ---------------------------------------- | | `/triangle` | `POST` | Create a named triangle in the database. | | Parameter | Type | Required | Description | | --------------- | ------- | -------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | | `triangle_name` | string | yes | The name of the triangle. | | `triangle_data` | JSON | yes | The triangle data. See our Python package [Bermuda](https://github.com/LedgerInvesting/bermuda-ledger) for more information about the correct dictionary/JSON format. The easiest option is to generate the JSON by saving the results of the `.to_dict()` method called on a Bermuda `Triangle` instance. | | `overwrite` | boolean | no | If a triangle already exists in the database, you must force it's re-creation by setting `overwrite=true` | ### Delete a triangle | Name | Method | Description | | ---------------- | -------- | -------------------------------------------------------- | | `/triangle/{id}` | `DELETE` | Delete a triangle in the database using the triangle id. | ## Model endpoints The LedgerAnalytics API has a number of loss development, tail development, and loss ratio forecasting models available for use. Each model type has it's own endpoint for basic CRUD operations. The specific endpoints are: * `/development-model` * `/tail-model` * `/forecast-model` For the different types of endpoints below, substitute `{model}` for any of the four specific endpoints above. ### Create or update a model This endpoint fits the specific model to a triangle of data already in the database. | Name | Method | Description | | ---------- | ------ | ---------------------------------------- | | `/{model}` | `POST` | Create a named triangle in the database. | | Parameter | Type | Required | Description | | --------------- | ------- | -------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | | `triangle_name` | string | yes | The name of a triangle present in the database. | | `model_name` | string | yes | The user's chosen name of the model. | | `model_type` | string | yes | The specific type of model. For full information about model types, see the [Model types](##model-types) section. | | `model_config` | JSON | yes | Configuration parameters for the model. See the User Guide sections for our companion Python [LedgerAnalytics](https://github.com/LedgerInvesting/ledger-analytics) package for a full description of each model's technical explanation and configuration parameters. | | `overwrite` | boolean | no | Set `overwrite=true` to overwrite a previously fit model. Defaults to `false` to avoid unintended overwrites. | ### List fitted models | Name | Method | Description | | ---------- | ------ | ---------------------------------------------------------------------------------------- | | `/{model}` | `GET` | List all created models, returning key information such as model names and internal ids. | ### Predict from a model Take a fitted model and produce predictions on a new triangle. | Name | Method | Description | | ----------------------- | ------ | ---------------------------------------------------------------------------------------------- | | `/{model}/{id}/predict` | `POST` | Makes predictions using a fitted model and stores the triangle of predictions in the database. | | Parameter | Type | Required | Description | | ---------------- | ------ | -------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | | `triangle_name` | string | yes | The name of the triangle to predict from. Many of insurance development and forecast models are auto-regressive and require an initial triangle to start predicting from. | | `predict_config` | JSON | yes | Configuration parameters for the model. See the User Guide sections for our companion Python [LedgerAnalytics](https://github.com/LedgerInvesting/ledger-analytics) package for a full description of each model's technical explanation and predict configuration parameters. | ### Delete a model | Name | Method | Description | | --------------- | -------- | ---------------------- | | `/{model}/{id}` | `DELETE` | Delete a fitted model. | ### Terminate a running model Our models run on remote cloud compute infrastructure. This endpoint allows users to terminate the remote process during model fit time. | Name | Method | Description | | ------------------------- | ------ | ----------------------------------- | | `/{model}/{id}/terminate` | `POST` | Terminate a remotely running model. | ### Model types | Model | Types | Reference | | ------------------- | --------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------- | | `development-model` | - `ChainLadder`
- `TraditionalChainLadder`
- `MeyersCRC`
- `GMCL`
- `ManualATA` | See the [detailed documentation](https://ledger-investing-ledger-analytics.readthedocs-hosted.com/en/latest/user-guide/development.html). | | `tail-model` | - `GeneralizedBondy`
- `Sherman`
- `ClassicalPowerTransform` | See the [detailed documentation](https://ledger-investing-ledger-analytics.readthedocs-hosted.com/en/latest/user-guide/tail.html) | | `forecast-model` | - `AR1`
- `SSM`
- `TraditionalGCC` | See the [detailed documentation](https://ledger-investing-ledger-analytics.readthedocs-hosted.com/en/latest/user-guide/forecast.html). | # Data Access Source: https://docs.ldgr.app/data_access Connect to our data # Python Access to Our Schema With any IDE, you can access our data, which is hosted on the Databricks platform. Use the following instructions: 1. Contact us at [support@ledgerinvesting.com](mailto:support@ledgerinvesting.com) and we will send you a link. 2. From this link, download a credential file you will need: `config.share` 3. Install the delta sharing python package in your local environment: `pip install delta_sharing` 4. Use the following code to get a table named `contract_text`: ```python theme={null} import delta_sharing # change local path to file if needed, this assumes it's in the same folder share_file = "config.share" client = delta_sharing.SharingClient(share_file) share = "ledgerdatamap" table_name = "contract_text" def get_table_url(table): return f"{share_file}#{share}.data_map.{table}" df = delta_sharing.load_as_pandas(get_table_url(table_name)) print(df) ``` 5. To view all available tables do: `client.list_all_tables()` # Data Map Source: https://docs.ldgr.app/data_map # Entity Relational Diagram Understand how your data is structured and how key entities relate to one another across Ledger’s datasets. This Entity Relationship Diagram (ERD) provides a high-level view of the core data model used in your Delta Sharing access. It covers key objects such as reinsurance transactions, contracts, policy groups, claims, premiums, and company entities. This map is designed to help developers, data analysts, and integration teams navigate the dataset efficiently. ### Explore the Interactive Version Dive deeper using the interactive view in [DB Docs](https://dbdocs.io/ledger/data_map?view=relationships) for field-level details and table relationships. ### Download the PDF Prefer a static version? View or download the PDF below for offline reference: