Migration
Migration Webhooks
When Migration Work Finishes
A webhook on the organization receives a JSON body when Migration Assistant work finishes: a repository moved or failed, a migration ended, a plan wave's move finished, or a converted pipeline's pull requests merged.
Turn these on under Organization Settings → Notifications, in the Migration results group. Each rule is a row: Repository moved, Repository failed, Migration finished, Wave moved, and Pipeline converted. Turn the row on, and tick the webhook's column. Every rule starts turned off. Migration Results sits with the other notification settings. Events go to that organization's destinations only. They never appear in the in-app bell, and they are not sent to a member's personal destinations. Slack and email can carry the same categories. They get a title and a body. A webhook also gets data.
A dry run is not a move
A plan's dry run copies into the sandbox. It sends no repository-moved, repository-failed, or migration-finished events.
Events
category | data.event | Sent when |
|---|---|---|
MigrationRepositoryMoved | migration.repository.moved | The copy landed and its post-migration steps finished. A Git copy that keeps syncing sends this at cutover, not at the first copy, and not again if it catches up after the source is locked. |
MigrationRepositoryFailed | migration.repository.failed | The repository failed to move. A retry that fails again sends another. |
MigrationRunFinished | migration.run.finished | The migration completed, completed with failures, or stopped. |
MigrationWaveMoveFinished | migration.wave.move_finished | Every migration the wave prepared, into every destination organization, has ended: completed, completed with failures, or stopped. |
MigrationPipelineConversionPublished | migration.pipeline.conversion_published | Every pull request of the workspace that converted the pipeline merged. Checking that merge again sends nothing more. |
A wave has not finished while a migration it prepared never started, was abandoned, or was deleted by the destination organization.
A repository that failed is severity Error. A migration that stopped or finished with failures, and a wave that finished with failures, are Warning. A clean move, a clean finish, and a published conversion are Info, and so is a finish whose moved copies still need custom properties their enterprise requires. These rules have no severity filter.
Which Organization Receives Them
A migration's repository and finishing events go to the organization that migration belongs to. When a plan wave moved those repositories into another organization, the plan's organization receives the same data. The link on the destination organization's copy opens the migration under Migration Assistant → Repositories → Migrations. The link on the plan's copy opens the wave.
A wave-finished event goes only to the plan's organization, and its link opens that wave.
A pipeline event goes to the organization the pipeline was imported into. When a batch converted it, the link opens that batch. A pipeline converted in someone's own editor workspace has no batch and no link.
The Webhook Body
CodeCargo sends an HTTPS POST with Content-Type: application/json. Redirects are not followed, and an address that resolves to a private network is refused. Answer with any 2xx before you do slower work. Delivery is at least once. The notification id stays the same across retries, so ignore an id you have already handled. The plan's organization and a destination organization get different ids for the same finish. Match those two with data.subject and data.occurredAt, not with id.
Events can arrive out of order, because a delivery or an event can be retried. For each subject, such as a repository, a migration, or a wave, keep the event with the latest data.occurredAt. Events saved together share one occurredAt, such as a migration's migration.run.finished and the migration.wave.move_finished raised with it, or several repositories from one save. Handle those independently instead of sorting them against each other.
When the destination has a secret, the request carries X-CodeCargo-Signature: sha256=<hex>. That is the lowercase hex HMAC-SHA256 of the raw body, keyed with the secret. Compute it over the body bytes before you parse them, and compare in constant time.
A destination can also send up to four request headers of its own with every delivery, such as an Authorization bearer token or an X-API-Key. Set them on the webhook destination. See Notifications.
{
"id": "0193a8f0-6c2e-7b55-9a37-2d6f1f0e8c41",
"orgId": "0192f4c1-1a2b-7c3d-8e4f-5a6b7c8d9e0f",
"orgName": "Acme Platform",
"category": "MigrationRepositoryMoved",
"severity": "Info",
"title": "Repository moved: contoso/payments/ledger to acme-platform/payments-ledger",
"body": "contoso/payments/ledger moved to acme-platform/payments-ledger in the migration of contoso into acme-platform, wave 3 (Payments).",
"actionUrl": "https://your-deployment.example/orgs/0192f4c1-1a2b-7c3d-8e4f-5a6b7c8d9e0f/migration-assistant/repositories/migrations/0193a8e2-0000-7000-8000-000000000007",
"createdAt": "2026-11-11T09:30:02.418221Z",
"data": {
"event": "migration.repository.moved",
"occurredAt": "2026-11-11T09:30:00.000123Z",
"subject": { "type": "RepositoryMigrationItem", "id": "0193a8e2-1111-7000-8000-000000000001" },
"toState": "REPOSITORY_MIGRATION_ITEM_STEP_POST_STEPS_DONE"
}
}
The title and body call a migration by its name, or by what it moves and where, never by its number. The body's orgId and orgName are the organization the notification was sent to. createdAt is when this delivery was made, so a retry is later. actionUrl is absolute. data is present only on these finish events. Other categories keep the body they had, with no data. That includes the Migration Assistant's other notifications, such as a run that needs input or failed, and a repository in a migration that is waiting for a person's decision.
Fields on Every Event
| Field | Meaning |
|---|---|
event | The event name from the table above. |
occurredAt | When the change was saved, UTC. A retried delivery keeps this time. |
subject.type | RepositoryMigrationItem (a repository in a migration), RepositoryMigrationRun, PlanWave, or Pipeline. |
subject.id | That subject's id. |
fromState, toState | The states the API reports. A moved repository's toState is REPOSITORY_MIGRATION_ITEM_STEP_POST_STEPS_DONE. A failed one's is REPOSITORY_MIGRATION_ITEM_STEP_FAILED. A wave moves from PLAN_WAVE_MOVE_MOVING to PLAN_WAVE_MOVE_MOVED. A published pipeline moves from MIGRATION_EXECUTION_STATUS_PR_OPEN to MIGRATION_EXECUTION_STATUS_MIGRATED. |
orgId | The organization the subject belongs to. On a copy sent to the plan's organization, this is the destination organization, not the body's orgId. |
plan | { id, orgId } of the plan whose wave made the migration, or null. |
wave | { id, number, name } of that wave, or null. |
The ids are the ones the API takes for that migration, wave, or pipeline.
Repository Moved or Failed
migration is the run: id, number, and name. repository includes:
itemIdandattemptssource:id,name,path, andurldestination:org,name,repositoryId, andurlfailure:nullon a move. On a failure,categoryandmessage, the reason the migration page shows.categoryis the API's name, such asMIGRATION_FAILURE_CATEGORY_GITHUB_TOKEN_REJECTED.
A Migration Finished
migration adds destinationOrg and status, the same value as toState. counts is total, moved, failed, skipped, notMoved, and propertiesHeld, counted the same way as the migration page. propertiesHeld counts the moved copies that still need custom properties their enterprise requires, and the body adds them, such as 4 moved, 0 failed, 0 skipped, 1 needs custom properties. A Git copy catching up after its source was locked counts as moved.
A Wave's Move Finished
migrations lists each run: id, number, orgId, destinationOrg, and status. counts covers every repository in those runs, with the same fields.
A Pipeline Converted
pipeline is id, name, externalId, source, and type: the API's names for where the pipeline came from and what kind it is. workspaceId is the workspace whose pull requests merged. pullRequests lists repository, number, and url. batch is id, name, and waveId when a batch converted the pipeline, and null when someone converted it in their own editor workspace.
