REST API

The LakeOps REST API gives you programmatic access to catalogs, tables, maintenance, policies, observability, and SQL queries. Use it from scripts, CI/CD, or your own applications. LakeOps does not ship a CLI or SDK — call the API with curl or any HTTP client.

AI agents normally use the MCP server on the same host with the same API key. MCP covers discovery, health, maintenance, and policies. Catalog registration, rollback, renames, table properties, and SQL are REST-only.

Base URL

LakeOps runs in data regions around the world, and each region has its own API host. Use the host for the region where your organization's catalogs live. The examples on this page use https://api.lakeops.dev. Connect Your Agent shows the host for your region; the REST API uses it without the /mcp path.

Authentication

Every request must include an API key as a Bearer token in the Authorization header. Create API keys in Organization > API Keys.

Example request

export LAKEOPS_API_KEY="<your-api-key>"

curl https://api.lakeops.dev/api/catalogs \
  -H "Authorization: Bearer $LAKEOPS_API_KEY"
•Keys belong to your organization; only organization admins can create them. Call the host for the region where your catalogs are connected.
•Keys carry permission scopes (see Permissions and scopes). A request without the route's scope returns 403 Forbidden, as does a key that is not owned by an organization.
•A missing, invalid, revoked, or expired key returns 401 Unauthorized.

Scopes in the key form

Each permission you pick when creating a key maps to one scope ID.

In the consoleScope ID
Grant full readread
Grant full writewrite
Policies: Read / Writepolicies:readpolicies:write
Catalogs: Read / Write / Admincatalogs:readcatalogs:writecatalogs:admin
Tables: Read / Write / Deletetables:readtables:writetables:delete
Query: Readquery:read

Response format

Responses are JSON and return the resource directly. Validation and server errors return a JSON object; the exact fields vary by route. Most include error or message, and some add details or success: false. Check the HTTP status first. Authentication failures (401) and scope failures (403) return only the status code.

// GET /api/catalogs — 200
[
  { "name": "production-glue", "type": "glue", "status": true,
    "tableCount": 142, "totalSizeInBytes": 2638827906662, ... }
]

// 400
{
  "error": "Validation error",
  "message": "Catalog name is required"
}

Endpoints

The API is organized by domain. Each group shows the minimum scope required.

Catalogs

catalogs:readcatalogs:writecatalogs:admin

Reading the list needs catalogs:read; registering and refreshing need catalogs:write. Changing, deleting, or reading a catalog's configuration needs catalogs:admin, which must be granted explicitly (write does not include it); in the console only organization admins can do these. Secrets are write-only: they come back as ******** everywhere, admins included.

MethodPath
GET/api/catalogs
POST/api/catalogs
PUT/api/catalogs/{name}
PATCH/api/catalogs/{name}/properties
DELETE/api/catalogs/{name}
GET/api/config/catalog/{name}
POST/api/refresh/catalog/{name}
POST/api/refresh/table/{catalogName}/{namespace}/{tableName}

Tables

tables:readtables:write

Table deletion over REST is authorized by tables:write. The separate tables:delete scope only gates the MCP delete_table tool, so treat any key with tables:write as able to delete tables.

MethodPath
GET/api/search
GET/api/namespaces/{catalogName}
GET/api/namespaces/{catalogName}/{namespacePath}
GET/api/tables/{catalogName}/{namespace}/{tableName}/metrics
GET/api/partition-distribution/{catalogName}/{namespace}/{tableName}
GET/api/table-metrics
DELETE/api/tables/{catalogName}/{namespace}/{tableName}
POST/api/tables/{catalogName}/{namespace}/{tableName}/rename
POST/api/tables/{catalogName}/{namespace}/{tableName}/properties
DELETE/api/tables/{catalogName}/{namespace}/{tableName}/properties

Maintenance

tables:readtables:write

Both POST routes need tables:write. The execute route runs one operation with the body as its config. The compaction route takes a required where predicate on file metadata and returns a plan; adding execute: true submits a compaction workflow for the matching files instead.

MethodPath
POST/api/tables/{catalogName}/{namespace}/{tableName}/policies/{type}/execute
POST/api/compaction/{catalogName}/{namespace}/{tableName}
GET/api/compaction/job/{jobId}

Snapshot management

tables:write
MethodPath
POST/api/tables/{catalogName}/{namespace}/{tableName}/rollback-to-snapshot
POST/api/tables/{catalogName}/{namespace}/{tableName}/rollback-to-timestamp
POST/api/tables/{catalogName}/{namespace}/{tableName}/set-current-snapshot
DELETE/api/tables/{catalogName}/{namespace}/{tableName}/branches/{branchName}
DELETE/api/tables/{catalogName}/{namespace}/{tableName}/tags/{tagName}

Observability

read

Insights and the per-table maintenance and events routes also accept tables:read.

MethodPath
GET/api/dashboard
GET/api/monitoring/maintenance-summary
GET/api/monitoring/maintenance-samples
GET/api/monitoring/operations-stats
GET/api/insights/search
GET/api/insights/{catalogName}/{namespace}/{tableName}
GET/api/tables/{catalogName}/{namespace}/{tableName}/maintenance
GET/api/events
GET/api/events/timeline
GET/api/events/storage-timeline
GET/api/tables/{catalogName}/{namespace}/{tableName}/events

Query

query:read
MethodPath
POST/api/query/{catalogName}

Policies

policies:readpolicies:write

Table-level routes under /api/tables/… are authorized as tables:read (GET) and tables:write (POST, PUT, DELETE).

MethodPath
GET/api/policies
POST/api/policies/{type}
GET/api/policies/{type}/{id}
PUT/api/policies/{type}/{id}
DELETE/api/policies/{type}/{id}
GET/api/tables/{catalogName}/{namespace}/{tableName}/policies
POST/api/tables/{catalogName}/{namespace}/{tableName}/policies/{type}
PUT/api/tables/{catalogName}/{namespace}/{tableName}/policies/{type}/{id}
POST/api/tables/{catalogName}/{namespace}/{tableName}/policies/{type}/{id}/enable
POST/api/tables/{catalogName}/{namespace}/{tableName}/policies/{type}/{id}/disable
POST/api/tables/{catalogName}/{namespace}/{tableName}/policies/{type}/{id}/execute

Examples

List all catalogs

curl https://api.lakeops.dev/api/catalogs \
  -H "Authorization: Bearer $LAKEOPS_API_KEY"

Add, change, or remove catalog properties

Needs catalogs:admin. Properties you don't name are left as they are. Send secrets in full: the masked ******** value is rejected here.

curl -X PATCH https://api.lakeops.dev/api/catalogs/prod_rest/properties \
  -H "Authorization: Bearer $LAKEOPS_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "updates": { "s3.region": "eu-west-1" },
    "removals": ["old-key"]
  }'

# 200
{ "updated": ["s3.region"], "removed": ["old-key"], "missing": [] }

Search tables by health status

curl "https://api.lakeops.dev/api/search?status=CRITICAL&catalog=production-glue" \
  -H "Authorization: Bearer $LAKEOPS_API_KEY"

Get table health insights

curl https://api.lakeops.dev/api/insights/production-glue/analytics/page_events \
  -H "Authorization: Bearer $LAKEOPS_API_KEY"

Run compaction on one table now

Needs tables:write. Returns once the workflow is submitted; the second call lists the table's operation events so you can follow it.

curl -X POST https://api.lakeops.dev/api/tables/production-glue/analytics/page_events/policies/COMPACT_DATA_FILES/execute \
  -H "Authorization: Bearer $LAKEOPS_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{"whereClause": "1=1"}'

curl https://api.lakeops.dev/api/tables/production-glue/analytics/page_events/events \
  -H "Authorization: Bearer $LAKEOPS_API_KEY"

Create a nightly compaction policy

Needs policies:write. cronExpression is 5-field Unix cron.

curl -X POST https://api.lakeops.dev/api/policies/COMPACT_DATA_FILES \
  -H "Authorization: Bearer $LAKEOPS_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "name": "nightly-compaction",
    "catalogName": "production-glue",
    "executionType": "SCHEDULED",
    "cronExpression": "0 2 * * *",
    "config": {
      "strategy": "binpack",
      "targetFileSizeBytes": 536870912
    }
  }'

Run an ad-hoc SQL query

Needs query:read. Only SELECT, SHOW, DESCRIBE, and EXPLAIN are allowed. limit defaults to 1000 (max 10000).

curl -X POST https://api.lakeops.dev/api/query/production-glue \
  -H "Authorization: Bearer $LAKEOPS_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "query": "SELECT COUNT(*) FROM analytics.page_events",
    "limit": 100
  }'

Get the org-wide dashboard

curl "https://api.lakeops.dev/api/dashboard?period=30d" \
  -H "Authorization: Bearer $LAKEOPS_API_KEY"

# period: 1d, 7d, 14d, or 30d (default 30d)
# Response includes:
# - totalCatalogs, totalTables, totalDataSizeBytes
# - healthyTables, warningTables, criticalTables
# - totalDeletedSizeBytes, compactionDataOptimizedBytes, compactionFileReductionPercent
# - tablesNeedingOptimization, tablesMaintained, totalEvents

GitHub Actions integration

Automate table maintenance as part of your CI/CD pipeline. Store your API key as a GitHub Actions secret and call the REST API from workflow steps.

1. Add the API key as a secret

Go to your repository's Settings > Secrets and variables > Actions and add a secret named LAKEOPS_API_KEY.

2. Example workflow

This workflow runs nightly: finds tables in CRITICAL health, runs compaction on each, and prints a lake health summary. The key needs read and tables:write.

# .github/workflows/lakeops-maintenance.yml
name: LakeOps Nightly Maintenance

on:
  schedule:
    - cron: "0 3 * * *"    # 3 AM UTC daily
  workflow_dispatch:         # manual trigger

env:
  LAKEOPS_API: https://api.lakeops.dev
  CATALOG: production-glue

jobs:
  maintain:
    runs-on: ubuntu-latest
    env:
      LAKEOPS_API_KEY: ${{ secrets.LAKEOPS_API_KEY }}
    steps:
      - name: Find critical tables
        run: |
          curl -sf "$LAKEOPS_API/api/search?status=CRITICAL&catalog=$CATALOG&pageSize=100" \
            -H "Authorization: Bearer $LAKEOPS_API_KEY" \
            | jq -r '.results[] | .namespace + "/" + .tableName' > critical_tables.txt
          echo "Critical tables: $(wc -l < critical_tables.txt)"

      - name: Compact critical tables
        run: |
          while IFS= read -r table; do
            echo "Compacting $CATALOG/$table"
            curl -sf -X POST "$LAKEOPS_API/api/tables/$CATALOG/$table/policies/COMPACT_DATA_FILES/execute" \
              -H "Authorization: Bearer $LAKEOPS_API_KEY" \
              -H "Content-Type: application/json" \
              -d '{"whereClause": "1=1"}'
            echo
          done < critical_tables.txt

      - name: Lake health summary
        run: |
          curl -sf "$LAKEOPS_API/api/dashboard" \
            -H "Authorization: Bearer $LAKEOPS_API_KEY" \
            | jq '{healthyTables, warningTables, criticalTables, totalDeletedSizeBytes}'

More CI/CD patterns

•Pre-deploy health gate — add a step that fails the pipeline if critical tables exceed a threshold.
•Post-ingestion compaction — trigger compaction after your data pipeline writes new data.
•Policy enforcement — use the policies API to create or update governance policies as part of infrastructure-as-code workflows.
•Monitoring & alerting — query the insights API to detect regressions in table health.

Best practices

  • •Use the narrowest scopes that work. A health-check job needs read only; add tables:write or policies:write only for jobs that change tables or policies. Avoid the global write scope in CI.
  • •Set an expiration on keys used in CI/CD. Rotate regularly.
  • •Store keys in secret managers (GitHub Secrets, AWS Secrets Manager, Vault) — never commit them to source control.
  • •For high-frequency polling, prefer the /api/dashboard endpoint over individual table queries.

Next steps