Skip to content
Docs/API Reference

API Reference

Use the vem API to push snapshots, pull memory, and run search across your project history.

Base URL

Local dev: http://localhost:3002
Hosted: use your deployed API base URL.

Authentication

All endpoints require Authorization: Bearer <api-key>. Generate keys in API Keys.

Headers

Authorization: Bearer $VEM_API_KEY
Content-Type: application/json

API keys are scoped to an org and user, which allows seat enforcement and audit logging on writes.

Endpoints

GET/

Health check

Returns a simple service status string.

Request

curl http://localhost:3002/

Response

vem Search API Active (Secured)
GET/search?q=string

Search tasks

Returns up to 10 matching tasks scoped to the current org.

Request

curl \
  -H "Authorization: Bearer $VEM_API_KEY" \
  "http://localhost:3002/search?q=auth"

Response

{
  "results": [
    {
      "id": "uuid",
      "title": "Implement auth flow",
      "status": "in-progress",
      "priority": "high",
      "external_id": "TASK-101"
    }
  ]
}
POST/snapshots

Push snapshot

Uploads local .vem memory to the cloud. project_id, git_hash, and snapshot_hash are required.

Request

curl \
  -H "Authorization: Bearer $VEM_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "project_id": "project-id",
    "repo_url": "git@github.com:org/repo.git",
    "base_version": "snapshot-id",
    "git_hash": "abc123",
    "snapshot_hash": "e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855",
    "tasks": { "tasks": [] },
    "context": "",
    "decisions": "",
    "changelog": "",
    "current_state": ""
  }' \
  http://localhost:3002/snapshots

Response

{
  "success": true,
  "version": "snapshot-id"
}
GET/snapshots/latest?repo_url=...|project_id=...

Pull latest snapshot

Fetches the most recent snapshot within your retention window.

Request

curl \
  -H "Authorization: Bearer $VEM_API_KEY" \
  "http://localhost:3002/snapshots/latest?repo_url=git@github.com:org/repo.git"

Response

{
  "snapshot": {
    "tasks": { "tasks": [] },
    "context": "",
    "decisions": "",
    "changelog": "",
    "current_state": ""
  },
  "version": "snapshot-id"
}
POST/projects/:projectId/ask

Ask a question

Asks an AI-powered question against the project memory, code, and diffs.

Request

curl \
  -X POST \
  -H "Authorization: Bearer $VEM_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{ "question": "What is the auth flow?", "path": "src/lib/auth" }' \
  "http://localhost:3002/projects/project-id/ask"

Response

{
  "answer": "The auth flow uses Supabase Auth...",
  "citations": [{ "id": "DOC-1", "reason": "Found in src/lib/auth.ts" }],
  "thread_id": "uuid"
}
POST/projects/:projectId/reindex

Trigger reindex

Triggers a full or incremental reindex of the repository code via the GitHub integration.

Request

curl \
  -X POST \
  -H "Authorization: Bearer $VEM_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{ "mode": "incremental" }' \
  "http://localhost:3002/projects/project-id/reindex"

Response

{ "success": true, "indexer": { "job_id": "uuid" } }
GET/projects/:projectId/snapshots

List snapshots

Lists recent snapshots for a project (up to 50).

Request

curl \
  -H "Authorization: Bearer $VEM_API_KEY" \
  "http://localhost:3002/projects/project-id/snapshots"

Response

{
  "snapshots": [
    {
      "id": "snapshot-id",
      "created_at": "2026-01-10T12:00:00.000Z",
      "git_hash": "abc123",
      "snapshot_hash": "e3b0...b855",
      "status": "pending",
      "verification_reason": "pending_no_matching_snapshot"
    }
  ]
}

Snapshot payload notes

Conflict detection

Send base_version to avoid overwriting newer snapshots. A mismatch returns 409.

Verification linkage

Each snapshot must include deterministic snapshot_hash. Webhook verification promotes pending snapshots to verified when commit linkage matches.

Secret scanning

Requests containing likely secrets are rejected with 400 and a list of matches.

Errors and enforcement

401 Unauthorized: missing or invalid API key.
402 Payment Required: no seat assigned or seat limit exceeded.
403 Forbidden: missing org context.
409 Conflict: repo mismatch or snapshot version conflict.

Next steps