---
title: "Import API"
method: POST
path: "/migrations/import"
tags: ["Migrations"]
---

# Import API

`POST /migrations/import`

The import API lets you import a migration package from your Octopus Server's built-in package feed (which is where packages are pushed to when using the partial-export API).

## Request body

- CreateMigrationImportTaskCommand — The import API lets you import a migration package from your Octopus Server's built-in package feed (which is where packages are pushed to when using the partial-export API).
  - `DeletePackageOnCompletion` boolean — Removes the migration package that you're importing from on successful completion of the import
  - `FailureCallbackUri` string — A webhook URL you can add if you wish to be notified on failure of the migration task *(Your Octopus Server will call this URL using a GET request)*
  - `IsDryRun` boolean — Do not commit changes, just print what would have happened *(This allows you to test an import without actually committing the transaction)*
  - `IsEncryptedPackage` boolean — Tells us whether the package was encrypted *(E.g. if you set `EncryptPackage` on export, you need to set this to `True`)*
  - `OverwriteExisting` boolean — If a document with the same name already exists, it will be skipped by default
  - `PackageFeedSpaceId` string — If using the Spaces feature, the ID of the Space where the package containing the data to migrate will be uploaded. This is only for the package; the data in the package specifies its own destination Space.
  - `PackageId` string, required — Package Name/ID that we are importing
  - `PackageVersion` string, required — SemVer package version that we are importing
  - `Password` string, required — Password that was used during the export migration *(This is the shared key between partial-export and import migrations)*
  - `SuccessCallbackUri` string — A webhook URL you can add if you wish to be notified on successful completion of the migration task *(Your Octopus Server will call this URL using a GET request, appending the `packageId` and `packageVersion` to the URL)*

## Response `200`

The requested import task that has been queued.

- MigrationImportResource
  - `DeletePackageOnCompletion` boolean
  - `FailureCallbackUri` string
  - `Id` string — Gets or sets a unique identifier for this resource.
  - `IsDryRun` boolean
  - `IsEncryptedPackage` boolean
  - `LastModifiedBy` string — Gets or sets the username of the user who last modified this resource.
  - `LastModifiedOn` string, date-time — Gets or sets the date/time that this resource was last modified.
  - `Links` object — Gets or sets a dictionary of links to other related resources. These links can be used to navigate the resources on the server.
  - `OverwriteExisting` boolean
  - `PackageFeedSpaceId` string
  - `PackageId` string
  - `PackageVersion` string
  - `Password` string
  - `SuccessCallbackUri` string
  - `TaskId` string — This will be populated with the TaskId that gets queued for this migration

## Other responses

- `400` — Bad request. Either the payload was not structurally valid or business rules did not permit the operation.
- `404` — Not found. One or more of the entities involved in the operation was not found.

---

[API](https://skmtc.dev/octopus/apis/octopus-server-api.md) · [All operations](https://skmtc.dev/octopus/apis/octopus-server-api/llms.txt) · [OpenAPI document](https://skmtc-service-production.skmtc.workers.dev/v1/apis/octopus/octopus-server-api/revisions/e174aeef632e/schema)
