Skip to main content

Documentation Index

Fetch the complete documentation index at: https://docs.case.dev/llms.txt

Use this file to discover all available pages before exploring further.

List your vaults

See all vaults in your organization.
Endpoint
GET /vault
curl https://api.case.dev/vault \
  -H "Authorization: Bearer $CASEDEV_API_KEY"
Response
{
  "vaults": [
    {
      "id": "vault_abc123",
      "name": "Smith v. Hospital 2024",
      "totalObjects": 47,
      "totalBytes": 125829120,
      "enableIndexing": true,
      "createdAt": "2025-01-15T10:30:00Z"
    }
  ],
  "total": 1
}

Get vault details

Get storage usage, document count, indexing status, and GraphRAG status for a specific vault.
Endpoint
GET /vault/:id
casedev vault retrieve --id $VAULT_ID
FieldDescription
enableIndexingWhether vector search is enabled. false for storage-only vaults
enableGraphWhether GraphRAG knowledge graph is enabled (requires indexing)

Move vault to a group

Assign a vault to a group, move it between groups, or remove it from a group.
Endpoint
PATCH /vault/:id
curl -X PATCH "https://api.case.dev/vault/$VAULT_ID" \
  -H "Authorization: Bearer $CASEDEV_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{"groupId": "grp_abc123"}'
API keys scoped to specific groups cannot remove a vault from its group (groupId: null returns 403). See Groups → Scoped API keys for details.

List documents in a vault

See all files you’ve uploaded.
Endpoint
GET /vault/:id/objects
curl "https://api.case.dev/vault/$VAULT_ID/objects" \
  -H "Authorization: Bearer $CASEDEV_API_KEY"
Response
{
  "objects": [
    {
      "id": "obj_xyz789",
      "filename": "deposition-johnson.pdf",
      "sizeBytes": 2458624,
      "ingestionStatus": "completed",
      "pageCount": 150,
      "createdAt": "2025-01-15T10:35:00Z"
    }
  ],
  "count": 1
}

Download a file

Get the original file you uploaded.
Endpoint
GET /vault/:vaultId/objects/:objectId/download
curl "https://api.case.dev/vault/$VAULT_ID/objects/$OBJECT_ID/download" \
  -H "Authorization: Bearer $CASEDEV_API_KEY" \
  -o deposition.pdf

Get extracted text

Get the OCR’d or transcribed text from a document.
Endpoint
GET /vault/:vaultId/objects/:objectId/text
curl "https://api.case.dev/vault/$VAULT_ID/objects/$OBJECT_ID/text" \
  -H "Authorization: Bearer $CASEDEV_API_KEY"

Get text by page

Get page-level text from a processed PDF or plain text object. Use start and end to request an inclusive 1-indexed page range, up to 500 pages per request.
Endpoint
GET /vault/:vaultId/objects/:objectId/pages
cURL
curl "https://api.case.dev/vault/$VAULT_ID/objects/$OBJECT_ID/pages?start=3&end=5" \
  -H "Authorization: Bearer $CASEDEV_API_KEY"
Response
{
  "pages": [
    { "page": 3, "text": "Q. Please state your name for the record..." },
    { "page": 4, "text": "A. My name is Jane Doe..." }
  ],
  "metadata": {
    "source": "ocr",
    "page_count": 42,
    "returned_pages": 2
  }
}
PDFs must finish ingestion before pages are available. metadata.source is ocr for PDF OCR text and txt for plain text fallback.

Update a document

Update a document’s filename, folder path, or custom metadata. Use this endpoint to rename files, organize them into virtual folders, or attach custom key-value metadata for filtering and categorization.
Endpoint
PATCH /vault/:vaultId/objects/:objectId

Update custom metadata

Attach custom key-value pairs to documents for filtering, categorization, or integration with your systems. Metadata is merged with existing values—only the fields you specify are updated.
# Add custom metadata to a document
curl -X PATCH "https://api.case.dev/vault/$VAULT_ID/objects/$OBJECT_ID" \
  -H "Authorization: Bearer $CASEDEV_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "metadata": {
      "category": "legal_filing",
      "tags": ["contract", "employment", "2024"],
      "priority": "high",
      "client_id": "client_12345"
    }
  }'
Metadata is merged, not replaced. When you update metadata, your new fields are merged with existing metadata. To remove a field, set it to null.

Rename or move a document

# Rename a file
curl -X PATCH "https://api.case.dev/vault/$VAULT_ID/objects/$OBJECT_ID" \
  -H "Authorization: Bearer $CASEDEV_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{"filename": "deposition-smith-final.pdf"}'

# Move to a folder
curl -X PATCH "https://api.case.dev/vault/$VAULT_ID/objects/$OBJECT_ID" \
  -H "Authorization: Bearer $CASEDEV_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{"path": "/Discovery/Depositions"}'

Request body

FieldTypeDescription
filenamestringNew display name for the document
pathstringVirtual folder path (e.g., /Discovery/Depositions)
metadataobjectCustom key-value pairs to merge with existing metadata
Response
{
  "id": "obj_xyz789",
  "vaultId": "vault_abc123",
  "filename": "deposition-smith-2024.pdf",
  "path": "/Discovery/Depositions",
  "contentType": "application/pdf",
  "sizeBytes": 2458624,
  "ingestionStatus": "completed",
  "metadata": {
    "path": "/Discovery/Depositions",
    "witness": "John Smith",
    "deposition_date": "2024-01-15",
    "category": "legal_filing"
  },
  "updatedAt": "2025-01-15T10:35:00Z"
}
Virtual folders. The path field creates a virtual folder hierarchy stored in metadata. Use this to organize documents without affecting their storage location. Build folder trees by grouping objects with the same path prefix.

Append PDF objects onto an existing object

Append up to 20 PDF vault objects to the end of an existing PDF object. The target is overwritten in place: sizeBytes, pageCount, and checksum change, while id, filename, and ingestionStatus stay the same. Appended pages are not searchable.
Endpoint
POST /vault/:vaultId/objects/:objectId/append
cURL
curl -X POST "https://api.case.dev/vault/$VAULT_ID/objects/$OBJECT_ID/append" \
  -H "Authorization: Bearer $CASEDEV_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "appendObjectIds": ["obj_exhibit_a", "obj_exhibit_b"],
    "rewriteLinks": true,
    "backLinks": true,
    "backLinksText": "Return to summary"
  }'

Request body

FieldTypeDescription
appendObjectIdsstring[]Required. PDF object IDs to append, in order. Must be unique and must not include the target object.
rewriteLinksbooleanOptional. Defaults to false. Rewrites matching target-PDF links into internal PDF jumps.
backLinksbooleanOptional. Defaults to false. Adds internal back links to appended pages.
backLinksTextstringOptional. Defaults to Back to Summary. Used only when backLinks is true.
All inputs must be PDFs and the combined target plus appended object size must be at most 250 MiB. The request fails while the target object is processing or deleting. When rewriteLinks is true, a link is rewritten only if it contains exactly one appendObjectIds value as a full decoded query parameter value or full decoded path segment, plus a valid page or pageNumber. Substring matches are ignored.
https://example.test/share?object_id=obj_exhibit_a&page=3
https://example.test/s/obj_exhibit_a?page=3
Back links use standard internal PDF destinations, not PDF JavaScript. Pages reached by a rewritten link point back to the citing target page; other appended pages point back to the first target page.

Delete a document

Remove a single file and all its search data.
Endpoint
DELETE /vault/:vaultId/objects/:objectId
curl -X DELETE "https://api.case.dev/vault/$VAULT_ID/objects/$OBJECT_ID" \
  -H "Authorization: Bearer $CASEDEV_API_KEY"

Force delete stuck documents

If a document gets stuck in processing status (e.g., due to an OCR timeout), you can force delete it:
# Force delete a stuck document
curl -X DELETE "https://api.case.dev/vault/$VAULT_ID/objects/$OBJECT_ID?force=true" \
  -H "Authorization: Bearer $CASEDEV_API_KEY"
When to use force delete. Use force=true only when a document is stuck in “processing” status and won’t complete. This can happen in rare cases like OCR timeouts. The force option bypasses the safety check that prevents deletion during active ingestion.
Permanent. This deletes the file, extracted text, and all search vectors. Cannot be undone.

Delete a vault

Remove an entire vault and everything in it.
Endpoint
DELETE /vault/:id
curl -X DELETE "https://api.case.dev/vault/$VAULT_ID" \
  -H "Authorization: Bearer $CASEDEV_API_KEY"
For large vaults (100+ documents), use async deletion:
curl -X DELETE "https://api.case.dev/vault/$VAULT_ID?async=true" \
  -H "Authorization: Bearer $CASEDEV_API_KEY"
Permanent. This deletes all documents, search indexes, knowledge graphs, and storage. Cannot be undone.