LeanLaw Developer Platform

Authentication

All API endpoints are authenticated by passing in a bearer token on the header with a LeanLaw API key.

Code
Authorization: Bearer {apikey}

To obtain a key, log into your LeanLaw account and create it like this:

  • Go to Settings > API and click "Generate API Key"
  • Pick permissions (scopes) for the key (read or write), give it a name and click "Save"
  • Copy the key (it will only be available once) and store it in a safe location

The API key represents the account (the firm) and acts on behalf of it with the access provided by the scopes associated with the API key when it was created. Many use cases for the API requires identifying a user. Those API calls have a userId filter or parameter, but as an alternative the user information can be provided in as a header value for all calls:

Code
x-leanlaw-userid: {userId}

This is the recommended approach for time tracking use cases where lists of matters and lists of time entries are for a specific user. The userId can be received from the ListUsers endpoint, either by listing all users or querying users by email.

Partner ID

If you are a LeanLaw partner provide your id on all requests in the header as follows:

Code
x-leanlaw-partnerid: {id}
Last modified on