Skip to main content

Data Management API

Quick Startโ€‹

# List available operations
epilot data-management

# Call an operation
epilot data-management queryEntities -p entity_schema=example

Common Flagsโ€‹

FlagDescription
-p key=valueSet a named parameter
-d '{...}'Request body JSON
-H 'Key: Value'Custom header
-t, --token <token>Bearer token for authentication
--profile <name>Use a named profile
-s, --server <url>Override server base URL
-i, --includeInclude response headers in output
--jsonOutput raw JSON (no formatting)
-v, --verboseVerbose output (show request details)
--jsonata <expr>JSONata expression to transform response
--definition <file>Override OpenAPI spec file/URL
--guidedPrompt for all parameters interactively
--no-interactiveDisable interactive prompts

Operationsโ€‹

Data Management

  • queryEntities โ€” Executes a query against the specified entity schema using the saved view definition, optionally combined with additiona
  • createJob โ€” POST /data-management/v1/{entity_schema}/jobs
  • updateJob โ€” PATCH /data-management/v1/{entity_schema}/jobs/{job_id}
  • getJob โ€” Returns details of a single job run.
  • getJobReportUrl โ€” Returns a short-lived, pre-signed URL to download the report file for the given job.
  • getConfig โ€” Returns a data management config by its id.
  • createJobForConfig โ€” Creates a job run for the given config and triggers asynchronous execution. Returns a job id which can be used to poll j
  • upsertConfig โ€” Creates or updates a config for the given entity schema. The config is later used by a scheduled background process to p
  • listConfigs โ€” Returns a paginated list of configs
  • listJobs โ€” Returns a paginated list of jobs

queryEntitiesโ€‹

Executes a query against the specified entity schema using the saved view definition, optionally combined with additiona

POST /data-management/v1/{entity_schema}/query

Parameters

NameInTypeRequiredDescription
entity_schemapathstringYesTarget entity schema to query (for example: "contact", "opportunity", "order").

Request Body (required)

Sample Call

epilot data-management queryEntities \
-p entity_schema=example

With request body:

epilot data-management queryEntities \
-p entity_schema=example \
-d '{
"saved_view_id": "string",
"include_deleted": "true",
"filters": [
{
"type": "entity_workflows_only_in_closed_or_cancelled_status",
"related_entity_schemas": ["string"],
"lookback_period_days": 0
}
],
"from": 0,
"size": 0,
"hydrate": true,
"fields": ["string"]
}'

Using positional args for path parameters:

epilot data-management queryEntities example

Using stdin pipe:

cat body.json | epilot data-management queryEntities -p entity_schema=example

With JSONata filter:

epilot data-management queryEntities -p entity_schema=example --jsonata 'results[0]'
Sample Response
{
"hits": 0,
"results": [
{}
]
}

createJobโ€‹

POST /data-management/v1/{entity_schema}/jobs

Parameters

NameInTypeRequiredDescription
entity_schemapathstringYes

Request Body (required)

Sample Call

epilot data-management createJob \
-p entity_schema=example

With request body:

epilot data-management createJob \
-p entity_schema=example \
-d '{
"type": "deletion",
"config_id": "string",
"scheduled_for": "1970-01-01",
"status": "in_progress",
"started_at": "1970-01-01T00:00:00.000Z"
}'

Using positional args for path parameters:

epilot data-management createJob example

Using stdin pipe:

cat body.json | epilot data-management createJob -p entity_schema=example

With JSONata filter:

epilot data-management createJob -p entity_schema=example --jsonata 'id'
Sample Response
{
"id": "string",
"type": "deletion",
"config_id": "string",
"entity_schema": "string",
"scheduled_for": "1970-01-01",
"status": "in_progress",
"details": {},
"started_at": "1970-01-01T00:00:00.000Z",
"completed_at": "1970-01-01T00:00:00.000Z",
"error": "string",
"report": {
"bucket": "string",
"key": "string",
"format": "csv"
},
"created_at": "1970-01-01T00:00:00.000Z",
"last_updated_at": "1970-01-01T00:00:00.000Z",
"trigger": "schedule",
"triggered_by": "string"
}

updateJobโ€‹

PATCH /data-management/v1/{entity_schema}/jobs/{job_id}

Parameters

NameInTypeRequiredDescription
entity_schemapathstringYes
job_idpathstringYes

Request Body (required)

Sample Call

epilot data-management updateJob \
-p entity_schema=example \
-p job_id=123e4567-e89b-12d3-a456-426614174000

With request body:

epilot data-management updateJob \
-p entity_schema=example \
-p job_id=123e4567-e89b-12d3-a456-426614174000 \
-d '{
"status": "in_progress",
"details": {},
"completed_at": "1970-01-01T00:00:00.000Z",
"error": "string",
"report": {
"bucket": "string",
"key": "string",
"format": "csv"
}
}'

Using positional args for path parameters:

epilot data-management updateJob example 123e4567-e89b-12d3-a456-426614174000

Using stdin pipe:

cat body.json | epilot data-management updateJob -p entity_schema=example -p job_id=123e4567-e89b-12d3-a456-426614174000

With JSONata filter:

epilot data-management updateJob -p entity_schema=example -p job_id=123e4567-e89b-12d3-a456-426614174000 --jsonata 'id'
Sample Response
{
"id": "string",
"type": "deletion",
"config_id": "string",
"entity_schema": "string",
"scheduled_for": "1970-01-01",
"status": "in_progress",
"details": {},
"started_at": "1970-01-01T00:00:00.000Z",
"completed_at": "1970-01-01T00:00:00.000Z",
"error": "string",
"report": {
"bucket": "string",
"key": "string",
"format": "csv"
},
"created_at": "1970-01-01T00:00:00.000Z",
"last_updated_at": "1970-01-01T00:00:00.000Z",
"trigger": "schedule",
"triggered_by": "string"
}

getJobโ€‹

Returns details of a single job run.

GET /data-management/v1/jobs/{job_id}

Parameters

NameInTypeRequiredDescription
job_idpathstringYes

Sample Call

epilot data-management getJob \
-p job_id=123e4567-e89b-12d3-a456-426614174000

Using positional args for path parameters:

epilot data-management getJob 123e4567-e89b-12d3-a456-426614174000

With JSONata filter:

epilot data-management getJob -p job_id=123e4567-e89b-12d3-a456-426614174000 --jsonata 'id'
Sample Response
{
"id": "string",
"type": "deletion",
"config_id": "string",
"entity_schema": "string",
"scheduled_for": "1970-01-01",
"status": "in_progress",
"details": {},
"started_at": "1970-01-01T00:00:00.000Z",
"completed_at": "1970-01-01T00:00:00.000Z",
"error": "string",
"report": {
"bucket": "string",
"key": "string",
"format": "csv"
},
"created_at": "1970-01-01T00:00:00.000Z",
"last_updated_at": "1970-01-01T00:00:00.000Z",
"trigger": "schedule",
"triggered_by": "string"
}

getJobReportUrlโ€‹

Returns a short-lived, pre-signed URL to download the report file for the given job.

GET /data-management/v1/jobs/{job_id}/report-url

Parameters

NameInTypeRequiredDescription
job_idpathstringYes

Sample Call

epilot data-management getJobReportUrl \
-p job_id=123e4567-e89b-12d3-a456-426614174000

Using positional args for path parameters:

epilot data-management getJobReportUrl 123e4567-e89b-12d3-a456-426614174000

With JSONata filter:

epilot data-management getJobReportUrl -p job_id=123e4567-e89b-12d3-a456-426614174000 --jsonata 'url'
Sample Response
{
"url": "string",
"expires_in": 0
}

getConfigโ€‹

Returns a data management config by its id.

GET /data-management/v1/configs/{config_id}

Parameters

NameInTypeRequiredDescription
config_idpathstringYes

Sample Call

epilot data-management getConfig \
-p config_id=123e4567-e89b-12d3-a456-426614174000

Using positional args for path parameters:

epilot data-management getConfig 123e4567-e89b-12d3-a456-426614174000

With JSONata filter:

epilot data-management getConfig -p config_id=123e4567-e89b-12d3-a456-426614174000 --jsonata 'id'
Sample Response
{
"id": "string",
"type": "deletion",
"entity_schema": "string",
"query": {
"saved_view_id": "string",
"include_deleted": "true",
"filters": [
{
"type": "entity_workflows_only_in_closed_or_cancelled_status",
"related_entity_schemas": ["string"],
"lookback_period_days": 0
}
]
},
"schedule": {
"frequency": "interval",
"interval_days": 1,
"start_date": "1970-01-01",
"end_date": "1970-01-01"
},
"enabled": true,
"created_at": "1970-01-01T00:00:00.000Z",
"last_updated_at": "1970-01-01T00:00:00.000Z",
"next_run_at": "1970-01-01",
"relations_for_deletion": ["contact"],
"last_run_at": "1970-01-01T00:00:00.000Z"
}

createJobForConfigโ€‹

Creates a job run for the given config and triggers asynchronous execution. Returns a job id which can be used to poll j

POST /data-management/v1/configs/{config_id}/jobs

Parameters

NameInTypeRequiredDescription
config_idpathstringYes

Sample Call

epilot data-management createJobForConfig \
-p config_id=123e4567-e89b-12d3-a456-426614174000

Using positional args for path parameters:

epilot data-management createJobForConfig 123e4567-e89b-12d3-a456-426614174000

With JSONata filter:

epilot data-management createJobForConfig -p config_id=123e4567-e89b-12d3-a456-426614174000 --jsonata 'id'
Sample Response
{
"id": "string",
"type": "deletion",
"config_id": "string",
"entity_schema": "string",
"scheduled_for": "1970-01-01",
"status": "in_progress",
"details": {},
"started_at": "1970-01-01T00:00:00.000Z",
"completed_at": "1970-01-01T00:00:00.000Z",
"error": "string",
"report": {
"bucket": "string",
"key": "string",
"format": "csv"
},
"created_at": "1970-01-01T00:00:00.000Z",
"last_updated_at": "1970-01-01T00:00:00.000Z",
"trigger": "schedule",
"triggered_by": "string"
}

upsertConfigโ€‹

Creates or updates a config for the given entity schema. The config is later used by a scheduled background process to p

POST /data-management/v1/{entity_schema}/configs

Parameters

NameInTypeRequiredDescription
entity_schemapathstringYesTarget entity schema for the config

Request Body (required)

Sample Call

epilot data-management upsertConfig \
-p entity_schema=example

With request body:

epilot data-management upsertConfig \
-p entity_schema=example \
-d '{
"type": "deletion",
"query": {
"saved_view_id": "string",
"include_deleted": "true",
"filters": [
{
"type": "entity_workflows_only_in_closed_or_cancelled_status",
"related_entity_schemas": ["string"],
"lookback_period_days": 0
}
]
},
"schedule": {
"frequency": "interval",
"interval_days": 1,
"start_date": "1970-01-01",
"end_date": "1970-01-01"
},
"relations_for_deletion": ["contact"],
"enabled": true
}'

Using positional args for path parameters:

epilot data-management upsertConfig example

Using stdin pipe:

cat body.json | epilot data-management upsertConfig -p entity_schema=example

With JSONata filter:

epilot data-management upsertConfig -p entity_schema=example --jsonata 'id'
Sample Response
{
"id": "string",
"type": "deletion",
"entity_schema": "string",
"query": {
"saved_view_id": "string",
"include_deleted": "true",
"filters": [
{
"type": "entity_workflows_only_in_closed_or_cancelled_status",
"related_entity_schemas": ["string"],
"lookback_period_days": 0
}
]
},
"schedule": {
"frequency": "interval",
"interval_days": 1,
"start_date": "1970-01-01",
"end_date": "1970-01-01"
},
"enabled": true,
"created_at": "1970-01-01T00:00:00.000Z",
"last_updated_at": "1970-01-01T00:00:00.000Z",
"next_run_at": "1970-01-01",
"relations_for_deletion": ["contact"],
"last_run_at": "1970-01-01T00:00:00.000Z"
}

listConfigsโ€‹

Returns a paginated list of configs

GET /data-management/v1/configs

Parameters

NameInTypeRequiredDescription
limitquerynumberNo
cursorquerystringNo
entity_schemaquerystringNoOptional entity schema to filter configs.
typequery"deletion"NoOptional config type to filter configs.
next_run_atquerystring (date)NoOptional next run date (YYYY-MM-DD) to filter configs.
enabledquerybooleanNoOptional enabled status to filter configs.

Sample Call

epilot data-management listConfigs

With JSONata filter:

epilot data-management listConfigs --jsonata 'configs'
Sample Response
{
"configs": [
{
"id": "string",
"type": "deletion",
"entity_schema": "string",
"query": {
"saved_view_id": "string",
"include_deleted": "true",
"filters": [
{
"type": "entity_workflows_only_in_closed_or_cancelled_status",
"related_entity_schemas": ["string"],
"lookback_period_days": 0
}
]
},
"schedule": {
"frequency": "interval",
"interval_days": 1,
"start_date": "1970-01-01",
"end_date": "1970-01-01"
},
"enabled": true,
"created_at": "1970-01-01T00:00:00.000Z",
"last_updated_at": "1970-01-01T00:00:00.000Z",
"next_run_at": "1970-01-01",
"relations_for_deletion": ["contact"],
"last_run_at": "1970-01-01T00:00:00.000Z"
}
],
"cursor": "string"
}

listJobsโ€‹

Returns a paginated list of jobs

GET /data-management/v1/jobs

Parameters

NameInTypeRequiredDescription
limitquerynumberNo
cursorquerystringNo
entity_schemaquerystringNoOptional entity schema to filter jobs.
typequery"deletion"NoOptional job type to filter jobs.
statusquery"in_progress" | "success" | "failed"NoOptional job status to filter jobs.
config_idquerystringNoOptional config id to filter jobs.

Sample Call

epilot data-management listJobs

With JSONata filter:

epilot data-management listJobs --jsonata 'jobs'
Sample Response
{
"jobs": [
{
"id": "string",
"type": "deletion",
"config_id": "string",
"entity_schema": "string",
"scheduled_for": "1970-01-01",
"status": "in_progress",
"details": {},
"started_at": "1970-01-01T00:00:00.000Z",
"completed_at": "1970-01-01T00:00:00.000Z",
"error": "string",
"report": {
"bucket": "string",
"key": "string",
"format": "csv"
},
"created_at": "1970-01-01T00:00:00.000Z",
"last_updated_at": "1970-01-01T00:00:00.000Z",
"trigger": "schedule",
"triggered_by": "string"
}
],
"cursor": "string"
}