Skip to main content

Data Migration - Send Existing Export

Endpoint

/i/datamigration/sendexport

Overview

Sends an already-generated export package to a target Countly server.

Authentication

Countly API supports three authentication methods:

  1. API key query parameter: api_key=YOUR_API_KEY
  2. Auth token query parameter: auth_token=YOUR_AUTH_TOKEN
  3. Auth token header: countly-token: YOUR_AUTH_TOKEN

Permissions

Requires data_migration Create permission.

Request Parameters

ParameterTypeRequiredDescription
exportidStringYesExisting export ID to send.
server_tokenStringYesRemote import token.
server_addressStringYesTarget server base address.
redirect_trafficNumber/StringNo1 enables post-import app redirect handoff metadata.
argsJSON String (Object)NoOptional JSON-stringified helper args.
api_keyStringConditionalRequired if auth_token is not provided.
auth_tokenStringConditionalRequired if api_key is not provided.

Response

Success Response

{
"result": "Success"
}

Response Fields

FieldTypeDescription
resultStringImmediate send-initiation response.

Error Responses

  • 404
{
"result": "data-migration.invalid-exportid"
}
  • 404
{
"result": "data-migration.token_missing"
}
  • 404
{
"result": "data-migration.address_missing"
}

Behavior/Processing

Behavior Modes

ModeTriggerProcessing PathResponse Shape
Send startValid parametersUpdates export progress metadata and triggers asynchronous send workflow.Wrapped { "result": "Success" }
Validation failureMissing export/token/addressStops before send workflow.Wrapped error key

Impact on Other Data

  • Updates export progress/state metadata in countly.data_migrations.
  • Asynchronous send flow can transition export to finished/failed states.

Audit & System Logs

ActionTriggerPayload
export_finished / export_failedSend/import lifecycle reaches terminal status{ app_ids, status, message }

Database Collections

CollectionUsed forData touched by this endpoint
countly.data_migrationsSend lifecycle stateUpdates send target details and progress before async dispatch.
countly.systemlogsAudit trailWrites terminal export state actions via progress updater.

Examples

Send existing export package

/i/datamigration/sendexport?
exportid=f9b35d90be5f2240eafced7c6bfdf130856cd0a7&
server_address=http://target-countly.example.com&
server_token=2fc9d68f6f284f9fa95b93b7d598&
redirect_traffic=1

Operational Considerations

  • This endpoint returns immediately after scheduling send work; use status endpoint to track completion.

Last Updated

2026-02-17