Skip to main content

Data Migration - Delete Export

Endpoint

/i/datamigration/delete_export

Overview

Deletes one export package and its migration record.

Authentication

Pass api_key or auth_token as a query parameter, or send countly-token as a header. See Authentication.

Permissions

Requires data_migration Delete permission.

Request Parameters

ParameterTypeRequiredDescription
exportidStringYesExport job ID.
argsJSON String (Object)NoOptional JSON-stringified helper args.
api_keyStringConditionalRequired if auth_token is not provided.
auth_tokenStringConditionalRequired if api_key is not provided.

Examples

Delete one export package

/i/datamigration/delete_export?
exportid=f9b35d90be5f2240eafced7c6bfdf130856cd0a7

Response

Success Response

{
"result": "ok"
}

Response Fields

FieldTypeDescription
resultStringOperation status key.

Error Responses

  • 404
{
"result": "data-migration.exportid_not_provided"
}
  • 404
{
"result": "data-migration.invalid-exportid"
}
  • 401
{
"result": "data-migration.unable-to-delete-log-file"
}

Behavior

Behavior Modes

ModeTriggerProcessing PathResponse Shape
Delete successValid exportid record foundCleans export archive/folder, removes export log file, removes DB record.Wrapped { "result": "ok" }
Invalid exportMissing or unknown exportidStops and returns invalid/missing key.Wrapped error key

Impact on Other Data

  • Deletes export files under plugin export workspace.
  • Deletes export record from countly.data_migrations.

Limitations

  • If log-file deletion fails, endpoint returns error and export DB cleanup may not complete.
Implementation details

Database Collections

CollectionUsed forData touched by this endpoint
countly.data_migrationsExport metadata lookup and deleteReads export by _id; removes matching migration document.