Granica APIs V1
REST API reference for the Granica platform — tables, schedules, policies, crunch, vacuum, partition expiration, catalog connections, Optimus, object maintenance, and more.
Overview
The Granica REST API (v1) lets you programmatically manage the Granica platform: registering tables, setting maintenance policies and schedules, triggering crunch, vacuum, and partition-expiration runs, connecting catalogs, applying Optimus query-optimization recommendations, and managing object-storage prefixes through Object Maintenance.
Base path: /api/v1
Authentication and API keys
Programmatic clients authenticate with an API key sent as a bearer token:
Authorization: Bearer <your-api-key>Requests go through the Granica console's API gateway, which prefixes every API path with /granica-api. For example, GET /api/v1/tables is called as:
curl -H "Authorization: Bearer $GRANICA_API_KEY" \
https://<your-granica-console>/granica-api/api/v1/tablesThe gateway authenticates the key and enforces its scopes before forwarding the request:
- A key with no scopes has full access to every endpoint on this page.
- A key with scopes can call only the endpoints its scopes cover. Each endpoint below lists the scope it requires. Endpoints marked Full-access keys only are not covered by any scope, so only a key with no scopes can call them.
- A request that the key's scopes do not cover returns
403. The response names the missing scope inrequired_scopes. - When a browser session (rather than an API key) calls the gateway,
GETrequests are open to every signed-in user andPOST/PUT/PATCH/DELETErequire the Editor or Admin role. - Object Maintenance endpoints are available only when the
object_maintenancefeature is enabled on your deployment.
Some endpoints choose the required scope from the request body. POST /tables/{table_id}/crunch with "job_type": "vacuum" requires vacuum:write; any other job type requires crunch:write. Policy writes pick between crunch_policy:write, vacuum_policy:write, and partition_exp_policy:write from the body's type field. The legacy policies:write scope satisfies all three.
Identifiers
Two different IDs refer to a table. Pass the right one to each endpoint:
| ID | Where it comes from | Used by |
|---|---|---|
table_id | The id returned by POST /tables (the onboarding registration). | Table, schedule, onboarding, crunch, vacuum, partition-expiration, and hard-delete endpoints. |
manage_table_id | The table's row in Granica's table inventory, created by catalog sync. Returned as manage_table_id by POST /tables and by the catalog table listings. | Policy endpoints, and the manage_table_id field in crunch, vacuum, partition-expiration, and hard-delete request bodies. |
A table registered with POST /tables before its catalog has been synced has no manage_table_id yet. POST /tables returns next_action in that case, telling you what to run so the table gets linked.
Errors
Every 4xx and 5xx response uses the RFC 7807 problem-details format, with Content-Type: application/problem+json:
{
"type": "about:blank",
"title": "Conflict",
"status": 409,
"detail": "Table 'orders' already exists"
}detailcarries the human-readable reason. Most error messages say what to do next.- Request-validation failures return
422. Each failing field is listed in thevalidation_errorsextension. - Some endpoints add extension fields, such as
code,can_force, orallowed_transitions. These are documented with the endpoint.
Pagination
List endpoints take offset (default 0) and limit query parameters, and return { "items": [...], "total": <count> } unless noted otherwise. The default and maximum limit vary by endpoint and are given in each parameter table.
Table formats
Wherever a table format appears it is one of delta, iceberg, hudi, hive, parquet, raw, or hive_external_parquet. unsupported is reported for catalog tables that cannot be classified, and such tables cannot be onboarded.
Priorities
priority is P1 (highest) through P5 (lowest). The default is P3.
Health
Health Check
GET /api/v1/health
Scope: config:read
Liveness check. Returns 200 with status and version while the API is running.
If the startup scan found catalog connections whose stored client secret can no longer be decrypted (for example, because the API's encryption key was rotated), the response also includes undecryptable_secrets: the number of affected connections. Re-enter the secret on those connections to fix them. The field only appears when it is non-zero, so probes that check only the status code are unaffected.
{ "status": "healthy", "version": "3.13.0" }Configuration
Platform-wide settings that control slot-based scheduling capacity.
Get Config
GET /api/v1/config
Scope: config:read
Returns the customer configuration.
| Field | Description |
|---|---|
default_runtime_mins | Default expected runtime assigned to new tables, in minutes. |
slot_duration_mins | Length of one scheduling slot, in minutes. For example, 30 means the slot 14:00 covers 14:00–14:30. |
max_scheduled_per_slot | Maximum number of scheduled jobs that may share one slot. POST /tables/{table_id}/schedule returns 429 when a slot is full. |
max_ondemand_concurrent | Maximum number of on-demand jobs that run concurrently. |
Update Config
PUT /api/v1/config
Scope: config:write
Updates the customer configuration. Send only the fields you want to change.
Request body: CustomerConfigUpdate
| Field | Type | Range | Description |
|---|---|---|---|
default_runtime_mins | integer | 5–120 | Default runtime for new tables. |
slot_duration_mins | integer | 15–60 | Slot duration. |
max_scheduled_per_slot | integer | 1–50 | Maximum scheduled jobs per slot. |
max_ondemand_concurrent | integer | 1–20 | Maximum concurrent on-demand jobs. |
| Response | Description |
|---|---|
200 | Returns the updated configuration. |
422 | A value is out of range. |
Get Slot Info
GET /api/v1/slots/{run_time_utc}
Scope: config:read
Returns how full a scheduling slot is. Use it to pick a run_time_utc with free capacity before you create a schedule.
run_time_utc is HH:MM in UTC. Leading zeros are optional: 2:30 and 02:30 refer to the same slot.
{ "slot": "02:30", "scheduled_count": 7, "max_scheduled": 10, "available": 3 }Tables
A table is a registration that brings a dataset under Granica management. Registering a table starts onboarding: Granica validates the table's location and schema, auto-discovers its partition layout, cluster columns, and enumerated columns, and generates a compression recipe. When onboarding reaches active, the table can be crunched on demand or on a schedule.
Onboarding status moves through pending → validating → validated → optimizing → active, or to failed. retry means a retry has been queued. Maintenance operations (vacuum, partition expiration, hard-delete) only need discovery to finish, so they are allowed from validated onward. Crunch and schedules need active.
List Tables
GET /api/v1/tables
Scope: tables:read
Lists registered tables, each with its embedded schedule. Use name to look up a table's ID by its unique name, for example after POST /tables returns 409.
| Parameter | In | Required | Description |
|---|---|---|---|
offset | query | No | Pagination offset. Default: 0. |
limit | query | No | Results per page, 1–1000. Default: 100. |
status | query | No | Filter by onboarding status, for example pending, active, or failed. |
name | query | No | Filter by exact table name. |
Each item is a TableResponse. Besides the fields you set, it includes what onboarding discovered:
| Field | Description |
|---|---|
onboarding_status, onboarding_error | Onboarding state and the last error, if any. |
date_partition_pattern, partition_columns | Discovered date-partition layout. Partition expiration derives its delete filter from date_partition_pattern. |
cluster_columns, enumerated_columns | Discovered or user-set layout columns. |
auto_discovery_status, auto_discovery_result | Discovery outcome: pending, running, discovered, needs_review, failed, skipped, or not_applicable. |
is_append_only, mutation_count_per_day, append_count_per_day | Write-pattern statistics sampled from the table's commit history. |
size_bytes, file_count, size_snapshot_at | Latest size snapshot. |
file_format | Underlying file format of a Hive table, such as parquet or json. |
forge_override, compression_route_override, data_timezone | Engine, routing, and timezone settings (see Update Table). |
target_file_size_mb, max_concurrent_jobs | Output file size target and concurrency limit. |
schedule | The table's schedule, if it has one. |
Create Table
POST /api/v1/tables
Scope: tables:write
Registers a table and starts onboarding. You don't need to provide a partition pattern, date filter, cluster columns, or enumerated columns: onboarding discovers them. Add a schedule or policy after onboarding completes.
Request body: TableCreate
You can identify the table in one of these ways. They are checked in this order:
manage_table_id: a table already synced from a catalog. Location and format are read from Granica's table inventory. This is the recommended path for catalog tables.manage_object_prefix_id: an Object Maintenance prefix. Location comes from the prefix and format from discovery. If a table is already registered at that location, it is reused and linked to the prefix rather than duplicated.nameis optional here: a name is derived from the prefix path, with a-2,-3suffix added on collision.uri+format: a storage path and format, given directly.catalog_table_path: Deprecated. Unity Catalog full name. Usemanage_table_idinstead.connection_id+catalog_database+catalog_table_name: required for Iceberg tables addressed through a Hive Metastore or Iceberg REST connection.
At most one of manage_table_id, manage_object_prefix_id, and catalog_table_path may be set.
| Field | Type | Description |
|---|---|---|
name | string | Unique table name, 1–255 characters. Required except with manage_object_prefix_id. |
manage_table_id | UUID | Inventory row of a synced catalog table. |
manage_object_prefix_id | UUID | Object Maintenance prefix to onboard. Also sets the prefix's management state to active. |
uri | string | Storage path (s3://, gs://, az://). |
format | string | Table format. See Table formats. |
catalog_table_path | string | Deprecated. Unity Catalog full name. |
connection_id | UUID | Catalog connection. Required for Iceberg. Must be a hive_metastore or iceberg_rest connection: Iceberg tables in AWS Glue are discovered but not yet supported for maintenance. |
catalog_database | string | Database or namespace. Required for Iceberg. |
catalog_table_name | string | Table name in the catalog. Required for Iceberg. |
priority | string | Scheduling priority. Default: P3. |
data_timezone | string | IANA timezone (for example America/New_York) that the table's partition values are written in. It decides which calendar day a run treats as "today" and where the partition-expiration cutoff falls. Schedule run times stay in UTC. |
forge_override | string | Run this table on the Forge engine with the named runtime: forge_jar_k8s, forge_jar_emr, forge_jar_serverless, or forge_jar_dataproc. ironman or null keeps the table off Forge. An explicit value always wins. When omitted, new tables default to forge_jar_k8s if the platform's Forge feature flag is on and the format supports Forge. |
inventory_report_uri | string | Hive tables only. URI (s3://, s3a://, gs://) of a file inventory you provide. The storage scan reads this file instead of listing the table's directory. |
{
"name": "orders",
"uri": "s3://bucket/data/orders",
"format": "delta",
"priority": "P2"
}{
"name": "events",
"connection_id": "2f7c…",
"catalog_database": "analytics",
"catalog_table_name": "events"
}Response: 201 with the table, plus two linking fields:
| Field | Description |
|---|---|
manage_table_id | The inventory row this registration is linked to. Pass this ID to the policy endpoints. |
next_action | Set only while the registration is not yet linked to a synced catalog table. It says what to run (usually a catalog sync) so the table is linked, appears in the console, and accepts policies. |
| Response | Description |
|---|---|
201 | Table registered and onboarding started. |
404 | manage_table_id, manage_object_prefix_id, or connection_id not found, or catalog_table_path is not in the synced catalog metadata (run a sync first). |
409 | A table with this name (or, for catalog tables, the same connection/database/table) already exists, or the inventory table is already onboarded. Use GET /tables?name=... to find the existing table's ID. |
422 | Validation failed: missing name, uri, or format; an unsupported format; a non-Hive table with inventory_report_uri; Forge not eligible for this table; Iceberg without the catalog fields; or the inventory table is no longer available. |
Get Table
GET /api/v1/tables/{table_id}
Scope: tables:read
Returns one table and its schedule. Returns 404 if the table does not exist.
Update Table
PUT /api/v1/tables/{table_id}
Scope: tables:write
Updates table configuration. Send only the fields you want to change.
Request body: TableUpdate
| Field | Type | Description |
|---|---|---|
priority | string | P1–P5. |
target_file_size_mb | integer | Target output file size, 64–1024 MB. |
max_concurrent_jobs | integer | Maximum concurrent jobs for this table (at least 1). |
cluster_columns | string | Comma-separated column names. Each must match [A-Za-z_][A-Za-z0-9_]*. Overrides the discovered value; discovery evidence is kept. |
enumerated_columns | object | Map of column name to a list of values. |
schedule | object | A nested ScheduleUpdate (see Update Schedule) applied to the table's schedule. |
compression_route_override | string | Force crunch or optimize routing. null restores automatic routing. |
data_timezone | string | IANA timezone of the partition values. |
forge_override | string | Forge runtime, or ironman/null to turn Forge off. The platform's Forge version must be configured first, otherwise 422. |
inventory_report_uri | string | Hive only. Changing it to a new non-null value on an onboarded table queues an inventory refresh against the new file. The refresh picks up newly added partitions; it is not a full reconcile. Setting null clears the field and does not queue anything. |
{
"priority": "P1",
"target_file_size_mb": 512
}| Response | Description |
|---|---|
200 | Returns the updated table. |
404 | Table not found. |
409 | An inventory refresh for this table is mid-retry. Try again once its current attempt starts or completes. |
422 | Validation failed, Forge not eligible for this table, or the Forge version is not configured. |
Delete Table
DELETE /api/v1/tables/{table_id}
Scope: tables:write
Deletes a table registration and its schedules. Any in-flight work for the table is stopped first. Data in storage is not touched.
| Response | Description |
|---|---|
204 | Deleted. |
404 | Table not found. |
503 | In-flight work could not be stopped, so the table was not deleted. Retry. |
Refresh Inventory
POST /api/v1/tables/{table_id}/inventory-refresh
Scope: tables:write
Queues an on-demand object-inventory refresh for a Hive table. The refresh finds new partitions and new files in partitions it has already seen. It only discovers files; it does not crunch them.
Request body (optional): InventoryRefreshRequest
| Field | Type | Description |
|---|---|---|
inventory_report_uri | string | A fresh file inventory to run this refresh against, which skips directory listing. When omitted, the table directory is listed. The table's stored inventory_report_uri is never reused, because a stale inventory must not drive a refresh. |
Response: 202 with table_id, refresh_id, status, and message.
| Response | Description |
|---|---|
202 | Refresh queued. |
404 | Table not found. |
409 | A refresh is mid-retry. Try again once its current attempt starts or completes. |
422 | The table is not Hive, the URI is invalid, or the table has no scannable location (a Hive Metastore database and table, or a Glue table location). |
Get Engine Readiness
GET /api/v1/tables/{table_id}/engine-readiness
Scope: tables:read
A dry run of engine selection. It reports which engines the table can run on and which one a crunch would use right now. Nothing is changed or queued.
| Field | Description |
|---|---|
table_format | The table's format. |
forge_override | The value stored on the table, or null. |
forge_flag_enabled | Whether the platform's Forge feature flag (the default for new tables) is on. |
feasible_engines | Every engine the table is eligible for. |
recommended | The engine a crunch triggered now would use. |
reason | Why that engine was chosen. |
Onboarding
Get Onboarding Status
GET /api/v1/onboarding/{table_id}/status
Scope: onboarding:read
Returns the table's onboarding progress.
| Field | Description |
|---|---|
onboarding_status | Current status. See Tables. |
onboarding_error | Last error, if any. |
can_retry | true when a plain retry is allowed (the table failed or stalled). |
can_force | true when a forced retry is allowed (onboarding is in progress or already active). |
retry_count | Number of retries so far. |
Retry Onboarding
POST /api/v1/onboarding/{table_id}/retry
Scope: onboarding:write
Restarts onboarding for a table.
failed, or validated with a failed recipe generation: onboarding is reset and rescheduled.forceis not needed.- In progress or
active, withoutforce: returns409. The response carriescode,onboarding_status, andcan_force: true, so a client can confirm with the user and retry withforce. - In progress or
active, withforce: true: any live onboarding pipeline is cancelled, then onboarding is reset and rescheduled.
Concurrent retries on the same table are serialized.
Request body (optional):
{ "force": true }Response: 202 with previous_status, new_status, and message.
| Response | Description |
|---|---|
202 | Retry queued. |
404 | Table not found. |
409 | Onboarding is in progress or active. Retry with force: true to cancel it and start over. |
Cancel Onboarding
POST /api/v1/onboarding/{table_id}/cancel
Scope: onboarding:write
Cancels an in-flight onboarding run, in either the metadata-collection phase or the recipe-generation phase. The running pipeline is torn down and its task pods are released. The table's status is set to failed, so it can be retried later.
Response: 200 with phase (the phase that was cancelled) and message.
| Response | Description |
|---|---|
200 | Cancelled. |
404 | Table not found. |
409 | Nothing is in flight to cancel. |
Table Policies
A policy is the recommended way to set up recurring maintenance for a catalog table. One policy document holds a table's crunch, vacuum, and partition-expiration settings. Each save creates a new, numbered version.
The scheduler reconciles each table's schedules against its active policy about once a minute. Schedules are created, updated, or deleted to match, so you don't need to call the schedule API after saving a policy. Any schedule you change directly on a table that has a policy will be overwritten.
Policy endpoints take the table's manage_table_id, not its table_id. See Identifiers.
Policy document
{
"policy_document": {
"policies": [
{
"id": "crunch",
"enabled": true,
"schedule": {
"scheduleType": "daily",
"runTimeUtc": "02:00",
"jobType": "optimize",
"partitionRangeStart": { "unit": "days", "value": 2 },
"partitionRangeEnd": { "unit": "days", "value": 0 }
},
"primitives": [{ "id": "compaction", "enabled": true }],
"options": { "targetFileSizeBytes": 134217728 }
},
{
"id": "partition_expiration",
"enabled": true,
"options": { "retentionDays": 90 }
}
]
},
"change_summary": "Nightly optimize over T-2..T-0, keep 90 days",
"type": "crunch"
}Policy entries (policies[].id):
id | Purpose |
|---|---|
crunch | Recurring crunch or optimize. |
snapshot_expiration_vacuum, snapshot_expiration_vacuum_lite, snapshot_expiration_vacuum_full | Vacuum lanes. |
partition_expiration | Drop partitions older than a retention window. |
Entries with other IDs are stored as given, so newer documents still save.
schedule fields:
| Field | Description |
|---|---|
scheduleType | daily, weekly, monthly, hourly, or custom. backfill is not allowed in a policy: use Trigger Crunch for a one-off date range. |
runTimeUtc | HH:MM. Its meaning depends on the cadence (see Sub-daily cadences). Default: 02:00. An explicit null is rejected. |
jobType | crunch or optimize. |
partitionRangeStart, partitionRangeEnd | The lookback window, as { "unit": "days" or "hours" or "weeks", "value": <non-negative integer> }. Unknown units are rejected, because the scheduler would otherwise read them as days. |
options keys read by the scheduler:
| Policy | Options |
|---|---|
crunch | targetFileSizeBytes, sortColumns, sortColumnsPartitionLevel, zOrderColumns, bloomColumns, fpp, swizzleColumns, mode, deleteSourceFiles, compactionOutputPath, minAgeFilterSeconds |
| Vacuum lanes | retentionHours, retainLast, vacuumAlgorithm, inventoryPath, manifestPath, deferred, ttlDays, allowUnsafeRetention |
partition_expiration | retentionDays (required when the entry is enabled, an integer of at least 1), deferred, ttlDays, manifestPath |
Validation is limited to the fields the scheduler would otherwise misread without any error: policies must be a list, every entry needs a string id, options must be an object, and the scheduleType, runTimeUtc, range-unit, and retentionDays rules above apply. Everything else is stored as given.
Other request fields:
| Field | Description |
|---|---|
change_summary | Note shown in the version history. |
type | crunch (default), vacuum, or partition_expiration. The API itself ignores it, but the gateway uses it to pick the required scope. Send it when your key holds a specific policy scope rather than policies:write. |
actor_email, actor_role, actor_user_id | Audit fields, recorded as given. Defaults: system and api. They are never used for authorization. |
Create or Replace Policy
POST /api/v1/tables/{manage_table_id}/policies
Scope: crunch_policy:write, vacuum_policy:write, or partition_exp_policy:write, chosen by type. policies:write also works.
Saves a new active policy version. In one transaction, it appends the version, deactivates the previous one, points the policy at the new version, and copies the enabled flags onto the table. The scheduler applies the change on its next run.
To restore an earlier version, POST that version's policy_document again with an explanatory change_summary. There is no separate restore endpoint.
Response: 201 with TablePolicyResponse: id, active_version_id, version, policy_document, enabled_primitives, crunch_enabled, vacuum_enabled, partition_exp_enabled, auto_apply_optimus, and timestamps.
| Response | Description |
|---|---|
201 | Policy version saved. |
404 | Managed table not found. |
409 | The table's Iceberg partition metadata or date scope is unsafe, untrusted, or stale. The message names the cause and the next step: the table is still onboarding; discovery is missing or stale (force an onboarding retry); discovery found no partition facts; the metadata is malformed; or the table is waiting for data or unpartitioned. |
422 | The policy document failed validation. |
Validate Policy
POST /api/v1/tables/{manage_table_id}/policies/validate
Scope: Same as Create or Replace Policy.
Runs the same admission checks as a save for an enabled crunch policy, without writing a policy or an audit row. Call it to find problems before saving.
| Parameter | In | Required | Description |
|---|---|---|---|
include_guard | query | No | When true, return 200 with a validated snapshot instead of 204. Default: false. |
| Response | Description |
|---|---|
204 | The policy would be accepted. |
200 | The policy would be accepted (include_guard=true). The body holds the validated snapshot. |
409 | Unsafe, untrusted, or stale Iceberg partition metadata or date scope. |
422 | The policy document failed validation. |
Get Active Policy
GET /api/v1/tables/{manage_table_id}/policies
Scope: crunch_policy:read, vacuum_policy:read, partition_exp_policy:read, or policies:read
Returns the active policy and its summary flags. Returns 404 if no policy is attached to the table.
List Policy Versions
GET /api/v1/tables/{manage_table_id}/policies/versions
Scope: Same as Get Active Policy.
Returns the policy's version history, newest first, as { "versions": [...], "total": n }. Each version has version, policy_document, enabled_primitives, change_summary, created_by, activated_at, deactivated_at, and is_active.
A table with no policy yet returns an empty list rather than 404. A manage_table_id that does not exist returns 404.
Validate Action
POST /api/v1/tables/{manage_table_id}/actions/validate
Scope: Full-access keys only.
Runs the admission checks for an on-demand crunch without creating anything, and returns the queued action as the server would record it. The body is the same as Trigger Crunch.
| Response | Description |
|---|---|
200 | The action would be accepted. |
409 | Unsafe, untrusted, or stale Iceberg partition metadata or date scope. |
Set Policy Preferences
PUT /api/v1/tables/{manage_table_id}/policy-preferences
Scope: crunch_policy:write, vacuum_policy:write, partition_exp_policy:write, or policies:write
Turns automatic application of Optimus recommendations on or off for a table. This preference is stored on the table's policy record, not in the policy document, so changing it does not create a new policy version.
{ "auto_apply_optimus": true }When true, Optimus recommendations for this table with action APPLY are applied automatically after each Optimus run, without review. Returns 404 if the table has no policy record.
Schedules
A schedule tells the scheduler when to run a job on a table. A table can have one schedule per job_type: crunch, optimize, vacuum, vacuum_lite, vacuum_full, or partition_expiration.
For catalog tables with a policy, the scheduler overwrites schedules to match the policy about once a minute. Use Table Policies for those tables. The schedule API is for tables without a policy.
Sub-daily cadences
run_time_utc is always HH:MM, but its meaning depends on schedule_type:
schedule_type | run_time_utc means | Fires |
|---|---|---|
daily, weekly, monthly | UTC time of day, 00:00–23:59. | Once per eligible day at that time. |
hourly | 00:MM. Only the minute is read (0–59). | Every hour at minute MM. |
custom | An interval: HH:MM means every HH*60 + MM minutes. Must be 15–1439 minutes. | Every N minutes, counting from 00:00 UTC. |
backfill | Ignored. | Once, over backfill_start_date–backfill_end_date. |
The lookback values are day offsets: lookback_start: 15, lookback_end: 2 processes partitions from 15 days ago through 2 days ago. 0 is today's UTC date when the job fires. lookback_start must be greater than or equal to lookback_end. Use 0 when data lands continuously (hourly) or when partitions are dated in a timezone ahead of UTC.
Create Schedule
POST /api/v1/tables/{table_id}/schedule
Scope: schedules:write
Creates a schedule. The table must be active.
Request body: ScheduleCreate
| Field | Type | Description |
|---|---|---|
schedule_type | string | Required. daily, weekly, monthly, hourly, custom, or backfill. |
lookback_start | integer | Required for every type except backfill. Start at T-N days. |
lookback_end | integer | Required for every type except backfill. End at T-N days. |
run_time_utc | string | See Sub-daily cadences. Default: 02:00. |
backfill_col | string | Column used for backfill filtering. |
backfill_start_date, backfill_end_date | date | Required for backfill. Start must be on or before end. |
job_type | string | Default: crunch. optimize and the vacuum types need a Delta or Iceberg table. partition_expiration needs Delta, Iceberg, or Hive. |
job_context | object | Job options passed through to the engine, such as vacuum or partition-expiration options. See JobContext. |
Daily, T-15 to T-2:
{
"schedule_type": "daily",
"lookback_start": 15,
"lookback_end": 2,
"run_time_utc": "02:00"
}Every 30 minutes, today's partition:
{
"schedule_type": "custom",
"lookback_start": 0,
"lookback_end": 0,
"run_time_utc": "00:30"
}Backfill:
{
"schedule_type": "backfill",
"backfill_col": "event_date",
"backfill_start_date": "2025-01-01",
"backfill_end_date": "2025-12-31"
}Response: 201 with the schedule, including enabled, next_run_at, and last_run_at.
| Response | Description |
|---|---|
201 | Schedule created. |
400 | The table is not active; job_type is not supported for this table's format; a partition-expiration retention filter can't be derived from the table's date_partition_pattern; or the cadence is invalid. |
404 | Table not found. |
409 | A schedule with this job_type already exists for the table. Use PUT to change it. |
429 | The slot is full. The response includes slot, scheduled, max, and a suggestion to try a different time. |
Get Schedule
GET /api/v1/tables/{table_id}/schedule
Scope: schedules:read
Returns the table's schedule.
| Parameter | In | Required | Description |
|---|---|---|---|
job_type | query | No | Which schedule to return, for example crunch, vacuum, or partition_expiration. |
Returns 404 if no matching schedule exists.
Update Schedule
PUT /api/v1/tables/{table_id}/schedule
Scope: schedules:write
Partially updates a schedule. Send only the fields you want to change. The result is validated as a whole: the cadence and lookback rules, the job-type-versus-format check, and the partition-expiration filter check all run on the merged schedule. If today's run time changes before the job has fired, today's run is rescheduled to the new time.
| Parameter | In | Required | Description |
|---|---|---|---|
job_type | query | No | Which schedule to update. |
Request body: ScheduleUpdate. Takes the same fields as Create Schedule, all optional, plus enabled (boolean) to pause or resume the schedule.
{
"lookback_start": 7,
"lookback_end": 1,
"run_time_utc": "03:00",
"enabled": false
}| Response | Description |
|---|---|
200 | Returns the updated schedule. |
400 | The merged schedule is invalid (bad cadence or lookback, format not supported, or partition-expiration filter not derivable). |
404 | Table or schedule not found. |
409 | Conflict while applying the update. |
Delete Schedule
DELETE /api/v1/tables/{table_id}/schedule
Scope: schedules:write
Deletes a schedule. The call is idempotent: it returns 204 even if no matching schedule exists.
| Parameter | In | Required | Description |
|---|---|---|---|
job_type | query | No | Which schedule to delete. |
Crunch
Crunch rewrites a table's data files for better compression and layout. optimize is a related job type for Delta and Iceberg that compacts and sorts files in place. Each crunch request creates one job per partition date in the requested window, or a single job for a whole-table run.
Trigger Crunch
POST /api/v1/tables/{table_id}/crunch
Scope: crunch:write, or vacuum:write when job_type is vacuum
Triggers a crunch immediately, outside any schedule.
How the request is handled depends on the table's onboarding status:
active: jobs are submitted immediately.- Not yet
active, withmanage_table_id: the action is queued and starts when onboarding completes. - Not yet
active, withoutmanage_table_id: returns400. Wait for onboarding to finish, or passmanage_table_id.
Request body: CrunchTrigger
scope sets the shape of the run:
incremental(default): crunch a date window, set in one of two ways (not both):- Lookback:
lookback_startandlookback_end, relative to today. - Backfill:
backfill_start_dateandbackfill_end_date, absolute and inclusive.
- Lookback:
full: one whole-table job, with no dates and nobatch_mode. Not supported for Hive tables. For Iceberg, the table needs current, trusted partition metadata and a qualified format-v3 runtime, otherwise409. Policies cannot request a full-scope run.
| Field | Type | Description |
|---|---|---|
scope | string | incremental (default) or full. |
lookback_start, lookback_end | integer | T-N day offsets. 0 is today's UTC date. Start must be greater than or equal to end. |
backfill_start_date, backfill_end_date | date | Inclusive date range. |
manage_table_id | UUID | Required for catalog tables. Records the action against the table and lets the request queue until onboarding finishes. Omit it only for tables registered by uri with no catalog. |
priority | string | P1–P5. Default: P3. |
job_type | string | crunch (default) or optimize. optimize needs a Delta or Iceberg table. |
cluster_columns | string | Comma-separated cluster columns for this run. |
job_timeout_seconds | integer | Per-job time limit, 1800–43200 seconds (30 minutes to 12 hours). Defaults to the platform setting. |
max_dag_retries | integer | How many times to re-run a failed job, 0–5. Default: no automatic retry. |
use_experimental | boolean | Use the experimental native crunch engine. Hive Parquet only. |
skip_recipe_sort | boolean | Run with the table's base recipe: no learned sort order. Explicit sort columns still apply. Only for crunch and optimize, not with batch_mode, and not supported on Forge. |
chunk_id | string | Hive only. Crunch a single object-inventory chunk. Default: all sealed chunks. |
job_context | object | Advanced engine options. See JobContext. |
batch_mode | boolean | Iceberg only. Group the per-partition jobs into one Spark rewrite. Default: false. |
batch_max_bytes | integer | Batch size limit in bytes. Defaults to the platform setting. |
| Parameter | In | Required | Description |
|---|---|---|---|
skip_recipe_check | query | No | Skip the check that recipe generation has completed. For testing. Default: false. |
include_crunch_ids | query | No | Return the IDs of the jobs created, in crunch_ids (up to 1000). Does not change how jobs are dispatched. Default: false. |
Lookback mode (T-15 to T-2, 14 days):
{
"lookback_start": 15,
"lookback_end": 2,
"priority": "P2"
}Backfill mode:
{
"backfill_start_date": "2026-01-01",
"backfill_end_date": "2026-01-15",
"priority": "P2",
"cluster_columns": "user_id,event_type"
}Whole table:
{
"scope": "full",
"manage_table_id": "8b1d…",
"job_type": "optimize"
}Response: 201 with CrunchTriggerResponse:
| Field | Description |
|---|---|
entries_created | Number of jobs created. 0 when the action was queued until onboarding finishes. |
date_range_start, date_range_end | The resolved date window. |
mode | The mode used: lookback, backfill, or full. |
action_id | The recorded action, when a manage_table_id was given. |
crunch_ids, crunch_ids_complete | Only with include_crunch_ids=true. Job IDs created or re-armed (an ID may repeat). crunch_ids_complete is true only when every ID is listed. It is false for queued actions or when the 1000-ID limit was reached. |
| Response | Description |
|---|---|
201 | Jobs created, or the action queued. |
400 | The request is invalid for this table. For example: no manage_table_id on a table that isn't active; optimize or vacuum on an unsupported format; scope: full on Hive; use_experimental or parallel_crunch_max_workers on a table that isn't Hive Parquet; in-place compaction of a non-Parquet Hive table; recipe generation not finished; or no date window. |
404 | Table not found, or chunk_id is not a dirty chunk in the table's inventory. |
409 | The run conflicts with current state. For example: another job already covers the window or the whole table; a job in the window is still being cancelled; in-place compaction while another crunch runs; no object inventory for a Hive table (run the inventory first); or partition metadata that can't safely define a date scope (rediscover the table). |
422 | Validation failed, for example compression-only settings with job_type: crunch (use optimize). |
JobContext
job_context holds advanced, job-specific engine options. Every field is optional and unknown keys are passed through.
| Field | Description |
|---|---|
target_file_size_bytes | Target output file size. With Hive Parquet, 1 means compression-only: files are rewritten one for one. Compression-only requires job_type: optimize. |
sort_columns | Comma-separated sort columns within each file. |
sort_columns_partition_level | Comma-separated columns for a global sort across each partition. |
zorder_columns | Comma-separated Z-order columns, as recommended by Optimus. |
sort_strategy | Forge sort strategy, such as SORT or ZORDER. |
bloom_columns, bloom_fpp | Columns to build Parquet bloom filters on, and the false-positive rate (strictly between 0 and 1; default 0.01). |
swizzle_columns | Columns to move to the front of the Parquet schema. |
auto_learn | Learn and cache a recipe when optimize finds none. Default: true. Set false to use only existing recipes. |
rewrite_all | Rewrite every eligible file in scope. This does not widen the scope to the whole table. |
forge_optimize_mode | Forge file selection: incremental keeps stable files, full reclusters everything in scope. |
min_input_files | Forge: minimum number of candidate files before a job runs. |
min_age_filter | Forge raw/Hive Parquet: skip objects modified within this many seconds of job start. Requires the Forge Kubernetes engine. |
forge_parquet_auto_recipe | Forge Parquet compression-only: choose between the base and sorted recipe for each file by measurement. |
compaction_mode | Hive: out_of_place (default; merged files go to a new path and the source files stay) or in_place (merged files are committed and the source files deleted). in_place must be paired with delete_source_files: true, and can't start while another crunch is running on the table. |
delete_source_files | Opts in to in-place compaction. Sets compaction_mode to in_place. |
compaction_output_path | Out-of-place destination for merged files. Must be outside the table's prefix. |
parallel_crunch_max_workers | Experimental, Hive Parquet only. Caps the worker pool. When omitted, it is sized from file sizes to avoid running out of memory. |
granica_parquet_writer_enabled | Use the Granica Parquet writer during optimize. |
compute_puffin_stats, puffin_columns | Iceberg: after optimize, compute Puffin statistics (distinct-value sketches) for the given columns, or all columns. |
retention_hours, dry_run, expire_snapshots, remove_orphan_files, rewrite_manifests | Vacuum options. See Trigger Vacuum. |
List Table Crunch Jobs
GET /api/v1/tables/{table_id}/crunch
Scope: crunch:read or vacuum:read
Lists a table's crunch and optimize jobs.
| Parameter | In | Required | Description |
|---|---|---|---|
offset | query | No | Default: 0. |
limit | query | No | 1–1000. Default: 100. |
status | query | No | Filter by job status, for example pending, processing, completed, failed, cancelling, or cancelled. |
job_type | query | No | crunch or optimize. |
Each job includes the partition (crunch_data_date, partition_condition), crunch_job_status, priority, and Spark details (spark_app_state, spark_error_message, submit and end times, duration, attempt counts). It also includes job_context, job_timeout_seconds, max_dag_retries, error_message, retry_count, and the Granica release version that ran the job.
Returns 404 if the table does not exist.
List All Crunch Jobs
GET /api/v1/crunch
Scope: crunch:read or vacuum:read
Lists crunch and optimize jobs across all tables.
| Parameter | In | Required | Description |
|---|---|---|---|
offset | query | No | Default: 0. |
limit | query | No | 1–1000. Default: 100. |
table_id | query | No | Filter by table. |
status | query | No | Filter by job status. |
job_type | query | No | crunch or optimize. |
Get Crunch Job With Metrics
GET /api/v1/crunch/{crunch_id}/metrics
Scope: crunch:read or vacuum:read
Returns a job together with metrics summed across all its partitions.
| Field | Description |
|---|---|
file_count | Files rewritten. |
before_bytes, after_bytes | Bytes before and after. For crunch, these are the bytes removed and written. For optimize, files that were already compressed are excluded (in older records). For Forge, they are the input and output bytes. |
before_rows, after_rows | Row counts before and after. |
drr_percent | Data Reduction Rate, (1 − after/before) × 100, computed when requested. |
granica_bytes_removed | Bytes saved, as reported by Forge. |
Returns 404 if the job does not exist.
Cancel Crunch Job
POST /api/v1/crunch/{crunch_id}/cancel
Scope: crunch:write
Cancels (kills) a crunch job that is pending or processing.
- Supported formats: Hive, Iceberg, Delta, and raw tables.
- Supported runtimes: jobs running on Spark-on-Kubernetes in the Granica cluster. Jobs on Forge EMR, Serverless, or Dataproc, jobs sent to EMR or Dataproc, and hybrid deployments return
409, because there's no way to confirm their writer has stopped.
The job moves to cancelling straight away. Teardown runs in the background and the job then becomes cancelled. If teardown fails, it's retried automatically. A batched job is cancelled together with every other job in its batch.
Response: 200 with crunch_id, table_id, action: "cancel", target_status: "cancelling", and message.
| Response | Description |
|---|---|
200 | Cancellation started. |
404 | Job not found. |
409 | The format or runtime isn't supported, the job isn't pending or processing, or it reached a terminal state while the request was processed. |
Retry Crunch Job
POST /api/v1/crunch/{crunch_id}/retry
Scope: crunch:write
Retries a failed crunch job. The job is reset to pending, its previous error is cleared, and it's dispatched again with a fresh run ID. Re-running is safe: the rewrite overwrites earlier output and metrics are recomputed.
Response: 200 with previous_status, new_status: "pending", and message.
| Response | Description |
|---|---|
200 | Job re-queued. |
404 | Job not found. |
409 | The job isn't failed, its status just changed, or another job has since taken its partitions or chunk. |
Vacuum
Vacuum removes data files that a Delta or Iceberg table no longer references. Vacuum runs are tracked separately from crunch jobs.
Trigger Vacuum
POST /api/v1/tables/{table_id}/vacuum
Scope: vacuum:write
Starts a vacuum on a Delta or Iceberg table. The table must be at least validated.
Vacuum must be enabled on your deployment (the vacuum_policies feature flag); otherwise this endpoint returns 403.
Request body: VacuumTrigger
| Field | Type | Description |
|---|---|---|
manage_table_id | UUID | Required. The table's inventory row, used to record the action. |
priority | string | P1–P5. Default: P3. |
retention_hours | integer | Keep files newer than this. 0 or omitted uses the table's own delta.deletedFileRetentionDuration. Values below that property are rejected unless allow_unsafe_retention is set. |
retain_last | integer | Iceberg: minimum number of snapshots to keep. Defaults to the table's history.expire.min-snapshots-to-keep. |
dry_run | boolean | List the files that would be deleted, without deleting them. |
deferred | boolean | Soft-delete: record the files to delete and remove them after ttl_days. Until then, they can be recovered from Delayed Deletions. Requires the vacuum_deferred feature flag. Can't be combined with dry_run. |
ttl_days | integer | Days before files are hard-deleted, 0–90. Required with deferred. 0 means the next hourly sweep. |
vacuum_mode | string | immediate (default) or deferred. |
vacuum_algorithm | string | full (scan for orphaned files; default), lite (only files the transaction log marks removed), or inventory (uses an S3 Inventory report; requires inventory_path). |
manifest_path | string | Where to store deletion manifests. |
inventory_path | string | S3 Inventory report path, for the inventory algorithm. |
allow_unsafe_retention | boolean | Unsafe. Accept a retention below the table's configured minimum. Restricted to admins and gated by a feature flag. |
expire_snapshots, remove_orphan_files, rewrite_manifests | boolean | Iceberg: which maintenance steps to run. Each defaults to true. |
{
"manage_table_id": "8b1d…",
"deferred": true,
"ttl_days": 7
}Response: 201 with action_id, entries_created, vacuum_mode, vacuum_algorithm, and message.
| Response | Description |
|---|---|
201 | Vacuum queued. |
400 | The table is not Delta or Iceberg. |
403 | Vacuum is disabled on this deployment. |
404 | Table not found. |
409 | The table isn't ready for maintenance yet (discovery hasn't finished). Retry once it reaches validated. |
422 | deferred requested but deferred vacuum is disabled; or validation failed (deferred with dry_run, missing ttl_days, or inventory without inventory_path). |
List Table Vacuum Jobs
GET /api/v1/tables/{table_id}/vacuum
Scope: vacuum:read
Lists a table's vacuum runs.
| Parameter | In | Required | Description |
|---|---|---|---|
offset | query | No | Default: 0. |
limit | query | No | 1–1000. Default: 100. |
status | query | No | Filter by status: pending, scheduled, running, completed, failed, or cancelled. |
Trigger Hard Delete
POST /api/v1/tables/{table_id}/hard-delete
Scope: Full-access keys only.
Queues an immediate hard-delete of a table's soft-deleted files whose recovery window has already passed. An hourly sweep deletes these files anyway; use this endpoint when you don't want to wait for it. Recovery windows are never shortened: files still inside their window are not affected.
The deletion itself runs in a background job that has access to your storage. This endpoint only queues that job.
Requires the vacuum_deferred feature flag.
Request body:
{ "manage_table_id": "8b1d…" }manage_table_id must refer to the same table as table_id. This ensures the deletion is always recorded against the table whose files are deleted.
Response: 201 with HardDeleteTriggerResponse. The counts describe what was eligible when the job was queued, not what was deleted:
| Field | Description |
|---|---|
entries_created | 1 if a job was queued, 0 if nothing was eligible. |
due_records, due_files | Delayed deletions and files whose window has passed. |
action_id, maintenance_job_id | The recorded action and job, or null when nothing was queued. |
| Response | Description |
|---|---|
201 | Job queued, or nothing was due. |
400 | manage_table_id does not belong to this table. |
403 | Deferred vacuum is disabled on this deployment. |
404 | Table not found. |
409 | The table isn't ready for maintenance yet. |
Partition Expiration
Partition expiration drops partitions older than a retention window. You give the retention in days, and Granica builds the delete filter from the table's discovered date_partition_pattern.
- Delta and Iceberg: metadata only. Matching files are marked deleted in the table log but stay in storage. You can recover them with time travel until vacuum removes them.
- Hive: the partitions are dropped from the metastore. For external tables, the files are deleted too, or recorded for a delayed delete when
deferredis set. Hive has no time travel, sodeferredis its only recovery window.
Trigger Partition Expiration
POST /api/v1/tables/{table_id}/partition-expiration
Scope: partition_exp_policy:write
Starts a partition-expiration run on a Delta, Iceberg, or Hive table. The table must be at least validated. Requires the partition_expiration feature flag.
Request body: PartitionExpirationTrigger
| Field | Type | Description |
|---|---|---|
manage_table_id | UUID | Required. The table's inventory row. |
retention_days | integer | Required. Number of days of partitions to keep, 1–36500. Partitions dated strictly before today minus retention_days are expired. The minimum of 1 prevents an accidental 0 from emptying the table. |
priority | string | Default: P3. |
dry_run | boolean | Preview what would be expired. |
deferred | boolean | External Hive tables only: record the dropped partitions' files and hard-delete them after ttl_days. Requires the partition_expiration_deferred flag. Can't be combined with dry_run. |
ttl_days | integer | 0–90. Required with deferred. |
manifest_path | string | Where to store the deletion manifest. Only valid with deferred. |
{
"manage_table_id": "8b1d…",
"retention_days": 365,
"dry_run": true
}Response: 201 with action_id, entries_created, filter_expression (the derived delete filter), retention_days, and message.
| Response | Description |
|---|---|
201 | Run queued. |
400 | Unsupported format, or no retention filter can be derived. For example, the table has no recorded date-partition pattern, or a multi-column date layout that can't be ordered by date. |
403 | Partition expiration is disabled on this deployment. |
404 | Table not found. |
409 | The table isn't ready for maintenance yet. |
422 | deferred on a table that isn't Hive, on a managed Hive table, or on an AWS Glue table; deferred expiration disabled; or validation failed. |
List Partition Expiration Jobs
GET /api/v1/tables/{table_id}/partition-expiration
Scope: partition_exp_policy:read
Lists a table's partition-expiration runs.
| Parameter | In | Required | Description |
|---|---|---|---|
offset | query | No | Default: 0. |
limit | query | No | 1–1000. Default: 100. |
status | query | No | Filter by status. |
Validate Partition Expiration Policy
POST /api/v1/tables/{table_id}/partition-expiration/validate
Scope: partition_exp_policy:write
Checks that a retention filter can be built for the table, without writing anything. Call it before saving a partition-expiration policy.
{ "retention_days": 90 }| Response | Description |
|---|---|
200 | Returns table_id, retention_days, and the filter_expression that would be used. |
400 | No filter can be derived. detail explains why. |
404 | Table not found. |
Delayed Deletions
Deferred vacuum and deferred Hive partition expiration don't delete files straight away. They record them as delayed deletions, which a sweep hard-deletes once their recovery window has passed. Until the sweep starts deleting a record, you can recover it.
The API paths, status values, and field names still use the original "pending" naming (/pending-deletions, PENDING_DELETE, pending_delete, total_bytes_pending).
A record's status moves from PENDING_DELETE to DELETING to HARD_DELETED. A failed deletion goes to FAILED, and a recovered record goes to RECOVERED. CANCELLED also exists. Once a record reaches DELETING, it can no longer be recovered.
Scope: Full-access keys only (all Delayed Deletions endpoints).
List Delayed Deletions
GET /api/v1/pending-deletions
Lists delayed-deletion records.
| Parameter | In | Required | Description |
|---|---|---|---|
offset | query | No | Default: 0. |
limit | query | No | 1–200. Default: 20. |
status | query | No | Filter by status. |
table_id | query | No | Filter by table. |
action_type | query | No | Filter by the action that created the record, such as vacuum or partition expiration. |
vacuum_mode | query | No | Filter by vacuum mode. |
Each record includes file_count, total_bytes, file_manifest_path, hard_delete_at, recovery details (recovered_at, recovered_by, recovery_reason), and progress fields (deleted_offset, files_failed, deleting_since, attempts, error_message).
Get Delayed Deletion Stats
GET /api/v1/pending-deletions/stats
Returns record counts by status (pending_delete, deleting, recovered, hard_deleted, cancelled, failed), plus total_bytes_pending and total_files_pending.
| Parameter | In | Required | Description |
|---|---|---|---|
table_id | query | No | Limit to one table. |
Get Delayed Deletion
GET /api/v1/pending-deletions/{deletion_id}
Returns one record. Returns 404 if it does not exist.
Recover Delayed Deletion
POST /api/v1/pending-deletions/{deletion_id}/recover
Cancels the hard-delete for a record that is still PENDING_DELETE, keeping its files. The status check and the change happen atomically: if the sweep has already started deleting the record, the call returns 409 rather than reporting success.
{
"recovered_by": "jane@example.com",
"recovery_reason": "Retention set too short"
}| Field | Description |
|---|---|
recovered_by | Required. Who is recovering, 1–255 characters. Recorded for audit. |
recovery_reason | Optional, up to 1000 characters. Recorded as (no reason given) when omitted. |
| Response | Description |
|---|---|
200 | Returns the recovered record. |
404 | Record not found. |
409 | The record isn't PENDING_DELETE. The response states its current status, for example DELETING. |
Retry Delayed Deletion
POST /api/v1/pending-deletions/{deletion_id}/retry
Re-queues a FAILED record so the sweep tries again. Use it after fixing the cause of the failure, such as missing storage permissions.
- A record that had nothing deleted goes back to
PENDING_DELETEand can still be recovered. - A record that was partly deleted goes to
DELETINGand resumes where it stopped. It can't be recovered, because some of its files are already gone. - A recovery window that hasn't passed yet is still respected. The usual safety checks run again, so files that another table now references are not deleted.
{ "retried_by": "jane@example.com", "retry_reason": "Fixed bucket policy" }| Parameter | In | Required | Description |
|---|---|---|---|
force | query | No | Retry even if the deletion manifest is older than the staleness limit. Default: false. |
| Response | Description |
|---|---|
200 | Returns the re-queued record. |
404 | Record not found. |
409 | The record isn't FAILED; or its manifest is too old, so the list of files to delete may be out of date (re-run vacuum, or pass force=true). |
Catalog Connections
Catalog connections link Granica to your metadata catalogs. Granica syncs table metadata from them into its table inventory. Supported catalog_type values are databricks (Unity Catalog), hive_metastore, iceberg_rest (for example Polaris or Snowflake Horizon), and glue (AWS Glue Data Catalog).
Client secrets are encrypted when stored and never returned.
Connection fields
| Field | Applies to | Description |
|---|---|---|
name | all | Required. Unique name, 1–255 characters. |
catalog_type | all | databricks (default), hive_metastore, iceberg_rest, or glue. |
host | databricks, iceberg_rest | Workspace URL or REST catalog base URL. Required for both. |
client_id | databricks, iceberg_rest | Service principal or OAuth client ID. Required for Databricks. Optional for credential-only Iceberg REST, including Horizon JWTs. |
client_secret | databricks, iceberg_rest | OAuth client secret or credential-only JWT. Required for both. |
default_catalog | databricks, iceberg_rest | Databricks: optional catalog filter (omit for all catalogs). Iceberg REST: required, the catalog (warehouse) name on the REST side. |
metastore_id, workspace_id | databricks | Optional identifiers. |
metastore_uri | hive_metastore | Thrift URI. Required. |
warehouse_path | hive_metastore | Iceberg warehouse root. Required. |
auth_type | iceberg_rest | Authentication type. Only oauth2_client_credentials is supported. |
rest_scope | iceberg_rest | OAuth2 scope for token requests. |
realm | iceberg_rest | Polaris realm, sent as the Polaris-Realm header. Omit for a single-realm catalog. |
vended_credentials | iceberg_rest, glue | Use short-lived, scoped storage credentials from the catalog instead of the deployment's own cloud permissions. Polaris vends them over the Iceberg REST protocol; Glue uses AWS Lake Formation. Not supported for databricks or hive_metastore. |
aws_region | glue | AWS region of the Data Catalog. Required; there is no default. |
glue_catalog_id | glue | AWS account ID that owns the Data Catalog. Omit to use the deployment's own account. |
Test Connection
POST /api/v1/catalog-connections/test
Scope: catalog_connections:write
Tests connection details without saving them, by listing the catalog's catalogs. Takes the same fields as Create Connection, minus name. To test an existing connection without re-entering its secret, pass its connection_id and leave client_secret blank; the stored secret is used. For Glue, vended_credentials: true also samples one table and asks Lake Formation for read credentials. A failure there is reported but doesn't fail the test.
Problems you can fix return a real 4xx. Temporary problems return 200 with success: false, so you can retry.
| Response | Description |
|---|---|
200 | success: true with catalogs, or success: false with error for a temporary problem: upstream 5xx, network, timeout, DNS, or Thrift transport. A Hive Metastore that can't be reached returns a stable error code with the host and port. |
400 | Bad request, or the stored secret can no longer be decrypted (re-enter and save it). |
401 / 403 | Authentication or authorization failed in the catalog. |
404 | connection_id not found, or a catalog object is missing. |
429 | The catalog's rate limit was hit. |
503 | Secret encryption is unavailable on the server. |
Create Connection
POST /api/v1/catalog-connections
Scope: catalog_connections:write
Creates a connection. Connections are shared across the platform, so overlapping ones are rejected to avoid syncing the same tables twice:
- Databricks and Iceberg REST: same host and same catalog, or an "all catalogs" connection overlapping a specific one.
- Hive Metastore: same metastore URI.
- Glue: same region and account.
Response: 201 with the connection, without the secret.
| Response | Description |
|---|---|
201 | Connection created. |
409 | The name is taken; the scope overlaps an existing connection; or a deleted connection with the same details exists (code: deleted_connection_exists, with its connection_id). Use Restore Connection to bring it back. |
422 | A field required for this catalog_type is missing. |
List Connections
GET /api/v1/catalog-connections
Scope: catalog_connections:read
Lists connections. Deleted connections are not included. Each connection includes sync_status, sync_error, last_synced_at, table_count, and managed_count.
| Parameter | In | Required | Description |
|---|---|---|---|
offset | query | No | Default: 0. |
limit | query | No | 1–1000. Default: 100. |
is_active | query | No | Filter by active status. |
Get Connection
GET /api/v1/catalog-connections/{connection_id}
Scope: catalog_connections:read
Returns one connection. Returns 404 if it does not exist.
Update Connection
PUT /api/v1/catalog-connections/{connection_id}
Scope: catalog_connections:write
Partially updates a connection. Send only the fields you want to change. A new client_secret is encrypted before it's stored. Changes to host or metastore_uri are checked to make sure they point at an allowed network address. You can also set is_active.
| Response | Description |
|---|---|
200 | Returns the updated connection. |
404 | Connection not found. |
409 | The new name is taken. |
Delete Connection
DELETE /api/v1/catalog-connections/{connection_id}
Scope: catalog_connections:write
Deletes a connection. The deletion is soft: the connection's synced tables and crunch metrics are kept, but the connection disappears from every listing, stops syncing, and no new crunches are scheduled for its tables. You can bring it back with Restore Connection.
| Parameter | In | Required | Description |
|---|---|---|---|
confirm | query | Yes | Must be true. |
| Response | Description |
|---|---|
204 | Deleted. |
404 | Connection not found. |
428 | confirm=true was not passed. |
Restore Connection
POST /api/v1/catalog-connections/{connection_id}/restore
Scope: catalog_connections:write
Restores a deleted connection and starts a sync. Its tables and metrics reappear, and the connection keeps the same ID. The body uses the same fields as Create Connection, so you can re-enter credentials. A glue_catalog_id left out of the body keeps its stored value rather than being cleared.
| Response | Description |
|---|---|
200 | Returns the restored connection. A sync starts in the background. |
404 | Connection not found. |
409 | The connection isn't deleted, or another connection now uses its name. |
Trigger Sync
POST /api/v1/catalog-connections/{connection_id}/sync
Scope: catalog_connections:write
Starts a metadata sync in the background. The sync also links any tables registered with POST /tables to their catalog entries.
| Parameter | In | Required | Description |
|---|---|---|---|
catalog | query | No | Sync only this catalog. |
mode | query | No | full walks every table and detects deletions. incremental syncs only tables changed since the last sync (Unity Catalog only). Default: full. |
| Response | Description |
|---|---|
200 | Sync started. Returns sync_status and message. |
400 | mode isn't full or incremental. |
404 | Connection not found. |
409 | A sync is already running for this connection. |
List Catalogs
GET /api/v1/catalog-connections/{connection_id}/catalogs
Scope: catalog_connections:read
Lists the synced catalogs for a connection.
| Parameter | In | Required | Description |
|---|---|---|---|
offset | query | No | Default: 0. |
limit | query | No | 1–1000. Default: 100. |
List Schemas
GET /api/v1/catalog-connections/{connection_id}/catalogs/{catalog_name}/schemas
Scope: catalog_connections:read
Lists the synced schemas in a catalog. Takes offset and limit (1–1000, default 100).
List Tables (Catalog)
GET /api/v1/catalog-connections/{connection_id}/tables
Scope: catalog_connections:read
Lists synced catalog tables with filtering, sorting, and pagination.
| Parameter | In | Required | Description |
|---|---|---|---|
catalog | query | No | Filter by catalog. |
schema | query | No | Filter by schema. |
prefix | query | No | Filter by table-name prefix. |
search | query | No | Search the full table name. |
format | query | No | Filter by table format. |
table_type | query | No | Filter by table type. |
min_size_bytes | query | No | Minimum table size. |
max_size_bytes | query | No | Maximum table size. |
has_partitions | query | No | Filter by whether the table is partitioned. |
sort_by | query | No | Sort field. Default: full_name. |
sort_order | query | No | asc or desc. Default: asc. |
offset | query | No | Default: 0. |
limit | query | No | 1–1000. Default: 100. |
Each table includes its location, format, owner, size, row and column counts, and partition columns, plus three linking fields:
| Field | Description |
|---|---|
manage_table_id | The table's inventory row: the ID the policy endpoints take. It is not the same as id, which identifies the catalog entry. It can be null briefly right after a sync. |
onboarding_table_id | The table_id of the onboarding registration linked to this table, or null. |
linked | true when an onboarding registration is linked. A registration made before the catalog was synced is linked on the next sync. |
Get Table Detail (Catalog)
GET /api/v1/catalog-connections/{connection_id}/tables/{full_name}
Scope: catalog_connections:read
Returns everything synced for one catalog table: the list fields above plus columns, format_properties, catalog_properties, column_statistics, table_constraints, effective_permissions, and raw_metadata. full_name may contain dots and slashes. Returns 404 if the table isn't found.
Optimus (Query Optimization)
Optimus analyzes your query logs and recommends a layout for each table: sort, Z-order, and partition-level sort columns. An Optimus submission (a "connection" in the console) points at a query-log location and runs once a day. Each daily run produces a fresh set of recommendations. Applying a recommendation writes it into the table's crunch policy, so the regular crunch scheduler carries it out.
In the URLs below, run_id and submission_id both refer to the submission's ID.
Scope: Full-access keys only (all Optimus endpoints).
Create Optimus Run
POST /api/v1/optimus/runs
Creates a submission and starts its first run immediately, whatever daily_sync_time_utc is set to.
Request body: OptimusRunCreate
| Field | Type | Description |
|---|---|---|
query_logs_uri | string | Required. Storage URI of the query log files. |
engine_type | string | Engine that produced the logs: trino (default), spark, athena, or snowflake. |
lookback_days | integer | How many days of logs to score, 1–365. Default: 7. The partition layout under query_logs_uri is detected automatically. If detection fails, logs are filtered by creation time over the same window. |
end_date | date | Last day of the window, inclusive. Default: today (UTC). Use it to replay a past period: end_date=2024-06-07 with lookback_days=7 scores 2024-06-01 to 2024-06-07. It applies to the first run only; daily runs always end today. |
daily_sync_time_utc | string | Time of the daily run, HH:MM in UTC. Default: 06:00. |
name | string | Label shown in the console. Defaults to the end of the URI. |
recommendation_engine | string | Override the platform's default recommendation engine for this submission. It doesn't affect which engine crunches the table later. |
config | object | Extra configuration for the scoring job. |
created_by | string | Audit actor. |
traceparent | string | Optional W3C trace context. |
| Response | Description |
|---|---|
201 | Submission created and first run started. |
400 | Invalid request. |
502 | The run could not be started. The submission and run are marked failed, with the error recorded. |
Get Optimus Run
GET /api/v1/optimus/runs/{run_id}
Returns the submission's settings and a latest_run summary, so you can see today's status in one call. Returns 404 if not found.
Update Optimus Submission
PATCH /api/v1/optimus/runs/{run_id}
Partially updates a submission. Send only the fields you want to change.
| Field | Description |
|---|---|
active | false pauses daily runs and true resumes them. Pausing keeps all past runs and recommendations. Days missed while paused are not run later. |
name | Label. An empty string clears it. |
lookback_days | 1–365. Takes effect from the next daily run. |
daily_sync_time_utc | HH:MM UTC. Takes effect from the next daily run. |
query_logs_uri | Move to a different log location. Takes effect from the next daily run. |
Today's run, if there is one, isn't affected. Returns 404 if not found.
Sync Optimus Submission Now
POST /api/v1/optimus/runs/{submission_id}/sync-now
Starts a run right away, outside the daily schedule. If today already has a run, whether running, succeeded, or failed, it's reset and started again. Unlike Retry, this works in any status.
| Parameter | In | Required | Description |
|---|---|---|---|
source | query | No | manual (default) always resets and restarts today's run. scheduled (used by the daily scheduler) does nothing if today's run already succeeded, so an earlier manual sync is never overwritten. |
Returns 201 with the run. Returns 404 if the submission doesn't exist.
Retry Optimus Run
POST /api/v1/optimus/runs/{submission_id}/retry
Retries a failed submission. Today's run is reused, or a new one is created if today has none. The retry uses the submission's original recommendation engine, even if the platform default has changed since.
| Response | Description |
|---|---|
201 | Retry started. |
404 | Submission not found. |
422 | The submission isn't failed. |
Delete Optimus Submission
DELETE /api/v1/optimus/runs/{submission_id}
Permanently deletes a submission with all its runs, recommendations, and daily statistics. To keep the history, pause the submission with PATCH and "active": false instead. Returns 204, or 404 if not found.
List Optimus Recommendations
GET /api/v1/optimus/runs/{run_id}/recommendations
Lists recommendations for each table from the submission's latest run only. Returns an empty list if no run has completed yet.
| Parameter | In | Required | Description |
|---|---|---|---|
offset | query | No | Default: 0. |
limit | query | No | 1–1000. Default: 100. |
Apply Optimus Recommendation
POST /api/v1/optimus/recommendations/{recommendation_id}/apply
Applies a recommendation to a table's crunch policy. A new policy version is created from the recommendation and linked to it. The crunch scheduler then uses the recommended layout on the next scheduled run; there is no separate Optimus job.
Request body: OptimusRecommendationApplyRequest
| Field | Type | Description |
|---|---|---|
manage_table_id | UUID | Required. The table that receives the policy. |
target_file_size_bytes | integer | Target file size for the generated policy. Default: 128 MiB. |
run_time_utc | string | Daily run time, HH:MM. Default: 02:00. |
lookback_start, lookback_end | integer | Lookback window. Defaults: 2 and 1. Start must be greater than or equal to end. |
enable_auto_apply | boolean | Also turn on automatic apply for this table in the same transaction, so later recommendations are applied without review. Default: false. |
created_by | string | Audit actor. |
Response: 200 with applied_policy_version_id, policy_version, policy_document, job_context, and auto_apply_optimus.
| Response | Description |
|---|---|
200 | Recommendation applied. |
404 | Recommendation not found. |
422 | The recommendation can't be applied to this table. |
Auto-Apply Sweep
POST /api/v1/optimus/runs/{run_id}/auto-apply-sweep
Applies every eligible recommendation from the latest run. Granica calls this automatically after each Optimus run. A recommendation is eligible when:
- its action is
APPLYand its type isn'tSKIP; - it hasn't been applied already;
- its table exists in the inventory; and
- automatic apply is turned on for that table (see Set Policy Preferences).
If a single recommendation fails, the call still succeeds: failures are listed in failed for review.
List Optimus Tables With Recommendations
GET /api/v1/optimus/runs/{run_id}/tables
Lists tables that have ever had a recommendation from this submission, one entry per table. Each entry includes the latest recommendation's latest_action and latest_opt_type, so you can see which tables have APPLY recommendations and which only have advisory or SKIP ones. Returns 404 if the submission isn't found.
Get Optimus Table Metrics
GET /api/v1/optimus/runs/{run_id}/tables/{table_fqn}/metrics
Returns daily query metrics for one table, with markers on the days recommendations were made, so you can see whether a recommendation helped. Markers are placed on the date the recommendation was created.
| Parameter | In | Required | Description |
|---|---|---|---|
days | query | No | Window size in days, including today, 1–365. Default: 90. |
Object Maintenance
Object Maintenance brings raw object-storage data (for example, Parquet files under S3 prefixes that aren't registered in any catalog) under Granica management.
- Register an inventory report that points at an S3 Inventory manifest, or register prefixes manually.
- Discovery scans the inventory, filters out prefixes that aren't worth maintaining (too small, too recent, archived, owned by another catalog, or blocklisted), and turns the rest into managed prefixes.
- Enable a prefix, or save a policy or trigger an action on it, to onboard it. Its lifecycle moves from
unmanagedtoactive, and Granica collects its metadata, which takes 20–30 minutes. - Crunch runs on the prefix through its policy or through on-demand actions.
Scope: Full-access keys only (all Object Maintenance endpoints). The object_maintenance feature must be enabled on your deployment.
Field naming: Object Maintenance requests accept either camelCase or snake_case field names. Responses use camelCase.
Errors and lifecycle
Lifecycle errors include extra fields in the problem response. An invalid transition returns 422 with allowed_transitions, which lists the actions that are valid from the prefix's current state.
Lifecycle responses (LifecycleStateResponse) have the same shape for every transition:
| Field | Description |
|---|---|
prefixId | The managed prefix. |
state | unmanaged, active, paused, or error. |
onboardingStatus, lastError | Progress of metadata collection for the linked table. |
onboardingTableId | The linked table_id, for reference only. |
reconciliation | How the linked table came about: created, reused-from-table-maintenance, reused-from-prior-onboarding, already-linked-at-discovery, or already-enabled. Pause, resume, and disable leave it null. |
_links | Links to the prefix's self, policy, actions, and runs resources. Treat these URLs as opaque. |
_allowedTransitions | Actions valid from the current state: enable, pause, resume, disable, or refresh. |
Create Inventory Report
POST /api/v1/object-maintenance/inventory-reports
Registers an inventory report.
Request body: InventoryReportCreate
| Field | Type | Description |
|---|---|---|
name | string | Required. Unique display name. |
description | string | Notes shown in the console. |
uri | string | Storage URI (s3://, gs://, abfss://) that limits the report's scope. Optional: when omitted, the scope comes from the manifest's source bucket on the first discovery. |
inventoryUri | string | Required. Manifest location, for example s3://.../manifest.json. |
inventoryFormat | string | Required. parquet (recommended), orc, or csv. |
discoveryCadence | string | How often discovery re-runs in the background: daily or weekly (default). Manual discovery runs are separate from this. |
runNow | boolean | Start a discovery straight after creating the report. Default: false. |
skipAgeDays | integer | Skip prefixes whose newest object is less than N days old. 0 applies no age cutoff, which isn't the same as leaving it out (leaving it out uses the global setting). |
minPrefixSizeBytes | integer | Minimum readable size for a prefix to qualify. 0 sets no minimum. Omit to use the global setting. |
catalogClaimThresholdPct | number | 0–100. If at least this share of a prefix's objects are in an unrecognized format, the prefix is treated as belonging to another catalog. Default: 90. |
eligibleStorageClasses | string list | Storage classes that crunch may read directly. Anything else counts as archival. Default: STANDARD only. An empty list turns the check off. Only prefixes that are entirely archival are skipped. GLACIER_IR is readable but charges per GB retrieved. |
interestingPrefixes | string list | Only scan manifest entries under these prefixes. |
extraSentinelGlobs | string list | Extra glob patterns for marker files (for example, files that indicate another system manages the data), added to the default set. |
binSizeOverrideBytes | integer | Size of each discovery work unit, 64 MiB–1 TiB. Defaults to a computed value. |
confirmExtensionlessFormats | boolean | After each discovery, read a sample object's first bytes to confirm the format of prefixes whose files have no extension (for example part-00000). Costs two small ranged reads per prefix, and the API needs s3:GetObject on the bucket. |
| Response | Description |
|---|---|
201 | Report created. |
409 | The name is taken, or the scope conflicts with another report. |
422 | Validation failed, for example an invalid URI or a missing inventoryUri or inventoryFormat. |
List Inventory Reports
GET /api/v1/object-maintenance/inventory-reports
Lists inventory reports. Takes offset and limit (1–200, default 50).
Get Inventory Report
GET /api/v1/object-maintenance/inventory-reports/{inventory_report_id}
Returns one report. Returns 404 if not found.
Update Inventory Report
PATCH /api/v1/object-maintenance/inventory-reports/{inventory_report_id}
Partially updates a report. Accepts description, enabled, skipAgeDays, discoveryCadence, interestingPrefixes, extraSentinelGlobs, minPrefixSizeBytes, catalogClaimThresholdPct, eligibleStorageClasses, confirmExtensionlessFormats, and binSizeOverrideBytes (null clears the override). Returns 404 if not found.
Delete Inventory Report
DELETE /api/v1/object-maintenance/inventory-reports/{inventory_report_id}
Deletes a report. Its managed and discovered prefixes are kept, detached from any report, so their history, policies, and actions survive. If you register a report for the same prefix later, they reattach to it. Returns 204, or 404 if not found.
Trigger Discovery
POST /api/v1/object-maintenance/inventory-reports/{inventory_report_id}/discover
Queues a discovery run for a report. The scan runs as a background Spark job, so inventories with millions of objects are fine.
| Response | Description |
|---|---|
200 | Discovery queued. |
404 | Report not found. |
409 | Discovery is already running for this report. Manually registered prefixes have no discovery step. |
429 | Discovery ran very recently. The message says how long to wait. |
List Discovered Prefixes
GET /api/v1/object-maintenance/inventory-reports/{inventory_report_id}/discovered-prefixes
Lists the results of the report's most recent completed discovery only, so results from different runs aren't mixed. Takes offset and limit (1–200, default 50).
List Managed Prefixes
GET /api/v1/object-maintenance/inventory-reports/{inventory_report_id}/managed-prefixes
Lists a report's managed prefixes. Takes offset and limit (1–200, default 50).
Register Manual Prefixes
POST /api/v1/object-maintenance/prefixes/manual
Registers 1–100 prefixes directly, without an inventory report or a discovery run. Registration is atomic: either every prefix in the batch is registered or none is.
{
"prefixes": [
{ "uri": "s3://bucket/landing/events/", "fileFormat": "parquet" }
]
}Each uri must be an absolute S3, GCS, or Azure URI without query parameters. fileFormat must be parquet. Duplicates within the batch are rejected, including URIs that differ only in scheme or trailing slash.
| Response | Description |
|---|---|
200 | Returns the registered prefixes. |
409 | Prefixes in the batch overlap each other or an existing prefix; the prefix is already available through an inventory report; it already has a different file type; or it was registered concurrently. |
422 | The prefix matches a skip blocklist entry. |
Get Prefix Metadata
GET /api/v1/object-maintenance/prefix-metadata
Returns metadata for up to 100 prefixes in one call.
| Parameter | In | Required | Description |
|---|---|---|---|
prefix_ids | query | Yes | 1–100 prefix IDs. Repeat the parameter for each ID. |
List Prefixes
GET /api/v1/object-maintenance/prefixes
Lists managed prefixes across all reports. Each row includes a summary of its parent report.
| Parameter | In | Required | Description |
|---|---|---|---|
offset | query | No | Default: 0. |
limit | query | No | 1–1000. Default: 50. |
inventory_report_id | query | No | Limit to one report. |
search | query | No | Text search on the prefix URI. |
search_reports | query | No | Also search report names. Default: false. |
sort_by | query | No | created_at (default), prefix_uri, object_count, or total_size_bytes. |
sort_order | query | No | asc or desc (default). |
include_summary | query | No | Include summary totals. Default: false. |
min_size_bytes | query | No | Minimum prefix size. |
onboarding_candidates | query | No | Only prefixes that can be onboarded. Default: false. |
onboarded_only | query | No | Only onboarded prefixes. Default: false. |
management_state | query | No | unmanaged, active, paused, or error. |
source_state | query | No | present or missing (the data has disappeared from storage). |
Get Prefix
GET /api/v1/object-maintenance/prefixes/{prefix_id}
Returns one managed prefix with a summary of its parent report. It also includes the linked table's onboarding status and error, and the estimated data reduction rate from recipe learning (estDrrAvg, min, and max). Returns 404 if not found.
Enable Maintenance
POST /api/v1/object-maintenance/inventory-reports/{inventory_report_id}/prefixes/{prefix_id}/enable
POST /api/v1/object-maintenance/prefixes/{prefix_id}/enable
Enables maintenance on a prefix, moving it from unmanaged to active. Granica creates a table for the prefix, or reuses one already registered at the same location, and schedules metadata collection. The call returns as soon as the link is in place; metadata collection (20–30 minutes) runs afterwards. reconciliation in the response says how the table came about.
The call is idempotent: enabling a prefix that's already active returns 200 with reconciliation: already-enabled.
| Response | Description |
|---|---|
200 | Already enabled. Nothing changed. |
201 | Enabled, with a new or reused table. |
404 | Prefix or report not found, or the prefix belongs to a different report. |
409 | The prefix's report is missing (reconnect it first), the prefix changed during the request, or it is detached from any report. |
422 | Invalid lifecycle transition, or a manually registered prefix has no file type set. |
Pause, Resume, Disable
POST /api/v1/object-maintenance/prefixes/{prefix_id}/pause
POST /api/v1/object-maintenance/prefixes/{prefix_id}/resume
POST /api/v1/object-maintenance/prefixes/{prefix_id}/disable
Change a prefix's lifecycle state. Each returns a LifecycleStateResponse.
- Pause (
active→paused): no new crunch jobs start. Queued and running jobs finish. To stop a specific job, use Cancel Crunch Job. - Resume (
paused→active): scheduling starts again on the scheduler's next run. - Disable (
active,paused, orerror→unmanaged): no new jobs start. The link to the table, the crunch history, and the policies are all kept, so enabling the prefix again picks up where it left off.
| Response | Description |
|---|---|
200 | State changed. |
404 | Prefix not found. |
422 | The transition isn't valid from the current state. See allowed_transitions. |
Refresh Prefix
POST /api/v1/object-maintenance/prefixes/{prefix_id}/refresh
Re-runs metadata collection and recipe generation (20–30 minutes) for an active prefix, without creating a new table. The lifecycle state doesn't change.
| Response | Description |
|---|---|
200 | Refresh queued. |
404 | Prefix not found. |
409 | Recipe generation is already running. Try again later. |
422 | No recipe exists yet because the first metadata collection hasn't finished, or the transition is invalid. Refresh isn't possible until the first recipe exists. |
Get Prefix Policy
GET /api/v1/object-maintenance/prefixes/{prefix_id}/policy
Returns the prefix's active policy and version. Returns 404 if the prefix has no policy.
Upsert Prefix Policy
PUT /api/v1/object-maintenance/prefixes/{prefix_id}/policy
Saves a new active policy version for the prefix. The policy document has the same format as for table policies. Saving a policy on an unmanaged prefix activates it automatically.
{
"policyDocument": { "policies": [ { "id": "crunch", "enabled": true, "schedule": { "scheduleType": "daily", "runTimeUtc": "03:00" } } ] },
"changeSummary": "Nightly crunch"
}When a crunch policy turns on automatic recipe selection, the resulting crunch settings are checked as well. Returns 409 if the save conflicts.
Delete Prefix Policy
DELETE /api/v1/object-maintenance/prefixes/{prefix_id}/policy
Deletes the prefix's policy and all its versions. Returns 204, or 404 if the prefix has no policy.
List Prefix Policy Versions
GET /api/v1/object-maintenance/prefixes/{prefix_id}/policy/versions
Returns the policy's version history, newest first. isActive marks the live version. A prefix with no policy returns { "versions": [], "total": 0 } rather than 404.
Trigger Prefix Action
POST /api/v1/object-maintenance/prefixes/{prefix_id}/actions
Queues an on-demand action on a prefix and returns straight away. The scheduler then creates one crunch job for each date partition, or a single job if the prefix isn't partitioned. Triggering an action on an unmanaged prefix activates it automatically.
| Field | Description |
|---|---|
actionType | crunch (default). |
priority | 1 (highest) to 5. P1–P5 strings are also accepted. Default: 3. |
payload | Same fields as the Trigger Crunch body, without manage_table_id: cluster_columns, lookback_start, lookback_end, backfill_start_date, backfill_end_date, and job_context. scope is incremental (a date range) or full (the whole prefix; omit any dates). |
Returns 201 with the action, or 409 if it conflicts with the prefix's state.
List Prefix Actions
GET /api/v1/object-maintenance/prefixes/{prefix_id}/actions
Lists the prefix's actions, newest first. Takes offset and limit (1–200, default 50).
List Prefix Runs
GET /api/v1/object-maintenance/prefixes/{prefix_id}/runs
Lists every job run for the prefix (crunch and maintenance) in a single timeline. Takes offset and limit (1–200, default 50).
Format Candidates
GET /api/v1/object-maintenance/inventory-reports/{inventory_report_id}/format-candidates
Lists prefixes whose format couldn't be confirmed from file names, ordered by unconfirmed bytes (largest first), so the most valuable prefixes come first. Read-only. Takes limit (1–500, default 100) and offset.
Confirm Formats
POST /api/v1/object-maintenance/inventory-reports/{inventory_report_id}/confirm-formats
Confirms the format of candidate prefixes now, instead of waiting for the next discovery. For each prefix, it reads the first few KB of one object. This works because one job writes a prefix with one writer, so a single object is representative. A prefix that can't be read (archival storage, missing permissions, or object gone) stays unconfirmed, and one bad object doesn't fail the batch. The call runs whether or not confirmExtensionlessFormats is set on the report.
| Parameter | In | Required | Description |
|---|---|---|---|
max_prefixes | query | No | Maximum number of prefixes to check in this call, 1–1000. Default: 200. The response says what was checked, so you can page through a large backlog. |
offset | query | No | Default: 0. |
Discovery runs
Each discovery is tracked as a discovery schedule with its own history. Use these endpoints to monitor a discovery and control it.
| Endpoint | Description |
|---|---|
GET /api/v1/object-maintenance/inventory-reports/{inventory_report_id}/discovery/schedules | The report's discovery history, most recent first. Takes offset and limit (1–200, default 50). |
GET /api/v1/object-maintenance/discovery/schedules/{schedule_id} | Full detail for one discovery. |
GET /api/v1/object-maintenance/discovery/schedules/{schedule_id}/state | Live progress, including skip counts for each filter. The console polls it every 5 seconds while a discovery is running. |
GET /api/v1/object-maintenance/discovery/schedules/{schedule_id}/plan | The plan: number of work units, total inventory bytes, and estimated duration. Available before scanning starts. |
POST /api/v1/object-maintenance/discovery/schedules/{schedule_id}/pause | Pause a running discovery. Its running task is stopped. Progress is saved after each completed work unit. |
POST /api/v1/object-maintenance/discovery/schedules/{schedule_id}/resume | Resume a paused discovery from the next unfinished work unit. |
POST /api/v1/object-maintenance/discovery/schedules/{schedule_id}/restart | Mark the run failed and queue a new one, atomically. Returns the new schedule ID. Returns 409 for a completed run (trigger a new discovery instead), when another run is already active for the report, or when the report has been deleted. |
POST /api/v1/object-maintenance/discovery/schedules/{schedule_id}/skip-bin/{bin_id} | Skip one stuck work unit without restarting the discovery. Optional body: { "skipReason": "..." }. Returns 409 if the run hasn't saved any progress yet (restart it instead). |
GET /api/v1/object-maintenance/discovery/schedules/{schedule_id}/effective-config | The discovery's settings at each level (defaults, global settings, report overrides), with the source of each final value. Useful when skip results look wrong. |
Pause and resume return 409 if the run isn't in a state that allows it.
Skip Blocklist
The skip blocklist stops matching prefixes from becoming managed prefixes during discovery.
| Endpoint | Description |
|---|---|
GET /api/v1/object-maintenance/skip-blocklist | List every entry, including disabled ones, so you can see rules that are switched off. |
POST /api/v1/object-maintenance/skip-blocklist | Add an entry: uriPattern, patternType (exact, prefix, or glob), reason, and enabled (default true). Returns 201, or 409 if the same pattern already exists. |
PATCH /api/v1/object-maintenance/skip-blocklist/{entry_id} | Update an entry. Fields you leave out are unchanged; for example, send { "enabled": false } to disable it. Built-in system entries can't be edited (403); add a narrower entry of your own instead. |
DELETE /api/v1/object-maintenance/skip-blocklist/{entry_id} | Remove an entry. System entries can't be deleted (403); disable them instead. |
Blocklist changes apply from the next discovery completion. They aren't applied to the past: prefixes already managed stay managed, and prefixes an entry used to block return on the next discovery.
Deprecated: Locations
The /object-maintenance/locations endpoints are deprecated aliases for inventory reports. They are kept during the transition and will be removed. Use the inventory-reports paths instead:
| Deprecated | Replacement |
|---|---|
GET, POST /object-maintenance/locations | /object-maintenance/inventory-reports |
GET, PATCH, DELETE /object-maintenance/locations/{location_id} | /object-maintenance/inventory-reports/{inventory_report_id} |
POST /object-maintenance/locations/{location_id}/discover | .../inventory-reports/{inventory_report_id}/discover |
GET /object-maintenance/locations/{location_id}/discovered-prefixes | .../inventory-reports/{inventory_report_id}/discovered-prefixes |
GET /object-maintenance/locations/{location_id}/managed-prefixes | .../inventory-reports/{inventory_report_id}/managed-prefixes |
GET /object-maintenance/locations/{location_id}/discovery/schedules | .../inventory-reports/{inventory_report_id}/discovery/schedules |
POST /object-maintenance/locations/{location_id}/prefixes/{prefix_id}/enable | .../inventory-reports/{inventory_report_id}/prefixes/{prefix_id}/enable |
GET /object-maintenance/locations/{location_id}/format-candidates | .../inventory-reports/{inventory_report_id}/format-candidates |
POST /object-maintenance/locations/{location_id}/confirm-formats | .../inventory-reports/{inventory_report_id}/confirm-formats |