> ## Documentation Index
> Fetch the complete documentation index at: https://visaflo.ca/knowledge-base/llms.txt
> Use this file to discover all available pages before exploring further.

# Integration Capabilities

> Understand what external systems can do with VisaFlo, how data moves, and where the workspace API boundary ends.

## The Integration Model

VisaFlo's workspace API is an **inbound operational API**. Your CRM, form, document system, internal tool, or automation platform calls VisaFlo when an event occurs. VisaFlo creates or finds the matching workspace records, then creates the work around them.

```text theme={null}
External system event
        |
        v
Your integration service
        |
        |  X-API-Key
        v
VisaFlo workspace API
        |
        +--> lead, client, or case
        +--> document upload
        +--> task, note, or workflow tasks
```

The API key determines the target workspace. Do not send a company ID or try to select a tenant from the request body.

## What You Can Build

### CRM and Sales Handoff

Connect HubSpot, Salesforce, Pipedrive, Close, or an internal CRM to VisaFlo when a lead reaches a qualified stage.

| Trigger in the CRM          | Action in VisaFlo           | Result                                                                |
| --------------------------- | --------------------------- | --------------------------------------------------------------------- |
| New qualified prospect      | Search then create a lead   | A lead enters the workspace's `new` pipeline state with source `api`. |
| Prospect becomes a client   | Search then create a client | A client record is available for case work.                           |
| Matter is opened            | Create a case               | The integration receives a VisaFlo case ID for future automation.     |
| Sales handoff needs context | Create a note or task       | The legal team sees the source-system context and follow-up work.     |

Use the source system's stable event ID and the returned VisaFlo ID together. This gives your integration a reliable retry and reconciliation key.

### Intake Forms and Booking Flows

Connect Typeform, Jotform, Tally, a custom website, a scheduling tool, or an inbound webhook receiver.

| Incoming data       | Recommended VisaFlo flow                                              |
| ------------------- | --------------------------------------------------------------------- |
| Web form submission | `lead/search` by email, then `lead/create` only when no match exists. |
| Consultation booked | Create a task linked to the matching lead or client.                  |
| Intake is approved  | Create or locate the client, create a case, then start a workflow.    |
| Follow-up summary   | Write a note onto the lead, client, or case.                          |

The API does not automatically convert a lead to a client. Keep that decision in your intake workflow, then create the client or case when your firm is ready.

### Document Intake

Connect a client upload portal, document collection tool, cloud-storage workflow, or inbound email processor.

1. Find the case using `caseId`, `caseNumber`, or the client's email.
2. Verify the returned case before sending a file.
3. Upload one file to `/case/:caseId/file/upload`.
4. VisaFlo stores the file in the case's `api` folder and returns a file registry ID.
5. Add a task or note when staff review is required.

This pattern is well suited to automations such as “a client uploaded a passport” or “a signed document arrived in our document system.” The API accepts one file per request and supports files up to 50 MB.

### Workflow and Case Operations

Connect internal operations tools, form processors, or workflow automation platforms such as Zapier, Make, n8n, Workato, or a custom worker.

| Need                                | API capability                                                       |
| ----------------------------------- | -------------------------------------------------------------------- |
| Start a standardized checklist      | List workflow templates, then create tasks from a selected workflow. |
| Create one-off operational work     | Create a task on a case, client, or lead.                            |
| Keep an external team aligned       | Add notes with a title and content.                                  |
| Update a case milestone             | Patch the case status.                                               |
| Generate or observe form automation | Start form generation and poll autofill status.                      |

Tasks inherit assignees from the linked VisaFlo record. The API does not accept arbitrary staff assignment in a task request.

### Reporting and Reconciliation

Use the search and read endpoints to verify that a source record maps to the correct VisaFlo case, client, or lead before performing an action. This supports operational dashboards and reconciliation jobs, but it is not a bulk analytics export API.

## Direction of Data Flow

| Direction                             | Available today | How it works                                                                                                               |
| ------------------------------------- | --------------- | -------------------------------------------------------------------------------------------------------------------------- |
| External system to VisaFlo            | Yes             | Your integration calls the workspace API with `X-API-Key`.                                                                 |
| VisaFlo record lookup                 | Yes             | Search and read endpoints return tenant-scoped, slim records.                                                              |
| VisaFlo to external system by webhook | No              | The workspace API does not currently provide outbound webhook subscriptions. Poll status or use your own workflow trigger. |
| Browser-direct integration            | No              | Keep API keys server-side; call VisaFlo through your server or automation worker.                                          |

## Current API Boundary

The public workspace API currently supports creates and lookups for leads, clients, and cases; case status updates; case file upload and file download; form generation/status; tasks; notes; and workflow task creation.

It does **not** currently provide generic lead/client update or delete endpoints, generic case deletion, arbitrary task assignee overrides, outbound webhooks, or a full workspace data export. Design your integration around the available actions and keep a system of record for fields VisaFlo does not expose for writeback.

## Choosing an Integration Pattern

| Pattern                     | Best for                                                    | Implementation                                                                              |
| --------------------------- | ----------------------------------------------------------- | ------------------------------------------------------------------------------------------- |
| Server-side webhook handler | Form submissions, CRM lifecycle events, document processors | Receive event, search for a match, call VisaFlo, persist returned IDs.                      |
| Scheduled worker            | Reconciliation and form-status checks                       | Run on an interval, use bounded retries and store checkpoints.                              |
| iPaaS HTTP step             | Lower-volume operations in Zapier, Make, or n8n             | Store the key as a platform secret and call the exact endpoint with JSON or multipart data. |
| Internal operations service | High-volume or regulated workflows                          | Add idempotency, audit logging, encryption, retry queues, and human review.                 |

<Tip>
  The safest first integration is: search by email, create a lead only when no match exists, save the returned VisaFlo ID, and create a follow-up task. It proves the complete integration path without creating a case or moving documents.
</Tip>
