API Reference

List Workflows

Get all available workflows with filtering options.

Endpoint

GET /workflows/v1
GET
/workflows/v1?category=litigation&type=document-processing&limit=10
curl -X GET https://api.case.dev/workflows/v1?category=litigation&type=document-processing&limit=10 \
  -H "Authorization: Bearer sk_case_your_api_key_here" \
  -H "Content-Type: application/json"

Query Parameters

  • category (optional): Filter by category (litigation, regulatory, transactional, corporate)
  • sub_category (optional): Filter by sub-category
  • type (optional): Filter by type (document-processing, case-intake, compliance, transactional)
  • published (optional): Only published workflows (default: true)
  • limit (optional): Max results (default: 50, max: 100)
  • offset (optional): Pagination offset

Example Request

curl "https://api.case.dev/workflows/v1?category=litigation&type=document-processing&limit=20" \
  -H "Authorization: Bearer sk_case_your_api_key_here"

Example Response

{
  "data": [
    {
      "id": "uuid",
      "name": "Personal Injury Case Intake Workflow",
      "description": "Multi-step workflow for processing personal injury cases: document intake, OCR processing, case summary generation, and initial assessment.",
      "parent_category": "litigation",
      "sub_category": "Personal_Injury",
      "type": "case-intake",
      "stage": "beta",
      "version": "1.2"
    },
    {
      "id": "uuid",
      "name": "Contract Review Automation",
      "description": "Automated contract analysis workflow: OCR, clause extraction, risk assessment, and compliance checking.",
      "parent_category": "transactional",
      "sub_category": "Contract_Review",
      "type": "document-processing",
      "stage": "production",
      "version": "2.1"
    }
  ],
  "total": 287,
  "limit": 20,
  "offset": 0
}

Search Workflows

Semantic search using vector embeddings to find workflows by natural language description.

Endpoint

POST /workflows/v1/search
POST
/workflows/v1/search
curl -X POST https://api.case.dev/workflows/v1/search \
  -H "Authorization: Bearer sk_case_your_api_key_here" \
  -H "Content-Type: application/json" \
  -d '{
  "query": "process deposition documents",
  "limit": 10,
  "category": "litigation"
}'

Example Request

curl -X POST https://api.case.dev/workflows/v1/search \
  -H "Authorization: Bearer sk_case_your_api_key_here" \
  -H "Content-Type: application/json" \
  -d '{
    "query": "process deposition documents",
    "limit": 10,
    "category": "litigation"
  }'

Example Response

{
  "data": [
    {
      "id": "uuid",
      "name": "Deposition Processing Workflow",
      "description": "Multi-step workflow: audio transcription, speaker diarization, summary generation, key point extraction",
      "parent_category": "litigation",
      "sub_category": "Employment_Litigation",
      "type": "document-processing",
      "similarity_score": 0.94
    },
    {
      "id": "uuid",
      "name": "Case Document Intake Automation",
      "description": "Automated intake workflow: OCR processing, document classification, data extraction, case summary",
      "parent_category": "litigation",
      "similarity_score": 0.89
    }
  ]
}

Get Workflow

Get detailed metadata for a specific workflow.

Endpoint

GET /workflows/v1/{id}
GET
/workflows/v1/uuid
curl -X GET https://api.case.dev/workflows/v1/uuid \
  -H "Authorization: Bearer sk_case_your_api_key_here" \
  -H "Content-Type: application/json"

Example Request

curl "https://api.case.dev/workflows/v1/uuid" \
  -H "Authorization: Bearer sk_case_your_api_key_here"

Example Response

{
  "id": "uuid",
  "name": "Personal Injury Case Intake Workflow",
  "description": "Multi-step workflow for processing personal injury cases: document intake, OCR processing, case summary generation, and initial assessment.",
  "parent_category": "litigation",
  "sub_category": "Personal_Injury",
  "type": "case-intake",
  "stage": "alpha",
  "version": "0.01",
  "demo_video_link": "https://example.com/demo.mp4",
  "link_to_ground_truth_example": "https://example.com/example.pdf",
  "link_to_generated_example": "https://example.com/generated.pdf"
}

Execute Workflow

Execute a workflow with your input. Workflows orchestrate multiple steps including document processing, AI analysis, and data transformation.

Endpoint

POST /workflows/v1/{id}/execute
POST
/workflows/v1/uuid/execute
curl -X POST https://api.case.dev/workflows/v1/uuid/execute \
  -H "Authorization: Bearer sk_case_your_api_key_here" \
  -H "Content-Type: application/json" \
  -d '{
  "input": {
    "text": "Full deposition transcript text here..."
  },
  "options": {
    "model": "anthropic/claude-sonnet-4.5",
    "temperature": 0.3,
    "max_tokens": 4000,
    "format": "json"
  },
  "variables": {
    "case_name": "Smith v. Hospital",
    "date": "2024-01-15"
  }
}'

Input Types

You can provide input in three ways:

1. Text Input:

{
  "input": {
    "text": "Full document text here..."
  }
}

2. Document URL:

{
  "input": {
    "document_url": "https://s3.../document.pdf"
  }
}

3. Vault Object:

{
  "input": {
    "vault_object_id": "obj_123"
  }
}

Options

  • model (optional): LLM model to use (default: template's recommended model)
  • temperature (optional): Randomness, 0-2 (default: 0.7)
  • max_tokens (optional): Maximum tokens to generate (default: 4096)
  • format (optional): Output format - json, text, or pdf (default: json)

Variables

Pass custom variables for prompt substitution:

{
  "variables": {
    "case_name": "Smith v. Hospital",
    "plaintiff_name": "John Smith",
    "date": "2024-01-15"
  }
}

Example Request (JSON Output)

curl -X POST https://api.case.dev/workflows/v1/uuid/execute \
  -H "Authorization: Bearer sk_case_your_api_key_here" \
  -H "Content-Type: application/json" \
  -d '{
    "input": {
      "text": "Deposition transcript text here..."
    },
    "options": {
      "format": "json",
      "model": "anthropic/claude-sonnet-4.5"
    }
  }'

Example Response (JSON Format)

{
  "id": "exec_abc123",
  "workflow_id": "uuid",
  "workflow_name": "Deposition Processing Workflow",
  "status": "completed",
  "output": {
    "format": "json",
    "data": {
      "summary": "Key points from deposition:\n1. Witness testified about...\n2. Documents reviewed include...",
      "key_admissions": [
        "Witness admitted to being present at the scene",
        "Witness confirmed receipt of medical records"
      ],
      "contradictions": [
        "Initial statement vs. deposition testimony regarding timeline"
      ],
      "timeline": [
        {"date": "2024-01-10", "event": "Incident occurred"},
        {"date": "2024-01-15", "event": "Medical treatment received"}
      ]
    }
  },
  "usage": {
    "prompt_tokens": 1245,
    "completion_tokens": 387,
    "total_tokens": 1632,
    "cost": 0.004896
  },
  "created_at": "2024-01-15T10:30:00Z",
  "duration_ms": 3450
}

Example Request (PDF Output)

curl -X POST https://api.case.dev/workflows/v1/uuid/execute \
  -H "Authorization: Bearer sk_case_your_api_key_here" \
  -H "Content-Type: application/json" \
  -d '{
    "input": {
      "document_url": "https://s3.../deposition.pdf"
    },
    "options": {
      "format": "pdf",
      "model": "anthropic/claude-sonnet-4.5"
    }
  }'

Example Response (PDF Format)

{
  "id": "exec_abc123",
  "workflow_id": "uuid",
  "workflow_name": "Deposition Processing Workflow",
  "status": "completed",
  "output": {
    "format": "pdf",
    "url": "https://s3.../exec_abc123.pdf",
    "expires_at": "2024-01-16T10:30:00Z"
  },
  "usage": {
    "prompt_tokens": 1245,
    "completion_tokens": 387,
    "total_tokens": 1632,
    "cost": 0.004896
  },
  "created_at": "2024-01-15T10:30:00Z"
}