Migrations
Start Migration
Start a migration
POST
/
api
/
v1
/
migrations
/
start
Start Migration
curl --request POST \
--url https://worker.anon.com/api/v1/migrations/start \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"tasks_to_include": [
{
"count": 123
}
],
"service_account_id": "<string>",
"company_name": "<string>",
"tasks_to_exclude": []
}
'import requests
url = "https://worker.anon.com/api/v1/migrations/start"
payload = {
"tasks_to_include": [{ "count": 123 }],
"service_account_id": "<string>",
"company_name": "<string>",
"tasks_to_exclude": []
}
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({
tasks_to_include: [{count: 123}],
service_account_id: '<string>',
company_name: '<string>',
tasks_to_exclude: []
})
};
fetch('https://worker.anon.com/api/v1/migrations/start', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://worker.anon.com/api/v1/migrations/start",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_POSTFIELDS => json_encode([
'tasks_to_include' => [
[
'count' => 123
]
],
'service_account_id' => '<string>',
'company_name' => '<string>',
'tasks_to_exclude' => [
]
]),
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>",
"Content-Type: application/json"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "https://worker.anon.com/api/v1/migrations/start"
payload := strings.NewReader("{\n \"tasks_to_include\": [\n {\n \"count\": 123\n }\n ],\n \"service_account_id\": \"<string>\",\n \"company_name\": \"<string>\",\n \"tasks_to_exclude\": []\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("Authorization", "Bearer <token>")
req.Header.Add("Content-Type", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.post("https://worker.anon.com/api/v1/migrations/start")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"tasks_to_include\": [\n {\n \"count\": 123\n }\n ],\n \"service_account_id\": \"<string>\",\n \"company_name\": \"<string>\",\n \"tasks_to_exclude\": []\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://worker.anon.com/api/v1/migrations/start")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Authorization"] = 'Bearer <token>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"tasks_to_include\": [\n {\n \"count\": 123\n }\n ],\n \"service_account_id\": \"<string>\",\n \"company_name\": \"<string>\",\n \"tasks_to_exclude\": []\n}"
response = http.request(request)
puts response.read_body{
"object": "migration",
"id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"created": "2023-11-07T05:31:56Z",
"status": "NOT_READY",
"created_by_user_id": "<string>",
"company_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a"
}{
"type": "api_error",
"message": "<string>"
}{
"type": "api_error",
"message": "<string>"
}Authorizations
Bearer token authentication
Body
application/json
Tasks to include in the migration
Show child attributes
Show child attributes
Unique identifier for the service account to use for the migration
Name of the company to migrate
Tasks to exclude in the migration
Available options:
EmployeeRoster, EmployeeDetails, DirectDeposit, EmployeeW2Previews, EmployeeDirectDeposit, ContractorRoster, ContractorPayments, TimeOffBalances, PTOData Response
Success
Available options:
migration Unique identifier for the migration
Timestamp when the migration was created
Current status of the migration
Available options:
NOT_READY, NOT_STARTED, WORKING, PENDING_USER_INPUT, COMPLETE, FAILED, LOGIN_ABANDONED, COMPLETED_WITH_FAILURES Unique identifier for the user who created the migration
Unique identifier for the company
Was this page helpful?
⌘I
Start Migration
curl --request POST \
--url https://worker.anon.com/api/v1/migrations/start \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"tasks_to_include": [
{
"count": 123
}
],
"service_account_id": "<string>",
"company_name": "<string>",
"tasks_to_exclude": []
}
'import requests
url = "https://worker.anon.com/api/v1/migrations/start"
payload = {
"tasks_to_include": [{ "count": 123 }],
"service_account_id": "<string>",
"company_name": "<string>",
"tasks_to_exclude": []
}
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({
tasks_to_include: [{count: 123}],
service_account_id: '<string>',
company_name: '<string>',
tasks_to_exclude: []
})
};
fetch('https://worker.anon.com/api/v1/migrations/start', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://worker.anon.com/api/v1/migrations/start",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_POSTFIELDS => json_encode([
'tasks_to_include' => [
[
'count' => 123
]
],
'service_account_id' => '<string>',
'company_name' => '<string>',
'tasks_to_exclude' => [
]
]),
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>",
"Content-Type: application/json"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "https://worker.anon.com/api/v1/migrations/start"
payload := strings.NewReader("{\n \"tasks_to_include\": [\n {\n \"count\": 123\n }\n ],\n \"service_account_id\": \"<string>\",\n \"company_name\": \"<string>\",\n \"tasks_to_exclude\": []\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("Authorization", "Bearer <token>")
req.Header.Add("Content-Type", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.post("https://worker.anon.com/api/v1/migrations/start")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"tasks_to_include\": [\n {\n \"count\": 123\n }\n ],\n \"service_account_id\": \"<string>\",\n \"company_name\": \"<string>\",\n \"tasks_to_exclude\": []\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://worker.anon.com/api/v1/migrations/start")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Authorization"] = 'Bearer <token>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"tasks_to_include\": [\n {\n \"count\": 123\n }\n ],\n \"service_account_id\": \"<string>\",\n \"company_name\": \"<string>\",\n \"tasks_to_exclude\": []\n}"
response = http.request(request)
puts response.read_body{
"object": "migration",
"id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"created": "2023-11-07T05:31:56Z",
"status": "NOT_READY",
"created_by_user_id": "<string>",
"company_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a"
}{
"type": "api_error",
"message": "<string>"
}{
"type": "api_error",
"message": "<string>"
}