{"activeVersionTag":"latest","latestAvailableVersionTag":"latest","collection":{"info":{"_postman_id":"e9579cd8-6b6b-42fb-ad59-d98d63e17353","name":"Lawcus API","description":"Welcome to the Lawcus API Documentation. This documentation is the reference point for the users who want to create applications using the Lawcus API. You can integrate with the Lawcus API to create customized application as per your requirement.\n\n# Lawcus Overview\n\nLawcus is a legal practice management software that allows you to organize and manage various components of legal practice. You can use the features available in the Lawcus application to simplify the day-to-day workflows and business operations in your law firm.\n\nLawcus API gives you access to the core features available in the Lawcus application so that you can design and create an application that is best fitted to suit your organizational needs.\n\nLawcus API allows you to access the Lawcus resources via multiple endpoints that can be used to access and manage data from the Lawcus application. You can access these endpoints using the Lawcus API Server. The server has been installed in two different geographic regions. Depending on your requirements, you can access the Lawcus API via the following geographic regions:\n\n- USA (api.lawcus.com)\n    \n- Europe (api.eu.lawcus.com)\n    \n\nEach endpoint defines an action that you can perform. For example, you can create a new contact in Lawcus using the [<i>https://api.us.lawcus.com/contacts</i>](https://api.us.lawcus.com/contacts) endpoint. Similarly, there are various other endpoints for each action in Lawcus. You can use these endpoints to interact with the Lawcus resources and create your system. Refer to the Lawcus API Documentation for further details on the API endpoints and their use.\n\n## Roles and Permissions\n\nLawcus uses role-based access control to allow or restrict access to critical information based on a users role. You can define roles and permissions for different users from the **Manage your organization** section in your Lawcus application.\n\nThere are two types of roles in the Lawcus application:\n\n- Default roles\n    \n- Custom roles\n    \n\n### Default Roles\n\nThe Lawcus application supports the following default roles:\n\n**Admin**: The **Admin** role allows users to act as the ultimate owner of the application. Users in the admin role can create and manage new contacts and matters, access the financial information, and add new roles and new members.\n\n**Member**: The **Member** role allows users to create new matters and contacts and manage all the contacts and matters in the Lawcus application.\n\nThe following table summarizes the permissions for the admin and member roles.\n\n| Lawcus Resources | Admin | Member |\n| --- | --- | --- |\n| Account | Yes | No |\n| Invoice | Yes | No |\n| Reports | Yes | No |\n| CRM Reports | Yes | No |\n| Contacts | Yes | Yes |\n| Leads | Yes | Yes |\n| Matters | Yes | Yes |\n| Workflows | Yes | Yes |\n| Intake Forms | Yes | Yes |\n| Document Templates | Yes | Yes |\n| Team Activities | Yes | No |\n| Personal Activities | Yes | Yes |\n| Interactions | Yes | Yes |\n| Tasks | Yes | Yes |\n| User Management | Yes | No |\n\n### Custom roles\n\nIf the existing default roles do not suffice your organization needs, you can also define custom roles in the Lawcus application. The custom roles can have custom permission depending on your organization requirements. Only an admin user can add custom roles.\n\n---\n\n**NOTE**\n\n- The Lawcus API returns a **406 Error** if the user does not have the permission to access the Lawcus resources.\n    \n- Lawcus API endpoints accept and return the dates in the UTC time format only. Therefore, all dates should be in the _YYYY-DD-MM HH:MM:SS_ format.\n    \n\n---\n\n## Lawcus API Integration\n\nThe Lawcus API connects your application to the Lawcus application. To integrate the Lawcus API endpoints in your application, you must first register in Lawcus. You can contact the Lawcus Team to obtain your Lawcus application.\n\nOnce you are registered in Lawcus, you must contact the Lawcus Team to obtain your client ID and client secret key. Then your application can request an access token from the Lawcus Authorization Server, extract the token from the response, and sends the token to the Lawcus API to fetch data from the server.\n\n# Authorization in the Lawcus API\n\nLawcus API uses the Oauth2 authentication flow to authorize its clients and requests. Oauth2 uses authentication tokens instead of passwords to authorize the API requests. You can access the Lawcus data without sharing your application password. You can request to fetch and modify the Lawcus data from your application after obtaining the authentication token.\n\nYou must follow the steps below to authenticate your application in Lawcus:\n\n## Creating a Lawcus Application\n\nTo obtain the authentication token, you must first create a Lawcus application and register a user who has the permission to access the authentication token.\n\nContact the [Lawcus Team](https://lawcus.com/contact-us) to create a Lawcus application and register an authorized user.\n\n## Obtaining the Authorization Token\n\nAfter registering a Lawcus application and user for your application, you can obtain the authentication token using the following steps:\n\n1. Authorize your application and user by making a GET request to the [<i>https://auth.lawcus.com/auth</i>](https://auth.lawcus.com/auth) url with the following parameters.\n    \n\n| Parameter | Description |\n| --- | --- |\n| client_id | Client ID. |\n| redirect_uri | Your application URL. |\n| response_type | Response type. The value of this parameter must be \"code\". |\n| state | State between the request and the callback. Optional parameter. |\n\n```\n**Request URL:**\nGET https://auth.lawcus.com/auth?response_type=code&state=&client_id=1234&scope=&redirect_uri=https://api-hostname/oauth\n\n ```\n\n**Grant Approved**:\n\nAfter the application is authenticated, the Lawcus API redirects you _redirect_uri_ along with the authorization code and the state of the request mentioned earlier.The authorization code is passed in the _code_ parameter in the url. You must use this code in the next step to obtain the authorization token.\n\n**Grant Approved Redirect URL:**\n\n```\n  https://your-application.com/oauth?code=fc70a440b1a911eb846a6140b7c6cb7a&state=xyz\n\n ```\n\n1. Obtain the access token required to authenticate your API requests. You must make a _POST_ request to the [<i>https://auth.lawcus.com/oauth/token</i>](https://auth.lawcus.com/oauth/token) url obtain the access token.\n    \n\n**Request URL:**\n\n```\n  https://auth.lawcus.com/oauth/token\n\n ```\n\n**Request Body Parameters:**\n\n| Parameter | Description |\n| --- | --- |\n| grant_type | Application grant type. The value of this parameter must be _authorization_code_. |\n| code | Authentication code. Value of the _code_ parameter obtained from step 1. |\n| redirect_uri | Your application URL. |\n| client_id | Client ID. |\n| client_secret | Client secret key. |\n\n**Request Body:**\n\n```\n {\n    \"code\": \"fc70a440b1a911eb846a6140b7c6cb7a\",\n    \"grant_type\": \"authorization_code\",\n    \"client_id\": \"1234\",\n    \"client_secret\": \"1234\",\n    \"redirect_uri\": \"https://your-application.com/oauth\"\n  }\n\n ```\n\n**Response Example:**\n\n```\n HTTP/1.1 200 OK\n {\n   \"access_token\":\"fd6cee60b1a911ebbebbf548c3991b60VZfd6cf170b1a911eb898b950834c3ffbf\",\n   \"refresh_token\":\"fd6cf1e0b1a911eb9f0f3b697f3cd8e6A63*@kjfd6cf240b1a911ebb59d7528e27c33d5\",\n   \"expires_in\":\"3660\",\n   \"region\":\"us\"\n }\n\n ```\n\n**Response Parameters:**\n\n| Parameter | Description |\n| --- | --- |\n| access_token | Access token for the API requests. |\n| refresh_token | Refresh token code required to generate a refresh token for the API requests. |\n| expires_in | Expiry time for the access token in seconds. |\n| region | Region of the API request. Value can be \"us\" for USA and \"eu\" or Europe. |\n\nYou can use the _access_token_ in each API request access data from Lawcus using the API.\n\n1. The access token expires after the given time, you must make a _POST_ request to the [<i>https://auth.lawcus.com/oauth/token</i>](https://auth.lawcus.com/oauth/token) url with the following parameters to obtain a new access token:\n    \n\n**Request Body Parameters:**\n\n| Parameter | Description |\n| --- | --- |\n| grant_type | Application grant type. The value of this parameter must be _refresh_token_. |\n| refresh_token | Refresh token code. Value of the _refresh_token_ parameter obtained from step 2. |\n| client_id | Client ID. |\n| client_secret | Client secret key. |\n\n**Request Body:**\n\n```\n {\n    \"code\": \"fd6cf1e0b1a911eb9f0f3b697f3cd8e6A63\",\n    \"grant_type\": \"refresh_token\",\n    \"client_id\": \"1234\",\n    \"client_secret\": \"1234\",\n    \"redirect_uri\": \"https://your-application.com/oauth\"\n  }\n\n ```\n\n**Response Example:**\n\n```\n  HTTP/1.1 200 OK\n {\n     \"access_token\": \"ede90e20b72f11eb8402cf457c1d45d2VZede910c0b72f11eb850b695ca8ee73a4\",\n     \"refresh_token\": \"ede91130b72f11eb98e4b570ce4f2ee4A63*@kjede91170b72f11eb9b73312727e4d8fc\",\n     \"expires_in\": \"3660\",\n     \"region\": \"us\"\n }\n\n ```\n\n**Response Parameters:**\n\n| Parameter | Description |\n| --- | --- |\n| access_token | Access token for the API requests. |\n| refresh_token | Refresh token code required to generate a refresh token for the API requests. |\n| expires_in | Expiry time for the access token in seconds. |\n| region | Region of the API request. Value can be \"us\" for USA and \"eu\" or Europe. |\n\n> Note: If you need a non-expiring token, you can generate a long-life token from Lawcus. Go to the **Using Long-Life Tokens for Simplified Authentication** section below to learn more. \n  \n\n## Using the Authorization Token to access Lawcus APIs\n\nAfter obtaining the authorization token, you can use them to access the Lawcus APIs. You must pass the token in the request header in the following format:\n\nAuthorization: Oauth Bearer < access_token >\n\nFor more information, you can watch the following demo video on how to obtain access token for Lawcus APIs using Postman:\n\n[Authorization in Lawcus using Postman](https://lawcus-assets.s3.amazonaws.com/video/lawcus.mp4)\n\n## **Using Long-Life Tokens for Simplified Authentication**\n\nIn addition to the OAuth2 flow, Lawcus provides a long-life token for simpler, user-based authentication. Unlike an OAuth access token, a long-life token doesn't expire, is tied to a single user's account and permissions, and stays valid until it's manually revoked. It's a good fit for scripts, background jobs, and server-to-server integrations where refreshing tokens isn't practical.\n\n### **Step 1: Restrict Access with a Custom Role (Optional)**\n\nIf the token should only access specific resources, create a role with just those permissions and assign it to a dedicated user before generating the token:\n\n1\\. Go to `Manage your organization > Roles and Permissions` and create a new custom role with only the permissions you need (e.g., matters, contacts).\n\n2\\. Go to `Manage your organization > Users` and create a new user (or select an existing one) to associate with the token.\n\n3\\. Assign the custom role you just created to that user.\n\nThe token generated for this user will only have the permissions defined in the custom role.\n\n### Step 2: Generate the Token\n\nFollow the steps below to generate a token:\n\n1\\. Log in to **Lawcus** as the user the token should belong to.\n\n2\\. Click on the profile icon.\n\n3\\. Go to `Settings > API Tokens`.\n\n4\\. Click **Add**, give the token a descriptive name, and set the type to **API long-life token**.\n\n5\\. Copy the token immediately. It's shown in full only once.\n\n### **Step 3: Use the Token in API Requests**\n\nAfter obtaining the authorization token, you can use it to access the Lawcus APIs. You must pass the token in every request using the LAWCUS-X-API-TOKEN header:\n\n**Example:**\n\n``` bash\ncurl -X GET https://api.us.lawcus.com/matters \\\n  -H \"LAWCUS-X-API-TOKEN: ltc_abcdef1234567890\" \\\n  -H \"Content-Type: application/json\"\n\n ```\n\n> **Note:****\\- Don't use Authorization: Bearer with this token. Only LAWCUS-X-API-TOKEN is accepted.**  \n**\\- Permissions update automatically if the user's role changes, and the token works across user region US or EU.** \n  \n\n### **Managing and Revoking Tokens**\n\n- You can view and delete your own tokens anytime from Settings > API Tokens.\n    \n- Organization owners can see every token issued across the organization from the same screen. They can revoke any token by clicking the delete icon next to it, which immediately invalidates it.\n    \n\nFor more information, you can watch the following demo video on how to obtain access token for Lawcus APIs using Postman:\n\n[Authorization in Lawcus using Postman](https://lawcus-assets.s3.amazonaws.com/video/lawcus.mp4)","schema":"https://schema.getpostman.com/json/collection/v2.0.0/collection.json","isPublicCollection":false,"owner":"15405515","team":1771794,"collectionId":"e9579cd8-6b6b-42fb-ad59-d98d63e17353","publishedId":"TzJrCKcK","public":true,"publicUrl":"https://docs.lawcus.com","privateUrl":"https://go.postman.co/documentation/15405515-e9579cd8-6b6b-42fb-ad59-d98d63e17353","customColor":{"top-bar":"FFFFFF","right-sidebar":"303030","highlight":"3047ED"},"documentationLayout":"classic-double-column","customisation":null,"version":"8.12.8","publishDate":"2021-05-24T17:53:08.000Z","activeVersionTag":"latest","documentationTheme":"light","metaTags":{},"logos":{}},"statusCode":200},"environments":[{"name":"Production","id":"653b947b-3d86-448d-a883-0cdc144393aa","owner":"15405515","values":[{"key":"host","value":"https://api.us.lawcus.com","enabled":true},{"key":"frontend_host","value":"https://www.auth.lawcus.com","enabled":true}],"published":true}],"user":{"authenticated":false,"permissions":{"publish":false}},"run":{"button":{"js":"https://run.pstmn.io/button.js","css":"https://run.pstmn.io/button.css"}},"web":"https://www.getpostman.com/","team":{"logo":"https://res.cloudinary.com/postman/image/upload/t_team_logo_pubdoc/v1/team/1b41123875b8aff44aa6b4aa1a27ff352157f1326850e51a0cc5ca9aa88925db","favicon":"https://res.cloudinary.com/postman/image/upload/v1631116815/team/yzpws19j82ldxzigirrz.ico"},"isEnvFetchError":false,"languages":"[{\"key\":\"csharp\",\"label\":\"C#\",\"variant\":\"HttpClient\"},{\"key\":\"csharp\",\"label\":\"C#\",\"variant\":\"RestSharp\"},{\"key\":\"curl\",\"label\":\"cURL\",\"variant\":\"cURL\"},{\"key\":\"dart\",\"label\":\"Dart\",\"variant\":\"http\"},{\"key\":\"go\",\"label\":\"Go\",\"variant\":\"Native\"},{\"key\":\"http\",\"label\":\"HTTP\",\"variant\":\"HTTP\"},{\"key\":\"java\",\"label\":\"Java\",\"variant\":\"OkHttp\"},{\"key\":\"java\",\"label\":\"Java\",\"variant\":\"Unirest\"},{\"key\":\"javascript\",\"label\":\"JavaScript\",\"variant\":\"Fetch\"},{\"key\":\"javascript\",\"label\":\"JavaScript\",\"variant\":\"jQuery\"},{\"key\":\"javascript\",\"label\":\"JavaScript\",\"variant\":\"XHR\"},{\"key\":\"c\",\"label\":\"C\",\"variant\":\"libcurl\"},{\"key\":\"nodejs\",\"label\":\"NodeJs\",\"variant\":\"Axios\"},{\"key\":\"nodejs\",\"label\":\"NodeJs\",\"variant\":\"Native\"},{\"key\":\"nodejs\",\"label\":\"NodeJs\",\"variant\":\"Request\"},{\"key\":\"nodejs\",\"label\":\"NodeJs\",\"variant\":\"Unirest\"},{\"key\":\"objective-c\",\"label\":\"Objective-C\",\"variant\":\"NSURLSession\"},{\"key\":\"ocaml\",\"label\":\"OCaml\",\"variant\":\"Cohttp\"},{\"key\":\"php\",\"label\":\"PHP\",\"variant\":\"cURL\"},{\"key\":\"php\",\"label\":\"PHP\",\"variant\":\"Guzzle\"},{\"key\":\"php\",\"label\":\"PHP\",\"variant\":\"HTTP_Request2\"},{\"key\":\"php\",\"label\":\"PHP\",\"variant\":\"pecl_http\"},{\"key\":\"powershell\",\"label\":\"PowerShell\",\"variant\":\"RestMethod\"},{\"key\":\"python\",\"label\":\"Python\",\"variant\":\"http.client\"},{\"key\":\"python\",\"label\":\"Python\",\"variant\":\"Requests\"},{\"key\":\"r\",\"label\":\"R\",\"variant\":\"httr\"},{\"key\":\"r\",\"label\":\"R\",\"variant\":\"RCurl\"},{\"key\":\"ruby\",\"label\":\"Ruby\",\"variant\":\"Net::HTTP\"},{\"key\":\"shell\",\"label\":\"Shell\",\"variant\":\"Httpie\"},{\"key\":\"shell\",\"label\":\"Shell\",\"variant\":\"wget\"},{\"key\":\"swift\",\"label\":\"Swift\",\"variant\":\"URLSession\"}]","languageSettings":[{"key":"csharp","label":"C#","variant":"HttpClient"},{"key":"csharp","label":"C#","variant":"RestSharp"},{"key":"curl","label":"cURL","variant":"cURL"},{"key":"dart","label":"Dart","variant":"http"},{"key":"go","label":"Go","variant":"Native"},{"key":"http","label":"HTTP","variant":"HTTP"},{"key":"java","label":"Java","variant":"OkHttp"},{"key":"java","label":"Java","variant":"Unirest"},{"key":"javascript","label":"JavaScript","variant":"Fetch"},{"key":"javascript","label":"JavaScript","variant":"jQuery"},{"key":"javascript","label":"JavaScript","variant":"XHR"},{"key":"c","label":"C","variant":"libcurl"},{"key":"nodejs","label":"NodeJs","variant":"Axios"},{"key":"nodejs","label":"NodeJs","variant":"Native"},{"key":"nodejs","label":"NodeJs","variant":"Request"},{"key":"nodejs","label":"NodeJs","variant":"Unirest"},{"key":"objective-c","label":"Objective-C","variant":"NSURLSession"},{"key":"ocaml","label":"OCaml","variant":"Cohttp"},{"key":"php","label":"PHP","variant":"cURL"},{"key":"php","label":"PHP","variant":"Guzzle"},{"key":"php","label":"PHP","variant":"HTTP_Request2"},{"key":"php","label":"PHP","variant":"pecl_http"},{"key":"powershell","label":"PowerShell","variant":"RestMethod"},{"key":"python","label":"Python","variant":"http.client"},{"key":"python","label":"Python","variant":"Requests"},{"key":"r","label":"R","variant":"httr"},{"key":"r","label":"R","variant":"RCurl"},{"key":"ruby","label":"Ruby","variant":"Net::HTTP"},{"key":"shell","label":"Shell","variant":"Httpie"},{"key":"shell","label":"Shell","variant":"wget"},{"key":"swift","label":"Swift","variant":"URLSession"}],"languageOptions":[{"label":"C# - HttpClient","value":"csharp - HttpClient - C#"},{"label":"C# - RestSharp","value":"csharp - RestSharp - C#"},{"label":"cURL - cURL","value":"curl - cURL - cURL"},{"label":"Dart - http","value":"dart - http - Dart"},{"label":"Go - Native","value":"go - Native - Go"},{"label":"HTTP - HTTP","value":"http - HTTP - HTTP"},{"label":"Java - OkHttp","value":"java - OkHttp - Java"},{"label":"Java - Unirest","value":"java - Unirest - Java"},{"label":"JavaScript - Fetch","value":"javascript - Fetch - JavaScript"},{"label":"JavaScript - jQuery","value":"javascript - jQuery - JavaScript"},{"label":"JavaScript - XHR","value":"javascript - XHR - JavaScript"},{"label":"C - libcurl","value":"c - libcurl - C"},{"label":"NodeJs - Axios","value":"nodejs - Axios - NodeJs"},{"label":"NodeJs - Native","value":"nodejs - Native - NodeJs"},{"label":"NodeJs - Request","value":"nodejs - Request - NodeJs"},{"label":"NodeJs - Unirest","value":"nodejs - Unirest - NodeJs"},{"label":"Objective-C - NSURLSession","value":"objective-c - NSURLSession - Objective-C"},{"label":"OCaml - Cohttp","value":"ocaml - Cohttp - OCaml"},{"label":"PHP - cURL","value":"php - cURL - PHP"},{"label":"PHP - Guzzle","value":"php - Guzzle - PHP"},{"label":"PHP - HTTP_Request2","value":"php - HTTP_Request2 - PHP"},{"label":"PHP - pecl_http","value":"php - pecl_http - PHP"},{"label":"PowerShell - RestMethod","value":"powershell - RestMethod - PowerShell"},{"label":"Python - http.client","value":"python - http.client - Python"},{"label":"Python - Requests","value":"python - Requests - Python"},{"label":"R - httr","value":"r - httr - R"},{"label":"R - RCurl","value":"r - RCurl - R"},{"label":"Ruby - Net::HTTP","value":"ruby - Net::HTTP - Ruby"},{"label":"Shell - Httpie","value":"shell - Httpie - Shell"},{"label":"Shell - wget","value":"shell - wget - Shell"},{"label":"Swift - URLSession","value":"swift - URLSession - Swift"}],"layoutOptions":[{"value":"classic-single-column","label":"Single Column"},{"value":"classic-double-column","label":"Double Column"}],"versionOptions":[],"environmentOptions":[{"value":"0","label":"No Environment"},{"label":"Production","value":"15405515-653b947b-3d86-448d-a883-0cdc144393aa"}],"canonicalUrl":"https://docs.lawcus.com/view/metadata/TzJrCKcK"}