Integration Steps
Follow these steps to integrate your application with Clio Manage through LawLink.ai.
Create Organization Admin & Login
First, a Superuser or Admin creates an Organization Admin (ORG_ADMIN) account for your law firm. The ORG_ADMIN will manage attorneys and API tokens for the organization.
💡 Tip: Login to LawLink at
https://app.lawlink.ai using your ORG_ADMIN credentials.
Create API Access Token
Navigate to API Tokens page and create a new API access token for integration. Set an appropriate expiration period (e.g., 1 year). Copy the token immediately — it's only shown once!
⚠️ Important: Store your API token securely. It grants access to your organization's Clio data.
Add Attorney Users
As an ORG_ADMIN, navigate to the Organization page and add user accounts for each attorney. Each attorney will have their own Clio connection and data.
📋 Fields Required: Email, Full Name, Password. Users are automatically assigned the USER role.
Authentication
Attorney Authorizes Clio Access
Each attorney must authorize LawLink to access their Clio Manage account. Send a Clio Invitation from the Organization page, or have the attorney login and connect directly.
🔐 OAuth Flow: The attorney will be redirected to Clio to grant access, then returned to LawLink upon success.
API Usage
Call APIs with Your Token
Use your API token in the Authorization header as a Bearer token.
All calls act on the Clio account connected to the authenticated user.
API Request Structure
Authorization: Bearer YOUR_ACCESS_TOKEN
Content-Type: application/json
Example: Get Contacts
# Get contacts from the connected Clio account
curl.exe -X GET \
"https://app.lawlink.ai/api/v1/clio/contacts?limit=10" \
-H "Authorization: Bearer ACCESS_TOKEN" \
-H "Content-Type: application/json"
Example: Create Contact
# Create a new contact in attorney's Clio account
curl.exe -X POST \
"https://app.lawlink.ai/api/v1/clio/contacts/create" \
-H "Authorization: Bearer ACCESS_TOKEN" \
-H "Content-Type: application/json" \
-d '{
"first_name": "John",
"last_name": "Doe",
"email": "john.doe@example.com",
"phone": "+15551234567"
}'
🔑 Key Points:
- The API token authenticates your application to LawLink
- All API calls affect the connected attorney's Clio data
Contact Conflict Check
Implement Contact Conflict Check
Before creating a new contact, use the /api/v1/clio/contacts/check endpoint
to detect potential duplicates. This prevents dirty data in your Clio account.
🔍 Detection Logic:
- High Confidence Fail: Exact email match OR (Name + Phone match) OR (Name + Email match) OR (Email + Phone match)
- Low Confidence Fail: Phone-only match (same phone number, different name/email)
- Pass: No match found, or name-only match (safe to create — same name is common)
POST /api/v1/clio/contacts/check
{
"first_name": "John",
"last_name": "Smith",
"email": "john@example.com", // Optional
"phone": "+15551234567" // Optional
}
{
"status": "pass",
"message": "Conflict check passes"
}
{
"status": "high_confidence_fail",
"message": "Conflict check failed with high confidence",
"reason": "Email matches an existing contact",
"contact": { "id": 12345, "name": "John Smith", ... }
}
{
"status": "low_confidence_fail",
"message": "Conflict check failed with low confidence",
"reason": "Phone number matches an existing contact",
"matches": [ { "id": 67890, "name": "John Smith", ... } ]
}
Contacts & Matters
1. Create the Client Contact
Create the client's contact record with POST /api/v1/clio/contacts/create.
The response includes the new contact's id — you'll use it in the next step.
curl.exe -X POST \
"https://app.lawlink.ai/api/v1/clio/contacts/create" \
-H "Authorization: Bearer ACCESS_TOKEN" \
-H "Content-Type: application/json" \
-d '{
"first_name": "Kayla",
"last_name": "Benavides",
"email": "kayla.benavides@example.com",
"phone": "+19563601734"
}'
// Returns the new contact — note the id
{
"data": {
"id": 12345678,
"name": "Kayla Benavides"
}
}
2. Create the Matter (Linked to the Contact)
Create the matter with POST /api/v1/clio/matters, passing the contact's
id as the client. The client.id field is what links the matter
to the contact — no separate linking step is needed.
curl.exe -X POST \
"https://app.lawlink.ai/api/v1/clio/matters" \
-H "Authorization: Bearer ACCESS_TOKEN" \
-H "Content-Type: application/json" \
-d '{
"description": "Personal Injury - MVA",
"client": { "id": 12345678 },
"status": "Pending"
}'
// Matter created and linked to the client
{
"data": {
"id": 1917746802,
"display_number": "00040-Benavides",
"description": "Personal Injury - MVA",
"status": "Pending"
}
}
Calendar & Automated Booking
1. Discover Available Calendars
Retrieve all calendars the attorney has access to (Personal, Firm-wide, or Shared). Each calendar returned includes its unique ID and brand color.
Example: Get Calendars
# Fetch list of calendars for an attorney
curl.exe -X GET \
"https://app.lawlink.ai/api/v1/clio/calendars" \
-H "Authorization: Bearer ACCESS_TOKEN"
// Returns list of available calendars
{
"data": [
{ "id": 123, "name": "Default Calendar", "color": "#367b9c" },
{ "id": 456, "name": "Firm Holidays", "color": "#e2445c" }
]
}
2. Check Availability
Retrieve a complete list of events for any given date. Instead of just free/busy blocks, LawLink provides the full context of the attorney's schedule.
🕒 Schedule Logic:
- Returns Full Event List: Every calendar entry for the requested period.
- Start/End Precision: All event times are normalized for easy integration with frontend calendars.
Example: Check Availability
# Find free gaps for a specific date
curl.exe -X GET \
"https://app.lawlink.ai/api/v1/clio/get-availability?date=2026-03-20&calendar_id=123" \
-H "Authorization: Bearer ACCESS_TOKEN"
// Returns raw list of events
{
"status": "success",
"events": [
{
"id": 1690562,
"summary": "Client Consultation",
"start_at": "2026-03-24T10:00:00Z",
"end_at": "2026-03-24T11:00:00Z",
"location": "Zoom",
"description": "Initial case review"
}
]
}
3. Smart Slot Booking
Once a slot is chosen, LawLink validates availability one last time before creating the event to prevent double-booking.
🧠 Booking Intelligence:
- Deterministic Timing: Send simple timestamps; LawLink handles the attorney's timezone.
- Conflict Safeguards: If a collision occurs, the API returns the conflicting event and suggested free slots automatically.
Example: Book a Slot
# Create event with conflict protection
curl.exe -X POST \
"https://app.lawlink.ai/api/v1/clio/book-slot" \
-H "Authorization: Bearer ACCESS_TOKEN" \
-H "Content-Type: application/json" \
-d '{
"summary": "Legal Consultation",
"start_at": "2026-03-20T10:00:00",
"end_at": "2026-03-20T11:00:00",
"calendar_id": 123
}'
// Success Response (No Conflict)
{
"event": {
"id": "4699678906",
"summary": "Legal Consultation",
"start_at": "2026-03-20T04:30:00Z",
"end_at": "2026-03-20T05:30:00Z",
"matter": null,
"calendar_owner": {
"id": 123456,
"name": "Primary Calendar"
}
},
"reminders_created": []
}
// Conflict Response (Double-booking Prevention)
{
"available": false,
"message": "Slot not available on calendar 123456. See suggestions below.",
"conflict": {
"id": "123456789",
"summary": "Meeting",
"start_at": "2026-02-26T10:00:00+00:00",
"end_at": "2026-02-26T11:00:00+00:00",
"all_day": false
},
"suggested_slots": [
{ "start": "10:42", "end": "14:00", "duration_minutes": 198 },
{ "start": "15:00", "end": "15:30", "duration_minutes": 30 }
]
}
4. Create Specialized Calendars
Organize your firm by creating dedicated calendars for specific workflows (e.g., "Intakes", "Depositions", "Court Dates").
🎨 Color Validation: Clio only accepts 20 specific brand colors. LawLink ensures your new calendars always use firm-approved styling.
Example: Create New Calendar
# Add a specialized workflow calendar
curl.exe -X POST \
"https://app.lawlink.ai/api/v1/clio/calendars" \
-H "Authorization: Bearer ACCESS_TOKEN" \
-H "Content-Type: application/json" \
-d '{
"name": "Intake Calendar",
"color": "#367b9c"
}'
// New calendar details
{
"id": 789,
"name": "Intake Calendar",
"color": "#367b9c",
"visible": true
}
🛠️ Developer Note:
LawLink strictly requires ISO-8601 compliant timestamps. Non-ISO formats (e.g.,
MM/DD/YYYY) will be rejected.
Dates may be naive (e.g., 2026-03-20T10:00:00) or ISO with an offset. If no offset
is provided, the attorney's Clio-configured timezone is assumed.
Document Management
LawLink exposes the full Clio document lifecycle: list, upload, rename/move, lock, delete, and retrieve download links.
1. List & Search Documents
Retrieve documents filtered by matter, folder, contact, category, text query, or lock state. All filters are optional — omit them to list all documents.
# Documents for a specific matter, newest first
curl.exe -X GET \
"https://app.lawlink.ai/api/v1/clio/documents?matter_id=1773038573&order=created_at(desc)&limit=25" \
-H "Authorization: Bearer ACCESS_TOKEN"
// Response
{
"data": [
{
"id": 18893119313,
"name": "Retainer_Agreement_v2.pdf",
"locked": false,
"matter": { "id": 1773038573 },
"document_category": { "id": 4, "name": "Agreements" },
"created_at": "2026-04-01T09:15:00Z"
}
]
}
2. Upload a Document File
Send a multipart/form-data POST. LawLink handles the full Clio signed-URL
upload flow (create session → PUT to S3 → mark complete) transparently.
Provide exactly one parent: matter_id, folder_id,
contact_id, or document_id (to add a new version).
⚠️ Parent Rule: Supplying more than one parent returns HTTP 400. Use
document_id only when uploading a new version of an existing document.
# Upload a new document to a matter
curl.exe -X POST \
"https://app.lawlink.ai/api/v1/clio/documents/upload" \
-H "Authorization: Bearer ACCESS_TOKEN" \
-F "file=@Retainer_Agreement.pdf" \
-F "matter_id=1773038573" \
-F "category_id=4"
# Upload a new version of an existing document
curl.exe -X POST \
"https://app.lawlink.ai/api/v1/clio/documents/upload" \
-H "Authorization: Bearer ACCESS_TOKEN" \
-F "file=@Retainer_Agreement_v3.pdf" \
-F "document_id=18893119313"
{
"data": { "id": 18903442808, "latest_document_version": { "fully_uploaded": true } },
"upload": { "mode": "signed_put_url", "completed": true }
}
3. Rename, Move, Lock, or Restore
A single PATCH covers all metadata mutations. Send only the fields you want to change.
🔑 Operations supported in one call:
name— rename the filematter_id/folder_id/contact_id— move to a new parent (one at a time)locked: true/false— lock or unlockcategory_id— reassign categoryrestore: true— recover a trashed document
# Rename and lock in one request
curl.exe -X PATCH \
"https://app.lawlink.ai/api/v1/clio/documents/18893119313" \
-H "Authorization: Bearer ACCESS_TOKEN" \
-H "Content-Type: application/json" \
-d '{
"name": "Retainer_Agreement_FINAL.pdf",
"locked": true
}'
4. Get a Download Link
Returns a short-lived signed S3 URL (typically valid for 10 minutes). Pass
version_id to download a specific version; omit for the latest.
# Download link for a specific version
curl.exe -X GET \
"https://app.lawlink.ai/api/v1/clio/documents/18893119313/download-link?version_id=18981709538" \
-H "Authorization: Bearer ACCESS_TOKEN"
{
"document_id": "18893119313",
"version_id": "18981709538",
"download_url": "https://iris-production.s3.us-east-1.amazonaws.com/uploads/...",
"status_code": 302
}
5. Delete & Restore
Clio uses soft deletion — deleted documents move to trash and are permanently removed
after 30 days. A GET by ID still returns the document (with a deleted_at
timestamp) until then.
# Soft-delete (move to trash)
curl.exe -X DELETE \
"https://app.lawlink.ai/api/v1/clio/documents/18893119313" \
-H "Authorization: Bearer ACCESS_TOKEN"
# Restore from trash
curl.exe -X PATCH \
"https://app.lawlink.ai/api/v1/clio/documents/18893119313" \
-H "Authorization: Bearer ACCESS_TOKEN" \
-H "Content-Type: application/json" \
-d '{ "restore": true }'