Granica APIs V1

REST API reference for the Granica platform — tables, schedules, crunch, vacuum, catalog connections, Optimus, object maintenance, and more.

Overview

The Granica REST API (v1) lets you programmatically manage all aspects of the Granica platform, including table onboarding, compaction scheduling, catalog connections, query optimization, and object maintenance.

Base path: /api/v1

All requests require valid authentication credentials. Responses use standard HTTP status codes; 422 indicates a validation error with detail in the response body.


Health

Health Check

GET /api/v1/health

Health check endpoint. Returns 200 when the API is operational.


Configuration

Get Config

GET /api/v1/config

Get customer configuration.

ResponseDescription
200Returns the current customer configuration.

Update Config

PUT /api/v1/config

Update customer configuration.

Request body: CustomerConfigUpdate

ResponseDescription
200Returns the updated configuration.
422Validation error.

Tables

List Tables

GET /api/v1/tables

List all tables with their schedules. Supports filtering by status and name. Use name to resolve a table's ID by its unique name (e.g. after a 409 on POST /tables).

ParameterInRequiredDescription
offsetqueryNoPagination offset. Default: 0.
limitqueryNoResults per page. Default: 100.
statusqueryNoFilter by onboarding status (e.g. pending, active, failed).
namequeryNoFilter by exact table name.

Create Table

POST /api/v1/tables

Register a table for onboarding. Schedule is added separately after onboarding completes. Partition pattern, date filter, cluster and enumerated columns are auto-discovered during onboarding.

Request body: TableCreate

{
  "name": "orders",
  "uri": "s3://bucket/data/orders",
  "format": "delta",
  "priority": "P2"
}
ResponseDescription
201Table created successfully.
422Validation error.

Get Table

GET /api/v1/tables/{table_id}

Get a table by ID, including its schedule.

Update Table

PUT /api/v1/tables/{table_id}

Update table configuration.

Request body: TableUpdate

{
  "priority": "P1",
  "target_file_size_mb": 512
}

Delete Table

DELETE /api/v1/tables/{table_id}

Delete a table and its schedules. Returns 204 on success.

Get Inventory History

GET /api/v1/tables/{table_id}/inventory-history

Append-only audit of inventory_report_uri changes for a table, ordered newest-first. Rows are retained after the table is deleted, so this may return audit history for removed tables.

ParameterInRequiredDescription
offsetqueryNoPagination offset. Default: 0.
limitqueryNoResults per page. Default: 50.

Schedules

Create Schedule

POST /api/v1/tables/{table_id}/schedule

Create a schedule for a table. Only works when onboarding_status is active.

Request body: ScheduleCreate

Daily with lookback range (T-15 to T-2):

{
  "schedule_type": "daily",
  "lookback_start": 15,
  "lookback_end": 2,
  "run_time_utc": "02:00"
}

Backfill:

{
  "schedule_type": "backfill",
  "backfill_col": "event_date",
  "backfill_start_date": "2025-01-01",
  "backfill_end_date": "2025-12-31"
}

Get Schedule

GET /api/v1/tables/{table_id}/schedule

Get the schedule for a table.

ParameterInRequiredDescription
job_typequeryNoFilter by job type: crunch, vacuum, or partition_expiration.

Update Schedule

PUT /api/v1/tables/{table_id}/schedule

Update the schedule for a table.

Request body: ScheduleUpdate

{
  "lookback_start": 7,
  "lookback_end": 1,
  "run_time_utc": "03:00",
  "enabled": false
}

Delete Schedule

DELETE /api/v1/tables/{table_id}/schedule

Delete the schedule for a table. Returns 204 on success.

ParameterInRequiredDescription
job_typequeryNoFilter by job type.

Onboarding

Get Onboarding Status

GET /api/v1/onboarding/{table_id}/status

Get the onboarding status for a table.

Retry Onboarding

POST /api/v1/onboarding/{table_id}/retry

Retry onboarding for a failed table. Only tables with onboarding_status='failed' can be retried. Resets status to retry for the onboarding scheduler to pick up.


Slots

Get Slot Info

GET /api/v1/slots/{run_time_utc}

Get slot capacity information for a specific time. Time format: HH:MM (e.g. 02:30, 14:00).


Crunch

Trigger Crunch

POST /api/v1/tables/{table_id}/crunch

Directly trigger a crunch job, bypassing the schedule.

Request body: CrunchTrigger

Two modes (mutually exclusive):

Lookback mode (relative to today):

{
  "lookback_start": 15,
  "lookback_end": 2,
  "priority": "P2"
}

Backfill mode (absolute dates):

{
  "backfill_start_date": "2026-01-01",
  "backfill_end_date": "2026-01-15",
  "priority": "P2",
  "cluster_columns": "user_id,event_type"
}
ParameterInRequiredDescription
skip_recipe_checkqueryNoSkip recipe completion check (for testing). Default: false.

List Table Crunch Jobs

GET /api/v1/tables/{table_id}/crunch

List crunch jobs for a specific table.

ParameterInRequiredDescription
offsetqueryNoPagination offset. Default: 0.
limitqueryNoResults per page. Default: 100.
statusqueryNoFilter by crunch job status.
job_typequeryNoFilter by job type: crunch or optimize.

List All Crunch Jobs

GET /api/v1/crunch

List all crunch jobs with optional filters.

ParameterInRequiredDescription
offsetqueryNoDefault: 0.
limitqueryNoDefault: 100.
table_idqueryNoFilter by table.
statusqueryNoFilter by crunch job status.
job_typequeryNoFilter by job type.

Get Crunch Job With Metrics

GET /api/v1/crunch/{crunch_id}/metrics

Get a crunch job with aggregated metrics including DRR (Data Reduction Rate), bytes before/after, and optimization metrics.

Cancel Crunch Job

POST /api/v1/crunch/{crunch_id}/cancel

Cancel a scheduled or in-flight crunch job.


Vacuum

Trigger Vacuum

POST /api/v1/tables/{table_id}/vacuum

Trigger a vacuum operation on a Delta or Iceberg table.

Request body: VacuumTrigger

List Table Vacuum Jobs

GET /api/v1/tables/{table_id}/vacuum

List vacuum jobs for a table.

ParameterInRequiredDescription
offsetqueryNoDefault: 0.
limitqueryNoDefault: 100.
statusqueryNoFilter by status.

Trigger Hard Delete

POST /api/v1/vacuum/hard-delete

Hard-delete files for all expired PENDING_DELETE records on demand.

ParameterInRequiredDescription
dry_runqueryNoPreview without deleting. Default: false.
table_idqueryNoScope to a specific table.
limitqueryNoMax records per call. Default: 500, cap 5000.

Partition Expiration

Trigger Partition Expiration

POST /api/v1/tables/{table_id}/partition-expiration

Trigger partition expiration (DELETE-only) on a Delta table. Files are tombstoned in the table log; physical reclamation is handled by the vacuum pipeline.

Request body: PartitionExpirationTrigger

List Partition Expiration Jobs

GET /api/v1/tables/{table_id}/partition-expiration

List partition expiration jobs for a table.

ParameterInRequiredDescription
offsetqueryNoDefault: 0.
limitqueryNoDefault: 100.
statusqueryNoFilter by status.

Validate Partition Expiration Policy

POST /api/v1/tables/{table_id}/partition-expiration/validate

Preflight a partition expiration policy before persisting. Side-effect-free — no DB writes.

Request body: PartitionExpirationValidateRequest


Pending Deletions

List Pending Deletions

GET /api/v1/pending-deletions

List pending deletions with optional filters.

ParameterInRequiredDescription
offsetqueryNoDefault: 0.
limitqueryNoDefault: 20.
statusqueryNoFilter by status.
table_idqueryNoFilter by table.
action_typequeryNoFilter by action type.
vacuum_modequeryNoFilter by vacuum mode.

Get Pending Deletion Stats

GET /api/v1/pending-deletions/stats

Aggregated pending deletion counts by status.

ParameterInRequiredDescription
table_idqueryNoScope to a specific table.

Get Pending Deletion

GET /api/v1/pending-deletions/{deletion_id}

Get a single pending deletion record.

Recover Pending Deletion

POST /api/v1/pending-deletions/{deletion_id}/recover

Recover a pending deletion to prevent hard-delete. Only PENDING_DELETE records can be recovered.

Request body: RecoverRequest


Catalog Connections

Test Connection

POST /api/v1/catalog-connections/test

Test a catalog connection without persisting. Validates credentials by listing catalogs.

Request body: ConnectionTest

Create Connection

POST /api/v1/catalog-connections

Create a new catalog connection.

Request body: ConnectionCreate

List Connections

GET /api/v1/catalog-connections

List catalog connections.

ParameterInRequiredDescription
offsetqueryNoDefault: 0.
limitqueryNoDefault: 100.
is_activequeryNoFilter by active status.

Get Connection

GET /api/v1/catalog-connections/{connection_id}

Get a single catalog connection.

Update Connection

PUT /api/v1/catalog-connections/{connection_id}

Update a catalog connection (partial update).

Request body: ConnectionUpdate

Delete Connection

DELETE /api/v1/catalog-connections/{connection_id}

Delete a catalog connection and all its synced metadata.

ParameterInRequiredDescription
confirmqueryNoMust be true to proceed. Deletion is irreversible.

Trigger Sync

POST /api/v1/catalog-connections/{connection_id}/sync

Trigger a catalog metadata sync. Runs in the background.

ParameterInRequiredDescription
catalogqueryNoLimit sync to a specific catalog.
modequeryNofull (walk all tables, detect deletions) or incremental (Unity Catalog only). Default: full.

List Catalogs

GET /api/v1/catalog-connections/{connection_id}/catalogs

List catalogs for a connection.

List Schemas

GET /api/v1/catalog-connections/{connection_id}/catalogs/{catalog_name}/schemas

List schemas within a catalog.

List Tables (Catalog)

GET /api/v1/catalog-connections/{connection_id}/tables

List tables with filtering, sorting, and pagination.

ParameterInRequiredDescription
catalogqueryNoFilter by catalog.
schemaqueryNoFilter by schema.
prefixqueryNoTable name prefix filter.
searchqueryNoSearch in full table name.
formatqueryNoFilter by table format.
table_typequeryNoFilter by table type.
min_size_bytesqueryNoMinimum table size filter.
max_size_bytesqueryNoMaximum table size filter.
has_partitionsqueryNoFilter by partitioning.
sort_byqueryNoSort field. Default: full_name.
sort_orderqueryNoasc or desc. Default: asc.
offsetqueryNoDefault: 0.
limitqueryNoDefault: 100.

Get Table Detail (Catalog)

GET /api/v1/catalog-connections/{connection_id}/tables/{full_name}

Get full table detail including JSONB fields.


Feature Flags

Get Feature Flag

GET /api/v1/feature-flags/{key}

Return the enabled state of a single feature flag. Returns {"key": key, "enabled": false} when the flag is missing — treat absence as disabled.


Optimus (Query Optimization)

Create Optimus Run

POST /api/v1/optimus/runs

Create and trigger an Optimus recommendation run.

Request body: OptimusRunCreate

Retry Optimus Run

POST /api/v1/optimus/runs/{submission_id}/retry

Retry a failed Optimus submission. Returns 422 unless the effective status is failed.

Sync Optimus Submission Now

POST /api/v1/optimus/runs/{submission_id}/sync-now

Fire an out-of-cycle Optimus run immediately, regardless of the configured daily_sync_time_utc.

Delete Optimus Submission

DELETE /api/v1/optimus/runs/{submission_id}

Hard-delete a submission. Cascades to runs, recommendations, and per-day predicate combos.

Get Optimus Run

GET /api/v1/optimus/runs/{run_id}

Get Optimus submission dispatch metadata and latest-run summary.

Update Optimus Submission

PATCH /api/v1/optimus/runs/{run_id}

Partially update an Optimus submission. Use to update name, lookback_days, daily_sync_time_utc, query_logs_uri, or active (pause/resume toggle).

Request body: OptimusSubmissionUpdate

List Optimus Recommendations

GET /api/v1/optimus/runs/{run_id}/recommendations

List per-table recommendations for the submission's latest run.

ParameterInRequiredDescription
offsetqueryNoDefault: 0.
limitqueryNoDefault: 100.

Apply Optimus Recommendation

POST /api/v1/optimus/recommendations/{recommendation_id}/apply

Apply one persisted Optimus recommendation to a managed table policy.

Request body: OptimusRecommendationApplyRequest

List Optimus Tables With Recommendations

GET /api/v1/optimus/runs/{run_id}/tables

List tables that have at least one recommendation under this submission.

Get Optimus Table Metrics

GET /api/v1/optimus/runs/{run_id}/tables/{table_fqn}/metrics

Per-day metric series for a table over the last days days, with applied-recommendation markers.

ParameterInRequiredDescription
daysqueryNoWindow width in days (inclusive of today). Default: 90.

Object Maintenance

Create Location

POST /api/v1/object-maintenance/locations

Register a new object maintenance location.

Request body: LocationCreate

List Locations

GET /api/v1/object-maintenance/locations

List object maintenance locations.

Get Location

GET /api/v1/object-maintenance/locations/{location_id}

Get a single object maintenance location.

Update Location

PATCH /api/v1/object-maintenance/locations/{location_id}

Partial update of an object maintenance location.

Request body: LocationUpdate

Delete Location

DELETE /api/v1/object-maintenance/locations/{location_id}

Delete an object maintenance location. Dependent prefixes are retained with location_id = NULL so history is preserved.

Trigger Discovery

POST /api/v1/object-maintenance/locations/{location_id}/discover

Trigger an object maintenance discovery pass. Runs in the background.

List Discovered Prefixes

GET /api/v1/object-maintenance/locations/{location_id}/discovered-prefixes

List the latest discovery-run results for a location (scoped to the most recent run).

List Managed Prefixes

GET /api/v1/object-maintenance/locations/{location_id}/managed-prefixes

List durable managed prefixes for a location.

List Prefixes (Cross-Location)

GET /api/v1/object-maintenance/prefixes

Flat view of managed prefixes across all locations.

ParameterInRequiredDescription
location_idqueryNoFilter to a single location.
management_statequeryNoFilter: unmanaged, active, paused, or error.
source_statequeryNoFilter: present or missing.

Get Prefix

GET /api/v1/object-maintenance/prefixes/{prefix_id}

Get a single managed prefix with parent-location summary and policy details.

Enable Maintenance

POST /api/v1/object-maintenance/locations/{location_id}/prefixes/{prefix_id}/enable

Enable maintenance on a prefix (unmanaged → active). Idempotent on already-active prefixes.

ResponseDescription
200Already enabled — no-op.
201Newly enabled.
404Prefix or location not found.
422Invalid lifecycle transition.

Get Prefix Policy

GET /api/v1/object-maintenance/prefixes/{prefix_id}/policy

Return the active policy and active version for a prefix.

Upsert Prefix Policy

PUT /api/v1/object-maintenance/prefixes/{prefix_id}/policy

Create or replace the active policy. Appends a new version and deactivates the prior one atomically. Auto-activates the prefix if still unmanaged.

Request body: PolicyUpsert

Delete Prefix Policy

DELETE /api/v1/object-maintenance/prefixes/{prefix_id}/policy

Drop the policy for a prefix. Cascades to policy versions.

List Prefix Policy Versions

GET /api/v1/object-maintenance/prefixes/{prefix_id}/policy/versions

Full version history of the active policy for a prefix, newest-first.

Trigger Prefix Action

POST /api/v1/object-maintenance/prefixes/{prefix_id}/actions

Trigger an ad-hoc action against a prefix.

Request body: ActionRequest

List Prefix Actions

GET /api/v1/object-maintenance/prefixes/{prefix_id}/actions

List actions for a prefix, newest first.

List Prefix Runs

GET /api/v1/object-maintenance/prefixes/{prefix_id}/runs

List execution rows for a prefix (crunch jobs and maintenance jobs unified).

Discovery Schedule Operations

EndpointDescription
GET /api/v1/object-maintenance/locations/{location_id}/discovery/schedulesList discovery-attempt history for a location.
GET /api/v1/object-maintenance/discovery/schedules/{schedule_id}Full detail for a discovery attempt.
GET /api/v1/object-maintenance/discovery/schedules/{schedule_id}/stateLive progress snapshot (console polls at 5s cadence while running).
GET /api/v1/object-maintenance/discovery/schedules/{schedule_id}/planPlan summary — bins, total bytes, estimated wall-time.
POST /api/v1/object-maintenance/discovery/schedules/{schedule_id}/pausePause a running discovery.
POST /api/v1/object-maintenance/discovery/schedules/{schedule_id}/resumeResume a paused discovery.
POST /api/v1/object-maintenance/discovery/schedules/{schedule_id}/restartRestart a discovery from scratch (cancels prior run, clears state).
POST /api/v1/object-maintenance/discovery/schedules/{schedule_id}/completeMark a discovery completed (dragon driver terminal callback).
POST /api/v1/object-maintenance/discovery/schedules/{schedule_id}/skip-bin/{bin_id}Skip a single wedged bin without restarting the full discovery.
GET /api/v1/object-maintenance/discovery/schedules/{schedule_id}/effective-configThree-layer config resolution for a schedule's parent location.
Was this page helpful?

On this page

Overview
Health
Health Check
Configuration
Get Config
Update Config
Tables
List Tables
Create Table
Get Table
Update Table
Delete Table
Get Inventory History
Schedules
Create Schedule
Get Schedule
Update Schedule
Delete Schedule
Onboarding
Get Onboarding Status
Retry Onboarding
Slots
Get Slot Info
Crunch
Trigger Crunch
List Table Crunch Jobs
List All Crunch Jobs
Get Crunch Job With Metrics
Cancel Crunch Job
Vacuum
Trigger Vacuum
List Table Vacuum Jobs
Trigger Hard Delete
Partition Expiration
Trigger Partition Expiration
List Partition Expiration Jobs
Validate Partition Expiration Policy
Pending Deletions
List Pending Deletions
Get Pending Deletion Stats
Get Pending Deletion
Recover Pending Deletion
Catalog Connections
Test Connection
Create Connection
List Connections
Get Connection
Update Connection
Delete Connection
Trigger Sync
List Catalogs
List Schemas
List Tables (Catalog)
Get Table Detail (Catalog)
Feature Flags
Get Feature Flag
Optimus (Query Optimization)
Create Optimus Run
Retry Optimus Run
Sync Optimus Submission Now
Delete Optimus Submission
Get Optimus Run
Update Optimus Submission
List Optimus Recommendations
Apply Optimus Recommendation
List Optimus Tables With Recommendations
Get Optimus Table Metrics
Object Maintenance
Create Location
List Locations
Get Location
Update Location
Delete Location
Trigger Discovery
List Discovered Prefixes
List Managed Prefixes
List Prefixes (Cross-Location)
Get Prefix
Enable Maintenance
Get Prefix Policy
Upsert Prefix Policy
Delete Prefix Policy
List Prefix Policy Versions
Trigger Prefix Action
List Prefix Actions
List Prefix Runs
Discovery Schedule Operations