Start migration job¶
POST/
Endpoint API · Migrations
Start a migration job in the receiving tenant.
Parameters¶
| Name | In | Type | Required | Description |
|---|---|---|---|---|
X-Tenant-ID | header | string (uuid) | Yes | Tenant ID. |
Request body¶
Content type: application/json
Request body fields
fromTenantstring (uuid)requiredSending tenant.
endpointsarray of string (uuid)requiredEndpoints that will be migrated to this tenant.
Must contain 1–1000 items.
Must contain 1–1000 items.
Request samples¶
curl -X POST "https://api-<data-region>.central.sophos.com/endpoint/v1/migrations" -H "Authorization: Bearer <access-token>" -H "X-Tenant-ID: <tenant-id>" -H "Content-Type: application/json" -d "{
\"fromTenant\": \"48bebbb0-f7b6-49c5-aec0-315858f73457\",
\"endpoints\": [
\"cb5bb918-8aee-4cad-b21b-875d1f6938b2\",
\"30fd930b-5325-46b7-842b-3c6e93c99947\",
\"70941003-9859-40d9-88ae-de3fcd1f527e\",
\"91c52a76-78bf-4bed-9446-b9e91f814940\",
\"1fc3237d-823c-451a-8726-f83ec9e1fe13\"
]
}"
import requests
response = requests.post(
"https://api-<data-region>.central.sophos.com/endpoint/v1/migrations",
headers={
"Authorization": "Bearer <access-token>",
"X-Tenant-ID": "<tenant-id>",
"Content-Type": "application/json",
},
json={ 'fromTenant': '48bebbb0-f7b6-49c5-aec0-315858f73457',
'endpoints': [ 'cb5bb918-8aee-4cad-b21b-875d1f6938b2',
'30fd930b-5325-46b7-842b-3c6e93c99947',
'70941003-9859-40d9-88ae-de3fcd1f527e',
'91c52a76-78bf-4bed-9446-b9e91f814940',
'1fc3237d-823c-451a-8726-f83ec9e1fe13']},
)
print(response.json())
$headers = @{
"Authorization" = "Bearer <access-token>"
"X-Tenant-ID" = "<tenant-id>"
"Content-Type" = "application/json"
}
$body = '{
"fromTenant": "48bebbb0-f7b6-49c5-aec0-315858f73457",
"endpoints": [
"cb5bb918-8aee-4cad-b21b-875d1f6938b2",
"30fd930b-5325-46b7-842b-3c6e93c99947",
"70941003-9859-40d9-88ae-de3fcd1f527e",
"91c52a76-78bf-4bed-9446-b9e91f814940",
"1fc3237d-823c-451a-8726-f83ec9e1fe13"
]
}'
Invoke-RestMethod -Method POST -Uri "https://api-<data-region>.central.sophos.com/endpoint/v1/migrations" -Headers $headers -Body $body -ContentType "application/json"
package main
import (
"fmt"
"io"
"net/http"
"strings"
)
func main() {
req, err := http.NewRequest("POST", "https://api-<data-region>.central.sophos.com/endpoint/v1/migrations", strings.NewReader(`{
"fromTenant": "48bebbb0-f7b6-49c5-aec0-315858f73457",
"endpoints": [
"cb5bb918-8aee-4cad-b21b-875d1f6938b2",
"30fd930b-5325-46b7-842b-3c6e93c99947",
"70941003-9859-40d9-88ae-de3fcd1f527e",
"91c52a76-78bf-4bed-9446-b9e91f814940",
"1fc3237d-823c-451a-8726-f83ec9e1fe13"
]
}`))
if err != nil {
panic(err)
}
req.Header.Set("Authorization", "Bearer <access-token>")
req.Header.Set("X-Tenant-ID", "<tenant-id>")
req.Header.Set("Content-Type", "application/json")
resp, err := http.DefaultClient.Do(req)
if err != nil {
panic(err)
}
defer resp.Body.Close()
body, _ := io.ReadAll(resp.Body)
fmt.Println(string(body))
}
const response = await fetch("https://api-<data-region>.central.sophos.com/endpoint/v1/migrations", {
method: "POST",
headers: {
"Authorization": "Bearer <access-token>",
"X-Tenant-ID": "<tenant-id>",
"Content-Type": "application/json",
},
body: JSON.stringify({
"fromTenant": "48bebbb0-f7b6-49c5-aec0-315858f73457",
"endpoints": [
"cb5bb918-8aee-4cad-b21b-875d1f6938b2",
"30fd930b-5325-46b7-842b-3c6e93c99947",
"70941003-9859-40d9-88ae-de3fcd1f527e",
"91c52a76-78bf-4bed-9446-b9e91f814940",
"1fc3237d-823c-451a-8726-f83ec9e1fe13"
]
}),
});
const data = await response.json();
console.log(data);
Responses¶
201 — Migration job created.¶
Response fields
idstring (uuid)requiredMigration job ID.
tokenstringJob token.
modestringrequiredWhether the tenant is sending or receiving endpoints.
Must be one of:
Must be one of:
sending, receiving.createdAtstring (date-time)requiredWhen the job was created.
createdByobjectShow child attributesHide child attributes
idstringrequiredPrincipal Email or clientId.
typestring (enum)requiredPrincipal type.
Must be one of:
Must be one of:
user, service, system.namestringUser Principal name.
accountTypestringAccount type.
Must be one of:
Must be one of:
partner, tenant, organization.accountIdstring (uuid)Account ID.
expiresAtstring (date-time)requiredWhen the migration job expires.
Errors¶
| Status | Meaning |
|---|---|
400 | Bad request. |
500 | Unexpected error. |
All error responses share the same shape — see the error response object.
Response examples¶
201¶
{
"id": "c83bc7f6-7c93-4aa4-ac73-006bd5a5884a",
"token": "eyJmb28iOiJ434833989debe92389we9e8debe902392388ede982372309099de9999a0a7732736611222fff2f1f212fffef3f592983iYXIifQo=",
"mode": "receiving",
"createdAt": "2021-04-22T15:32:28.482Z",
"expiresAt": "2021-04-29T15:32:28.482Z"
}
See the guide for a narrative walkthrough of this API.