# Clio plugin
Integrates Clio (opens new window) with the Epona provisioning service. The plugin periodically syncs matters and contacts from Clio to SharePoint, and optionally sends data back to Clio when matters are updated.
DLL: Epona.Clio.dll
# What it does
- Matter sync — reads matters from Clio via the REST API and creates or updates matters in SharePoint on a configurable schedule.
- Contact sync — optionally reads contacts and assigns them to matter team members.
- Post handler — when a matter is updated in SharePoint, can send data back to Clio to update custom fields.
- Field mapping — maps Clio matter and contact fields to SharePoint properties with customizable source/target field names.
# Deployment
- Copy
Epona.Clio.dllto the service's bin directory. - Restart the provisioning service.
- Open the Configurator, select the configuration, and configure the Clio section that now appears in the property grid.
- Connect the plugin to Clio as described in Connecting to Clio.
# Connecting to Clio
The plugin connects to Clio with OAuth. You register an app in Clio once, request an authorization code, and enter the code in the configuration. From then on the plugin keeps the connection alive by itself.
# Clio regions
Clio runs a separate instance per region. The app, the authorization code and the connection only work on the instance they belong to, so use the same region throughout.
| Region | AppUrl | Authorize URL |
|---|---|---|
| United States | https://app.clio.com/ | https://app.clio.com/oauth/authorize |
| Europe | https://eu.app.clio.com/ | https://eu.app.clio.com/oauth/authorize |
| Canada | https://ca.app.clio.com/ | https://ca.app.clio.com/oauth/authorize |
| Australia | https://au.app.clio.com/ | https://au.app.clio.com/oauth/authorize |
The region is the address the customer uses to log in to Clio.
# Step 1: register the Clio app
- In the Clio developer portal for the customer's region, create an app (or open the existing one).
- Add
https://oauth2.eponalegal.comto the app's Redirect URIs. Other redirect URIs may stay; this one must be present. - Copy the app's Client ID into AppKey and its Client Secret into AppSecret (see Entering the secrets).
# Step 2: request the authorization code
Log in to Clio as a user with access to the matters that must be synchronized.
Open the authorize URL of the customer's region with these parameters, replacing
<Client ID>:https://app.clio.com/oauth/authorize?response_type=code&client_id=<Client ID>&redirect_uri=https%3A%2F%2Foauth2.eponalegal.comFor another region, replace
https://app.clio.comwith that region's address from the table above.Click Allow. Clio sends you to the
oauth2.eponalegal.compage, which shows the authorization code in a dialog. Copy it from there.
The redirect_uri parameter is required. A code requested without it, or through Clio's own approval page (/oauth/approval), is rejected when the plugin uses it.
# Step 3: enter the code
An authorization code is valid for 10 minutes and can be used only once. Right after requesting it:
- Enter it as Authorization Code (see Entering the secrets).
- Save the configuration and restart the provisioning service. The plugin connects on its first run, shortly after the service starts, provided IntervalInMinutes is at least
1.
Check the log: the connection succeeded when there is no Clio rejected ... error and matters are retrieved.
# Entering the secrets
Where AppSecret and Authorization Code are entered depends on whether the configuration has been migrated to the secret store:
- Not migrated: in the Clio section of the property grid.
- Migrated to the secret store: in the Secrets window (toolbar button), as
Clio.AppSecretandClio.AppCode. The fields are then no longer shown in the property grid. Save the secrets while logged in as the Windows account the service runs under.
# How the connection is kept
After the first connection the plugin stores the tokens it receives from Clio and renews them automatically before they expire. The authorization code is only used again when Clio rejects the renewal; the log then asks for a new code. Entering a new code is enough; you do not need to reset anything else. The one exception is described in Resetting the stored connection.
# Configuration reference
# Connection settings
# Name
Type: string | Default: Clio
Display name for this plugin configuration.
# Disabled
Type: boolean | Default: false
Set to true to disable this configuration without removing it.
# AppUrl
Type: string | Default: https://app.clio.com/
Base URL of the customer's Clio instance, including the trailing /. Use the address for the customer's region; see Clio regions.
# AppKey
Type: string
The Client ID of the Clio app.
# AppSecret
Type: string
The Client Secret of the Clio app. Stored encrypted. See Entering the secrets for where to enter it.
# AppCode
Type: string | Configurator: Authorization Code
Clio authorization code for OAuth authentication. Stored encrypted. See Entering the secrets for where to enter it.
The plugin uses the authorization code only when it has no working tokens: on the first connection, or when Clio rejects the stored refresh token. An authorization code is valid for 10 minutes and can be used once. If the log reports that Clio rejected the authorization code, request a new code as described in Step 2 and enter it here. The plugin picks it up on its next run; you do not need to reset anything else.
# Scheduling
# IntervalInMinutes
Type: integer | Default: 0
How often the sync job runs, in minutes. The first run starts shortly after the service starts. With 0 the sync does not run at all.
# StartTime
Type: TimeSpan
Earliest time of day the job may run. Leave empty to run at any time.
# EndTime
Type: TimeSpan
Latest time of day the job may run. Leave empty to run at any time.
# LastRunDateTime
Type: datetime
Starting point of the first sync: matters changed since this moment are read. After the first run the plugin keeps track of its progress separately, so this value in the configuration does not change. With TestMapping enabled the plugin does not move its progress forward.
# Matter mapping
# MatterCode
Type: string | Default: display_number
Clio field that maps to the SharePoint matter code.
# MatterName
Type: string | Default: description
Clio field that maps to the SharePoint matter name.
# MatterNameUseDescription
Type: boolean | Default: false
If true, use the description field as the matter name instead of the display name.
# MatterFieldMapping
Type: string
Maps Clio fields to SharePoint fields. Syntax: sharepointField=clioField;sharepointField2=clioField2.
# MatterEndpointUrlFilter
Type: string
Optional query parameters to append when fetching matters. Example: ?status=active.
# Client mapping
# MapPracticeArea
Type: string
Clio field containing the practice area.
# MapResponsibleAttorneyName
Type: string
Clio field containing the responsible attorney's name.
# MapResponsibleAttorneyEmail
Type: string
Clio field containing the responsible attorney's email.
# MapOriginatingAttorneyName
Type: string
Clio field containing the originating attorney's name.
# MapOriginatingAttorneyEmail
Type: string
Clio field containing the originating attorney's email.
# MapStatus
Type: string
Clio field containing the matter status.
# MatterCodeSplit
Type: string | Default: /
Delimiter used to split composite matter codes.
# ClientFieldMapping
Type: string
Maps Clio client fields to SharePoint fields. Same syntax as MatterFieldMapping.
# Filtering
# MatterFilter
Type: string
Filters applied when reading matters from Clio. Syntax: <clioField>=<value>;.
# Post handler (save back to Clio)
# EnablePostHandler
Type: boolean | Default: false
Set to true to enable saving data back to Clio when matters are updated.
# SharePointMatterIdPropertyName
Type: string
Name of the SharePoint property that contains the Clio matter ID.
# SharepointDataPropertyName
Type: string | Default: URL
Name of the SharePoint property containing the data to send to Clio.
# SaveInCustomFieldValues
Type: boolean | Default: false
Set to true if the target Clio field is in the custom field values section.
# ClioTargetField
Type: string
Name of the Clio field (or custom field) that receives the data.
# Debugging
# Debug
Type: boolean | Default: false
Enables verbose debug logging.
# TestMapping
Type: boolean | Default: false
When enabled, moves parsed JSON to the test directory and skips updating the last-changed timestamp. Use to validate field mappings without modifying state.
# Troubleshooting
| Log message | Cause | What to do |
|---|---|---|
Clio rejected the authorization code (invalid_grant: Redirect URI does not match callback url) | The code was requested without redirect_uri=https%3A%2F%2Foauth2.eponalegal.com, for example through Clio's approval page. The log advises generating a new code, but a new code requested the same way fails again. | Request a new code exactly as described in Step 2. |
Clio rejected the authorization code (invalid_grant ...) with any other description | The code has expired (after 10 minutes) or was already used. | Request a new code and enter it right away. |
Clio rejected the Clio app credentials ... Check AppKey and AppSecret | AppKey or AppSecret is wrong, or belongs to an app in another region. | Check both values and AppUrl against the Clio app. |
The access token provided is expired, revoked, malformed or invalid for other reasons on every run | Clio no longer accepts the stored connection before it is due for renewal, for example after access to the app was revoked in Clio, or after AppKey or AppUrl was changed to another app or region. | Reset the stored connection, see below. |
# Resetting the stored connection
The plugin keeps using a stored connection until it is due for renewal. If Clio rejects it earlier (last row above), reset it:
- Stop the provisioning service, and keep it stopped until step 5.
- Set LastRunDateTime to a recent date. Resetting also resets the sync progress to this value; with the default value all matters are read again.
- In the service directory, delete the file
Config\Clio\<configuration name>.json. - Request a new authorization code as described in Step 2 and enter it as Authorization Code (see Entering the secrets).
- Start the provisioning service within 10 minutes of requesting the code.
# Example configuration
| Property | Example value |
|---|---|
Name | Clio |
AppUrl | https://app.clio.com/ |
AppKey | your-clio-client-id |
IntervalInMinutes | 30 |
MatterCode | display_number |
MatterName | description |
MatterFieldMapping | MatterType=practice_area;Responsible=responsible_attorney_name |
MapPracticeArea | practice_area |
MapResponsibleAttorneyName | responsible_attorney_name |
MapResponsibleAttorneyEmail | responsible_attorney_email |
MatterFilter | status=active; |
EnablePostHandler | false |
Debug | false |
# Related
- Configuration reference — provisioning configuration reference
- Plugins index — list of available plugins