# Process Data Model API

The Process Data Model API allows you to completely or partially reload your data models, ensuring that the latest data from your source system is available. This is a RESTful API that allows you run GET requests to retrieve information and POST requests to trigger the data model loads.

## Required parameters - Data pool and data model IDs

To use this API, you need both the data pool ID and data model ID, both of which can be found from your URL when viewing that area of the Celonis Platform.

### Data pool ID

Your data pool ID will be in the following format:

```
[https://TEAMNAME.REALM.celonis.cloud/integration/ui/pools/DATA_POOL_ID/](null)
```

### Data model ID

Your data model ID will be in the following format:

```
[https://TEAMNAME.REALM.celonis.cloud/integration/ui/pools/DATAPOOLID/data-configuration/process-data-models/DATA_MODEL_ID?tab=data-model](null)
```

## Authentication methods

To connect to and use the process data model API, use an OAuth client. Create an OAuth client by clicking **Admin & Settings** and selecting **Applications**. The OAuth client needs to have the scope `integration.data-pools` to use all of the APIs. For a full list of Celonis OAuth scopes, see [Available OAuth scopes](https://docs.celonis.com/en/available-oauth-scopes.html). In addition, the client needs to be granted **Edit** permissions on the corresponding data pool. For details on obtaining an access token, see [Authentication](/celonis-apis/auth).

## Complete data model reload

Using a RESTful API, you can trigger a complete data model load (complete load) with this POST request:

```
POST /integration/api/v1/data-pools/{poolId}/data-models/{dataModelId}/load
```

## Partial data model reload

If you only want to update a subset of tables, you can also perform a partial reload. This does a complete reload of the specified tables only and a reload from cache for the rest.

To perfrom a partial reload you need to query the table list first:

```
GET /integration/api/v1/data-pools/{poolId}/data-models/{dataModelId}/tables
```

This will return the following response parameters:

- **id**: The ID of the table configuration in the data model (required for the partial data model reload).
- **dataModelId**: The ID of the data model.
- **dataSourceId**: The ID of the data connection if applicable.
- **name**: The name of the table.
- **alias**: The alias of the table.
- **aliasOrName**: The alias if defined or the name of the table.


Note the IDs of the table to which you would like to sync and then execute the following:

```
POST /integration/api/v1/data-pools/{poolId}/data-models/{dataModelId}/load/partial-sync
```

In the body of this request, you will need to specify the tables as a list of IDs:

```
["table_id1", "table_id2"]
```

## Last load information

In order to query information about the last data model load, use the following endpoint:

```
GET /integration/api/v1/data-pools/{poolId}/data-models/{dataModelId}/last-load
```

## Python example

The following is an example of how this API can be used in Python:

```
`import requests` \
 \
`realm = 'xyz' # e.g. eu-1, us-1, eu-2` \
`tenant = 'xyz' # the name of your team (your subdomain)` \
`access_token = 'xyz' # the OAuth 2.0 access token` \
`pool_id = 'xyz' # the Data Pool ID (see above)` \
`data_model_id = 'xyz' # the Data Model ID (see above)` \
 \
`url = "https://{}.{}.celonis.cloud/integration/api/v1/data-pools/{}/data-models/{}/load".format(tenant, realm, pool_id, data_model_id)` \
 \
`requests.post(url, headers={'authorization': "Bearer {}".format(access_token)})`
```